diff --git a/Source/DiscoveryV1/Discovery.swift b/Source/DiscoveryV1/Discovery.swift index ac9830cac..e9901899f 100644 --- a/Source/DiscoveryV1/Discovery.swift +++ b/Source/DiscoveryV1/Discovery.swift @@ -118,7 +118,8 @@ public class Discovery { - parameter name: Name that identifies the environment. - parameter description: Description of the environment. - - parameter size: Size of the environment. + - parameter size: Size of the environment. In the Lite plan the default and only accepted value is `LT`, in all + other plans the default is `S`. - parameter headers: A dictionary of request headers to be sent with this request. - parameter failure: A function executed if an error occurs. - parameter success: A function executed with the successful result. @@ -284,6 +285,8 @@ public class Discovery { - parameter environmentID: The ID of the environment. - parameter name: Name that identifies the environment. - parameter description: Description of the environment. + - parameter size: Size that the environment should be increased to. Environment size cannot be modified when + using a Lite plan. Environment size can only increased and not decreased. - parameter headers: A dictionary of request headers to be sent with this request. - parameter failure: A function executed if an error occurs. - parameter success: A function executed with the successful result. @@ -292,12 +295,13 @@ public class Discovery { environmentID: String, name: String? = nil, description: String? = nil, + size: String? = nil, headers: [String: String]? = nil, failure: ((Error) -> Void)? = nil, success: @escaping (Environment) -> Void) { // construct body - let updateEnvironmentRequest = UpdateEnvironmentRequest(name: name, description: description) + let updateEnvironmentRequest = UpdateEnvironmentRequest(name: name, description: description, size: size) guard let body = try? JSONEncoder().encode(updateEnvironmentRequest) else { failure?(RestError.serializationError) return diff --git a/Source/DiscoveryV1/Models/UpdateEnvironmentRequest.swift b/Source/DiscoveryV1/Models/UpdateEnvironmentRequest.swift index 6ed15a0a5..d66271c33 100644 --- a/Source/DiscoveryV1/Models/UpdateEnvironmentRequest.swift +++ b/Source/DiscoveryV1/Models/UpdateEnvironmentRequest.swift @@ -19,6 +19,21 @@ import Foundation /** UpdateEnvironmentRequest. */ internal struct UpdateEnvironmentRequest: Encodable { + /** + Size that the environment should be increased to. Environment size cannot be modified when using a Lite plan. + Environment size can only increased and not decreased. + */ + public enum Size: String { + case s = "S" + case ms = "MS" + case m = "M" + case ml = "ML" + case l = "L" + case xl = "XL" + case xxl = "XXL" + case xxxl = "XXXL" + } + /** Name that identifies the environment. */ @@ -29,10 +44,17 @@ internal struct UpdateEnvironmentRequest: Encodable { */ public var description: String? + /** + Size that the environment should be increased to. Environment size cannot be modified when using a Lite plan. + Environment size can only increased and not decreased. + */ + public var size: String? + // Map each property name to the key that shall be used for encoding/decoding. private enum CodingKeys: String, CodingKey { case name = "name" case description = "description" + case size = "size" } /** @@ -40,16 +62,20 @@ internal struct UpdateEnvironmentRequest: Encodable { - parameter name: Name that identifies the environment. - parameter description: Description of the environment. + - parameter size: Size that the environment should be increased to. Environment size cannot be modified when + using a Lite plan. Environment size can only increased and not decreased. - returns: An initialized `UpdateEnvironmentRequest`. */ public init( name: String? = nil, - description: String? = nil + description: String? = nil, + size: String? = nil ) { self.name = name self.description = description + self.size = size } }