import Foundation
import azureSwiftRuntime
public protocol OperationsList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (OperationEntityListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Operations {
// List lists all the available Cognitive Services account operations.
    internal class ListCommand : BaseCommand, OperationsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var apiVersion = "2017-04-18"

    public override init() {
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/providers/Microsoft.CognitiveServices/operations"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(OperationEntityListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (OperationEntityListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: OperationEntityListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CheckSkuAvailabilityParameterData : CheckSkuAvailabilityParameterProtocol {
    public var skus: [SkuNameEnum]
    public var kind: KindEnum
    public var type: String

        enum CodingKeys: String, CodingKey {case skus = "skus"
        case kind = "kind"
        case type = "type"
        }

  public init(skus: [SkuNameEnum], kind: KindEnum, type: String)  {
    self.skus = skus
    self.kind = kind
    self.type = type
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.skus = try container.decode([SkuNameEnum].self, forKey: .skus)
    self.kind = try container.decode(KindEnum.self, forKey: .kind)
    self.type = try container.decode(String.self, forKey: .type)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.skus as! [SkuNameEnum], forKey: .skus)
    try container.encode(self.kind, forKey: .kind)
    try container.encode(self.type, forKey: .type)
  }
}

extension DataFactory {
  public static func createCheckSkuAvailabilityParameterProtocol(skus: [SkuNameEnum], kind: KindEnum, type: String) -> CheckSkuAvailabilityParameterProtocol {
    return CheckSkuAvailabilityParameterData(skus: skus, kind: kind, type: type)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CheckSkuAvailabilityResultData : CheckSkuAvailabilityResultProtocol {
    public var kind: KindEnum?
    public var type: String?
    public var skuName: SkuNameEnum?
    public var skuAvailable: Bool?
    public var reason: String?
    public var message: String?

        enum CodingKeys: String, CodingKey {case kind = "kind"
        case type = "type"
        case skuName = "skuName"
        case skuAvailable = "skuAvailable"
        case reason = "reason"
        case message = "message"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.kind) {
        self.kind = try container.decode(KindEnum?.self, forKey: .kind)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.skuName) {
        self.skuName = try container.decode(SkuNameEnum?.self, forKey: .skuName)
    }
    if container.contains(.skuAvailable) {
        self.skuAvailable = try container.decode(Bool?.self, forKey: .skuAvailable)
    }
    if container.contains(.reason) {
        self.reason = try container.decode(String?.self, forKey: .reason)
    }
    if container.contains(.message) {
        self.message = try container.decode(String?.self, forKey: .message)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.skuName != nil {try container.encode(self.skuName, forKey: .skuName)}
    if self.skuAvailable != nil {try container.encode(self.skuAvailable, forKey: .skuAvailable)}
    if self.reason != nil {try container.encode(self.reason, forKey: .reason)}
    if self.message != nil {try container.encode(self.message, forKey: .message)}
  }
}

extension DataFactory {
  public static func createCheckSkuAvailabilityResultProtocol() -> CheckSkuAvailabilityResultProtocol {
    return CheckSkuAvailabilityResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CheckSkuAvailabilityResultListData : CheckSkuAvailabilityResultListProtocol {
    public var value: [CheckSkuAvailabilityResultProtocol?]?

        enum CodingKeys: String, CodingKey {case value = "value"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.value) {
        self.value = try container.decode([CheckSkuAvailabilityResultData?]?.self, forKey: .value)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.value != nil {try container.encode(self.value as! [CheckSkuAvailabilityResultData?]?, forKey: .value)}
  }
}

extension DataFactory {
  public static func createCheckSkuAvailabilityResultListProtocol() -> CheckSkuAvailabilityResultListProtocol {
    return CheckSkuAvailabilityResultListData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CognitiveServicesAccountCreateParametersData : CognitiveServicesAccountCreateParametersProtocol {
    public var sku: SkuProtocol
    public var kind: KindEnum
    public var location: String
    public var tags: [String:String]?
    public var properties: [String: String?]

        enum CodingKeys: String, CodingKey {case sku = "sku"
        case kind = "kind"
        case location = "location"
        case tags = "tags"
        case properties = "properties"
        }

  public init(sku: SkuProtocol, kind: KindEnum, location: String, properties: [String: String?])  {
    self.sku = sku
    self.kind = kind
    self.location = location
    self.properties = properties
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.sku = try container.decode(SkuData.self, forKey: .sku)
    self.kind = try container.decode(KindEnum.self, forKey: .kind)
    self.location = try container.decode(String.self, forKey: .location)
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    self.properties = try container.decode([String: String?].self, forKey: .properties)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.sku as! SkuData, forKey: .sku)
    try container.encode(self.kind, forKey: .kind)
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    try container.encode(self.properties, forKey: .properties)
  }
}

extension DataFactory {
  public static func createCognitiveServicesAccountCreateParametersProtocol(sku: SkuProtocol, kind: KindEnum, location: String, properties: [String: String?]) -> CognitiveServicesAccountCreateParametersProtocol {
    return CognitiveServicesAccountCreateParametersData(sku: sku, kind: kind, location: location, properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CognitiveServicesAccountData : CognitiveServicesAccountProtocol {
    public var etag: String?
    public var id: String?
    public var kind: String?
    public var location: String?
    public var name: String?
    public var properties: CognitiveServicesAccountPropertiesProtocol?
    public var sku: SkuProtocol?
    public var tags: [String:String]?
    public var type: String?

        enum CodingKeys: String, CodingKey {case etag = "etag"
        case id = "id"
        case kind = "kind"
        case location = "location"
        case name = "name"
        case properties = "properties"
        case sku = "sku"
        case tags = "tags"
        case type = "type"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.etag) {
        self.etag = try container.decode(String?.self, forKey: .etag)
    }
    if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    if container.contains(.location) {
        self.location = try container.decode(String?.self, forKey: .location)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(CognitiveServicesAccountPropertiesData?.self, forKey: .properties)
    }
    if container.contains(.sku) {
        self.sku = try container.decode(SkuData?.self, forKey: .sku)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.location != nil {try container.encode(self.location, forKey: .location)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.properties != nil {try container.encode(self.properties as! CognitiveServicesAccountPropertiesData?, forKey: .properties)}
    if self.sku != nil {try container.encode(self.sku as! SkuData?, forKey: .sku)}
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createCognitiveServicesAccountProtocol() -> CognitiveServicesAccountProtocol {
    return CognitiveServicesAccountData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CognitiveServicesAccountEnumerateSkusResultData : CognitiveServicesAccountEnumerateSkusResultProtocol {
    public var value: [CognitiveServicesResourceAndSkuProtocol?]?

        enum CodingKeys: String, CodingKey {case value = "value"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.value) {
        self.value = try container.decode([CognitiveServicesResourceAndSkuData?]?.self, forKey: .value)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.value != nil {try container.encode(self.value as! [CognitiveServicesResourceAndSkuData?]?, forKey: .value)}
  }
}

extension DataFactory {
  public static func createCognitiveServicesAccountEnumerateSkusResultProtocol() -> CognitiveServicesAccountEnumerateSkusResultProtocol {
    return CognitiveServicesAccountEnumerateSkusResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CognitiveServicesAccountKeysData : CognitiveServicesAccountKeysProtocol {
    public var key1: String?
    public var key2: String?

        enum CodingKeys: String, CodingKey {case key1 = "key1"
        case key2 = "key2"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.key1) {
        self.key1 = try container.decode(String?.self, forKey: .key1)
    }
    if container.contains(.key2) {
        self.key2 = try container.decode(String?.self, forKey: .key2)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.key1 != nil {try container.encode(self.key1, forKey: .key1)}
    if self.key2 != nil {try container.encode(self.key2, forKey: .key2)}
  }
}

extension DataFactory {
  public static func createCognitiveServicesAccountKeysProtocol() -> CognitiveServicesAccountKeysProtocol {
    return CognitiveServicesAccountKeysData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CognitiveServicesAccountListResultData : CognitiveServicesAccountListResultProtocol {
    public var _nextLink: String?
    public var value: [CognitiveServicesAccountProtocol?]?

        enum CodingKeys: String, CodingKey {case _nextLink = "nextLink"
        case value = "value"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(._nextLink) {
        self._nextLink = try container.decode(String?.self, forKey: ._nextLink)
    }
    if container.contains(.value) {
        self.value = try container.decode([CognitiveServicesAccountData?]?.self, forKey: .value)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
    if self.value != nil {try container.encode(self.value as! [CognitiveServicesAccountData?]?, forKey: .value)}
  }
}

extension DataFactory {
  public static func createCognitiveServicesAccountListResultProtocol() -> CognitiveServicesAccountListResultProtocol {
    return CognitiveServicesAccountListResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CognitiveServicesAccountPropertiesData : CognitiveServicesAccountPropertiesProtocol {
    public var provisioningState: ProvisioningStateEnum?
    public var endpoint: String?
    public var internalId: String?

        enum CodingKeys: String, CodingKey {case provisioningState = "provisioningState"
        case endpoint = "endpoint"
        case internalId = "internalId"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.endpoint) {
        self.endpoint = try container.decode(String?.self, forKey: .endpoint)
    }
    if container.contains(.internalId) {
        self.internalId = try container.decode(String?.self, forKey: .internalId)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.endpoint != nil {try container.encode(self.endpoint, forKey: .endpoint)}
    if self.internalId != nil {try container.encode(self.internalId, forKey: .internalId)}
  }
}

extension DataFactory {
  public static func createCognitiveServicesAccountPropertiesProtocol() -> CognitiveServicesAccountPropertiesProtocol {
    return CognitiveServicesAccountPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CognitiveServicesAccountUpdateParametersData : CognitiveServicesAccountUpdateParametersProtocol {
    public var sku: SkuProtocol?
    public var tags: [String:String]?

        enum CodingKeys: String, CodingKey {case sku = "sku"
        case tags = "tags"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.sku) {
        self.sku = try container.decode(SkuData?.self, forKey: .sku)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.sku != nil {try container.encode(self.sku as! SkuData?, forKey: .sku)}
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
  }
}

extension DataFactory {
  public static func createCognitiveServicesAccountUpdateParametersProtocol() -> CognitiveServicesAccountUpdateParametersProtocol {
    return CognitiveServicesAccountUpdateParametersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CognitiveServicesResourceAndSkuData : CognitiveServicesResourceAndSkuProtocol {
    public var resourceType: String?
    public var sku: SkuProtocol?

        enum CodingKeys: String, CodingKey {case resourceType = "resourceType"
        case sku = "sku"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.resourceType) {
        self.resourceType = try container.decode(String?.self, forKey: .resourceType)
    }
    if container.contains(.sku) {
        self.sku = try container.decode(SkuData?.self, forKey: .sku)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.resourceType != nil {try container.encode(self.resourceType, forKey: .resourceType)}
    if self.sku != nil {try container.encode(self.sku as! SkuData?, forKey: .sku)}
  }
}

extension DataFactory {
  public static func createCognitiveServicesResourceAndSkuProtocol() -> CognitiveServicesResourceAndSkuProtocol {
    return CognitiveServicesResourceAndSkuData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ErrorBodyData : ErrorBodyProtocol {
    public var code: String
    public var message: String

        enum CodingKeys: String, CodingKey {case code = "code"
        case message = "message"
        }

  public init(code: String, message: String)  {
    self.code = code
    self.message = message
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.code = try container.decode(String.self, forKey: .code)
    self.message = try container.decode(String.self, forKey: .message)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.code, forKey: .code)
    try container.encode(self.message, forKey: .message)
  }
}

extension DataFactory {
  public static func createErrorBodyProtocol(code: String, message: String) -> ErrorBodyProtocol {
    return ErrorBodyData(code: code, message: message)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ErrorData : ErrorProtocol {
    public var error: ErrorBodyProtocol?

        enum CodingKeys: String, CodingKey {case error = "error"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.error) {
        self.error = try container.decode(ErrorBodyData?.self, forKey: .error)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.error != nil {try container.encode(self.error as! ErrorBodyData?, forKey: .error)}
  }
}

extension DataFactory {
  public static func createErrorProtocol() -> ErrorProtocol {
    return ErrorData()
  }
}


// KeyName enumerates the values for key name.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum KeyNameEnum: String, Codable
{
// Key1 specifies the key 1 state for key name.
    case Key1 = "Key1"
// Key2 specifies the key 2 state for key name.
    case Key2 = "Key2"
}


// Kind enumerates the values for kind.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum KindEnum: String, Codable
{
// Academic specifies the academic state for kind.
    case Academic = "Academic"
// BingAutosuggest specifies the bing autosuggest state for kind.
    case BingAutosuggest = "Bing.Autosuggest"
// BingAutosuggestv7 specifies the bing autosuggestv 7 state for kind.
    case BingAutosuggestv7 = "Bing.Autosuggest.v7"
// BingCustomSearch specifies the bing custom search state for kind.
    case BingCustomSearch = "Bing.CustomSearch"
// BingSearch specifies the bing search state for kind.
    case BingSearch = "Bing.Search"
// BingSearchv7 specifies the bing searchv 7 state for kind.
    case BingSearchv7 = "Bing.Search.v7"
// BingSpeech specifies the bing speech state for kind.
    case BingSpeech = "Bing.Speech"
// BingSpellCheck specifies the bing spell check state for kind.
    case BingSpellCheck = "Bing.SpellCheck"
// BingSpellCheckv7 specifies the bing spell checkv 7 state for kind.
    case BingSpellCheckv7 = "Bing.SpellCheck.v7"
// ComputerVision specifies the computer vision state for kind.
    case ComputerVision = "ComputerVision"
// ContentModerator specifies the content moderator state for kind.
    case ContentModerator = "ContentModerator"
// CustomSpeech specifies the custom speech state for kind.
    case CustomSpeech = "CustomSpeech"
// Emotion specifies the emotion state for kind.
    case Emotion = "Emotion"
// Face specifies the face state for kind.
    case Face = "Face"
// LUIS specifies the luis state for kind.
    case LUIS = "LUIS"
// Recommendations specifies the recommendations state for kind.
    case Recommendations = "Recommendations"
// SpeakerRecognition specifies the speaker recognition state for kind.
    case SpeakerRecognition = "SpeakerRecognition"
// Speech specifies the speech state for kind.
    case Speech = "Speech"
// SpeechTranslation specifies the speech translation state for kind.
    case SpeechTranslation = "SpeechTranslation"
// TextAnalytics specifies the text analytics state for kind.
    case TextAnalytics = "TextAnalytics"
// TextTranslation specifies the text translation state for kind.
    case TextTranslation = "TextTranslation"
// WebLM specifies the web lm state for kind.
    case WebLM = "WebLM"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct OperationDisplayInfoData : OperationDisplayInfoProtocol {
    public var description: String?
    public var operation: String?
    public var provider: String?
    public var resource: String?

        enum CodingKeys: String, CodingKey {case description = "description"
        case operation = "operation"
        case provider = "provider"
        case resource = "resource"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.operation) {
        self.operation = try container.decode(String?.self, forKey: .operation)
    }
    if container.contains(.provider) {
        self.provider = try container.decode(String?.self, forKey: .provider)
    }
    if container.contains(.resource) {
        self.resource = try container.decode(String?.self, forKey: .resource)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.operation != nil {try container.encode(self.operation, forKey: .operation)}
    if self.provider != nil {try container.encode(self.provider, forKey: .provider)}
    if self.resource != nil {try container.encode(self.resource, forKey: .resource)}
  }
}

extension DataFactory {
  public static func createOperationDisplayInfoProtocol() -> OperationDisplayInfoProtocol {
    return OperationDisplayInfoData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct OperationEntityData : OperationEntityProtocol {
    public var name: String?
    public var display: OperationDisplayInfoProtocol?
    public var origin: String?
    public var properties: [String: String?]?

        enum CodingKeys: String, CodingKey {case name = "name"
        case display = "display"
        case origin = "origin"
        case properties = "properties"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.display) {
        self.display = try container.decode(OperationDisplayInfoData?.self, forKey: .display)
    }
    if container.contains(.origin) {
        self.origin = try container.decode(String?.self, forKey: .origin)
    }
    if container.contains(.properties) {
        self.properties = try container.decode([String: String?]?.self, forKey: .properties)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.display != nil {try container.encode(self.display as! OperationDisplayInfoData?, forKey: .display)}
    if self.origin != nil {try container.encode(self.origin, forKey: .origin)}
    if self.properties != nil {try container.encode(self.properties, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createOperationEntityProtocol() -> OperationEntityProtocol {
    return OperationEntityData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct OperationEntityListResultData : OperationEntityListResultProtocol {
    public var _nextLink: String?
    public var value: [OperationEntityProtocol?]?

        enum CodingKeys: String, CodingKey {case _nextLink = "nextLink"
        case value = "value"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(._nextLink) {
        self._nextLink = try container.decode(String?.self, forKey: ._nextLink)
    }
    if container.contains(.value) {
        self.value = try container.decode([OperationEntityData?]?.self, forKey: .value)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
    if self.value != nil {try container.encode(self.value as! [OperationEntityData?]?, forKey: .value)}
  }
}

extension DataFactory {
  public static func createOperationEntityListResultProtocol() -> OperationEntityListResultProtocol {
    return OperationEntityListResultData()
  }
}


// ProvisioningState enumerates the values for provisioning state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ProvisioningStateEnum: String, Codable
{
// Creating specifies the creating state for provisioning state.
    case Creating = "Creating"
// Deleting specifies the deleting state for provisioning state.
    case Deleting = "Deleting"
// Failed specifies the failed state for provisioning state.
    case Failed = "Failed"
// Moving specifies the moving state for provisioning state.
    case Moving = "Moving"
// ResolvingDNS specifies the resolving dns state for provisioning state.
    case ResolvingDNS = "ResolvingDNS"
// Succeeded specifies the succeeded state for provisioning state.
    case Succeeded = "Succeeded"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct RegenerateKeyParametersData : RegenerateKeyParametersProtocol {
    public var keyName: KeyNameEnum

        enum CodingKeys: String, CodingKey {case keyName = "keyName"
        }

  public init(keyName: KeyNameEnum)  {
    self.keyName = keyName
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.keyName = try container.decode(KeyNameEnum.self, forKey: .keyName)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.keyName, forKey: .keyName)
  }
}

extension DataFactory {
  public static func createRegenerateKeyParametersProtocol(keyName: KeyNameEnum) -> RegenerateKeyParametersProtocol {
    return RegenerateKeyParametersData(keyName: keyName)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SkuData : SkuProtocol {
    public var name: SkuNameEnum
    public var tier: SkuTierEnum?

        enum CodingKeys: String, CodingKey {case name = "name"
        case tier = "tier"
        }

  public init(name: SkuNameEnum)  {
    self.name = name
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.name = try container.decode(SkuNameEnum.self, forKey: .name)
    if container.contains(.tier) {
        self.tier = try container.decode(SkuTierEnum?.self, forKey: .tier)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.name, forKey: .name)
    if self.tier != nil {try container.encode(self.tier, forKey: .tier)}
  }
}

extension DataFactory {
  public static func createSkuProtocol(name: SkuNameEnum) -> SkuProtocol {
    return SkuData(name: name)
  }
}


// SkuName enumerates the values for sku name.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SkuNameEnum: String, Codable
{
// F0 specifies the f0 state for sku name.
    case F0 = "F0"
// P0 specifies the p0 state for sku name.
    case P0 = "P0"
// P1 specifies the p1 state for sku name.
    case P1 = "P1"
// P2 specifies the p2 state for sku name.
    case P2 = "P2"
// S0 specifies the s0 state for sku name.
    case S0 = "S0"
// S1 specifies the s1 state for sku name.
    case S1 = "S1"
// S2 specifies the s2 state for sku name.
    case S2 = "S2"
// S3 specifies the s3 state for sku name.
    case S3 = "S3"
// S4 specifies the s4 state for sku name.
    case S4 = "S4"
// S5 specifies the s5 state for sku name.
    case S5 = "S5"
// S6 specifies the s6 state for sku name.
    case S6 = "S6"
}


// SkuTier enumerates the values for sku tier.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SkuTierEnum: String, Codable
{
// Free specifies the free state for sku tier.
    case Free = "Free"
// Premium specifies the premium state for sku tier.
    case Premium = "Premium"
// Standard specifies the standard state for sku tier.
    case Standard = "Standard"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CheckSkuAvailabilityParameterProtocol is check SKU availability parameter.
public protocol CheckSkuAvailabilityParameterProtocol : Codable {
     var skus: [SkuNameEnum] { get set }
     var kind: KindEnum { get set }
     var type: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CheckSkuAvailabilityResultListProtocol is check SKU availability result list.
public protocol CheckSkuAvailabilityResultListProtocol : Codable {
     var value: [CheckSkuAvailabilityResultProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CheckSkuAvailabilityResultProtocol is check SKU availability result.
public protocol CheckSkuAvailabilityResultProtocol : Codable {
     var kind: KindEnum? { get set }
     var type: String? { get set }
     var skuName: SkuNameEnum? { get set }
     var skuAvailable: Bool? { get set }
     var reason: String? { get set }
     var message: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CognitiveServicesAccountCreateParametersProtocol is the parameters to provide for the account.
public protocol CognitiveServicesAccountCreateParametersProtocol : Codable {
     var sku: SkuProtocol { get set }
     var kind: KindEnum { get set }
     var location: String { get set }
     var tags: [String:String]? { get set }
     var properties: [String: String?] { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CognitiveServicesAccountEnumerateSkusResultProtocol is the list of cognitive services accounts operation response.
public protocol CognitiveServicesAccountEnumerateSkusResultProtocol : Codable {
     var value: [CognitiveServicesResourceAndSkuProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CognitiveServicesAccountKeysProtocol is the access keys for the cognitive services account.
public protocol CognitiveServicesAccountKeysProtocol : Codable {
     var key1: String? { get set }
     var key2: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CognitiveServicesAccountListResultProtocol is the list of cognitive services accounts operation response.
public protocol CognitiveServicesAccountListResultProtocol : Codable {
     var _nextLink: String? { get set }
     var value: [CognitiveServicesAccountProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CognitiveServicesAccountPropertiesProtocol is properties of Cognitive Services account.
public protocol CognitiveServicesAccountPropertiesProtocol : Codable {
     var provisioningState: ProvisioningStateEnum? { get set }
     var endpoint: String? { get set }
     var internalId: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CognitiveServicesAccountProtocol is cognitive Services Account is an Azure resource representing the provisioned
// account, its type, location and SKU.
public protocol CognitiveServicesAccountProtocol : Codable {
     var etag: String? { get set }
     var id: String? { get set }
     var kind: String? { get set }
     var location: String? { get set }
     var name: String? { get set }
     var properties: CognitiveServicesAccountPropertiesProtocol? { get set }
     var sku: SkuProtocol? { get set }
     var tags: [String:String]? { get set }
     var type: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CognitiveServicesAccountUpdateParametersProtocol is the parameters to provide for the account.
public protocol CognitiveServicesAccountUpdateParametersProtocol : Codable {
     var sku: SkuProtocol? { get set }
     var tags: [String:String]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CognitiveServicesResourceAndSkuProtocol is cognitive Services resource type and SKU.
public protocol CognitiveServicesResourceAndSkuProtocol : Codable {
     var resourceType: String? { get set }
     var sku: SkuProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ErrorBodyProtocol is cognitive Services error body.
public protocol ErrorBodyProtocol : Codable {
     var code: String { get set }
     var message: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ErrorProtocol is cognitive Services error object.
public protocol ErrorProtocol : Codable {
     var error: ErrorBodyProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationDisplayInfoProtocol is the operation supported by Cognitive Services.
public protocol OperationDisplayInfoProtocol : Codable {
     var description: String? { get set }
     var operation: String? { get set }
     var provider: String? { get set }
     var resource: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationEntityListResultProtocol is the list of cognitive services accounts operation response.
public protocol OperationEntityListResultProtocol : Codable {
     var _nextLink: String? { get set }
     var value: [OperationEntityProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationEntityProtocol is the operation supported by Cognitive Services.
public protocol OperationEntityProtocol : Codable {
     var name: String? { get set }
     var display: OperationDisplayInfoProtocol? { get set }
     var origin: String? { get set }
     var properties: [String: String?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// RegenerateKeyParametersProtocol is regenerate key parameters.
public protocol RegenerateKeyParametersProtocol : Codable {
     var keyName: KeyNameEnum { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SkuProtocol is the SKU of the cognitive services account.
public protocol SkuProtocol : Codable {
     var name: SkuNameEnum { get set }
     var tier: SkuTierEnum? { get set }
}


// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
    name: "compute",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "compute",
            targets: ["compute"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.0.10"),
        .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "3.4.2"),
        .package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "3.1.4"),
        .package(url: "git@github.com:alvadb/autorest-clientruntime-for-swift.git", .branch("master"))
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages which this package depends on.
        .target(
            name: "compute",
            dependencies: ["Alamofire", "RxSwift", "SwiftyJSON", "azureSwiftRuntime"])
    ]
)


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.

// AvailabilitySets is the compute Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct AvailabilitySets {
    public static func CreateOrUpdate(resourceGroupName: String, availabilitySetName: String, subscriptionId: String, parameters: AvailabilitySetProtocol) -> AvailabilitySetsCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, availabilitySetName: availabilitySetName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, availabilitySetName: String, subscriptionId: String) -> AvailabilitySetsDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, availabilitySetName: availabilitySetName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, availabilitySetName: String, subscriptionId: String) -> AvailabilitySetsGet {
        return GetCommand(resourceGroupName: resourceGroupName, availabilitySetName: availabilitySetName, subscriptionId: subscriptionId)
    }
    public static func List(resourceGroupName: String, subscriptionId: String) -> AvailabilitySetsList {
        return ListCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func ListAvailableSizes(resourceGroupName: String, availabilitySetName: String, subscriptionId: String) -> AvailabilitySetsListAvailableSizes {
        return ListAvailableSizesCommand(resourceGroupName: resourceGroupName, availabilitySetName: availabilitySetName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol AvailabilitySetsCreateOrUpdate  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var availabilitySetName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var parameters :  AvailabilitySetProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (AvailabilitySetProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.AvailabilitySets {
// CreateOrUpdate create or update an availability set.
    internal class CreateOrUpdateCommand : BaseCommand, AvailabilitySetsCreateOrUpdate {
        public var resourceGroupName : String
        public var availabilitySetName : String
        public var subscriptionId : String
        public var apiVersion = "2017-12-01"
    public var parameters :  AvailabilitySetProtocol?

        public init(resourceGroupName: String, availabilitySetName: String, subscriptionId: String, parameters: AvailabilitySetProtocol) {
            self.resourceGroupName = resourceGroupName
            self.availabilitySetName = availabilitySetName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{availabilitySetName}"] = String(describing: self.availabilitySetName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = parameters

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? AvailabilitySetData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(AvailabilitySetData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AvailabilitySetProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: AvailabilitySetData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol AvailabilitySetsDelete  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var availabilitySetName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (OperationStatusResponseProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.AvailabilitySets {
// Delete delete an availability set.
    internal class DeleteCommand : BaseCommand, AvailabilitySetsDelete {
        public var resourceGroupName : String
        public var availabilitySetName : String
        public var subscriptionId : String
        public var apiVersion = "2017-12-01"

        public init(resourceGroupName: String, availabilitySetName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.availabilitySetName = availabilitySetName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{availabilitySetName}"] = String(describing: self.availabilitySetName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(OperationStatusResponseData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (OperationStatusResponseProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: OperationStatusResponseData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol AvailabilitySetsGet  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var availabilitySetName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (AvailabilitySetProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.AvailabilitySets {
// Get retrieves information about an availability set.
    internal class GetCommand : BaseCommand, AvailabilitySetsGet {
        public var resourceGroupName : String
        public var availabilitySetName : String
        public var subscriptionId : String
        public var apiVersion = "2017-12-01"

        public init(resourceGroupName: String, availabilitySetName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.availabilitySetName = availabilitySetName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{availabilitySetName}"] = String(describing: self.availabilitySetName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(AvailabilitySetData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AvailabilitySetProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: AvailabilitySetData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol AvailabilitySetsList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (AvailabilitySetListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.AvailabilitySets {
// List lists all availability sets in a resource group.
    internal class ListCommand : BaseCommand, AvailabilitySetsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-12-01"

        public init(resourceGroupName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(AvailabilitySetListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AvailabilitySetListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: AvailabilitySetListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol AvailabilitySetsListAvailableSizes  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var availabilitySetName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (VirtualMachineSizeListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.AvailabilitySets {
// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an
// existing availability set.
    internal class ListAvailableSizesCommand : BaseCommand, AvailabilitySetsListAvailableSizes {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var availabilitySetName : String
        public var subscriptionId : String
        public var apiVersion = "2017-12-01"

        public init(resourceGroupName: String, availabilitySetName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.availabilitySetName = availabilitySetName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{availabilitySetName}"] = String(describing: self.availabilitySetName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(VirtualMachineSizeListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (VirtualMachineSizeListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: VirtualMachineSizeListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.

// ContainerServices is the compute Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct ContainerServices {
    public static func CreateOrUpdate(resourceGroupName: String, containerServiceName: String, subscriptionId: String, parameters: ContainerServiceProtocol) -> ContainerServicesCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, containerServiceName: containerServiceName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, containerServiceName: String, subscriptionId: String) -> ContainerServicesDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, containerServiceName: containerServiceName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, containerServiceName: String, subscriptionId: String) -> ContainerServicesGet {
        return GetCommand(resourceGroupName: resourceGroupName, containerServiceName: containerServiceName, subscriptionId: subscriptionId)
    }
    public static func List(subscriptionId: String) -> ContainerServicesList {
        return ListCommand(subscriptionId: subscriptionId)
    }
    public static func ListByResourceGroup(resourceGroupName: String, subscriptionId: String) -> ContainerServicesListByResourceGroup {
        return ListByResourceGroupCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol ContainerServicesCreateOrUpdate  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var containerServiceName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var parameters :  ContainerServiceProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ContainerServiceProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.ContainerServices {
// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and
// agents. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. The
// channel will be used to cancel polling and any outstanding HTTP requests.
    internal class CreateOrUpdateCommand : BaseCommand, ContainerServicesCreateOrUpdate {
        public var resourceGroupName : String
        public var containerServiceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-01-31"
    public var parameters :  ContainerServiceProtocol?

        public init(resourceGroupName: String, containerServiceName: String, subscriptionId: String, parameters: ContainerServiceProtocol) {
            self.resourceGroupName = resourceGroupName
            self.containerServiceName = containerServiceName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{containerServiceName}"] = String(describing: self.containerServiceName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = parameters

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? ContainerServiceData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(ContainerServiceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ContainerServiceProtocol?, Error?) -> Void) -> Void {
            client.executeAsyncLRO(command: self) {
                (result: ContainerServiceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol ContainerServicesDelete  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var containerServiceName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.ContainerServices {
// Delete deletes the specified container service in the specified subscription and resource group. The operation does
// not delete other resources created as part of creating a container service, including storage accounts, VMs, and
// availability sets. All the other resources created with the container service are part of the same resource group
// and can be deleted individually. This method may poll for completion. Polling can be canceled by passing the cancel
// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
    internal class DeleteCommand : BaseCommand, ContainerServicesDelete {
        public var resourceGroupName : String
        public var containerServiceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-01-31"

        public init(resourceGroupName: String, containerServiceName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.containerServiceName = containerServiceName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{containerServiceName}"] = String(describing: self.containerServiceName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsyncLRO(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol ContainerServicesGet  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var containerServiceName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ContainerServiceProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.ContainerServices {
// Get gets the properties of the specified container service in the specified subscription and resource group. The
// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters
// and agents.
    internal class GetCommand : BaseCommand, ContainerServicesGet {
        public var resourceGroupName : String
        public var containerServiceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-01-31"

        public init(resourceGroupName: String, containerServiceName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.containerServiceName = containerServiceName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{containerServiceName}"] = String(describing: self.containerServiceName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(ContainerServiceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ContainerServiceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: ContainerServiceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol ContainerServicesList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ContainerServiceListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.ContainerServices {
// List gets a list of container services in the specified subscription. The operation returns properties of each
// container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents.
    internal class ListCommand : BaseCommand, ContainerServicesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2017-01-31"

        public init(subscriptionId: String) {
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(ContainerServiceListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ContainerServiceListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ContainerServiceListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol ContainerServicesListByResourceGroup  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ContainerServiceListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.ContainerServices {
// ListByResourceGroup gets a list of container services in the specified subscription and resource group. The
// operation returns properties of each container service including state, orchestrator, number of masters and agents,
// and FQDNs of masters and agents.
    internal class ListByResourceGroupCommand : BaseCommand, ContainerServicesListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-01-31"

        public init(resourceGroupName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(ContainerServiceListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ContainerServiceListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ContainerServiceListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public class DataFactory {
}
public class Commands {
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.

// Disks is the compute Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Disks {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, diskName: String, disk: DiskProtocol) -> DisksCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, diskName: diskName, disk: disk)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, diskName: String) -> DisksDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, diskName: diskName)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, diskName: String) -> DisksGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, diskName: diskName)
    }
    public static func GrantAccess(subscriptionId: String, resourceGroupName: String, diskName: String, grantAccessData: GrantAccessDataProtocol) -> DisksGrantAccess {
        return GrantAccessCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, diskName: diskName, grantAccessData: grantAccessData)
    }
    public static func List(subscriptionId: String) -> DisksList {
        return ListCommand(subscriptionId: subscriptionId)
    }
    public static func ListByResourceGroup(subscriptionId: String, resourceGroupName: String) -> DisksListByResourceGroup {
        return ListByResourceGroupCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName)
    }
    public static func RevokeAccess(subscriptionId: String, resourceGroupName: String, diskName: String) -> DisksRevokeAccess {
        return RevokeAccessCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, diskName: diskName)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, diskName: String, disk: DiskUpdateProtocol) -> DisksUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, diskName: diskName, disk: disk)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol DisksCreateOrUpdate  {
    var headerParameters: [String: String] { get set }
    var subscriptionId : String { get set }
    var resourceGroupName : String { get set }
    var diskName : String { get set }
    var apiVersion : String { get set }
    var disk :  DiskProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (DiskProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Disks {
// CreateOrUpdate creates or updates a disk. This method may poll for completion. Polling can be canceled by passing
// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
    internal class CreateOrUpdateCommand : BaseCommand, DisksCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var diskName : String
        public var apiVersion = "2017-03-30"
    public var disk :  DiskProtocol?

        public init(subscriptionId: String, resourceGroupName: String, diskName: String, disk: DiskProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.diskName = diskName
            self.disk = disk
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{diskName}"] = String(describing: self.diskName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = disk

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(disk as? DiskData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(DiskData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (DiskProtocol?, Error?) -> Void) -> Void {
            client.executeAsyncLRO(command: self) {
                (result: DiskData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol DisksDelete  {
    var headerParameters: [String: String] { get set }
    var subscriptionId : String { get set }
    var resourceGroupName : String { get set }
    var diskName : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (OperationStatusResponseProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Disks {
// Delete deletes a disk. This method may poll for completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding HTTP requests.
    internal class DeleteCommand : BaseCommand, DisksDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var diskName : String
        public var apiVersion = "2017-03-30"

        public init(subscriptionId: String, resourceGroupName: String, diskName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.diskName = diskName
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{diskName}"] = String(describing: self.diskName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(OperationStatusResponseData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (OperationStatusResponseProtocol?, Error?) -> Void) -> Void {
            client.executeAsyncLRO(command: self) {
                (result: OperationStatusResponseData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol DisksGet  {
    var headerParameters: [String: String] { get set }
    var subscriptionId : String { get set }
    var resourceGroupName : String { get set }
    var diskName : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (DiskProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Disks {
// Get gets information about a disk.
    internal class GetCommand : BaseCommand, DisksGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var diskName : String
        public var apiVersion = "2017-03-30"

        public init(subscriptionId: String, resourceGroupName: String, diskName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.diskName = diskName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{diskName}"] = String(describing: self.diskName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(DiskData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (DiskProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: DiskData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}