// 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 ApplicationResourceUpdateData : ApplicationResourceUpdateProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var properties: ApplicationUpdatePropertiesProtocol?

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

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

  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)
    if container.contains(.properties) {
        self.properties = try container.decode(ApplicationUpdatePropertiesData?.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)
    if self.properties != nil {try container.encode(self.properties as! ApplicationUpdatePropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createApplicationResourceUpdateProtocol(location: String) -> ApplicationResourceUpdateProtocol {
    return ApplicationResourceUpdateData(location: location)
  }
}


// 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 ApplicationTypePropertiesData : ApplicationTypePropertiesProtocol {
    public var provisioningState: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createApplicationTypePropertiesProtocol() -> ApplicationTypePropertiesProtocol {
    return ApplicationTypePropertiesData()
  }
}


// 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 ApplicationTypeResourceData : ApplicationTypeResourceProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var properties: ApplicationTypePropertiesProtocol?

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

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

  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)
    if container.contains(.properties) {
        self.properties = try container.decode(ApplicationTypePropertiesData?.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)
    if self.properties != nil {try container.encode(self.properties as! ApplicationTypePropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createApplicationTypeResourceProtocol(location: String) -> ApplicationTypeResourceProtocol {
    return ApplicationTypeResourceData(location: location)
  }
}


// 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 ApplicationTypeResourceListData : ApplicationTypeResourceListProtocol {
    public var value: [ApplicationTypeResourceProtocol?]?

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

extension DataFactory {
  public static func createApplicationTypeResourceListProtocol() -> ApplicationTypeResourceListProtocol {
    return ApplicationTypeResourceListData()
  }
}


// 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 ApplicationUpdatePropertiesData : ApplicationUpdatePropertiesProtocol {
    public var typeVersion: String?
    public var parameters: [ApplicationParameterProtocol?]?
    public var upgradePolicy: ApplicationUpgradePolicyProtocol?
    public var minimumNodes: Int64?
    public var maximumNodes: Int64?
    public var removeApplicationCapacity: Bool?
    public var metrics: [ApplicationMetricDescriptionProtocol?]?

        enum CodingKeys: String, CodingKey {case typeVersion = "typeVersion"
        case parameters = "parameters"
        case upgradePolicy = "upgradePolicy"
        case minimumNodes = "minimumNodes"
        case maximumNodes = "maximumNodes"
        case removeApplicationCapacity = "removeApplicationCapacity"
        case metrics = "metrics"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.typeVersion) {
        self.typeVersion = try container.decode(String?.self, forKey: .typeVersion)
    }
    if container.contains(.parameters) {
        self.parameters = try container.decode([ApplicationParameterData?]?.self, forKey: .parameters)
    }
    if container.contains(.upgradePolicy) {
        self.upgradePolicy = try container.decode(ApplicationUpgradePolicyData?.self, forKey: .upgradePolicy)
    }
    if container.contains(.minimumNodes) {
        self.minimumNodes = try container.decode(Int64?.self, forKey: .minimumNodes)
    }
    if container.contains(.maximumNodes) {
        self.maximumNodes = try container.decode(Int64?.self, forKey: .maximumNodes)
    }
    if container.contains(.removeApplicationCapacity) {
        self.removeApplicationCapacity = try container.decode(Bool?.self, forKey: .removeApplicationCapacity)
    }
    if container.contains(.metrics) {
        self.metrics = try container.decode([ApplicationMetricDescriptionData?]?.self, forKey: .metrics)
    }
    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.typeVersion != nil {try container.encode(self.typeVersion, forKey: .typeVersion)}
    if self.parameters != nil {try container.encode(self.parameters as! [ApplicationParameterData?]?, forKey: .parameters)}
    if self.upgradePolicy != nil {try container.encode(self.upgradePolicy as! ApplicationUpgradePolicyData?, forKey: .upgradePolicy)}
    if self.minimumNodes != nil {try container.encode(self.minimumNodes, forKey: .minimumNodes)}
    if self.maximumNodes != nil {try container.encode(self.maximumNodes, forKey: .maximumNodes)}
    if self.removeApplicationCapacity != nil {try container.encode(self.removeApplicationCapacity, forKey: .removeApplicationCapacity)}
    if self.metrics != nil {try container.encode(self.metrics as! [ApplicationMetricDescriptionData?]?, forKey: .metrics)}
  }
}

extension DataFactory {
  public static func createApplicationUpdatePropertiesProtocol() -> ApplicationUpdatePropertiesProtocol {
    return ApplicationUpdatePropertiesData()
  }
}


// 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 ApplicationUpgradePolicyData : ApplicationUpgradePolicyProtocol {
    public var upgradeReplicaSetCheckTimeout: Int64?
    public var forceRestart: Bool?
    public var rollingUpgradeMonitoringPolicy: RollingUpgradeMonitoringPolicyProtocol?
    public var applicationHealthPolicy: ApplicationHealthPolicyProtocol?

        enum CodingKeys: String, CodingKey {case upgradeReplicaSetCheckTimeout = "upgradeReplicaSetCheckTimeout"
        case forceRestart = "forceRestart"
        case rollingUpgradeMonitoringPolicy = "rollingUpgradeMonitoringPolicy"
        case applicationHealthPolicy = "applicationHealthPolicy"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.upgradeReplicaSetCheckTimeout) {
        self.upgradeReplicaSetCheckTimeout = try container.decode(Int64?.self, forKey: .upgradeReplicaSetCheckTimeout)
    }
    if container.contains(.forceRestart) {
        self.forceRestart = try container.decode(Bool?.self, forKey: .forceRestart)
    }
    if container.contains(.rollingUpgradeMonitoringPolicy) {
        self.rollingUpgradeMonitoringPolicy = try container.decode(RollingUpgradeMonitoringPolicyData?.self, forKey: .rollingUpgradeMonitoringPolicy)
    }
    if container.contains(.applicationHealthPolicy) {
        self.applicationHealthPolicy = try container.decode(ApplicationHealthPolicyData?.self, forKey: .applicationHealthPolicy)
    }
    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.upgradeReplicaSetCheckTimeout != nil {try container.encode(self.upgradeReplicaSetCheckTimeout, forKey: .upgradeReplicaSetCheckTimeout)}
    if self.forceRestart != nil {try container.encode(self.forceRestart, forKey: .forceRestart)}
    if self.rollingUpgradeMonitoringPolicy != nil {try container.encode(self.rollingUpgradeMonitoringPolicy as! RollingUpgradeMonitoringPolicyData?, forKey: .rollingUpgradeMonitoringPolicy)}
    if self.applicationHealthPolicy != nil {try container.encode(self.applicationHealthPolicy as! ApplicationHealthPolicyData?, forKey: .applicationHealthPolicy)}
  }
}

extension DataFactory {
  public static func createApplicationUpgradePolicyProtocol() -> ApplicationUpgradePolicyProtocol {
    return ApplicationUpgradePolicyData()
  }
}


// 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 AvailableOperationDisplayData : AvailableOperationDisplayProtocol {
    public var provider: String?
    public var resource: String?
    public var operation: String?
    public var description: String?

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

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

extension DataFactory {
  public static func createAvailableOperationDisplayProtocol() -> AvailableOperationDisplayProtocol {
    return AvailableOperationDisplayData()
  }
}


// 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 AzureActiveDirectoryData : AzureActiveDirectoryProtocol {
    public var tenantId: String?
    public var clusterApplication: String?
    public var clientApplication: String?

        enum CodingKeys: String, CodingKey {case tenantId = "tenantId"
        case clusterApplication = "clusterApplication"
        case clientApplication = "clientApplication"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureActiveDirectoryProtocol() -> AzureActiveDirectoryProtocol {
    return AzureActiveDirectoryData()
  }
}


// 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 CertificateDescriptionData : CertificateDescriptionProtocol {
    public var thumbprint: String
    public var thumbprintSecondary: String?
    public var x509StoreName: X509StoreNameEnum?

        enum CodingKeys: String, CodingKey {case thumbprint = "thumbprint"
        case thumbprintSecondary = "thumbprintSecondary"
        case x509StoreName = "x509StoreName"
        }

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

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

extension DataFactory {
  public static func createCertificateDescriptionProtocol(thumbprint: String) -> CertificateDescriptionProtocol {
    return CertificateDescriptionData(thumbprint: thumbprint)
  }
}


// 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 ClientCertificateCommonNameData : ClientCertificateCommonNameProtocol {
    public var isAdmin: Bool
    public var certificateCommonName: String
    public var certificateIssuerThumbprint: String

        enum CodingKeys: String, CodingKey {case isAdmin = "isAdmin"
        case certificateCommonName = "certificateCommonName"
        case certificateIssuerThumbprint = "certificateIssuerThumbprint"
        }

  public init(isAdmin: Bool, certificateCommonName: String, certificateIssuerThumbprint: String)  {
    self.isAdmin = isAdmin
    self.certificateCommonName = certificateCommonName
    self.certificateIssuerThumbprint = certificateIssuerThumbprint
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.isAdmin = try container.decode(Bool.self, forKey: .isAdmin)
    self.certificateCommonName = try container.decode(String.self, forKey: .certificateCommonName)
    self.certificateIssuerThumbprint = try container.decode(String.self, forKey: .certificateIssuerThumbprint)
    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.isAdmin, forKey: .isAdmin)
    try container.encode(self.certificateCommonName, forKey: .certificateCommonName)
    try container.encode(self.certificateIssuerThumbprint, forKey: .certificateIssuerThumbprint)
  }
}

extension DataFactory {
  public static func createClientCertificateCommonNameProtocol(isAdmin: Bool, certificateCommonName: String, certificateIssuerThumbprint: String) -> ClientCertificateCommonNameProtocol {
    return ClientCertificateCommonNameData(isAdmin: isAdmin, certificateCommonName: certificateCommonName, certificateIssuerThumbprint: certificateIssuerThumbprint)
  }
}


// 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 ClientCertificateThumbprintData : ClientCertificateThumbprintProtocol {
    public var isAdmin: Bool
    public var certificateThumbprint: String

        enum CodingKeys: String, CodingKey {case isAdmin = "isAdmin"
        case certificateThumbprint = "certificateThumbprint"
        }

  public init(isAdmin: Bool, certificateThumbprint: String)  {
    self.isAdmin = isAdmin
    self.certificateThumbprint = certificateThumbprint
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.isAdmin = try container.decode(Bool.self, forKey: .isAdmin)
    self.certificateThumbprint = try container.decode(String.self, forKey: .certificateThumbprint)
    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.isAdmin, forKey: .isAdmin)
    try container.encode(self.certificateThumbprint, forKey: .certificateThumbprint)
  }
}

extension DataFactory {
  public static func createClientCertificateThumbprintProtocol(isAdmin: Bool, certificateThumbprint: String) -> ClientCertificateThumbprintProtocol {
    return ClientCertificateThumbprintData(isAdmin: isAdmin, certificateThumbprint: certificateThumbprint)
  }
}


// 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 ClusterCodeVersionsListResultData : ClusterCodeVersionsListResultProtocol {
    public var value: [ClusterCodeVersionsResultProtocol?]?
    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([ClusterCodeVersionsResultData?]?.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! [ClusterCodeVersionsResultData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createClusterCodeVersionsListResultProtocol() -> ClusterCodeVersionsListResultProtocol {
    return ClusterCodeVersionsListResultData()
  }
}


// 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 ClusterCodeVersionsResultData : ClusterCodeVersionsResultProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: ClusterVersionDetailsProtocol?

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

  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(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(ClusterVersionDetailsData?.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)}
    if self.properties != nil {try container.encode(self.properties as! ClusterVersionDetailsData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createClusterCodeVersionsResultProtocol() -> ClusterCodeVersionsResultProtocol {
    return ClusterCodeVersionsResultData()
  }
}


// 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 ClusterData : ClusterProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var tags: [String:String]?
    public var properties: ClusterPropertiesProtocol?

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

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

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

extension DataFactory {
  public static func createClusterProtocol(location: String) -> ClusterProtocol {
    return ClusterData(location: location)
  }
}


// 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 ClusterHealthPolicyData : ClusterHealthPolicyProtocol {
    public var maxPercentUnhealthyNodes: Int32?
    public var maxPercentUnhealthyApplications: Int32?

        enum CodingKeys: String, CodingKey {case maxPercentUnhealthyNodes = "maxPercentUnhealthyNodes"
        case maxPercentUnhealthyApplications = "maxPercentUnhealthyApplications"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createClusterHealthPolicyProtocol() -> ClusterHealthPolicyProtocol {
    return ClusterHealthPolicyData()
  }
}


// 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 ClusterListResultData : ClusterListResultProtocol {
    public var value: [ClusterProtocol?]?
    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([ClusterData?]?.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! [ClusterData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createClusterListResultProtocol() -> ClusterListResultProtocol {
    return ClusterListResultData()
  }
}


// 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 ClusterPropertiesData : ClusterPropertiesProtocol {
    public var availableClusterVersions: [ClusterVersionDetailsProtocol?]?
    public var clusterId: String?
    public var clusterState: ClusterStateEnum?
    public var clusterEndpoint: String?
    public var clusterCodeVersion: String?
    public var certificate: CertificateDescriptionProtocol?
    public var reliabilityLevel: ReliabilityLevelEnum?
    public var upgradeMode: UpgradeModeEnum?
    public var clientCertificateThumbprints: [ClientCertificateThumbprintProtocol?]?
    public var clientCertificateCommonNames: [ClientCertificateCommonNameProtocol?]?
    public var fabricSettings: [SettingsSectionDescriptionProtocol?]?
    public var reverseProxyCertificate: CertificateDescriptionProtocol?
    public var managementEndpoint: String
    public var nodeTypes: [NodeTypeDescriptionProtocol]
    public var azureActiveDirectory: AzureActiveDirectoryProtocol?
    public var provisioningState: ProvisioningStateEnum?
    public var vmImage: String?
    public var diagnosticsStorageAccountConfig: DiagnosticsStorageAccountConfigProtocol?
    public var upgradeDescription: ClusterUpgradePolicyProtocol?
    public var addOnFeatures: [String?]?

        enum CodingKeys: String, CodingKey {case availableClusterVersions = "availableClusterVersions"
        case clusterId = "clusterId"
        case clusterState = "clusterState"
        case clusterEndpoint = "clusterEndpoint"
        case clusterCodeVersion = "clusterCodeVersion"
        case certificate = "certificate"
        case reliabilityLevel = "reliabilityLevel"
        case upgradeMode = "upgradeMode"
        case clientCertificateThumbprints = "clientCertificateThumbprints"
        case clientCertificateCommonNames = "clientCertificateCommonNames"
        case fabricSettings = "fabricSettings"
        case reverseProxyCertificate = "reverseProxyCertificate"
        case managementEndpoint = "managementEndpoint"
        case nodeTypes = "nodeTypes"
        case azureActiveDirectory = "azureActiveDirectory"
        case provisioningState = "provisioningState"
        case vmImage = "vmImage"
        case diagnosticsStorageAccountConfig = "diagnosticsStorageAccountConfig"
        case upgradeDescription = "upgradeDescription"
        case addOnFeatures = "addOnFeatures"
        }

  public init(managementEndpoint: String, nodeTypes: [NodeTypeDescriptionProtocol])  {
    self.managementEndpoint = managementEndpoint
    self.nodeTypes = nodeTypes
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.availableClusterVersions) {
        self.availableClusterVersions = try container.decode([ClusterVersionDetailsData?]?.self, forKey: .availableClusterVersions)
    }
    if container.contains(.clusterId) {
        self.clusterId = try container.decode(String?.self, forKey: .clusterId)
    }
    if container.contains(.clusterState) {
        self.clusterState = try container.decode(ClusterStateEnum?.self, forKey: .clusterState)
    }
    if container.contains(.clusterEndpoint) {
        self.clusterEndpoint = try container.decode(String?.self, forKey: .clusterEndpoint)
    }
    if container.contains(.clusterCodeVersion) {
        self.clusterCodeVersion = try container.decode(String?.self, forKey: .clusterCodeVersion)
    }
    if container.contains(.certificate) {
        self.certificate = try container.decode(CertificateDescriptionData?.self, forKey: .certificate)
    }
    if container.contains(.reliabilityLevel) {
        self.reliabilityLevel = try container.decode(ReliabilityLevelEnum?.self, forKey: .reliabilityLevel)
    }
    if container.contains(.upgradeMode) {
        self.upgradeMode = try container.decode(UpgradeModeEnum?.self, forKey: .upgradeMode)
    }
    if container.contains(.clientCertificateThumbprints) {
        self.clientCertificateThumbprints = try container.decode([ClientCertificateThumbprintData?]?.self, forKey: .clientCertificateThumbprints)
    }
    if container.contains(.clientCertificateCommonNames) {
        self.clientCertificateCommonNames = try container.decode([ClientCertificateCommonNameData?]?.self, forKey: .clientCertificateCommonNames)
    }
    if container.contains(.fabricSettings) {
        self.fabricSettings = try container.decode([SettingsSectionDescriptionData?]?.self, forKey: .fabricSettings)
    }
    if container.contains(.reverseProxyCertificate) {
        self.reverseProxyCertificate = try container.decode(CertificateDescriptionData?.self, forKey: .reverseProxyCertificate)
    }
    self.managementEndpoint = try container.decode(String.self, forKey: .managementEndpoint)
    self.nodeTypes = try container.decode([NodeTypeDescriptionData].self, forKey: .nodeTypes)
    if container.contains(.azureActiveDirectory) {
        self.azureActiveDirectory = try container.decode(AzureActiveDirectoryData?.self, forKey: .azureActiveDirectory)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.vmImage) {
        self.vmImage = try container.decode(String?.self, forKey: .vmImage)
    }
    if container.contains(.diagnosticsStorageAccountConfig) {
        self.diagnosticsStorageAccountConfig = try container.decode(DiagnosticsStorageAccountConfigData?.self, forKey: .diagnosticsStorageAccountConfig)
    }
    if container.contains(.upgradeDescription) {
        self.upgradeDescription = try container.decode(ClusterUpgradePolicyData?.self, forKey: .upgradeDescription)
    }
    if container.contains(.addOnFeatures) {
        self.addOnFeatures = try container.decode([String?]?.self, forKey: .addOnFeatures)
    }
    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.availableClusterVersions != nil {try container.encode(self.availableClusterVersions as! [ClusterVersionDetailsData?]?, forKey: .availableClusterVersions)}
    if self.clusterId != nil {try container.encode(self.clusterId, forKey: .clusterId)}
    if self.clusterState != nil {try container.encode(self.clusterState, forKey: .clusterState)}
    if self.clusterEndpoint != nil {try container.encode(self.clusterEndpoint, forKey: .clusterEndpoint)}
    if self.clusterCodeVersion != nil {try container.encode(self.clusterCodeVersion, forKey: .clusterCodeVersion)}
    if self.certificate != nil {try container.encode(self.certificate as! CertificateDescriptionData?, forKey: .certificate)}
    if self.reliabilityLevel != nil {try container.encode(self.reliabilityLevel, forKey: .reliabilityLevel)}
    if self.upgradeMode != nil {try container.encode(self.upgradeMode, forKey: .upgradeMode)}
    if self.clientCertificateThumbprints != nil {try container.encode(self.clientCertificateThumbprints as! [ClientCertificateThumbprintData?]?, forKey: .clientCertificateThumbprints)}
    if self.clientCertificateCommonNames != nil {try container.encode(self.clientCertificateCommonNames as! [ClientCertificateCommonNameData?]?, forKey: .clientCertificateCommonNames)}
    if self.fabricSettings != nil {try container.encode(self.fabricSettings as! [SettingsSectionDescriptionData?]?, forKey: .fabricSettings)}
    if self.reverseProxyCertificate != nil {try container.encode(self.reverseProxyCertificate as! CertificateDescriptionData?, forKey: .reverseProxyCertificate)}
    try container.encode(self.managementEndpoint, forKey: .managementEndpoint)
    try container.encode(self.nodeTypes as! [NodeTypeDescriptionData], forKey: .nodeTypes)
    if self.azureActiveDirectory != nil {try container.encode(self.azureActiveDirectory as! AzureActiveDirectoryData?, forKey: .azureActiveDirectory)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.vmImage != nil {try container.encode(self.vmImage, forKey: .vmImage)}
    if self.diagnosticsStorageAccountConfig != nil {try container.encode(self.diagnosticsStorageAccountConfig as! DiagnosticsStorageAccountConfigData?, forKey: .diagnosticsStorageAccountConfig)}
    if self.upgradeDescription != nil {try container.encode(self.upgradeDescription as! ClusterUpgradePolicyData?, forKey: .upgradeDescription)}
    if self.addOnFeatures != nil {try container.encode(self.addOnFeatures as! [String?]?, forKey: .addOnFeatures)}
  }
}

extension DataFactory {
  public static func createClusterPropertiesProtocol(managementEndpoint: String, nodeTypes: [NodeTypeDescriptionProtocol]) -> ClusterPropertiesProtocol {
    return ClusterPropertiesData(managementEndpoint: managementEndpoint, nodeTypes: nodeTypes)
  }
}


// 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 ClusterPropertiesUpdateParametersData : ClusterPropertiesUpdateParametersProtocol {
    public var reliabilityLevel: ReliabilityLevel1Enum?
    public var upgradeMode: UpgradeMode1Enum?
    public var clusterCodeVersion: String?
    public var certificate: CertificateDescriptionProtocol?
    public var clientCertificateThumbprints: [ClientCertificateThumbprintProtocol?]?
    public var clientCertificateCommonNames: [ClientCertificateCommonNameProtocol?]?
    public var fabricSettings: [SettingsSectionDescriptionProtocol?]?
    public var reverseProxyCertificate: CertificateDescriptionProtocol?
    public var nodeTypes: [NodeTypeDescriptionProtocol?]?
    public var upgradeDescription: ClusterUpgradePolicyProtocol?
    public var addOnFeatures: [String?]?

        enum CodingKeys: String, CodingKey {case reliabilityLevel = "reliabilityLevel"
        case upgradeMode = "upgradeMode"
        case clusterCodeVersion = "clusterCodeVersion"
        case certificate = "certificate"
        case clientCertificateThumbprints = "clientCertificateThumbprints"
        case clientCertificateCommonNames = "clientCertificateCommonNames"
        case fabricSettings = "fabricSettings"
        case reverseProxyCertificate = "reverseProxyCertificate"
        case nodeTypes = "nodeTypes"
        case upgradeDescription = "upgradeDescription"
        case addOnFeatures = "addOnFeatures"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.reliabilityLevel) {
        self.reliabilityLevel = try container.decode(ReliabilityLevel1Enum?.self, forKey: .reliabilityLevel)
    }
    if container.contains(.upgradeMode) {
        self.upgradeMode = try container.decode(UpgradeMode1Enum?.self, forKey: .upgradeMode)
    }
    if container.contains(.clusterCodeVersion) {
        self.clusterCodeVersion = try container.decode(String?.self, forKey: .clusterCodeVersion)
    }
    if container.contains(.certificate) {
        self.certificate = try container.decode(CertificateDescriptionData?.self, forKey: .certificate)
    }
    if container.contains(.clientCertificateThumbprints) {
        self.clientCertificateThumbprints = try container.decode([ClientCertificateThumbprintData?]?.self, forKey: .clientCertificateThumbprints)
    }
    if container.contains(.clientCertificateCommonNames) {
        self.clientCertificateCommonNames = try container.decode([ClientCertificateCommonNameData?]?.self, forKey: .clientCertificateCommonNames)
    }
    if container.contains(.fabricSettings) {
        self.fabricSettings = try container.decode([SettingsSectionDescriptionData?]?.self, forKey: .fabricSettings)
    }
    if container.contains(.reverseProxyCertificate) {
        self.reverseProxyCertificate = try container.decode(CertificateDescriptionData?.self, forKey: .reverseProxyCertificate)
    }
    if container.contains(.nodeTypes) {
        self.nodeTypes = try container.decode([NodeTypeDescriptionData?]?.self, forKey: .nodeTypes)
    }
    if container.contains(.upgradeDescription) {
        self.upgradeDescription = try container.decode(ClusterUpgradePolicyData?.self, forKey: .upgradeDescription)
    }
    if container.contains(.addOnFeatures) {
        self.addOnFeatures = try container.decode([String?]?.self, forKey: .addOnFeatures)
    }
    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.reliabilityLevel != nil {try container.encode(self.reliabilityLevel, forKey: .reliabilityLevel)}
    if self.upgradeMode != nil {try container.encode(self.upgradeMode, forKey: .upgradeMode)}
    if self.clusterCodeVersion != nil {try container.encode(self.clusterCodeVersion, forKey: .clusterCodeVersion)}
    if self.certificate != nil {try container.encode(self.certificate as! CertificateDescriptionData?, forKey: .certificate)}
    if self.clientCertificateThumbprints != nil {try container.encode(self.clientCertificateThumbprints as! [ClientCertificateThumbprintData?]?, forKey: .clientCertificateThumbprints)}
    if self.clientCertificateCommonNames != nil {try container.encode(self.clientCertificateCommonNames as! [ClientCertificateCommonNameData?]?, forKey: .clientCertificateCommonNames)}
    if self.fabricSettings != nil {try container.encode(self.fabricSettings as! [SettingsSectionDescriptionData?]?, forKey: .fabricSettings)}
    if self.reverseProxyCertificate != nil {try container.encode(self.reverseProxyCertificate as! CertificateDescriptionData?, forKey: .reverseProxyCertificate)}
    if self.nodeTypes != nil {try container.encode(self.nodeTypes as! [NodeTypeDescriptionData?]?, forKey: .nodeTypes)}
    if self.upgradeDescription != nil {try container.encode(self.upgradeDescription as! ClusterUpgradePolicyData?, forKey: .upgradeDescription)}
    if self.addOnFeatures != nil {try container.encode(self.addOnFeatures as! [String?]?, forKey: .addOnFeatures)}
  }
}

extension DataFactory {
  public static func createClusterPropertiesUpdateParametersProtocol() -> ClusterPropertiesUpdateParametersProtocol {
    return ClusterPropertiesUpdateParametersData()
  }
}


// ClusterState enumerates the values for cluster 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 ClusterStateEnum: String, Codable
{
// AutoScale specifies the auto scale state for cluster state.
    case AutoScale = "AutoScale"
// BaselineUpgrade specifies the baseline upgrade state for cluster state.
    case BaselineUpgrade = "BaselineUpgrade"
// Deploying specifies the deploying state for cluster state.
    case Deploying = "Deploying"
// EnforcingClusterVersion specifies the enforcing cluster version state for cluster state.
    case EnforcingClusterVersion = "EnforcingClusterVersion"
// Ready specifies the ready state for cluster state.
    case Ready = "Ready"
// UpdatingInfrastructure specifies the updating infrastructure state for cluster state.
    case UpdatingInfrastructure = "UpdatingInfrastructure"
// UpdatingUserCertificate specifies the updating user certificate state for cluster state.
    case UpdatingUserCertificate = "UpdatingUserCertificate"
// UpdatingUserConfiguration specifies the updating user configuration state for cluster state.
    case UpdatingUserConfiguration = "UpdatingUserConfiguration"
// UpgradeServiceUnreachable specifies the upgrade service unreachable state for cluster state.
    case UpgradeServiceUnreachable = "UpgradeServiceUnreachable"
// WaitingForNodes specifies the waiting for nodes state for cluster state.
    case WaitingForNodes = "WaitingForNodes"
}


// 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 ClusterUpdateParametersData : ClusterUpdateParametersProtocol {
    public var properties: ClusterPropertiesUpdateParametersProtocol?
    public var tags: [String:String]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createClusterUpdateParametersProtocol() -> ClusterUpdateParametersProtocol {
    return ClusterUpdateParametersData()
  }
}


// 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 ClusterUpgradeDeltaHealthPolicyData : ClusterUpgradeDeltaHealthPolicyProtocol {
    public var maxPercentDeltaUnhealthyNodes: Int32
    public var maxPercentUpgradeDomainDeltaUnhealthyNodes: Int32
    public var maxPercentDeltaUnhealthyApplications: Int32

        enum CodingKeys: String, CodingKey {case maxPercentDeltaUnhealthyNodes = "maxPercentDeltaUnhealthyNodes"
        case maxPercentUpgradeDomainDeltaUnhealthyNodes = "maxPercentUpgradeDomainDeltaUnhealthyNodes"
        case maxPercentDeltaUnhealthyApplications = "maxPercentDeltaUnhealthyApplications"
        }

  public init(maxPercentDeltaUnhealthyNodes: Int32, maxPercentUpgradeDomainDeltaUnhealthyNodes: Int32, maxPercentDeltaUnhealthyApplications: Int32)  {
    self.maxPercentDeltaUnhealthyNodes = maxPercentDeltaUnhealthyNodes
    self.maxPercentUpgradeDomainDeltaUnhealthyNodes = maxPercentUpgradeDomainDeltaUnhealthyNodes
    self.maxPercentDeltaUnhealthyApplications = maxPercentDeltaUnhealthyApplications
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.maxPercentDeltaUnhealthyNodes = try container.decode(Int32.self, forKey: .maxPercentDeltaUnhealthyNodes)
    self.maxPercentUpgradeDomainDeltaUnhealthyNodes = try container.decode(Int32.self, forKey: .maxPercentUpgradeDomainDeltaUnhealthyNodes)
    self.maxPercentDeltaUnhealthyApplications = try container.decode(Int32.self, forKey: .maxPercentDeltaUnhealthyApplications)
    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.maxPercentDeltaUnhealthyNodes, forKey: .maxPercentDeltaUnhealthyNodes)
    try container.encode(self.maxPercentUpgradeDomainDeltaUnhealthyNodes, forKey: .maxPercentUpgradeDomainDeltaUnhealthyNodes)
    try container.encode(self.maxPercentDeltaUnhealthyApplications, forKey: .maxPercentDeltaUnhealthyApplications)
  }
}

extension DataFactory {
  public static func createClusterUpgradeDeltaHealthPolicyProtocol(maxPercentDeltaUnhealthyNodes: Int32, maxPercentUpgradeDomainDeltaUnhealthyNodes: Int32, maxPercentDeltaUnhealthyApplications: Int32) -> ClusterUpgradeDeltaHealthPolicyProtocol {
    return ClusterUpgradeDeltaHealthPolicyData(maxPercentDeltaUnhealthyNodes: maxPercentDeltaUnhealthyNodes, maxPercentUpgradeDomainDeltaUnhealthyNodes: maxPercentUpgradeDomainDeltaUnhealthyNodes, maxPercentDeltaUnhealthyApplications: maxPercentDeltaUnhealthyApplications)
  }
}


// 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 ClusterUpgradePolicyData : ClusterUpgradePolicyProtocol {
    public var forceRestart: Bool?
    public var upgradeReplicaSetCheckTimeout: String
    public var healthCheckWaitDuration: String
    public var healthCheckStableDuration: String
    public var healthCheckRetryTimeout: String
    public var upgradeTimeout: String
    public var upgradeDomainTimeout: String
    public var healthPolicy: ClusterHealthPolicyProtocol
    public var deltaHealthPolicy: ClusterUpgradeDeltaHealthPolicyProtocol?

        enum CodingKeys: String, CodingKey {case forceRestart = "forceRestart"
        case upgradeReplicaSetCheckTimeout = "upgradeReplicaSetCheckTimeout"
        case healthCheckWaitDuration = "healthCheckWaitDuration"
        case healthCheckStableDuration = "healthCheckStableDuration"
        case healthCheckRetryTimeout = "healthCheckRetryTimeout"
        case upgradeTimeout = "upgradeTimeout"
        case upgradeDomainTimeout = "upgradeDomainTimeout"
        case healthPolicy = "healthPolicy"
        case deltaHealthPolicy = "deltaHealthPolicy"
        }

  public init(upgradeReplicaSetCheckTimeout: String, healthCheckWaitDuration: String, healthCheckStableDuration: String, healthCheckRetryTimeout: String, upgradeTimeout: String, upgradeDomainTimeout: String, healthPolicy: ClusterHealthPolicyProtocol)  {
    self.upgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout
    self.healthCheckWaitDuration = healthCheckWaitDuration
    self.healthCheckStableDuration = healthCheckStableDuration
    self.healthCheckRetryTimeout = healthCheckRetryTimeout
    self.upgradeTimeout = upgradeTimeout
    self.upgradeDomainTimeout = upgradeDomainTimeout
    self.healthPolicy = healthPolicy
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.forceRestart) {
        self.forceRestart = try container.decode(Bool?.self, forKey: .forceRestart)
    }
    self.upgradeReplicaSetCheckTimeout = try container.decode(String.self, forKey: .upgradeReplicaSetCheckTimeout)
    self.healthCheckWaitDuration = try container.decode(String.self, forKey: .healthCheckWaitDuration)
    self.healthCheckStableDuration = try container.decode(String.self, forKey: .healthCheckStableDuration)
    self.healthCheckRetryTimeout = try container.decode(String.self, forKey: .healthCheckRetryTimeout)
    self.upgradeTimeout = try container.decode(String.self, forKey: .upgradeTimeout)
    self.upgradeDomainTimeout = try container.decode(String.self, forKey: .upgradeDomainTimeout)
    self.healthPolicy = try container.decode(ClusterHealthPolicyData.self, forKey: .healthPolicy)
    if container.contains(.deltaHealthPolicy) {
        self.deltaHealthPolicy = try container.decode(ClusterUpgradeDeltaHealthPolicyData?.self, forKey: .deltaHealthPolicy)
    }
    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.forceRestart != nil {try container.encode(self.forceRestart, forKey: .forceRestart)}
    try container.encode(self.upgradeReplicaSetCheckTimeout, forKey: .upgradeReplicaSetCheckTimeout)
    try container.encode(self.healthCheckWaitDuration, forKey: .healthCheckWaitDuration)
    try container.encode(self.healthCheckStableDuration, forKey: .healthCheckStableDuration)
    try container.encode(self.healthCheckRetryTimeout, forKey: .healthCheckRetryTimeout)
    try container.encode(self.upgradeTimeout, forKey: .upgradeTimeout)
    try container.encode(self.upgradeDomainTimeout, forKey: .upgradeDomainTimeout)
    try container.encode(self.healthPolicy as! ClusterHealthPolicyData, forKey: .healthPolicy)
    if self.deltaHealthPolicy != nil {try container.encode(self.deltaHealthPolicy as! ClusterUpgradeDeltaHealthPolicyData?, forKey: .deltaHealthPolicy)}
  }
}

extension DataFactory {
  public static func createClusterUpgradePolicyProtocol(upgradeReplicaSetCheckTimeout: String, healthCheckWaitDuration: String, healthCheckStableDuration: String, healthCheckRetryTimeout: String, upgradeTimeout: String, upgradeDomainTimeout: String, healthPolicy: ClusterHealthPolicyProtocol) -> ClusterUpgradePolicyProtocol {
    return ClusterUpgradePolicyData(upgradeReplicaSetCheckTimeout: upgradeReplicaSetCheckTimeout, healthCheckWaitDuration: healthCheckWaitDuration, healthCheckStableDuration: healthCheckStableDuration, healthCheckRetryTimeout: healthCheckRetryTimeout, upgradeTimeout: upgradeTimeout, upgradeDomainTimeout: upgradeDomainTimeout, healthPolicy: healthPolicy)
  }
}


// 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 ClusterVersionDetailsData : ClusterVersionDetailsProtocol {
    public var codeVersion: String?
    public var supportExpiryUtc: String?
    public var environment: EnvironmentEnum?

        enum CodingKeys: String, CodingKey {case codeVersion = "codeVersion"
        case supportExpiryUtc = "supportExpiryUtc"
        case environment = "environment"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createClusterVersionDetailsProtocol() -> ClusterVersionDetailsProtocol {
    return ClusterVersionDetailsData()
  }
}


// DefaultMoveCost enumerates the values for default move cost.

// 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 DefaultMoveCostEnum: String, Codable
{
// High specifies the high state for default move cost.
    case High = "High"
// Low specifies the low state for default move cost.
    case Low = "Low"
// Medium specifies the medium state for default move cost.
    case Medium = "Medium"
// Zero specifies the zero state for default move cost.
    case Zero = "Zero"
}


// 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 DiagnosticsStorageAccountConfigData : DiagnosticsStorageAccountConfigProtocol {
    public var storageAccountName: String
    public var protectedAccountKeyName: String
    public var blobEndpoint: String
    public var queueEndpoint: String
    public var tableEndpoint: String

        enum CodingKeys: String, CodingKey {case storageAccountName = "storageAccountName"
        case protectedAccountKeyName = "protectedAccountKeyName"
        case blobEndpoint = "blobEndpoint"
        case queueEndpoint = "queueEndpoint"
        case tableEndpoint = "tableEndpoint"
        }

  public init(storageAccountName: String, protectedAccountKeyName: String, blobEndpoint: String, queueEndpoint: String, tableEndpoint: String)  {
    self.storageAccountName = storageAccountName
    self.protectedAccountKeyName = protectedAccountKeyName
    self.blobEndpoint = blobEndpoint
    self.queueEndpoint = queueEndpoint
    self.tableEndpoint = tableEndpoint
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.storageAccountName = try container.decode(String.self, forKey: .storageAccountName)
    self.protectedAccountKeyName = try container.decode(String.self, forKey: .protectedAccountKeyName)
    self.blobEndpoint = try container.decode(String.self, forKey: .blobEndpoint)
    self.queueEndpoint = try container.decode(String.self, forKey: .queueEndpoint)
    self.tableEndpoint = try container.decode(String.self, forKey: .tableEndpoint)
    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.storageAccountName, forKey: .storageAccountName)
    try container.encode(self.protectedAccountKeyName, forKey: .protectedAccountKeyName)
    try container.encode(self.blobEndpoint, forKey: .blobEndpoint)
    try container.encode(self.queueEndpoint, forKey: .queueEndpoint)
    try container.encode(self.tableEndpoint, forKey: .tableEndpoint)
  }
}

extension DataFactory {
  public static func createDiagnosticsStorageAccountConfigProtocol(storageAccountName: String, protectedAccountKeyName: String, blobEndpoint: String, queueEndpoint: String, tableEndpoint: String) -> DiagnosticsStorageAccountConfigProtocol {
    return DiagnosticsStorageAccountConfigData(storageAccountName: storageAccountName, protectedAccountKeyName: protectedAccountKeyName, blobEndpoint: blobEndpoint, queueEndpoint: queueEndpoint, tableEndpoint: tableEndpoint)
  }
}


// DurabilityLevel enumerates the values for durability level.

// 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 DurabilityLevelEnum: String, Codable
{
// Bronze specifies the bronze state for durability level.
    case Bronze = "Bronze"
// Gold specifies the gold state for durability level.
    case Gold = "Gold"
// Silver specifies the silver state for durability level.
    case Silver = "Silver"
}


// 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 EndpointRangeDescriptionData : EndpointRangeDescriptionProtocol {
    public var startPort: Int32
    public var endPort: Int32

        enum CodingKeys: String, CodingKey {case startPort = "startPort"
        case endPort = "endPort"
        }

  public init(startPort: Int32, endPort: Int32)  {
    self.startPort = startPort
    self.endPort = endPort
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.startPort = try container.decode(Int32.self, forKey: .startPort)
    self.endPort = try container.decode(Int32.self, forKey: .endPort)
    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.startPort, forKey: .startPort)
    try container.encode(self.endPort, forKey: .endPort)
  }
}

extension DataFactory {
  public static func createEndpointRangeDescriptionProtocol(startPort: Int32, endPort: Int32) -> EndpointRangeDescriptionProtocol {
    return EndpointRangeDescriptionData(startPort: startPort, endPort: endPort)
  }
}


// Environment enumerates the values for environment.

// 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 EnvironmentEnum: String, Codable
{
// Linux specifies the linux state for environment.
    case Linux = "Linux"
// Windows specifies the windows state for environment.
    case Windows = "Windows"
}


// 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 ErrorModelData : ErrorModelProtocol {
    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 createErrorModelProtocol() -> ErrorModelProtocol {
    return ErrorModelData()
  }
}


// GetByEnvironmentEnvironment enumerates the values for get by environment environment.

// 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 GetByEnvironmentEnvironmentEnum: String, Codable
{
// GetByEnvironmentEnvironmentLinux specifies the get by environment environment linux state for get by environment
// environment.
    case GetByEnvironmentEnvironmentLinux = "Linux"
// GetByEnvironmentEnvironmentWindows specifies the get by environment environment windows state for get by environment
// environment.
    case GetByEnvironmentEnvironmentWindows = "Windows"
}


// ListByEnvironmentEnvironment enumerates the values for list by environment environment.

// 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 ListByEnvironmentEnvironmentEnum: String, Codable
{
// ListByEnvironmentEnvironmentLinux specifies the list by environment environment linux state for list by environment
// environment.
    case ListByEnvironmentEnvironmentLinux = "Linux"
// ListByEnvironmentEnvironmentWindows specifies the list by environment environment windows state for list by
// environment environment.
    case ListByEnvironmentEnvironmentWindows = "Windows"
}


// 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 NamedPartitionSchemeDescriptionData : NamedPartitionSchemeDescriptionProtocol, PartitionSchemeDescriptionProtocol {
    public var count: Int32
    public var names: [String]

        enum CodingKeys: String, CodingKey {case count = "Count"
        case names = "Names"
        }

  public init(count: Int32, names: [String])  {
    self.count = count
    self.names = names
  }

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

extension DataFactory {
  public static func createNamedPartitionSchemeDescriptionProtocol(count: Int32, names: [String]) -> NamedPartitionSchemeDescriptionProtocol {
    return NamedPartitionSchemeDescriptionData(count: count, names: names)
  }
}


// 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 NodeTypeDescriptionData : NodeTypeDescriptionProtocol {
    public var name: String
    public var placementProperties: [String:String]?
    public var capacities: [String:String]?
    public var clientConnectionEndpointPort: Int32
    public var httpGatewayEndpointPort: Int32
    public var durabilityLevel: DurabilityLevelEnum?
    public var applicationPorts: EndpointRangeDescriptionProtocol?
    public var ephemeralPorts: EndpointRangeDescriptionProtocol?
    public var isPrimary: Bool
    public var vmInstanceCount: Int32
    public var reverseProxyEndpointPort: Int32?

        enum CodingKeys: String, CodingKey {case name = "name"
        case placementProperties = "placementProperties"
        case capacities = "capacities"
        case clientConnectionEndpointPort = "clientConnectionEndpointPort"
        case httpGatewayEndpointPort = "httpGatewayEndpointPort"
        case durabilityLevel = "durabilityLevel"
        case applicationPorts = "applicationPorts"
        case ephemeralPorts = "ephemeralPorts"
        case isPrimary = "isPrimary"
        case vmInstanceCount = "vmInstanceCount"
        case reverseProxyEndpointPort = "reverseProxyEndpointPort"
        }

  public init(name: String, clientConnectionEndpointPort: Int32, httpGatewayEndpointPort: Int32, isPrimary: Bool, vmInstanceCount: Int32)  {
    self.name = name
    self.clientConnectionEndpointPort = clientConnectionEndpointPort
    self.httpGatewayEndpointPort = httpGatewayEndpointPort
    self.isPrimary = isPrimary
    self.vmInstanceCount = vmInstanceCount
  }

  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(.placementProperties) {
        self.placementProperties = try container.decode([String:String]?.self, forKey: .placementProperties)
    }
    if container.contains(.capacities) {
        self.capacities = try container.decode([String:String]?.self, forKey: .capacities)
    }
    self.clientConnectionEndpointPort = try container.decode(Int32.self, forKey: .clientConnectionEndpointPort)
    self.httpGatewayEndpointPort = try container.decode(Int32.self, forKey: .httpGatewayEndpointPort)
    if container.contains(.durabilityLevel) {
        self.durabilityLevel = try container.decode(DurabilityLevelEnum?.self, forKey: .durabilityLevel)
    }
    if container.contains(.applicationPorts) {
        self.applicationPorts = try container.decode(EndpointRangeDescriptionData?.self, forKey: .applicationPorts)
    }
    if container.contains(.ephemeralPorts) {
        self.ephemeralPorts = try container.decode(EndpointRangeDescriptionData?.self, forKey: .ephemeralPorts)
    }
    self.isPrimary = try container.decode(Bool.self, forKey: .isPrimary)
    self.vmInstanceCount = try container.decode(Int32.self, forKey: .vmInstanceCount)
    if container.contains(.reverseProxyEndpointPort) {
        self.reverseProxyEndpointPort = try container.decode(Int32?.self, forKey: .reverseProxyEndpointPort)
    }
    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.placementProperties != nil {try container.encode(self.placementProperties, forKey: .placementProperties)}
    if self.capacities != nil {try container.encode(self.capacities, forKey: .capacities)}
    try container.encode(self.clientConnectionEndpointPort, forKey: .clientConnectionEndpointPort)
    try container.encode(self.httpGatewayEndpointPort, forKey: .httpGatewayEndpointPort)
    if self.durabilityLevel != nil {try container.encode(self.durabilityLevel, forKey: .durabilityLevel)}
    if self.applicationPorts != nil {try container.encode(self.applicationPorts as! EndpointRangeDescriptionData?, forKey: .applicationPorts)}
    if self.ephemeralPorts != nil {try container.encode(self.ephemeralPorts as! EndpointRangeDescriptionData?, forKey: .ephemeralPorts)}
    try container.encode(self.isPrimary, forKey: .isPrimary)
    try container.encode(self.vmInstanceCount, forKey: .vmInstanceCount)
    if self.reverseProxyEndpointPort != nil {try container.encode(self.reverseProxyEndpointPort, forKey: .reverseProxyEndpointPort)}
  }
}

extension DataFactory {
  public static func createNodeTypeDescriptionProtocol(name: String, clientConnectionEndpointPort: Int32, httpGatewayEndpointPort: Int32, isPrimary: Bool, vmInstanceCount: Int32) -> NodeTypeDescriptionProtocol {
    return NodeTypeDescriptionData(name: name, clientConnectionEndpointPort: clientConnectionEndpointPort, httpGatewayEndpointPort: httpGatewayEndpointPort, isPrimary: isPrimary, vmInstanceCount: vmInstanceCount)
  }
}


// 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: [OperationResultProtocol?]?
    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([OperationResultData?]?.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! [OperationResultData?]?, 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 OperationResultData : OperationResultProtocol {
    public var name: String?
    public var display: AvailableOperationDisplayProtocol?
    public var origin: String?
    public var _nextLink: String?

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

  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(AvailableOperationDisplayData?.self, forKey: .display)
    }
    if container.contains(.origin) {
        self.origin = try container.decode(String?.self, forKey: .origin)
    }
    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.name != nil {try container.encode(self.name, forKey: .name)}
    if self.display != nil {try container.encode(self.display as! AvailableOperationDisplayData?, forKey: .display)}
    if self.origin != nil {try container.encode(self.origin, forKey: .origin)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createOperationResultProtocol() -> OperationResultProtocol {
    return OperationResultData()
  }
}


// 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 PartitionSchemeDescriptionData : PartitionSchemeDescriptionProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    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 {
  }
}

extension DataFactory {
  public static func createPartitionSchemeDescriptionProtocol() -> PartitionSchemeDescriptionProtocol {
    return PartitionSchemeDescriptionData()
  }
}


// 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
{
// Canceled specifies the canceled state for provisioning state.
    case Canceled = "Canceled"
// Failed specifies the failed state for provisioning state.
    case Failed = "Failed"
// Succeeded specifies the succeeded state for provisioning state.
    case Succeeded = "Succeeded"
// 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 ProxyResourceData : ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String

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

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

  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)
    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)
  }
}

extension DataFactory {
  public static func createProxyResourceProtocol(location: String) -> ProxyResourceProtocol {
    return ProxyResourceData(location: location)
  }
}


// ReliabilityLevel1 enumerates the values for reliability level 1.

// 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 ReliabilityLevel1Enum: String, Codable
{
// ReliabilityLevel1Bronze specifies the reliability level 1 bronze state for reliability level 1.
    case ReliabilityLevel1Bronze = "Bronze"
// ReliabilityLevel1Gold specifies the reliability level 1 gold state for reliability level 1.
    case ReliabilityLevel1Gold = "Gold"
// ReliabilityLevel1Silver specifies the reliability level 1 silver state for reliability level 1.
    case ReliabilityLevel1Silver = "Silver"
}


// ReliabilityLevel enumerates the values for reliability level.

// 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 ReliabilityLevelEnum: String, Codable
{
// ReliabilityLevelBronze specifies the reliability level bronze state for reliability level.
    case ReliabilityLevelBronze = "Bronze"
// ReliabilityLevelGold specifies the reliability level gold state for reliability level.
    case ReliabilityLevelGold = "Gold"
// ReliabilityLevelNone specifies the reliability level none state for reliability level.
    case ReliabilityLevelNone = "None"
// ReliabilityLevelPlatinum specifies the reliability level platinum state for reliability level.
    case ReliabilityLevelPlatinum = "Platinum"
// ReliabilityLevelSilver specifies the reliability level silver state for reliability level.
    case ReliabilityLevelSilver = "Silver"
}


// 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 tags: [String:String]?

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

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

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

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


// 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 RollingUpgradeMonitoringPolicyData : RollingUpgradeMonitoringPolicyProtocol {
    public var healthCheckWaitDuration: String?
    public var healthCheckStableDuration: String?
    public var healthCheckRetryTimeout: String?
    public var upgradeTimeout: String?
    public var upgradeDomainTimeout: String?

        enum CodingKeys: String, CodingKey {case healthCheckWaitDuration = "healthCheckWaitDuration"
        case healthCheckStableDuration = "healthCheckStableDuration"
        case healthCheckRetryTimeout = "healthCheckRetryTimeout"
        case upgradeTimeout = "upgradeTimeout"
        case upgradeDomainTimeout = "upgradeDomainTimeout"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRollingUpgradeMonitoringPolicyProtocol() -> RollingUpgradeMonitoringPolicyProtocol {
    return RollingUpgradeMonitoringPolicyData()
  }
}


// Scheme enumerates the values for scheme.

// 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 SchemeEnum: String, Codable
{
// Affinity specifies the affinity state for scheme.
    case Affinity = "Affinity"
// AlignedAffinity specifies the aligned affinity state for scheme.
    case AlignedAffinity = "AlignedAffinity"
// Invalid specifies the invalid state for scheme.
    case Invalid = "Invalid"
// NonAlignedAffinity specifies the non aligned affinity state for scheme.
    case NonAlignedAffinity = "NonAlignedAffinity"
}


// 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 ServiceCorrelationDescriptionData : ServiceCorrelationDescriptionProtocol {
    public var scheme: SchemeEnum
    public var serviceName: String

        enum CodingKeys: String, CodingKey {case scheme = "Scheme"
        case serviceName = "ServiceName"
        }

  public init(scheme: SchemeEnum, serviceName: String)  {
    self.scheme = scheme
    self.serviceName = serviceName
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.scheme = try container.decode(SchemeEnum.self, forKey: .scheme)
    self.serviceName = try container.decode(String.self, forKey: .serviceName)
    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.scheme, forKey: .scheme)
    try container.encode(self.serviceName, forKey: .serviceName)
  }
}

extension DataFactory {
  public static func createServiceCorrelationDescriptionProtocol(scheme: SchemeEnum, serviceName: String) -> ServiceCorrelationDescriptionProtocol {
    return ServiceCorrelationDescriptionData(scheme: scheme, serviceName: serviceName)
  }
}