// 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 ServiceLoadMetricDescriptionData : ServiceLoadMetricDescriptionProtocol {
    public var name: String
    public var weight: WeightEnum?
    public var primaryDefaultLoad: Int32?
    public var secondaryDefaultLoad: Int32?
    public var defaultLoad: Int32?

        enum CodingKeys: String, CodingKey {case name = "Name"
        case weight = "Weight"
        case primaryDefaultLoad = "PrimaryDefaultLoad"
        case secondaryDefaultLoad = "SecondaryDefaultLoad"
        case defaultLoad = "DefaultLoad"
        }

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

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

extension DataFactory {
  public static func createServiceLoadMetricDescriptionProtocol(name: String) -> ServiceLoadMetricDescriptionProtocol {
    return ServiceLoadMetricDescriptionData(name: name)
  }
}


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

  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 createServicePlacementPolicyDescriptionProtocol() -> ServicePlacementPolicyDescriptionProtocol {
    return ServicePlacementPolicyDescriptionData()
  }
}


// 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 ServicePropertiesBaseData : ServicePropertiesBaseProtocol {
    public var placementConstraints: String?
    public var correlationScheme: [ServiceCorrelationDescriptionProtocol?]?
    public var serviceLoadMetrics: [ServiceLoadMetricDescriptionProtocol?]?
    public var servicePlacementPolicies: [ServicePlacementPolicyDescriptionProtocol?]?
    public var defaultMoveCost: DefaultMoveCostEnum?

        enum CodingKeys: String, CodingKey {case placementConstraints = "placementConstraints"
        case correlationScheme = "correlationScheme"
        case serviceLoadMetrics = "serviceLoadMetrics"
        case servicePlacementPolicies = "servicePlacementPolicies"
        case defaultMoveCost = "defaultMoveCost"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createServicePropertiesBaseProtocol() -> ServicePropertiesBaseProtocol {
    return ServicePropertiesBaseData()
  }
}


// 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 ServicePropertiesData : ServicePropertiesProtocol, ServicePropertiesBaseProtocol {
    public var placementConstraints: String?
    public var correlationScheme: [ServiceCorrelationDescriptionProtocol?]?
    public var serviceLoadMetrics: [ServiceLoadMetricDescriptionProtocol?]?
    public var servicePlacementPolicies: [ServicePlacementPolicyDescriptionProtocol?]?
    public var defaultMoveCost: DefaultMoveCostEnum?
    public var provisioningState: String?
    public var serviceTypeName: String?
    public var partitionDescription: PartitionSchemeDescriptionProtocol?

        enum CodingKeys: String, CodingKey {case placementConstraints = "placementConstraints"
        case correlationScheme = "correlationScheme"
        case serviceLoadMetrics = "serviceLoadMetrics"
        case servicePlacementPolicies = "servicePlacementPolicies"
        case defaultMoveCost = "defaultMoveCost"
        case provisioningState = "provisioningState"
        case serviceTypeName = "serviceTypeName"
        case partitionDescription = "partitionDescription"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.placementConstraints) {
        self.placementConstraints = try container.decode(String?.self, forKey: .placementConstraints)
    }
    if container.contains(.correlationScheme) {
        self.correlationScheme = try container.decode([ServiceCorrelationDescriptionData?]?.self, forKey: .correlationScheme)
    }
    if container.contains(.serviceLoadMetrics) {
        self.serviceLoadMetrics = try container.decode([ServiceLoadMetricDescriptionData?]?.self, forKey: .serviceLoadMetrics)
    }
    if container.contains(.servicePlacementPolicies) {
        self.servicePlacementPolicies = try container.decode([ServicePlacementPolicyDescriptionData?]?.self, forKey: .servicePlacementPolicies)
    }
    if container.contains(.defaultMoveCost) {
        self.defaultMoveCost = try container.decode(DefaultMoveCostEnum?.self, forKey: .defaultMoveCost)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.serviceTypeName) {
        self.serviceTypeName = try container.decode(String?.self, forKey: .serviceTypeName)
    }
    if container.contains(.partitionDescription) {
        self.partitionDescription = try container.decode(PartitionSchemeDescriptionData?.self, forKey: .partitionDescription)
    }
    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.placementConstraints != nil {try container.encode(self.placementConstraints, forKey: .placementConstraints)}
    if self.correlationScheme != nil {try container.encode(self.correlationScheme as! [ServiceCorrelationDescriptionData?]?, forKey: .correlationScheme)}
    if self.serviceLoadMetrics != nil {try container.encode(self.serviceLoadMetrics as! [ServiceLoadMetricDescriptionData?]?, forKey: .serviceLoadMetrics)}
    if self.servicePlacementPolicies != nil {try container.encode(self.servicePlacementPolicies as! [ServicePlacementPolicyDescriptionData?]?, forKey: .servicePlacementPolicies)}
    if self.defaultMoveCost != nil {try container.encode(self.defaultMoveCost, forKey: .defaultMoveCost)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.serviceTypeName != nil {try container.encode(self.serviceTypeName, forKey: .serviceTypeName)}
    if self.partitionDescription != nil {try container.encode(self.partitionDescription as! PartitionSchemeDescriptionData?, forKey: .partitionDescription)}
  }
}

extension DataFactory {
  public static func createServicePropertiesProtocol() -> ServicePropertiesProtocol {
    return ServicePropertiesData()
  }
}


// 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 ServiceResourceData : ServiceResourceProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var properties: ServicePropertiesProtocol?

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

extension DataFactory {
  public static func createServiceResourceProtocol(location: String) -> ServiceResourceProtocol {
    return ServiceResourceData(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 ServiceResourceListData : ServiceResourceListProtocol {
    public var value: [ServiceResourceProtocol?]?

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

extension DataFactory {
  public static func createServiceResourceListProtocol() -> ServiceResourceListProtocol {
    return ServiceResourceListData()
  }
}


// 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 ServiceResourceUpdateData : ServiceResourceUpdateProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var properties: ServiceUpdatePropertiesProtocol?

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

extension DataFactory {
  public static func createServiceResourceUpdateProtocol(location: String) -> ServiceResourceUpdateProtocol {
    return ServiceResourceUpdateData(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 ServiceTypeDeltaHealthPolicyData : ServiceTypeDeltaHealthPolicyProtocol {
    public var maxPercentDeltaUnhealthyServices: Int32?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createServiceTypeDeltaHealthPolicyProtocol() -> ServiceTypeDeltaHealthPolicyProtocol {
    return ServiceTypeDeltaHealthPolicyData()
  }
}


// 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 ServiceTypeHealthPolicyData : ServiceTypeHealthPolicyProtocol {
    public var maxPercentUnhealthyPartitionsPerService: Int32?
    public var maxPercentUnhealthyReplicasPerPartition: Int32?
    public var maxPercentUnhealthyServices: Int32?

        enum CodingKeys: String, CodingKey {case maxPercentUnhealthyPartitionsPerService = "MaxPercentUnhealthyPartitionsPerService"
        case maxPercentUnhealthyReplicasPerPartition = "MaxPercentUnhealthyReplicasPerPartition"
        case maxPercentUnhealthyServices = "MaxPercentUnhealthyServices"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createServiceTypeHealthPolicyProtocol() -> ServiceTypeHealthPolicyProtocol {
    return ServiceTypeHealthPolicyData()
  }
}


// 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 ServiceTypeHealthPolicyMapItemData : ServiceTypeHealthPolicyMapItemProtocol {
    public var key: String
    public var value: ServiceTypeHealthPolicyProtocol

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

  public init(key: String, value: ServiceTypeHealthPolicyProtocol)  {
    self.key = key
    self.value = value
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.key, forKey: .key)
    try container.encode(self.value as! ServiceTypeHealthPolicyData, forKey: .value)
  }
}

extension DataFactory {
  public static func createServiceTypeHealthPolicyMapItemProtocol(key: String, value: ServiceTypeHealthPolicyProtocol) -> ServiceTypeHealthPolicyMapItemProtocol {
    return ServiceTypeHealthPolicyMapItemData(key: key, value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ServiceUpdatePropertiesData : ServiceUpdatePropertiesProtocol, ServicePropertiesBaseProtocol {
    public var placementConstraints: String?
    public var correlationScheme: [ServiceCorrelationDescriptionProtocol?]?
    public var serviceLoadMetrics: [ServiceLoadMetricDescriptionProtocol?]?
    public var servicePlacementPolicies: [ServicePlacementPolicyDescriptionProtocol?]?
    public var defaultMoveCost: DefaultMoveCostEnum?

        enum CodingKeys: String, CodingKey {case placementConstraints = "placementConstraints"
        case correlationScheme = "correlationScheme"
        case serviceLoadMetrics = "serviceLoadMetrics"
        case servicePlacementPolicies = "servicePlacementPolicies"
        case defaultMoveCost = "defaultMoveCost"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createServiceUpdatePropertiesProtocol() -> ServiceUpdatePropertiesProtocol {
    return ServiceUpdatePropertiesData()
  }
}


// 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 SettingsParameterDescriptionData : SettingsParameterDescriptionProtocol {
    public var name: String
    public var value: String

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

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

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

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

extension DataFactory {
  public static func createSettingsParameterDescriptionProtocol(name: String, value: String) -> SettingsParameterDescriptionProtocol {
    return SettingsParameterDescriptionData(name: name, value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SettingsSectionDescriptionData : SettingsSectionDescriptionProtocol {
    public var name: String
    public var parameters: [SettingsParameterDescriptionProtocol]

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

  public init(name: String, parameters: [SettingsParameterDescriptionProtocol])  {
    self.name = name
    self.parameters = parameters
  }

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

extension DataFactory {
  public static func createSettingsSectionDescriptionProtocol(name: String, parameters: [SettingsParameterDescriptionProtocol]) -> SettingsSectionDescriptionProtocol {
    return SettingsSectionDescriptionData(name: name, parameters: parameters)
  }
}


// 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 SingletonPartitionSchemeDescriptionData : SingletonPartitionSchemeDescriptionProtocol, 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 createSingletonPartitionSchemeDescriptionProtocol() -> SingletonPartitionSchemeDescriptionProtocol {
    return SingletonPartitionSchemeDescriptionData()
  }
}


// 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 StatefulServicePropertiesData : StatefulServicePropertiesProtocol, ServicePropertiesProtocol, ServicePropertiesBaseProtocol {
    public var placementConstraints: String?
    public var correlationScheme: [ServiceCorrelationDescriptionProtocol?]?
    public var serviceLoadMetrics: [ServiceLoadMetricDescriptionProtocol?]?
    public var servicePlacementPolicies: [ServicePlacementPolicyDescriptionProtocol?]?
    public var defaultMoveCost: DefaultMoveCostEnum?
    public var provisioningState: String?
    public var serviceTypeName: String?
    public var partitionDescription: PartitionSchemeDescriptionProtocol?
    public var hasPersistedState: Bool?
    public var targetReplicaSetSize: Int32?
    public var minReplicaSetSize: Int32?
    public var replicaRestartWaitDuration: Date?
    public var quorumLossWaitDuration: Date?
    public var standByReplicaKeepDuration: Date?

        enum CodingKeys: String, CodingKey {case placementConstraints = "placementConstraints"
        case correlationScheme = "correlationScheme"
        case serviceLoadMetrics = "serviceLoadMetrics"
        case servicePlacementPolicies = "servicePlacementPolicies"
        case defaultMoveCost = "defaultMoveCost"
        case provisioningState = "provisioningState"
        case serviceTypeName = "serviceTypeName"
        case partitionDescription = "partitionDescription"
        case hasPersistedState = "hasPersistedState"
        case targetReplicaSetSize = "targetReplicaSetSize"
        case minReplicaSetSize = "minReplicaSetSize"
        case replicaRestartWaitDuration = "replicaRestartWaitDuration"
        case quorumLossWaitDuration = "quorumLossWaitDuration"
        case standByReplicaKeepDuration = "standByReplicaKeepDuration"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.placementConstraints) {
        self.placementConstraints = try container.decode(String?.self, forKey: .placementConstraints)
    }
    if container.contains(.correlationScheme) {
        self.correlationScheme = try container.decode([ServiceCorrelationDescriptionData?]?.self, forKey: .correlationScheme)
    }
    if container.contains(.serviceLoadMetrics) {
        self.serviceLoadMetrics = try container.decode([ServiceLoadMetricDescriptionData?]?.self, forKey: .serviceLoadMetrics)
    }
    if container.contains(.servicePlacementPolicies) {
        self.servicePlacementPolicies = try container.decode([ServicePlacementPolicyDescriptionData?]?.self, forKey: .servicePlacementPolicies)
    }
    if container.contains(.defaultMoveCost) {
        self.defaultMoveCost = try container.decode(DefaultMoveCostEnum?.self, forKey: .defaultMoveCost)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.serviceTypeName) {
        self.serviceTypeName = try container.decode(String?.self, forKey: .serviceTypeName)
    }
    if container.contains(.partitionDescription) {
        self.partitionDescription = try container.decode(PartitionSchemeDescriptionData?.self, forKey: .partitionDescription)
    }
    if container.contains(.hasPersistedState) {
        self.hasPersistedState = try container.decode(Bool?.self, forKey: .hasPersistedState)
    }
    if container.contains(.targetReplicaSetSize) {
        self.targetReplicaSetSize = try container.decode(Int32?.self, forKey: .targetReplicaSetSize)
    }
    if container.contains(.minReplicaSetSize) {
        self.minReplicaSetSize = try container.decode(Int32?.self, forKey: .minReplicaSetSize)
    }
    if container.contains(.replicaRestartWaitDuration) {
        self.replicaRestartWaitDuration = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .replicaRestartWaitDuration)), format: .dateTime)
    }
    if container.contains(.quorumLossWaitDuration) {
        self.quorumLossWaitDuration = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .quorumLossWaitDuration)), format: .dateTime)
    }
    if container.contains(.standByReplicaKeepDuration) {
        self.standByReplicaKeepDuration = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .standByReplicaKeepDuration)), format: .dateTime)
    }
    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.placementConstraints != nil {try container.encode(self.placementConstraints, forKey: .placementConstraints)}
    if self.correlationScheme != nil {try container.encode(self.correlationScheme as! [ServiceCorrelationDescriptionData?]?, forKey: .correlationScheme)}
    if self.serviceLoadMetrics != nil {try container.encode(self.serviceLoadMetrics as! [ServiceLoadMetricDescriptionData?]?, forKey: .serviceLoadMetrics)}
    if self.servicePlacementPolicies != nil {try container.encode(self.servicePlacementPolicies as! [ServicePlacementPolicyDescriptionData?]?, forKey: .servicePlacementPolicies)}
    if self.defaultMoveCost != nil {try container.encode(self.defaultMoveCost, forKey: .defaultMoveCost)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.serviceTypeName != nil {try container.encode(self.serviceTypeName, forKey: .serviceTypeName)}
    if self.partitionDescription != nil {try container.encode(self.partitionDescription as! PartitionSchemeDescriptionData?, forKey: .partitionDescription)}
    if self.hasPersistedState != nil {try container.encode(self.hasPersistedState, forKey: .hasPersistedState)}
    if self.targetReplicaSetSize != nil {try container.encode(self.targetReplicaSetSize, forKey: .targetReplicaSetSize)}
    if self.minReplicaSetSize != nil {try container.encode(self.minReplicaSetSize, forKey: .minReplicaSetSize)}
    if self.replicaRestartWaitDuration != nil {
        try container.encode(DateConverter.toString(date: self.replicaRestartWaitDuration!, format: .dateTime), forKey: .replicaRestartWaitDuration)
    }
    if self.quorumLossWaitDuration != nil {
        try container.encode(DateConverter.toString(date: self.quorumLossWaitDuration!, format: .dateTime), forKey: .quorumLossWaitDuration)
    }
    if self.standByReplicaKeepDuration != nil {
        try container.encode(DateConverter.toString(date: self.standByReplicaKeepDuration!, format: .dateTime), forKey: .standByReplicaKeepDuration)
    }
  }
}

extension DataFactory {
  public static func createStatefulServicePropertiesProtocol() -> StatefulServicePropertiesProtocol {
    return StatefulServicePropertiesData()
  }
}


// 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 StatefulServiceUpdatePropertiesData : StatefulServiceUpdatePropertiesProtocol, ServiceUpdatePropertiesProtocol, ServicePropertiesBaseProtocol {
    public var placementConstraints: String?
    public var correlationScheme: [ServiceCorrelationDescriptionProtocol?]?
    public var serviceLoadMetrics: [ServiceLoadMetricDescriptionProtocol?]?
    public var servicePlacementPolicies: [ServicePlacementPolicyDescriptionProtocol?]?
    public var defaultMoveCost: DefaultMoveCostEnum?
    public var targetReplicaSetSize: Int32?
    public var minReplicaSetSize: Int32?
    public var replicaRestartWaitDuration: Date?
    public var quorumLossWaitDuration: Date?
    public var standByReplicaKeepDuration: Date?

        enum CodingKeys: String, CodingKey {case placementConstraints = "placementConstraints"
        case correlationScheme = "correlationScheme"
        case serviceLoadMetrics = "serviceLoadMetrics"
        case servicePlacementPolicies = "servicePlacementPolicies"
        case defaultMoveCost = "defaultMoveCost"
        case targetReplicaSetSize = "targetReplicaSetSize"
        case minReplicaSetSize = "minReplicaSetSize"
        case replicaRestartWaitDuration = "replicaRestartWaitDuration"
        case quorumLossWaitDuration = "quorumLossWaitDuration"
        case standByReplicaKeepDuration = "standByReplicaKeepDuration"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.placementConstraints) {
        self.placementConstraints = try container.decode(String?.self, forKey: .placementConstraints)
    }
    if container.contains(.correlationScheme) {
        self.correlationScheme = try container.decode([ServiceCorrelationDescriptionData?]?.self, forKey: .correlationScheme)
    }
    if container.contains(.serviceLoadMetrics) {
        self.serviceLoadMetrics = try container.decode([ServiceLoadMetricDescriptionData?]?.self, forKey: .serviceLoadMetrics)
    }
    if container.contains(.servicePlacementPolicies) {
        self.servicePlacementPolicies = try container.decode([ServicePlacementPolicyDescriptionData?]?.self, forKey: .servicePlacementPolicies)
    }
    if container.contains(.defaultMoveCost) {
        self.defaultMoveCost = try container.decode(DefaultMoveCostEnum?.self, forKey: .defaultMoveCost)
    }
    if container.contains(.targetReplicaSetSize) {
        self.targetReplicaSetSize = try container.decode(Int32?.self, forKey: .targetReplicaSetSize)
    }
    if container.contains(.minReplicaSetSize) {
        self.minReplicaSetSize = try container.decode(Int32?.self, forKey: .minReplicaSetSize)
    }
    if container.contains(.replicaRestartWaitDuration) {
        self.replicaRestartWaitDuration = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .replicaRestartWaitDuration)), format: .dateTime)
    }
    if container.contains(.quorumLossWaitDuration) {
        self.quorumLossWaitDuration = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .quorumLossWaitDuration)), format: .dateTime)
    }
    if container.contains(.standByReplicaKeepDuration) {
        self.standByReplicaKeepDuration = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .standByReplicaKeepDuration)), format: .dateTime)
    }
    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.placementConstraints != nil {try container.encode(self.placementConstraints, forKey: .placementConstraints)}
    if self.correlationScheme != nil {try container.encode(self.correlationScheme as! [ServiceCorrelationDescriptionData?]?, forKey: .correlationScheme)}
    if self.serviceLoadMetrics != nil {try container.encode(self.serviceLoadMetrics as! [ServiceLoadMetricDescriptionData?]?, forKey: .serviceLoadMetrics)}
    if self.servicePlacementPolicies != nil {try container.encode(self.servicePlacementPolicies as! [ServicePlacementPolicyDescriptionData?]?, forKey: .servicePlacementPolicies)}
    if self.defaultMoveCost != nil {try container.encode(self.defaultMoveCost, forKey: .defaultMoveCost)}
    if self.targetReplicaSetSize != nil {try container.encode(self.targetReplicaSetSize, forKey: .targetReplicaSetSize)}
    if self.minReplicaSetSize != nil {try container.encode(self.minReplicaSetSize, forKey: .minReplicaSetSize)}
    if self.replicaRestartWaitDuration != nil {
        try container.encode(DateConverter.toString(date: self.replicaRestartWaitDuration!, format: .dateTime), forKey: .replicaRestartWaitDuration)
    }
    if self.quorumLossWaitDuration != nil {
        try container.encode(DateConverter.toString(date: self.quorumLossWaitDuration!, format: .dateTime), forKey: .quorumLossWaitDuration)
    }
    if self.standByReplicaKeepDuration != nil {
        try container.encode(DateConverter.toString(date: self.standByReplicaKeepDuration!, format: .dateTime), forKey: .standByReplicaKeepDuration)
    }
  }
}

extension DataFactory {
  public static func createStatefulServiceUpdatePropertiesProtocol() -> StatefulServiceUpdatePropertiesProtocol {
    return StatefulServiceUpdatePropertiesData()
  }
}


// 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 StatelessServicePropertiesData : StatelessServicePropertiesProtocol, ServicePropertiesProtocol, ServicePropertiesBaseProtocol {
    public var placementConstraints: String?
    public var correlationScheme: [ServiceCorrelationDescriptionProtocol?]?
    public var serviceLoadMetrics: [ServiceLoadMetricDescriptionProtocol?]?
    public var servicePlacementPolicies: [ServicePlacementPolicyDescriptionProtocol?]?
    public var defaultMoveCost: DefaultMoveCostEnum?
    public var provisioningState: String?
    public var serviceTypeName: String?
    public var partitionDescription: PartitionSchemeDescriptionProtocol?
    public var instanceCount: Int32?

        enum CodingKeys: String, CodingKey {case placementConstraints = "placementConstraints"
        case correlationScheme = "correlationScheme"
        case serviceLoadMetrics = "serviceLoadMetrics"
        case servicePlacementPolicies = "servicePlacementPolicies"
        case defaultMoveCost = "defaultMoveCost"
        case provisioningState = "provisioningState"
        case serviceTypeName = "serviceTypeName"
        case partitionDescription = "partitionDescription"
        case instanceCount = "instanceCount"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.placementConstraints) {
        self.placementConstraints = try container.decode(String?.self, forKey: .placementConstraints)
    }
    if container.contains(.correlationScheme) {
        self.correlationScheme = try container.decode([ServiceCorrelationDescriptionData?]?.self, forKey: .correlationScheme)
    }
    if container.contains(.serviceLoadMetrics) {
        self.serviceLoadMetrics = try container.decode([ServiceLoadMetricDescriptionData?]?.self, forKey: .serviceLoadMetrics)
    }
    if container.contains(.servicePlacementPolicies) {
        self.servicePlacementPolicies = try container.decode([ServicePlacementPolicyDescriptionData?]?.self, forKey: .servicePlacementPolicies)
    }
    if container.contains(.defaultMoveCost) {
        self.defaultMoveCost = try container.decode(DefaultMoveCostEnum?.self, forKey: .defaultMoveCost)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.serviceTypeName) {
        self.serviceTypeName = try container.decode(String?.self, forKey: .serviceTypeName)
    }
    if container.contains(.partitionDescription) {
        self.partitionDescription = try container.decode(PartitionSchemeDescriptionData?.self, forKey: .partitionDescription)
    }
    if container.contains(.instanceCount) {
        self.instanceCount = try container.decode(Int32?.self, forKey: .instanceCount)
    }
    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.placementConstraints != nil {try container.encode(self.placementConstraints, forKey: .placementConstraints)}
    if self.correlationScheme != nil {try container.encode(self.correlationScheme as! [ServiceCorrelationDescriptionData?]?, forKey: .correlationScheme)}
    if self.serviceLoadMetrics != nil {try container.encode(self.serviceLoadMetrics as! [ServiceLoadMetricDescriptionData?]?, forKey: .serviceLoadMetrics)}
    if self.servicePlacementPolicies != nil {try container.encode(self.servicePlacementPolicies as! [ServicePlacementPolicyDescriptionData?]?, forKey: .servicePlacementPolicies)}
    if self.defaultMoveCost != nil {try container.encode(self.defaultMoveCost, forKey: .defaultMoveCost)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.serviceTypeName != nil {try container.encode(self.serviceTypeName, forKey: .serviceTypeName)}
    if self.partitionDescription != nil {try container.encode(self.partitionDescription as! PartitionSchemeDescriptionData?, forKey: .partitionDescription)}
    if self.instanceCount != nil {try container.encode(self.instanceCount, forKey: .instanceCount)}
  }
}

extension DataFactory {
  public static func createStatelessServicePropertiesProtocol() -> StatelessServicePropertiesProtocol {
    return StatelessServicePropertiesData()
  }
}


// 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 StatelessServiceUpdatePropertiesData : StatelessServiceUpdatePropertiesProtocol, ServiceUpdatePropertiesProtocol, ServicePropertiesBaseProtocol {
    public var placementConstraints: String?
    public var correlationScheme: [ServiceCorrelationDescriptionProtocol?]?
    public var serviceLoadMetrics: [ServiceLoadMetricDescriptionProtocol?]?
    public var servicePlacementPolicies: [ServicePlacementPolicyDescriptionProtocol?]?
    public var defaultMoveCost: DefaultMoveCostEnum?
    public var instanceCount: Int32?

        enum CodingKeys: String, CodingKey {case placementConstraints = "placementConstraints"
        case correlationScheme = "correlationScheme"
        case serviceLoadMetrics = "serviceLoadMetrics"
        case servicePlacementPolicies = "servicePlacementPolicies"
        case defaultMoveCost = "defaultMoveCost"
        case instanceCount = "instanceCount"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.placementConstraints) {
        self.placementConstraints = try container.decode(String?.self, forKey: .placementConstraints)
    }
    if container.contains(.correlationScheme) {
        self.correlationScheme = try container.decode([ServiceCorrelationDescriptionData?]?.self, forKey: .correlationScheme)
    }
    if container.contains(.serviceLoadMetrics) {
        self.serviceLoadMetrics = try container.decode([ServiceLoadMetricDescriptionData?]?.self, forKey: .serviceLoadMetrics)
    }
    if container.contains(.servicePlacementPolicies) {
        self.servicePlacementPolicies = try container.decode([ServicePlacementPolicyDescriptionData?]?.self, forKey: .servicePlacementPolicies)
    }
    if container.contains(.defaultMoveCost) {
        self.defaultMoveCost = try container.decode(DefaultMoveCostEnum?.self, forKey: .defaultMoveCost)
    }
    if container.contains(.instanceCount) {
        self.instanceCount = try container.decode(Int32?.self, forKey: .instanceCount)
    }
    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.placementConstraints != nil {try container.encode(self.placementConstraints, forKey: .placementConstraints)}
    if self.correlationScheme != nil {try container.encode(self.correlationScheme as! [ServiceCorrelationDescriptionData?]?, forKey: .correlationScheme)}
    if self.serviceLoadMetrics != nil {try container.encode(self.serviceLoadMetrics as! [ServiceLoadMetricDescriptionData?]?, forKey: .serviceLoadMetrics)}
    if self.servicePlacementPolicies != nil {try container.encode(self.servicePlacementPolicies as! [ServicePlacementPolicyDescriptionData?]?, forKey: .servicePlacementPolicies)}
    if self.defaultMoveCost != nil {try container.encode(self.defaultMoveCost, forKey: .defaultMoveCost)}
    if self.instanceCount != nil {try container.encode(self.instanceCount, forKey: .instanceCount)}
  }
}

extension DataFactory {
  public static func createStatelessServiceUpdatePropertiesProtocol() -> StatelessServiceUpdatePropertiesProtocol {
    return StatelessServiceUpdatePropertiesData()
  }
}


// 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 UniformInt64RangePartitionSchemeDescriptionData : UniformInt64RangePartitionSchemeDescriptionProtocol, PartitionSchemeDescriptionProtocol {
    public var count: Int32
    public var lowKey: String
    public var highKey: String

        enum CodingKeys: String, CodingKey {case count = "Count"
        case lowKey = "LowKey"
        case highKey = "HighKey"
        }

  public init(count: Int32, lowKey: String, highKey: String)  {
    self.count = count
    self.lowKey = lowKey
    self.highKey = highKey
  }

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

extension DataFactory {
  public static func createUniformInt64RangePartitionSchemeDescriptionProtocol(count: Int32, lowKey: String, highKey: String) -> UniformInt64RangePartitionSchemeDescriptionProtocol {
    return UniformInt64RangePartitionSchemeDescriptionData(count: count, lowKey: lowKey, highKey: highKey)
  }
}


// UpgradeMode1 enumerates the values for upgrade mode 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 UpgradeMode1Enum: String, Codable
{
// UpgradeMode1Automatic specifies the upgrade mode 1 automatic state for upgrade mode 1.
    case UpgradeMode1Automatic = "Automatic"
// UpgradeMode1Manual specifies the upgrade mode 1 manual state for upgrade mode 1.
    case UpgradeMode1Manual = "Manual"
}


// UpgradeMode enumerates the values for upgrade mode.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum UpgradeModeEnum: String, Codable
{
// Automatic specifies the automatic state for upgrade mode.
    case Automatic = "Automatic"
// Manual specifies the manual state for upgrade mode.
    case Manual = "Manual"
}


// 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 VersionPropertiesData : VersionPropertiesProtocol {
    public var provisioningState: String?
    public var appPackageUrl: String
    public var defaultParameterList: [ApplicationParameterProtocol?]?

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

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

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

extension DataFactory {
  public static func createVersionPropertiesProtocol(appPackageUrl: String) -> VersionPropertiesProtocol {
    return VersionPropertiesData(appPackageUrl: appPackageUrl)
  }
}


// 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 VersionResourceData : VersionResourceProtocol, ProxyResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var properties: VersionPropertiesProtocol?

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

extension DataFactory {
  public static func createVersionResourceProtocol(location: String) -> VersionResourceProtocol {
    return VersionResourceData(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 VersionResourceListData : VersionResourceListProtocol {
    public var value: [VersionResourceProtocol?]?

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

extension DataFactory {
  public static func createVersionResourceListProtocol() -> VersionResourceListProtocol {
    return VersionResourceListData()
  }
}


// Weight enumerates the values for weight.

// 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 WeightEnum: String, Codable
{
// WeightHigh specifies the weight high state for weight.
    case WeightHigh = "High"
// WeightLow specifies the weight low state for weight.
    case WeightLow = "Low"
// WeightMedium specifies the weight medium state for weight.
    case WeightMedium = "Medium"
// WeightZero specifies the weight zero state for weight.
    case WeightZero = "Zero"
}


// X509StoreName enumerates the values for x509 store name.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum X509StoreNameEnum: String, Codable
{
// AddressBook specifies the address book state for x509 store name.
    case AddressBook = "AddressBook"
// AuthRoot specifies the auth root state for x509 store name.
    case AuthRoot = "AuthRoot"
// CertificateAuthority specifies the certificate authority state for x509 store name.
    case CertificateAuthority = "CertificateAuthority"
// Disallowed specifies the disallowed state for x509 store name.
    case Disallowed = "Disallowed"
// My specifies the my state for x509 store name.
    case My = "My"
// Root specifies the root state for x509 store name.
    case Root = "Root"
// TrustedPeople specifies the trusted people state for x509 store name.
    case TrustedPeople = "TrustedPeople"
// TrustedPublisher specifies the trusted publisher state for x509 store name.
    case TrustedPublisher = "TrustedPublisher"
}


// 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
// ApplicationHealthPolicyProtocol is defines a health policy used to evaluate the health of an application or one of
// its children entities.
public protocol ApplicationHealthPolicyProtocol : Codable {
     var considerWarningAsError: Bool? { get set }
     var maxPercentUnhealthyDeployedApplications: Int32? { get set }
     var defaultServiceTypeHealthPolicy: ServiceTypeHealthPolicyProtocol? { get set }
     var serviceTypeHealthPolicyMap: [ServiceTypeHealthPolicyMapItemProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ApplicationMetricDescriptionProtocol is describes capacity information for a custom resource balancing metric. This
// can be used to limit the total consumption of this metric by the services of this application.
public protocol ApplicationMetricDescriptionProtocol : Codable {
     var name: String? { get set }
     var maximumCapacity: Int64? { get set }
     var reservationCapacity: Int64? { get set }
     var totalApplicationCapacity: Int64? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ApplicationParameterProtocol is describes an application parameter override to be applied when creating or upgrading
// an application.
public protocol ApplicationParameterProtocol : Codable {
     var key: String { get set }
     var value: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ApplicationPropertiesProtocol is the application resource properties.
public protocol ApplicationPropertiesProtocol : ApplicationUpdatePropertiesProtocol {
     var provisioningState: String? { get set }
     var typeName: String? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ApplicationResourceProtocol is the application resource.
public protocol ApplicationResourceProtocol : ProxyResourceProtocol {
     var properties: ApplicationPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ApplicationResourceUpdateProtocol is the application resource for patch operations.
public protocol ApplicationResourceUpdateProtocol : ProxyResourceProtocol {
     var properties: ApplicationUpdatePropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ApplicationTypePropertiesProtocol is the application type name properties
public protocol ApplicationTypePropertiesProtocol : Codable {
     var provisioningState: String? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ApplicationTypeResourceProtocol is the application type name resource
public protocol ApplicationTypeResourceProtocol : ProxyResourceProtocol {
     var properties: ApplicationTypePropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ApplicationUpdatePropertiesProtocol is the application resource properties for patch operations.
public protocol ApplicationUpdatePropertiesProtocol : Codable {
     var typeVersion: String? { get set }
     var parameters: [ApplicationParameterProtocol?]? { get set }
     var upgradePolicy: ApplicationUpgradePolicyProtocol? { get set }
     var minimumNodes: Int64? { get set }
     var maximumNodes: Int64? { get set }
     var removeApplicationCapacity: Bool? { get set }
     var metrics: [ApplicationMetricDescriptionProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ApplicationUpgradePolicyProtocol is describes the policy for a monitored application upgrade.
public protocol ApplicationUpgradePolicyProtocol : Codable {
     var upgradeReplicaSetCheckTimeout: Int64? { get set }
     var forceRestart: Bool? { get set }
     var rollingUpgradeMonitoringPolicy: RollingUpgradeMonitoringPolicyProtocol? { get set }
     var applicationHealthPolicy: ApplicationHealthPolicyProtocol? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AzureActiveDirectoryProtocol is the settings to enable AAD authentication on the cluster.
public protocol AzureActiveDirectoryProtocol : Codable {
     var tenantId: String? { get set }
     var clusterApplication: String? { get set }
     var clientApplication: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CertificateDescriptionProtocol is describes the certificate details.
public protocol CertificateDescriptionProtocol : Codable {
     var thumbprint: String { get set }
     var thumbprintSecondary: String? { get set }
     var x509StoreName: X509StoreNameEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClientCertificateCommonNameProtocol is describes the client certificate details using common name.
public protocol ClientCertificateCommonNameProtocol : Codable {
     var isAdmin: Bool { get set }
     var certificateCommonName: String { get set }
     var certificateIssuerThumbprint: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClientCertificateThumbprintProtocol is describes the client certificate details using thumbprint.
public protocol ClientCertificateThumbprintProtocol : Codable {
     var isAdmin: Bool { get set }
     var certificateThumbprint: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterCodeVersionsListResultProtocol is the list results of the ServiceFabric runtime versions.
public protocol ClusterCodeVersionsListResultProtocol : Codable {
     var value: [ClusterCodeVersionsResultProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterCodeVersionsResultProtocol is the result of the ServiceFabric runtime versions
public protocol ClusterCodeVersionsResultProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var properties: ClusterVersionDetailsProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterHealthPolicyProtocol is defines a health policy used to evaluate the health of the cluster or of a cluster
// node.
public protocol ClusterHealthPolicyProtocol : Codable {
     var maxPercentUnhealthyNodes: Int32? { get set }
     var maxPercentUnhealthyApplications: Int32? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterPropertiesProtocol is describes the cluster resource properties.
public protocol ClusterPropertiesProtocol : Codable {
     var availableClusterVersions: [ClusterVersionDetailsProtocol?]? { get set }
     var clusterId: String? { get set }
     var clusterState: ClusterStateEnum? { get set }
     var clusterEndpoint: String? { get set }
     var clusterCodeVersion: String? { get set }
     var certificate: CertificateDescriptionProtocol? { get set }
     var reliabilityLevel: ReliabilityLevelEnum? { get set }
     var upgradeMode: UpgradeModeEnum? { get set }
     var clientCertificateThumbprints: [ClientCertificateThumbprintProtocol?]? { get set }
     var clientCertificateCommonNames: [ClientCertificateCommonNameProtocol?]? { get set }
     var fabricSettings: [SettingsSectionDescriptionProtocol?]? { get set }
     var reverseProxyCertificate: CertificateDescriptionProtocol? { get set }
     var managementEndpoint: String { get set }
     var nodeTypes: [NodeTypeDescriptionProtocol] { get set }
     var azureActiveDirectory: AzureActiveDirectoryProtocol? { get set }
     var provisioningState: ProvisioningStateEnum? { get set }
     var vmImage: String? { get set }
     var diagnosticsStorageAccountConfig: DiagnosticsStorageAccountConfigProtocol? { get set }
     var upgradeDescription: ClusterUpgradePolicyProtocol? { get set }
     var addOnFeatures: [String?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterPropertiesUpdateParametersProtocol is describes the cluster resource properties that can be updated during
// PATCH operation.
public protocol ClusterPropertiesUpdateParametersProtocol : Codable {
     var reliabilityLevel: ReliabilityLevel1Enum? { get set }
     var upgradeMode: UpgradeMode1Enum? { get set }
     var clusterCodeVersion: String? { get set }
     var certificate: CertificateDescriptionProtocol? { get set }
     var clientCertificateThumbprints: [ClientCertificateThumbprintProtocol?]? { get set }
     var clientCertificateCommonNames: [ClientCertificateCommonNameProtocol?]? { get set }
     var fabricSettings: [SettingsSectionDescriptionProtocol?]? { get set }
     var reverseProxyCertificate: CertificateDescriptionProtocol? { get set }
     var nodeTypes: [NodeTypeDescriptionProtocol?]? { get set }
     var upgradeDescription: ClusterUpgradePolicyProtocol? { get set }
     var addOnFeatures: [String?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterProtocol is the cluster resource
public protocol ClusterProtocol : ResourceProtocol {
     var properties: ClusterPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterUpdateParametersProtocol is cluster update request
public protocol ClusterUpdateParametersProtocol : Codable {
     var properties: ClusterPropertiesUpdateParametersProtocol? { get set }
     var tags: [String:String]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterUpgradeDeltaHealthPolicyProtocol is describes the delta health policies for the cluster upgrade.
public protocol ClusterUpgradeDeltaHealthPolicyProtocol : Codable {
     var maxPercentDeltaUnhealthyNodes: Int32 { get set }
     var maxPercentUpgradeDomainDeltaUnhealthyNodes: Int32 { get set }
     var maxPercentDeltaUnhealthyApplications: Int32 { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterUpgradePolicyProtocol is describes the policy used when upgrading the cluster.
public protocol ClusterUpgradePolicyProtocol : Codable {
     var forceRestart: Bool? { get set }
     var upgradeReplicaSetCheckTimeout: String { get set }
     var healthCheckWaitDuration: String { get set }
     var healthCheckStableDuration: String { get set }
     var healthCheckRetryTimeout: String { get set }
     var upgradeTimeout: String { get set }
     var upgradeDomainTimeout: String { get set }
     var healthPolicy: ClusterHealthPolicyProtocol { get set }
     var deltaHealthPolicy: ClusterUpgradeDeltaHealthPolicyProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ClusterVersionDetailsProtocol is the detail of the Service Fabric runtime version result
public protocol ClusterVersionDetailsProtocol : Codable {
     var codeVersion: String? { get set }
     var supportExpiryUtc: String? { get set }
     var environment: EnvironmentEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// DiagnosticsStorageAccountConfigProtocol is the storage account information for storing Service Fabric diagnostic
// logs.
public protocol DiagnosticsStorageAccountConfigProtocol : Codable {
     var storageAccountName: String { get set }
     var protectedAccountKeyName: String { get set }
     var blobEndpoint: String { get set }
     var queueEndpoint: String { get set }
     var tableEndpoint: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EndpointRangeDescriptionProtocol is port range details
public protocol EndpointRangeDescriptionProtocol : Codable {
     var startPort: Int32 { get set }
     var endPort: Int32 { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// NamedPartitionSchemeDescriptionProtocol is describes the named partition scheme of the service.
public protocol NamedPartitionSchemeDescriptionProtocol : PartitionSchemeDescriptionProtocol {
     var count: Int32 { get set }
     var names: [String] { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// NodeTypeDescriptionProtocol is describes a node type in the cluster, each node type represents sub set of nodes in
// the cluster.
public protocol NodeTypeDescriptionProtocol : Codable {
     var name: String { get set }
     var placementProperties: [String:String]? { get set }
     var capacities: [String:String]? { get set }
     var clientConnectionEndpointPort: Int32 { get set }
     var httpGatewayEndpointPort: Int32 { get set }
     var durabilityLevel: DurabilityLevelEnum? { get set }
     var applicationPorts: EndpointRangeDescriptionProtocol? { get set }
     var ephemeralPorts: EndpointRangeDescriptionProtocol? { get set }
     var isPrimary: Bool { get set }
     var vmInstanceCount: Int32 { get set }
     var reverseProxyEndpointPort: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationListResultProtocol is describes the result of the request to list Service Fabric operations.
public protocol OperationListResultProtocol : Codable {
     var value: [OperationResultProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationResultProtocol is available operation list result
public protocol OperationResultProtocol : Codable {
     var name: String? { get set }
     var display: AvailableOperationDisplayProtocol? { get set }
     var origin: String? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// PartitionSchemeDescriptionProtocol is describes how the service is partitioned.
public protocol PartitionSchemeDescriptionProtocol : Codable {
}


// 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
// ProxyResourceProtocol is the resource model definition for proxy-only resource.
public protocol ProxyResourceProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var location: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ResourceProtocol is the resource model definition.
public protocol ResourceProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var location: String { get set }
     var tags: [String:String]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// RollingUpgradeMonitoringPolicyProtocol is the policy used for monitoring the application upgrade
public protocol RollingUpgradeMonitoringPolicyProtocol : Codable {
     var healthCheckWaitDuration: String? { get set }
     var healthCheckStableDuration: String? { get set }
     var healthCheckRetryTimeout: String? { get set }
     var upgradeTimeout: String? { get set }
     var upgradeDomainTimeout: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServiceCorrelationDescriptionProtocol is creates a particular correlation between services.
public protocol ServiceCorrelationDescriptionProtocol : Codable {
     var scheme: SchemeEnum { get set }
     var serviceName: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServiceLoadMetricDescriptionProtocol is specifies a metric to load balance a service during runtime.
public protocol ServiceLoadMetricDescriptionProtocol : Codable {
     var name: String { get set }
     var weight: WeightEnum? { get set }
     var primaryDefaultLoad: Int32? { get set }
     var secondaryDefaultLoad: Int32? { get set }
     var defaultLoad: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServicePlacementPolicyDescriptionProtocol is describes the policy to be used for placement of a Service Fabric
// service.
public protocol ServicePlacementPolicyDescriptionProtocol : Codable {
}


// 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
// ServicePropertiesBaseProtocol is the common service resource properties.
public protocol ServicePropertiesBaseProtocol : Codable {
     var placementConstraints: String? { get set }
     var correlationScheme: [ServiceCorrelationDescriptionProtocol?]? { get set }
     var serviceLoadMetrics: [ServiceLoadMetricDescriptionProtocol?]? { get set }
     var servicePlacementPolicies: [ServicePlacementPolicyDescriptionProtocol?]? { get set }
     var defaultMoveCost: DefaultMoveCostEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServicePropertiesProtocol is the service resource properties.
public protocol ServicePropertiesProtocol : ServicePropertiesBaseProtocol {
     var provisioningState: String? { get set }
     var serviceTypeName: String? { get set }
     var partitionDescription: PartitionSchemeDescriptionProtocol? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServiceResourceProtocol is the service resource.
public protocol ServiceResourceProtocol : ProxyResourceProtocol {
     var properties: ServicePropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServiceResourceUpdateProtocol is the service resource for patch operations.
public protocol ServiceResourceUpdateProtocol : ProxyResourceProtocol {
     var properties: ServiceUpdatePropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServiceTypeDeltaHealthPolicyProtocol is service health policy
public protocol ServiceTypeDeltaHealthPolicyProtocol : Codable {
     var maxPercentDeltaUnhealthyServices: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServiceTypeHealthPolicyMapItemProtocol is defines an item in ServiceTypeHealthPolicyMap.
public protocol ServiceTypeHealthPolicyMapItemProtocol : Codable {
     var key: String { get set }
     var value: ServiceTypeHealthPolicyProtocol { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServiceTypeHealthPolicyProtocol is represents the health policy used to evaluate the health of services belonging to
// a service type.
public protocol ServiceTypeHealthPolicyProtocol : Codable {
     var maxPercentUnhealthyPartitionsPerService: Int32? { get set }
     var maxPercentUnhealthyReplicasPerPartition: Int32? { get set }
     var maxPercentUnhealthyServices: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ServiceUpdatePropertiesProtocol is the service resource properties for patch operations.
public protocol ServiceUpdatePropertiesProtocol : ServicePropertiesBaseProtocol {
}


// 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
// SettingsParameterDescriptionProtocol is describes a parameter in fabric settings of the cluster.
public protocol SettingsParameterDescriptionProtocol : Codable {
     var name: String { get set }
     var value: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SettingsSectionDescriptionProtocol is describes a section in the fabric settings of the cluster.
public protocol SettingsSectionDescriptionProtocol : Codable {
     var name: String { get set }
     var parameters: [SettingsParameterDescriptionProtocol] { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SingletonPartitionSchemeDescriptionProtocol is describes the partition scheme of a singleton-partitioned, or
// non-partitioned service.
public protocol SingletonPartitionSchemeDescriptionProtocol : PartitionSchemeDescriptionProtocol {
}


// 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
// StatefulServicePropertiesProtocol is the properties of a stateful service resource.
public protocol StatefulServicePropertiesProtocol : ServicePropertiesProtocol {
     var hasPersistedState: Bool? { get set }
     var targetReplicaSetSize: Int32? { get set }
     var minReplicaSetSize: Int32? { get set }
     var replicaRestartWaitDuration: Date? { get set }
     var quorumLossWaitDuration: Date? { get set }
     var standByReplicaKeepDuration: Date? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// StatefulServiceUpdatePropertiesProtocol is the properties of a stateful service resource for patch operations.
public protocol StatefulServiceUpdatePropertiesProtocol : ServiceUpdatePropertiesProtocol {
     var targetReplicaSetSize: Int32? { get set }
     var minReplicaSetSize: Int32? { get set }
     var replicaRestartWaitDuration: Date? { get set }
     var quorumLossWaitDuration: Date? { get set }
     var standByReplicaKeepDuration: Date? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// StatelessServicePropertiesProtocol is the properties of a stateless service resource.
public protocol StatelessServicePropertiesProtocol : ServicePropertiesProtocol {
     var instanceCount: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// StatelessServiceUpdatePropertiesProtocol is the properties of a stateless service resource for patch operations.
public protocol StatelessServiceUpdatePropertiesProtocol : ServiceUpdatePropertiesProtocol {
     var instanceCount: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// UniformInt64RangePartitionSchemeDescriptionProtocol is describes a partitioning scheme where an integer range is
// allocated evenly across a number of partitions.
public protocol UniformInt64RangePartitionSchemeDescriptionProtocol : PartitionSchemeDescriptionProtocol {
     var count: Int32 { get set }
     var lowKey: String { get set }
     var highKey: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VersionPropertiesProtocol is the properties of the version resource.
public protocol VersionPropertiesProtocol : Codable {
     var provisioningState: String? { get set }
     var appPackageUrl: String { get set }
     var defaultParameterList: [ApplicationParameterProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VersionResourceListProtocol is the list of version resources for the specified application type name.
public protocol VersionResourceListProtocol : Codable {
     var value: [VersionResourceProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VersionResourceProtocol is a version resource for the specified application type name.
public protocol VersionResourceProtocol : ProxyResourceProtocol {
     var properties: VersionPropertiesProtocol? { get set }
}