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

extension Commands.Servers {
// Update updates the current state of the specified Analysis Services server. 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 UpdateCommand : BaseCommand, ServersUpdate {
        public var resourceGroupName : String
        public var serverName : String
        public var subscriptionId : String
        public var apiVersion = "2017-08-01"
    public var serverUpdateParameters :  AnalysisServicesServerUpdateParametersProtocol?

        public init(resourceGroupName: String, serverName: String, subscriptionId: String, serverUpdateParameters: AnalysisServicesServerUpdateParametersProtocol) {
            self.resourceGroupName = resourceGroupName
            self.serverName = serverName
            self.subscriptionId = subscriptionId
            self.serverUpdateParameters = serverUpdateParameters
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        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(serverUpdateParameters as? AnalysisServicesServerUpdateParametersData)
                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(AnalysisServicesServerData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AnalysisServicesServerProtocol?, Error?) -> Void) -> Void {
            client.executeAsyncLRO(command: self) {
                (result: AnalysisServicesServerData?, 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 AnalysisServicesServerData : AnalysisServicesServerProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var sku: ResourceSkuProtocol
    public var tags: [String:String]?
    public var properties: AnalysisServicesServerPropertiesProtocol?

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

  public init(location: String, sku: ResourceSkuProtocol)  {
    self.location = location
    self.sku = sku
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    self.location = try container.decode(String.self, forKey: .location)
    self.sku = try container.decode(ResourceSkuData.self, forKey: .sku)
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(AnalysisServicesServerPropertiesData?.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.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    try container.encode(self.location, forKey: .location)
    try container.encode(self.sku as! ResourceSkuData, forKey: .sku)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.properties != nil {try container.encode(self.properties as! AnalysisServicesServerPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createAnalysisServicesServerProtocol(location: String, sku: ResourceSkuProtocol) -> AnalysisServicesServerProtocol {
    return AnalysisServicesServerData(location: location, sku: sku)
  }
}


// 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 AnalysisServicesServerMutablePropertiesData : AnalysisServicesServerMutablePropertiesProtocol {
    public var asAdministrators: ServerAdministratorsProtocol?
    public var backupBlobContainerUri: String?
    public var gatewayDetails: GatewayDetailsProtocol?
    public var ipV4FirewallSettings: IPv4FirewallSettingsProtocol?
    public var querypoolConnectionMode: ConnectionModeEnum?

        enum CodingKeys: String, CodingKey {case asAdministrators = "asAdministrators"
        case backupBlobContainerUri = "backupBlobContainerUri"
        case gatewayDetails = "gatewayDetails"
        case ipV4FirewallSettings = "ipV4FirewallSettings"
        case querypoolConnectionMode = "querypoolConnectionMode"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.asAdministrators) {
        self.asAdministrators = try container.decode(ServerAdministratorsData?.self, forKey: .asAdministrators)
    }
    if container.contains(.backupBlobContainerUri) {
        self.backupBlobContainerUri = try container.decode(String?.self, forKey: .backupBlobContainerUri)
    }
    if container.contains(.gatewayDetails) {
        self.gatewayDetails = try container.decode(GatewayDetailsData?.self, forKey: .gatewayDetails)
    }
    if container.contains(.ipV4FirewallSettings) {
        self.ipV4FirewallSettings = try container.decode(IPv4FirewallSettingsData?.self, forKey: .ipV4FirewallSettings)
    }
    if container.contains(.querypoolConnectionMode) {
        self.querypoolConnectionMode = try container.decode(ConnectionModeEnum?.self, forKey: .querypoolConnectionMode)
    }
    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.asAdministrators != nil {try container.encode(self.asAdministrators as! ServerAdministratorsData?, forKey: .asAdministrators)}
    if self.backupBlobContainerUri != nil {try container.encode(self.backupBlobContainerUri, forKey: .backupBlobContainerUri)}
    if self.gatewayDetails != nil {try container.encode(self.gatewayDetails as! GatewayDetailsData?, forKey: .gatewayDetails)}
    if self.ipV4FirewallSettings != nil {try container.encode(self.ipV4FirewallSettings as! IPv4FirewallSettingsData?, forKey: .ipV4FirewallSettings)}
    if self.querypoolConnectionMode != nil {try container.encode(self.querypoolConnectionMode, forKey: .querypoolConnectionMode)}
  }
}

extension DataFactory {
  public static func createAnalysisServicesServerMutablePropertiesProtocol() -> AnalysisServicesServerMutablePropertiesProtocol {
    return AnalysisServicesServerMutablePropertiesData()
  }
}


// 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 AnalysisServicesServerPropertiesData : AnalysisServicesServerPropertiesProtocol, AnalysisServicesServerMutablePropertiesProtocol {
    public var asAdministrators: ServerAdministratorsProtocol?
    public var backupBlobContainerUri: String?
    public var gatewayDetails: GatewayDetailsProtocol?
    public var ipV4FirewallSettings: IPv4FirewallSettingsProtocol?
    public var querypoolConnectionMode: ConnectionModeEnum?
    public var state: StateEnum?
    public var provisioningState: ProvisioningStateEnum?
    public var serverFullName: String?

        enum CodingKeys: String, CodingKey {case asAdministrators = "asAdministrators"
        case backupBlobContainerUri = "backupBlobContainerUri"
        case gatewayDetails = "gatewayDetails"
        case ipV4FirewallSettings = "ipV4FirewallSettings"
        case querypoolConnectionMode = "querypoolConnectionMode"
        case state = "state"
        case provisioningState = "provisioningState"
        case serverFullName = "serverFullName"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.asAdministrators) {
        self.asAdministrators = try container.decode(ServerAdministratorsData?.self, forKey: .asAdministrators)
    }
    if container.contains(.backupBlobContainerUri) {
        self.backupBlobContainerUri = try container.decode(String?.self, forKey: .backupBlobContainerUri)
    }
    if container.contains(.gatewayDetails) {
        self.gatewayDetails = try container.decode(GatewayDetailsData?.self, forKey: .gatewayDetails)
    }
    if container.contains(.ipV4FirewallSettings) {
        self.ipV4FirewallSettings = try container.decode(IPv4FirewallSettingsData?.self, forKey: .ipV4FirewallSettings)
    }
    if container.contains(.querypoolConnectionMode) {
        self.querypoolConnectionMode = try container.decode(ConnectionModeEnum?.self, forKey: .querypoolConnectionMode)
    }
    if container.contains(.state) {
        self.state = try container.decode(StateEnum?.self, forKey: .state)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.serverFullName) {
        self.serverFullName = try container.decode(String?.self, forKey: .serverFullName)
    }
    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.asAdministrators != nil {try container.encode(self.asAdministrators as! ServerAdministratorsData?, forKey: .asAdministrators)}
    if self.backupBlobContainerUri != nil {try container.encode(self.backupBlobContainerUri, forKey: .backupBlobContainerUri)}
    if self.gatewayDetails != nil {try container.encode(self.gatewayDetails as! GatewayDetailsData?, forKey: .gatewayDetails)}
    if self.ipV4FirewallSettings != nil {try container.encode(self.ipV4FirewallSettings as! IPv4FirewallSettingsData?, forKey: .ipV4FirewallSettings)}
    if self.querypoolConnectionMode != nil {try container.encode(self.querypoolConnectionMode, forKey: .querypoolConnectionMode)}
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.serverFullName != nil {try container.encode(self.serverFullName, forKey: .serverFullName)}
  }
}

extension DataFactory {
  public static func createAnalysisServicesServerPropertiesProtocol() -> AnalysisServicesServerPropertiesProtocol {
    return AnalysisServicesServerPropertiesData()
  }
}


// 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 AnalysisServicesServersData : AnalysisServicesServersProtocol {
    public var value: [AnalysisServicesServerProtocol]

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

  public init(value: [AnalysisServicesServerProtocol])  {
    self.value = value
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.value = try container.decode([AnalysisServicesServerData].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)
    try container.encode(self.value as! [AnalysisServicesServerData], forKey: .value)
  }
}

extension DataFactory {
  public static func createAnalysisServicesServersProtocol(value: [AnalysisServicesServerProtocol]) -> AnalysisServicesServersProtocol {
    return AnalysisServicesServersData(value: value)
  }
}


// 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 AnalysisServicesServerUpdateParametersData : AnalysisServicesServerUpdateParametersProtocol {
    public var sku: ResourceSkuProtocol?
    public var tags: [String:String]?
    public var properties: AnalysisServicesServerMutablePropertiesProtocol?

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

  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(ResourceSkuData?.self, forKey: .sku)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(AnalysisServicesServerMutablePropertiesData?.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.sku != nil {try container.encode(self.sku as! ResourceSkuData?, forKey: .sku)}
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.properties != nil {try container.encode(self.properties as! AnalysisServicesServerMutablePropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createAnalysisServicesServerUpdateParametersProtocol() -> AnalysisServicesServerUpdateParametersProtocol {
    return AnalysisServicesServerUpdateParametersData()
  }
}


// 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 CheckServerNameAvailabilityParametersData : CheckServerNameAvailabilityParametersProtocol {
    public var name: String?
    public var type: String?

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

  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(.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.name != nil {try container.encode(self.name, forKey: .name)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
  }
}

extension DataFactory {
  public static func createCheckServerNameAvailabilityParametersProtocol() -> CheckServerNameAvailabilityParametersProtocol {
    return CheckServerNameAvailabilityParametersData()
  }
}


// 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 CheckServerNameAvailabilityResultData : CheckServerNameAvailabilityResultProtocol {
    public var nameAvailable: Bool?
    public var reason: String?
    public var message: String?

        enum CodingKeys: String, CodingKey {case nameAvailable = "nameAvailable"
        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(.nameAvailable) {
        self.nameAvailable = try container.decode(Bool?.self, forKey: .nameAvailable)
    }
    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.nameAvailable != nil {try container.encode(self.nameAvailable, forKey: .nameAvailable)}
    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 createCheckServerNameAvailabilityResultProtocol() -> CheckServerNameAvailabilityResultProtocol {
    return CheckServerNameAvailabilityResultData()
  }
}


// ConnectionMode enumerates the values for connection mode.

// 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 ConnectionModeEnum: String, Codable
{
// All specifies the all state for connection mode.
    case All = "All"
// ReadOnly specifies the read only state for connection mode.
    case ReadOnly = "ReadOnly"
}


// 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 ErrorResponseData : ErrorResponseProtocol {
    public var code: String?
    public var message: String?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.code) {
        self.code = try container.decode(String?.self, forKey: .code)
    }
    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.code != nil {try container.encode(self.code, forKey: .code)}
    if self.message != nil {try container.encode(self.message, forKey: .message)}
  }
}

extension DataFactory {
  public static func createErrorResponseProtocol() -> ErrorResponseProtocol {
    return ErrorResponseData()
  }
}


// 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 GatewayDetailsData : GatewayDetailsProtocol {
    public var gatewayResourceId: String?
    public var gatewayObjectId: String?
    public var dmtsClusterUri: String?

        enum CodingKeys: String, CodingKey {case gatewayResourceId = "gatewayResourceId"
        case gatewayObjectId = "gatewayObjectId"
        case dmtsClusterUri = "dmtsClusterUri"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.gatewayResourceId) {
        self.gatewayResourceId = try container.decode(String?.self, forKey: .gatewayResourceId)
    }
    if container.contains(.gatewayObjectId) {
        self.gatewayObjectId = try container.decode(String?.self, forKey: .gatewayObjectId)
    }
    if container.contains(.dmtsClusterUri) {
        self.dmtsClusterUri = try container.decode(String?.self, forKey: .dmtsClusterUri)
    }
    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.gatewayResourceId != nil {try container.encode(self.gatewayResourceId, forKey: .gatewayResourceId)}
    if self.gatewayObjectId != nil {try container.encode(self.gatewayObjectId, forKey: .gatewayObjectId)}
    if self.dmtsClusterUri != nil {try container.encode(self.dmtsClusterUri, forKey: .dmtsClusterUri)}
  }
}

extension DataFactory {
  public static func createGatewayDetailsProtocol() -> GatewayDetailsProtocol {
    return GatewayDetailsData()
  }
}


// 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 GatewayErrorData : GatewayErrorProtocol {
    public var code: String?
    public var message: String?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.code) {
        self.code = try container.decode(String?.self, forKey: .code)
    }
    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.code != nil {try container.encode(self.code, forKey: .code)}
    if self.message != nil {try container.encode(self.message, forKey: .message)}
  }
}

extension DataFactory {
  public static func createGatewayErrorProtocol() -> GatewayErrorProtocol {
    return GatewayErrorData()
  }
}


// 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 GatewayListStatusErrorData : GatewayListStatusErrorProtocol {
    public var error: GatewayErrorProtocol?

        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(GatewayErrorData?.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! GatewayErrorData?, forKey: .error)}
  }
}

extension DataFactory {
  public static func createGatewayListStatusErrorProtocol() -> GatewayListStatusErrorProtocol {
    return GatewayListStatusErrorData()
  }
}


// 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 GatewayListStatusLiveData : GatewayListStatusLiveProtocol {
    public var status: StatusEnum?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.status) {
        self.status = try container.decode(StatusEnum?.self, forKey: .status)
    }
    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.status != nil {try container.encode(self.status, forKey: .status)}
  }
}

extension DataFactory {
  public static func createGatewayListStatusLiveProtocol() -> GatewayListStatusLiveProtocol {
    return GatewayListStatusLiveData()
  }
}


// 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 IPv4FirewallRuleData : IPv4FirewallRuleProtocol {
    public var firewallRuleName: String?
    public var rangeStart: String?
    public var rangeEnd: String?

        enum CodingKeys: String, CodingKey {case firewallRuleName = "firewallRuleName"
        case rangeStart = "rangeStart"
        case rangeEnd = "rangeEnd"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.firewallRuleName) {
        self.firewallRuleName = try container.decode(String?.self, forKey: .firewallRuleName)
    }
    if container.contains(.rangeStart) {
        self.rangeStart = try container.decode(String?.self, forKey: .rangeStart)
    }
    if container.contains(.rangeEnd) {
        self.rangeEnd = try container.decode(String?.self, forKey: .rangeEnd)
    }
    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.firewallRuleName != nil {try container.encode(self.firewallRuleName, forKey: .firewallRuleName)}
    if self.rangeStart != nil {try container.encode(self.rangeStart, forKey: .rangeStart)}
    if self.rangeEnd != nil {try container.encode(self.rangeEnd, forKey: .rangeEnd)}
  }
}

extension DataFactory {
  public static func createIPv4FirewallRuleProtocol() -> IPv4FirewallRuleProtocol {
    return IPv4FirewallRuleData()
  }
}


// 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 IPv4FirewallSettingsData : IPv4FirewallSettingsProtocol {
    public var firewallRules: [IPv4FirewallRuleProtocol?]?
    public var enablePowerBIService: String?

        enum CodingKeys: String, CodingKey {case firewallRules = "firewallRules"
        case enablePowerBIService = "enablePowerBIService"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.firewallRules) {
        self.firewallRules = try container.decode([IPv4FirewallRuleData?]?.self, forKey: .firewallRules)
    }
    if container.contains(.enablePowerBIService) {
        self.enablePowerBIService = try container.decode(String?.self, forKey: .enablePowerBIService)
    }
    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.firewallRules != nil {try container.encode(self.firewallRules as! [IPv4FirewallRuleData?]?, forKey: .firewallRules)}
    if self.enablePowerBIService != nil {try container.encode(self.enablePowerBIService, forKey: .enablePowerBIService)}
  }
}

extension DataFactory {
  public static func createIPv4FirewallSettingsProtocol() -> IPv4FirewallSettingsProtocol {
    return IPv4FirewallSettingsData()
  }
}


// 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 OperationData : OperationProtocol {
    public var name: String?
    public var display: OperationDisplayProtocol?

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

  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(OperationDisplayData?.self, forKey: .display)
    }
    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! OperationDisplayData?, forKey: .display)}
  }
}

extension DataFactory {
  public static func createOperationProtocol() -> OperationProtocol {
    return OperationData()
  }
}


// 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 OperationDisplayData : OperationDisplayProtocol {
    public var provider: String?
    public var resource: String?
    public var operation: String?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      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 container.contains(.operation) {
        self.operation = try container.decode(String?.self, forKey: .operation)
    }
    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.provider != nil {try container.encode(self.provider, forKey: .provider)}
    if self.resource != nil {try container.encode(self.resource, forKey: .resource)}
    if self.operation != nil {try container.encode(self.operation, forKey: .operation)}
  }
}

extension DataFactory {
  public static func createOperationDisplayProtocol() -> OperationDisplayProtocol {
    return OperationDisplayData()
  }
}


// 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 OperationListResultData : OperationListResultProtocol {
    public var value: [OperationProtocol?]?
    public var _nextLink: String?

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

  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([OperationData?]?.self, forKey: .value)
    }
    if container.contains(._nextLink) {
        self._nextLink = try container.decode(String?.self, forKey: ._nextLink)
    }
    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! [OperationData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createOperationListResultProtocol() -> OperationListResultProtocol {
    return OperationListResultData()
  }
}


// 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 OperationStatusData : OperationStatusProtocol {
    public var id: String?
    public var name: String?
    public var startTime: String?
    public var endTime: String?
    public var status: String?
    public var error: ErrorResponseProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case startTime = "startTime"
        case endTime = "endTime"
        case status = "status"
        case error = "error"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.startTime) {
        self.startTime = try container.decode(String?.self, forKey: .startTime)
    }
    if container.contains(.endTime) {
        self.endTime = try container.decode(String?.self, forKey: .endTime)
    }
    if container.contains(.status) {
        self.status = try container.decode(String?.self, forKey: .status)
    }
    if container.contains(.error) {
        self.error = try container.decode(ErrorResponseData?.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.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.startTime != nil {try container.encode(self.startTime, forKey: .startTime)}
    if self.endTime != nil {try container.encode(self.endTime, forKey: .endTime)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.error != nil {try container.encode(self.error as! ErrorResponseData?, forKey: .error)}
  }
}

extension DataFactory {
  public static func createOperationStatusProtocol() -> OperationStatusProtocol {
    return OperationStatusData()
  }
}


// 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
{
// Deleting specifies the deleting state for provisioning state.
    case Deleting = "Deleting"
// Failed specifies the failed state for provisioning state.
    case Failed = "Failed"
// Paused specifies the paused state for provisioning state.
    case Paused = "Paused"
// Pausing specifies the pausing state for provisioning state.
    case Pausing = "Pausing"
// Preparing specifies the preparing state for provisioning state.
    case Preparing = "Preparing"
// Provisioning specifies the provisioning state for provisioning state.
    case Provisioning = "Provisioning"
// Resuming specifies the resuming state for provisioning state.
    case Resuming = "Resuming"
// Scaling specifies the scaling state for provisioning state.
    case Scaling = "Scaling"
// Succeeded specifies the succeeded state for provisioning state.
    case Succeeded = "Succeeded"
// Suspended specifies the suspended state for provisioning state.
    case Suspended = "Suspended"
// Suspending specifies the suspending state for provisioning state.
    case Suspending = "Suspending"
// Updating specifies the updating state for provisioning state.
    case Updating = "Updating"
}


// 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 ResourceData : ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var sku: ResourceSkuProtocol
    public var tags: [String:String]?

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

  public init(location: String, sku: ResourceSkuProtocol)  {
    self.location = location
    self.sku = sku
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    self.location = try container.decode(String.self, forKey: .location)
    self.sku = try container.decode(ResourceSkuData.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.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    try container.encode(self.location, forKey: .location)
    try container.encode(self.sku as! ResourceSkuData, forKey: .sku)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
  }
}

extension DataFactory {
  public static func createResourceProtocol(location: String, sku: ResourceSkuProtocol) -> ResourceProtocol {
    return ResourceData(location: location, sku: sku)
  }
}


// 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 ResourceSkuData : ResourceSkuProtocol {
    public var name: String
    public var tier: SkuTierEnum?
    public var capacity: Int32?

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

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.name = try container.decode(String.self, forKey: .name)
    if container.contains(.tier) {
        self.tier = try container.decode(SkuTierEnum?.self, forKey: .tier)
    }
    if container.contains(.capacity) {
        self.capacity = try container.decode(Int32?.self, forKey: .capacity)
    }
    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)}
    if self.capacity != nil {try container.encode(self.capacity, forKey: .capacity)}
  }
}

extension DataFactory {
  public static func createResourceSkuProtocol(name: String) -> ResourceSkuProtocol {
    return ResourceSkuData(name: 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.
import Foundation
import azureSwiftRuntime
internal struct ServerAdministratorsData : ServerAdministratorsProtocol {
    public var members: [String]?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.members) {
        self.members = try container.decode([String]?.self, forKey: .members)
    }
    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.members != nil {try container.encode(self.members as! [String]?, forKey: .members)}
  }
}

extension DataFactory {
  public static func createServerAdministratorsProtocol() -> ServerAdministratorsProtocol {
    return ServerAdministratorsData()
  }
}


// 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 SkuDetailsForExistingResourceData : SkuDetailsForExistingResourceProtocol {
    public var sku: ResourceSkuProtocol?

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

  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(ResourceSkuData?.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.sku != nil {try container.encode(self.sku as! ResourceSkuData?, forKey: .sku)}
  }
}

extension DataFactory {
  public static func createSkuDetailsForExistingResourceProtocol() -> SkuDetailsForExistingResourceProtocol {
    return SkuDetailsForExistingResourceData()
  }
}


// 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 SkuEnumerationForExistingResourceResultData : SkuEnumerationForExistingResourceResultProtocol {
    public var value: [SkuDetailsForExistingResourceProtocol?]?

        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([SkuDetailsForExistingResourceData?]?.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! [SkuDetailsForExistingResourceData?]?, forKey: .value)}
  }
}

extension DataFactory {
  public static func createSkuEnumerationForExistingResourceResultProtocol() -> SkuEnumerationForExistingResourceResultProtocol {
    return SkuEnumerationForExistingResourceResultData()
  }
}


// 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 SkuEnumerationForNewResourceResultData : SkuEnumerationForNewResourceResultProtocol {
    public var value: [ResourceSkuProtocol?]?

        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([ResourceSkuData?]?.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! [ResourceSkuData?]?, forKey: .value)}
  }
}

extension DataFactory {
  public static func createSkuEnumerationForNewResourceResultProtocol() -> SkuEnumerationForNewResourceResultProtocol {
    return SkuEnumerationForNewResourceResultData()
  }
}


// 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
{
// Basic specifies the basic state for sku tier.
    case Basic = "Basic"
// Development specifies the development state for sku tier.
    case Development = "Development"
// Standard specifies the standard state for sku tier.
    case Standard = "Standard"
}


// State enumerates the values for 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 StateEnum: String, Codable
{
// StateDeleting specifies the state deleting state for state.
    case StateDeleting = "Deleting"
// StateFailed specifies the state failed state for state.
    case StateFailed = "Failed"
// StatePaused specifies the state paused state for state.
    case StatePaused = "Paused"
// StatePausing specifies the state pausing state for state.
    case StatePausing = "Pausing"
// StatePreparing specifies the state preparing state for state.
    case StatePreparing = "Preparing"
// StateProvisioning specifies the state provisioning state for state.
    case StateProvisioning = "Provisioning"
// StateResuming specifies the state resuming state for state.
    case StateResuming = "Resuming"
// StateScaling specifies the state scaling state for state.
    case StateScaling = "Scaling"
// StateSucceeded specifies the state succeeded state for state.
    case StateSucceeded = "Succeeded"
// StateSuspended specifies the state suspended state for state.
    case StateSuspended = "Suspended"
// StateSuspending specifies the state suspending state for state.
    case StateSuspending = "Suspending"
// StateUpdating specifies the state updating state for state.
    case StateUpdating = "Updating"
}


// Status enumerates the values for status.

// 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 StatusEnum: String, Codable
{
// Live specifies the live state for status.
    case Live = "Live"
}


// 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
// AnalysisServicesServerMutablePropertiesProtocol is an object that represents a set of mutable Analysis Services
// resource properties.
public protocol AnalysisServicesServerMutablePropertiesProtocol : Codable {
     var asAdministrators: ServerAdministratorsProtocol? { get set }
     var backupBlobContainerUri: String? { get set }
     var gatewayDetails: GatewayDetailsProtocol? { get set }
     var ipV4FirewallSettings: IPv4FirewallSettingsProtocol? { get set }
     var querypoolConnectionMode: ConnectionModeEnum? { 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
// AnalysisServicesServerPropertiesProtocol is properties of Analysis Services resource.
public protocol AnalysisServicesServerPropertiesProtocol : AnalysisServicesServerMutablePropertiesProtocol {
     var state: StateEnum? { get set }
     var provisioningState: ProvisioningStateEnum? { get set }
     var serverFullName: 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
// AnalysisServicesServerProtocol is represents an instance of an Analysis Services resource.
public protocol AnalysisServicesServerProtocol : ResourceProtocol {
     var properties: AnalysisServicesServerPropertiesProtocol? { 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
// AnalysisServicesServersProtocol is an array of Analysis Services resources.
public protocol AnalysisServicesServersProtocol : Codable {
     var value: [AnalysisServicesServerProtocol] { 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
// AnalysisServicesServerUpdateParametersProtocol is provision request specification
public protocol AnalysisServicesServerUpdateParametersProtocol : Codable {
     var sku: ResourceSkuProtocol? { get set }
     var tags: [String:String]? { get set }
     var properties: AnalysisServicesServerMutablePropertiesProtocol? { 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
// CheckServerNameAvailabilityParametersProtocol is details of server name request body.
public protocol CheckServerNameAvailabilityParametersProtocol : Codable {
     var name: 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
// CheckServerNameAvailabilityResultProtocol is the checking result of server name availibility.
public protocol CheckServerNameAvailabilityResultProtocol : Codable {
     var nameAvailable: 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
// ErrorResponseProtocol is describes the format of Error response.
public protocol ErrorResponseProtocol : 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
// GatewayDetailsProtocol is the gateway details.
public protocol GatewayDetailsProtocol : Codable {
     var gatewayResourceId: String? { get set }
     var gatewayObjectId: String? { get set }
     var dmtsClusterUri: 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
// GatewayErrorProtocol is detail of gateway errors.
public protocol GatewayErrorProtocol : 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
// GatewayListStatusErrorProtocol is status of gateway is error.
public protocol GatewayListStatusErrorProtocol : Codable {
     var error: GatewayErrorProtocol? { 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
// GatewayListStatusLiveProtocol is status of gateway is live.
public protocol GatewayListStatusLiveProtocol : Codable {
     var status: StatusEnum? { 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
// IPv4FirewallRuleProtocol is the detail of firewall rule.
public protocol IPv4FirewallRuleProtocol : Codable {
     var firewallRuleName: String? { get set }
     var rangeStart: String? { get set }
     var rangeEnd: 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
// IPv4FirewallSettingsProtocol is an array of firewall rules.
public protocol IPv4FirewallSettingsProtocol : Codable {
     var firewallRules: [IPv4FirewallRuleProtocol?]? { get set }
     var enablePowerBIService: 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
// OperationDisplayProtocol is the object that represents the operation.
public protocol OperationDisplayProtocol : Codable {
     var provider: String? { get set }
     var resource: String? { get set }
     var operation: 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
// OperationListResultProtocol is result of listing consumption operations. It contains a list of operations and a URL
// link to get the next set of results.
public protocol OperationListResultProtocol : Codable {
     var value: [OperationProtocol?]? { get set }
     var _nextLink: 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
// OperationProtocol is a Consumption REST API operation.
public protocol OperationProtocol : Codable {
     var name: String? { get set }
     var display: OperationDisplayProtocol? { 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
// OperationStatusProtocol is the status of operation.
public protocol OperationStatusProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var startTime: String? { get set }
     var endTime: String? { get set }
     var status: String? { get set }
     var error: ErrorResponseProtocol? { 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
// ResourceProtocol is represents an instance of an Analysis Services resource.
public protocol ResourceProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var location: String { get set }
     var sku: ResourceSkuProtocol { 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
// ResourceSkuProtocol is represents the SKU name and Azure pricing tier for Analysis Services resource.
public protocol ResourceSkuProtocol : Codable {
     var name: String { get set }
     var tier: SkuTierEnum? { get set }
     var capacity: Int32? { 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
// ServerAdministratorsProtocol is an array of administrator user identities.
public protocol ServerAdministratorsProtocol : Codable {
     var members: [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
// SkuDetailsForExistingResourceProtocol is an object that represents SKU details for existing resources.
public protocol SkuDetailsForExistingResourceProtocol : Codable {
     var sku: ResourceSkuProtocol? { 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
// SkuEnumerationForExistingResourceResultProtocol is an object that represents enumerating SKUs for existing
// resources.
public protocol SkuEnumerationForExistingResourceResultProtocol : Codable {
     var value: [SkuDetailsForExistingResourceProtocol?]? { 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
// SkuEnumerationForNewResourceResultProtocol is an object that represents enumerating SKUs for new resources.
public protocol SkuEnumerationForNewResourceResultProtocol : Codable {
     var value: [ResourceSkuProtocol?]? { 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: "appservice",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "appservice",
            targets: ["appservice"]),
    ],
    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: "appservice",
            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.

// AppServiceCertificateOrders is the webSite Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct AppServiceCertificateOrders {
    public static func CreateOrUpdate(resourceGroupName: String, certificateOrderName: String, subscriptionId: String, certificateDistinguishedName: AppServiceCertificateOrderProtocol) -> AppServiceCertificateOrdersCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId, certificateDistinguishedName: certificateDistinguishedName)
    }
    public static func CreateOrUpdateCertificate(resourceGroupName: String, certificateOrderName: String, name: String, subscriptionId: String, keyVaultCertificate: AppServiceCertificateResourceProtocol) -> AppServiceCertificateOrdersCreateOrUpdateCertificate {
        return CreateOrUpdateCertificateCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, name: name, subscriptionId: subscriptionId, keyVaultCertificate: keyVaultCertificate)
    }
    public static func Delete(resourceGroupName: String, certificateOrderName: String, subscriptionId: String) -> AppServiceCertificateOrdersDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId)
    }
    public static func DeleteCertificate(resourceGroupName: String, certificateOrderName: String, name: String, subscriptionId: String) -> AppServiceCertificateOrdersDeleteCertificate {
        return DeleteCertificateCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, name: name, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, certificateOrderName: String, subscriptionId: String) -> AppServiceCertificateOrdersGet {
        return GetCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId)
    }
    public static func GetCertificate(resourceGroupName: String, certificateOrderName: String, name: String, subscriptionId: String) -> AppServiceCertificateOrdersGetCertificate {
        return GetCertificateCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, name: name, subscriptionId: subscriptionId)
    }
    public static func List(subscriptionId: String) -> AppServiceCertificateOrdersList {
        return ListCommand(subscriptionId: subscriptionId)
    }
    public static func ListByResourceGroup(resourceGroupName: String, subscriptionId: String) -> AppServiceCertificateOrdersListByResourceGroup {
        return ListByResourceGroupCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func ListCertificates(resourceGroupName: String, certificateOrderName: String, subscriptionId: String) -> AppServiceCertificateOrdersListCertificates {
        return ListCertificatesCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId)
    }
    public static func Reissue(resourceGroupName: String, certificateOrderName: String, subscriptionId: String, reissueCertificateOrderRequest: ReissueCertificateOrderRequestProtocol) -> AppServiceCertificateOrdersReissue {
        return ReissueCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId, reissueCertificateOrderRequest: reissueCertificateOrderRequest)
    }
    public static func Renew(resourceGroupName: String, certificateOrderName: String, subscriptionId: String, renewCertificateOrderRequest: RenewCertificateOrderRequestProtocol) -> AppServiceCertificateOrdersRenew {
        return RenewCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId, renewCertificateOrderRequest: renewCertificateOrderRequest)
    }
    public static func ResendEmail(resourceGroupName: String, certificateOrderName: String, subscriptionId: String) -> AppServiceCertificateOrdersResendEmail {
        return ResendEmailCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId)
    }
    public static func ResendRequestEmails(resourceGroupName: String, certificateOrderName: String, subscriptionId: String, nameIdentifier: NameIdentifierProtocol) -> AppServiceCertificateOrdersResendRequestEmails {
        return ResendRequestEmailsCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId, nameIdentifier: nameIdentifier)
    }
    public static func RetrieveCertificateActions(resourceGroupName: String, name: String, subscriptionId: String) -> AppServiceCertificateOrdersRetrieveCertificateActions {
        return RetrieveCertificateActionsCommand(resourceGroupName: resourceGroupName, name: name, subscriptionId: subscriptionId)
    }
    public static func RetrieveCertificateEmailHistory(resourceGroupName: String, name: String, subscriptionId: String) -> AppServiceCertificateOrdersRetrieveCertificateEmailHistory {
        return RetrieveCertificateEmailHistoryCommand(resourceGroupName: resourceGroupName, name: name, subscriptionId: subscriptionId)
    }
    public static func RetrieveSiteSeal(resourceGroupName: String, certificateOrderName: String, subscriptionId: String, siteSealRequest: SiteSealRequestProtocol) -> AppServiceCertificateOrdersRetrieveSiteSeal {
        return RetrieveSiteSealCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId, siteSealRequest: siteSealRequest)
    }
    public static func Update(resourceGroupName: String, certificateOrderName: String, subscriptionId: String, certificateDistinguishedName: AppServiceCertificateOrderPatchResourceProtocol) -> AppServiceCertificateOrdersUpdate {
        return UpdateCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId, certificateDistinguishedName: certificateDistinguishedName)
    }
    public static func UpdateCertificate(resourceGroupName: String, certificateOrderName: String, name: String, subscriptionId: String, keyVaultCertificate: AppServiceCertificatePatchResourceProtocol) -> AppServiceCertificateOrdersUpdateCertificate {
        return UpdateCertificateCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, name: name, subscriptionId: subscriptionId, keyVaultCertificate: keyVaultCertificate)
    }
    public static func ValidatePurchaseInformation(subscriptionId: String, appServiceCertificateOrder: AppServiceCertificateOrderProtocol) -> AppServiceCertificateOrdersValidatePurchaseInformation {
        return ValidatePurchaseInformationCommand(subscriptionId: subscriptionId, appServiceCertificateOrder: appServiceCertificateOrder)
    }
    public static func VerifyDomainOwnership(resourceGroupName: String, certificateOrderName: String, subscriptionId: String) -> AppServiceCertificateOrdersVerifyDomainOwnership {
        return VerifyDomainOwnershipCommand(resourceGroupName: resourceGroupName, certificateOrderName: certificateOrderName, subscriptionId: subscriptionId)
    }
}
}


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

extension Commands.AppServiceCertificateOrders {
// CreateOrUpdate create or update a certificate purchase order. 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, AppServiceCertificateOrdersCreateOrUpdate {
        public var resourceGroupName : String
        public var certificateOrderName : String
        public var subscriptionId : String
        public var apiVersion = "2015-08-01"
    public var certificateDistinguishedName :  AppServiceCertificateOrderProtocol?

        public init(resourceGroupName: String, certificateOrderName: String, subscriptionId: String, certificateDistinguishedName: AppServiceCertificateOrderProtocol) {
            self.resourceGroupName = resourceGroupName
            self.certificateOrderName = certificateOrderName
            self.subscriptionId = subscriptionId
            self.certificateDistinguishedName = certificateDistinguishedName
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        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(certificateDistinguishedName as? AppServiceCertificateOrderData)
                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(AppServiceCertificateOrderData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AppServiceCertificateOrderProtocol?, Error?) -> Void) -> Void {
            client.executeAsyncLRO(command: self) {
                (result: AppServiceCertificateOrderData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.AppServiceCertificateOrders {
// CreateOrUpdateCertificate creates or updates a certificate and associates with key vault secret. 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 CreateOrUpdateCertificateCommand : BaseCommand, AppServiceCertificateOrdersCreateOrUpdateCertificate {
        public var resourceGroupName : String
        public var certificateOrderName : String
        public var name : String
        public var subscriptionId : String
        public var apiVersion = "2015-08-01"
    public var keyVaultCertificate :  AppServiceCertificateResourceProtocol?

        public init(resourceGroupName: String, certificateOrderName: String, name: String, subscriptionId: String, keyVaultCertificate: AppServiceCertificateResourceProtocol) {
            self.resourceGroupName = resourceGroupName
            self.certificateOrderName = certificateOrderName
            self.name = name
            self.subscriptionId = subscriptionId
            self.keyVaultCertificate = keyVaultCertificate
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        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(keyVaultCertificate as? AppServiceCertificateResourceData)
                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(AppServiceCertificateResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AppServiceCertificateResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsyncLRO(command: self) {
                (result: AppServiceCertificateResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.AppServiceCertificateOrders {
// Delete delete an existing certificate order.
    internal class DeleteCommand : BaseCommand, AppServiceCertificateOrdersDelete {
        public var resourceGroupName : String
        public var certificateOrderName : String
        public var subscriptionId : String
        public var apiVersion = "2015-08-01"

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

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{certificateOrderName}"] = String(describing: self.certificateOrderName)
            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.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


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

extension Commands.AppServiceCertificateOrders {
// DeleteCertificate delete the certificate associated with a certificate order.
    internal class DeleteCertificateCommand : BaseCommand, AppServiceCertificateOrdersDeleteCertificate {
        public var resourceGroupName : String
        public var certificateOrderName : String
        public var name : String
        public var subscriptionId : String
        public var apiVersion = "2015-08-01"

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

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{certificateOrderName}"] = String(describing: self.certificateOrderName)
            self.pathParameters["{name}"] = String(describing: self.name)
            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.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


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

extension Commands.AppServiceCertificateOrders {
// Get get a certificate order.
    internal class GetCommand : BaseCommand, AppServiceCertificateOrdersGet {
        public var resourceGroupName : String
        public var certificateOrderName : String
        public var subscriptionId : String
        public var apiVersion = "2015-08-01"

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

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{certificateOrderName}"] = String(describing: self.certificateOrderName)
            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(AppServiceCertificateOrderData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AppServiceCertificateOrderProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: AppServiceCertificateOrderData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.AppServiceCertificateOrders {
// GetCertificate get the certificate associated with a certificate order.
    internal class GetCertificateCommand : BaseCommand, AppServiceCertificateOrdersGetCertificate {
        public var resourceGroupName : String
        public var certificateOrderName : String
        public var name : String
        public var subscriptionId : String
        public var apiVersion = "2015-08-01"

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

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{certificateOrderName}"] = String(describing: self.certificateOrderName)
            self.pathParameters["{name}"] = String(describing: self.name)
            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(AppServiceCertificateResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AppServiceCertificateResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: AppServiceCertificateResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol AppServiceCertificateOrdersList  {
    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 (AppServiceCertificateOrderCollectionProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.AppServiceCertificateOrders {
// List list all certificate orders in a subscription.
    internal class ListCommand : BaseCommand, AppServiceCertificateOrdersList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2015-08-01"

        public init(subscriptionId: String) {
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders"
            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(AppServiceCertificateOrderCollectionData?.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 (AppServiceCertificateOrderCollectionProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: AppServiceCertificateOrderCollectionData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}