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

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

  public init()  {
  }

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

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

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct OperationImpactData : OperationImpactProtocol {
    public var name: String?
    public var unit: String?
    public var changeValueAbsolute: Double?
    public var changeValueRelative: Double?

        enum CodingKeys: String, CodingKey {case name = "name"
        case unit = "unit"
        case changeValueAbsolute = "changeValueAbsolute"
        case changeValueRelative = "changeValueRelative"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationImpactProtocol() -> OperationImpactProtocol {
    return OperationImpactData()
  }
}


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

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

  public init()  {
  }

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

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

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


// OperationOrigin enumerates the values for operation origin.

// 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 OperationOriginEnum: String, Codable
{
// OperationOriginSystem specifies the operation origin system state for operation origin.
    case OperationOriginSystem = "system"
// OperationOriginUser specifies the operation origin user state for operation origin.
    case OperationOriginUser = "user"
}


// 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 PartnerInfoData : PartnerInfoProtocol {
    public var id: String
    public var location: String?
    public var replicationRole: FailoverGroupReplicationRoleEnum?

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

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

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

extension DataFactory {
  public static func createPartnerInfoProtocol(id: String) -> PartnerInfoProtocol {
    return PartnerInfoData(id: id)
  }
}


// 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 PerformanceLevelData : PerformanceLevelProtocol {
    public var unit: PerformanceLevelUnitEnum?
    public var value: Int32?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createPerformanceLevelProtocol() -> PerformanceLevelProtocol {
    return PerformanceLevelData()
  }
}


// PerformanceLevelUnit enumerates the values for performance level unit.

// 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 PerformanceLevelUnitEnum: String, Codable
{
// DTU specifies the dtu state for performance level unit.
    case DTU = "DTU"
}


// PrimaryAggregationType enumerates the values for primary aggregation type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum PrimaryAggregationTypeEnum: String, Codable
{
// Average specifies the average state for primary aggregation type.
    case Average = "Average"
// Count specifies the count state for primary aggregation type.
    case Count = "Count"
// Maximum specifies the maximum state for primary aggregation type.
    case Maximum = "Maximum"
// Minimum specifies the minimum state for primary aggregation type.
    case Minimum = "Minimum"
// None specifies the none state for primary aggregation type.
    case None = "None"
// Total specifies the total state for primary aggregation type.
    case Total = "Total"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ProxyResourceData : ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?

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

  public init()  {
  }

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

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


// ReadOnlyEndpointFailoverPolicy enumerates the values for read only endpoint failover policy.

// 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 ReadOnlyEndpointFailoverPolicyEnum: String, Codable
{
// ReadOnlyEndpointFailoverPolicyDisabled specifies the read only endpoint failover policy disabled state for read only
// endpoint failover policy.
    case ReadOnlyEndpointFailoverPolicyDisabled = "Disabled"
// ReadOnlyEndpointFailoverPolicyEnabled specifies the read only endpoint failover policy enabled state for read only
// endpoint failover policy.
    case ReadOnlyEndpointFailoverPolicyEnabled = "Enabled"
}


// ReadScale enumerates the values for read scale.

// 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 ReadScaleEnum: String, Codable
{
// ReadScaleDisabled specifies the read scale disabled state for read scale.
    case ReadScaleDisabled = "Disabled"
// ReadScaleEnabled specifies the read scale enabled state for read scale.
    case ReadScaleEnabled = "Enabled"
}


// ReadWriteEndpointFailoverPolicy enumerates the values for read write endpoint failover policy.

// 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 ReadWriteEndpointFailoverPolicyEnum: String, Codable
{
// Automatic specifies the automatic state for read write endpoint failover policy.
    case Automatic = "Automatic"
// Manual specifies the manual state for read write endpoint failover policy.
    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 RecommendedElasticPoolData : RecommendedElasticPoolProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: RecommendedElasticPoolPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRecommendedElasticPoolProtocol() -> RecommendedElasticPoolProtocol {
    return RecommendedElasticPoolData()
  }
}


// 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 RecommendedElasticPoolListMetricsResultData : RecommendedElasticPoolListMetricsResultProtocol {
    public var value: [RecommendedElasticPoolMetricProtocol]

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

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

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

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

extension DataFactory {
  public static func createRecommendedElasticPoolListMetricsResultProtocol(value: [RecommendedElasticPoolMetricProtocol]) -> RecommendedElasticPoolListMetricsResultProtocol {
    return RecommendedElasticPoolListMetricsResultData(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 RecommendedElasticPoolListResultData : RecommendedElasticPoolListResultProtocol {
    public var value: [RecommendedElasticPoolProtocol]

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

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

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

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

extension DataFactory {
  public static func createRecommendedElasticPoolListResultProtocol(value: [RecommendedElasticPoolProtocol]) -> RecommendedElasticPoolListResultProtocol {
    return RecommendedElasticPoolListResultData(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 RecommendedElasticPoolMetricData : RecommendedElasticPoolMetricProtocol {
    public var dateTime: Date?
    public var dtu: Double?
    public var sizeGB: Double?

        enum CodingKeys: String, CodingKey {case dateTime = "dateTime"
        case dtu = "dtu"
        case sizeGB = "sizeGB"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.dateTime) {
        self.dateTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .dateTime)), format: .dateTime)
    }
    if container.contains(.dtu) {
        self.dtu = try container.decode(Double?.self, forKey: .dtu)
    }
    if container.contains(.sizeGB) {
        self.sizeGB = try container.decode(Double?.self, forKey: .sizeGB)
    }
    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.dateTime != nil {
        try container.encode(DateConverter.toString(date: self.dateTime!, format: .dateTime), forKey: .dateTime)
    }
    if self.dtu != nil {try container.encode(self.dtu, forKey: .dtu)}
    if self.sizeGB != nil {try container.encode(self.sizeGB, forKey: .sizeGB)}
  }
}

extension DataFactory {
  public static func createRecommendedElasticPoolMetricProtocol() -> RecommendedElasticPoolMetricProtocol {
    return RecommendedElasticPoolMetricData()
  }
}


// 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 RecommendedElasticPoolPropertiesData : RecommendedElasticPoolPropertiesProtocol {
    public var databaseEdition: ElasticPoolEditionEnum?
    public var dtu: Double?
    public var databaseDtuMin: Double?
    public var databaseDtuMax: Double?
    public var storageMB: Double?
    public var observationPeriodStart: Date?
    public var observationPeriodEnd: Date?
    public var maxObservedDtu: Double?
    public var maxObservedStorageMB: Double?
    public var databases: [DatabaseProtocol?]?
    public var metrics: [RecommendedElasticPoolMetricProtocol?]?

        enum CodingKeys: String, CodingKey {case databaseEdition = "databaseEdition"
        case dtu = "dtu"
        case databaseDtuMin = "databaseDtuMin"
        case databaseDtuMax = "databaseDtuMax"
        case storageMB = "storageMB"
        case observationPeriodStart = "observationPeriodStart"
        case observationPeriodEnd = "observationPeriodEnd"
        case maxObservedDtu = "maxObservedDtu"
        case maxObservedStorageMB = "maxObservedStorageMB"
        case databases = "databases"
        case metrics = "metrics"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.databaseEdition) {
        self.databaseEdition = try container.decode(ElasticPoolEditionEnum?.self, forKey: .databaseEdition)
    }
    if container.contains(.dtu) {
        self.dtu = try container.decode(Double?.self, forKey: .dtu)
    }
    if container.contains(.databaseDtuMin) {
        self.databaseDtuMin = try container.decode(Double?.self, forKey: .databaseDtuMin)
    }
    if container.contains(.databaseDtuMax) {
        self.databaseDtuMax = try container.decode(Double?.self, forKey: .databaseDtuMax)
    }
    if container.contains(.storageMB) {
        self.storageMB = try container.decode(Double?.self, forKey: .storageMB)
    }
    if container.contains(.observationPeriodStart) {
        self.observationPeriodStart = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .observationPeriodStart)), format: .dateTime)
    }
    if container.contains(.observationPeriodEnd) {
        self.observationPeriodEnd = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .observationPeriodEnd)), format: .dateTime)
    }
    if container.contains(.maxObservedDtu) {
        self.maxObservedDtu = try container.decode(Double?.self, forKey: .maxObservedDtu)
    }
    if container.contains(.maxObservedStorageMB) {
        self.maxObservedStorageMB = try container.decode(Double?.self, forKey: .maxObservedStorageMB)
    }
    if container.contains(.databases) {
        self.databases = try container.decode([DatabaseData?]?.self, forKey: .databases)
    }
    if container.contains(.metrics) {
        self.metrics = try container.decode([RecommendedElasticPoolMetricData?]?.self, forKey: .metrics)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.databaseEdition != nil {try container.encode(self.databaseEdition, forKey: .databaseEdition)}
    if self.dtu != nil {try container.encode(self.dtu, forKey: .dtu)}
    if self.databaseDtuMin != nil {try container.encode(self.databaseDtuMin, forKey: .databaseDtuMin)}
    if self.databaseDtuMax != nil {try container.encode(self.databaseDtuMax, forKey: .databaseDtuMax)}
    if self.storageMB != nil {try container.encode(self.storageMB, forKey: .storageMB)}
    if self.observationPeriodStart != nil {
        try container.encode(DateConverter.toString(date: self.observationPeriodStart!, format: .dateTime), forKey: .observationPeriodStart)
    }
    if self.observationPeriodEnd != nil {
        try container.encode(DateConverter.toString(date: self.observationPeriodEnd!, format: .dateTime), forKey: .observationPeriodEnd)
    }
    if self.maxObservedDtu != nil {try container.encode(self.maxObservedDtu, forKey: .maxObservedDtu)}
    if self.maxObservedStorageMB != nil {try container.encode(self.maxObservedStorageMB, forKey: .maxObservedStorageMB)}
    if self.databases != nil {try container.encode(self.databases as! [DatabaseData?]?, forKey: .databases)}
    if self.metrics != nil {try container.encode(self.metrics as! [RecommendedElasticPoolMetricData?]?, forKey: .metrics)}
  }
}

extension DataFactory {
  public static func createRecommendedElasticPoolPropertiesProtocol() -> RecommendedElasticPoolPropertiesProtocol {
    return RecommendedElasticPoolPropertiesData()
  }
}


// RecommendedIndexAction enumerates the values for recommended index action.

// 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 RecommendedIndexActionEnum: String, Codable
{
// Create specifies the create state for recommended index action.
    case Create = "Create"
// Drop specifies the drop state for recommended index action.
    case Drop = "Drop"
// Rebuild specifies the rebuild state for recommended index action.
    case Rebuild = "Rebuild"
}


// 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 RecommendedIndexData : RecommendedIndexProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: RecommendedIndexPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRecommendedIndexProtocol() -> RecommendedIndexProtocol {
    return RecommendedIndexData()
  }
}


// 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 RecommendedIndexPropertiesData : RecommendedIndexPropertiesProtocol {
    public var action: RecommendedIndexActionEnum?
    public var state: RecommendedIndexStateEnum?
    public var created: Date?
    public var lastModified: Date?
    public var indexType: RecommendedIndexTypeEnum?
    public var schema: String?
    public var table: String?
    public var columns: [String]?
    public var includedColumns: [String]?
    public var indexScript: String?
    public var estimatedImpact: [OperationImpactProtocol?]?
    public var reportedImpact: [OperationImpactProtocol?]?

        enum CodingKeys: String, CodingKey {case action = "action"
        case state = "state"
        case created = "created"
        case lastModified = "lastModified"
        case indexType = "indexType"
        case schema = "schema"
        case table = "table"
        case columns = "columns"
        case includedColumns = "includedColumns"
        case indexScript = "indexScript"
        case estimatedImpact = "estimatedImpact"
        case reportedImpact = "reportedImpact"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.action) {
        self.action = try container.decode(RecommendedIndexActionEnum?.self, forKey: .action)
    }
    if container.contains(.state) {
        self.state = try container.decode(RecommendedIndexStateEnum?.self, forKey: .state)
    }
    if container.contains(.created) {
        self.created = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .created)), format: .dateTime)
    }
    if container.contains(.lastModified) {
        self.lastModified = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModified)), format: .dateTime)
    }
    if container.contains(.indexType) {
        self.indexType = try container.decode(RecommendedIndexTypeEnum?.self, forKey: .indexType)
    }
    if container.contains(.schema) {
        self.schema = try container.decode(String?.self, forKey: .schema)
    }
    if container.contains(.table) {
        self.table = try container.decode(String?.self, forKey: .table)
    }
    if container.contains(.columns) {
        self.columns = try container.decode([String]?.self, forKey: .columns)
    }
    if container.contains(.includedColumns) {
        self.includedColumns = try container.decode([String]?.self, forKey: .includedColumns)
    }
    if container.contains(.indexScript) {
        self.indexScript = try container.decode(String?.self, forKey: .indexScript)
    }
    if container.contains(.estimatedImpact) {
        self.estimatedImpact = try container.decode([OperationImpactData?]?.self, forKey: .estimatedImpact)
    }
    if container.contains(.reportedImpact) {
        self.reportedImpact = try container.decode([OperationImpactData?]?.self, forKey: .reportedImpact)
    }
    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.action != nil {try container.encode(self.action, forKey: .action)}
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.created != nil {
        try container.encode(DateConverter.toString(date: self.created!, format: .dateTime), forKey: .created)
    }
    if self.lastModified != nil {
        try container.encode(DateConverter.toString(date: self.lastModified!, format: .dateTime), forKey: .lastModified)
    }
    if self.indexType != nil {try container.encode(self.indexType, forKey: .indexType)}
    if self.schema != nil {try container.encode(self.schema, forKey: .schema)}
    if self.table != nil {try container.encode(self.table, forKey: .table)}
    if self.columns != nil {try container.encode(self.columns as! [String]?, forKey: .columns)}
    if self.includedColumns != nil {try container.encode(self.includedColumns as! [String]?, forKey: .includedColumns)}
    if self.indexScript != nil {try container.encode(self.indexScript, forKey: .indexScript)}
    if self.estimatedImpact != nil {try container.encode(self.estimatedImpact as! [OperationImpactData?]?, forKey: .estimatedImpact)}
    if self.reportedImpact != nil {try container.encode(self.reportedImpact as! [OperationImpactData?]?, forKey: .reportedImpact)}
  }
}

extension DataFactory {
  public static func createRecommendedIndexPropertiesProtocol() -> RecommendedIndexPropertiesProtocol {
    return RecommendedIndexPropertiesData()
  }
}


// RecommendedIndexState enumerates the values for recommended index state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum RecommendedIndexStateEnum: String, Codable
{
// RecommendedIndexStateActive specifies the recommended index state active state for recommended index state.
    case RecommendedIndexStateActive = "Active"
// RecommendedIndexStateBlocked specifies the recommended index state blocked state for recommended index state.
    case RecommendedIndexStateBlocked = "Blocked"
// RecommendedIndexStateExecuting specifies the recommended index state executing state for recommended index state.
    case RecommendedIndexStateExecuting = "Executing"
// RecommendedIndexStateExpired specifies the recommended index state expired state for recommended index state.
    case RecommendedIndexStateExpired = "Expired"
// RecommendedIndexStateIgnored specifies the recommended index state ignored state for recommended index state.
    case RecommendedIndexStateIgnored = "Ignored"
// RecommendedIndexStatePending specifies the recommended index state pending state for recommended index state.
    case RecommendedIndexStatePending = "Pending"
// RecommendedIndexStatePendingRevert specifies the recommended index state pending revert state for recommended index
// state.
    case RecommendedIndexStatePendingRevert = "Pending Revert"
// RecommendedIndexStateReverted specifies the recommended index state reverted state for recommended index state.
    case RecommendedIndexStateReverted = "Reverted"
// RecommendedIndexStateReverting specifies the recommended index state reverting state for recommended index state.
    case RecommendedIndexStateReverting = "Reverting"
// RecommendedIndexStateSuccess specifies the recommended index state success state for recommended index state.
    case RecommendedIndexStateSuccess = "Success"
// RecommendedIndexStateVerifying specifies the recommended index state verifying state for recommended index state.
    case RecommendedIndexStateVerifying = "Verifying"
}


// RecommendedIndexType enumerates the values for recommended index type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum RecommendedIndexTypeEnum: String, Codable
{
// CLUSTERED specifies the clustered state for recommended index type.
    case CLUSTERED = "CLUSTERED"
// CLUSTEREDCOLUMNSTORE specifies the clusteredcolumnstore state for recommended index type.
    case CLUSTEREDCOLUMNSTORE = "CLUSTERED COLUMNSTORE"
// COLUMNSTORE specifies the columnstore state for recommended index type.
    case COLUMNSTORE = "COLUMNSTORE"
// NONCLUSTERED specifies the nonclustered state for recommended index type.
    case NONCLUSTERED = "NONCLUSTERED"
}


// 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 RecoverableDatabaseData : RecoverableDatabaseProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: RecoverableDatabasePropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRecoverableDatabaseProtocol() -> RecoverableDatabaseProtocol {
    return RecoverableDatabaseData()
  }
}


// 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 RecoverableDatabaseListResultData : RecoverableDatabaseListResultProtocol {
    public var value: [RecoverableDatabaseProtocol]

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

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

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

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

extension DataFactory {
  public static func createRecoverableDatabaseListResultProtocol(value: [RecoverableDatabaseProtocol]) -> RecoverableDatabaseListResultProtocol {
    return RecoverableDatabaseListResultData(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 RecoverableDatabasePropertiesData : RecoverableDatabasePropertiesProtocol {
    public var edition: String?
    public var serviceLevelObjective: String?
    public var elasticPoolName: String?
    public var lastAvailableBackupDate: Date?

        enum CodingKeys: String, CodingKey {case edition = "edition"
        case serviceLevelObjective = "serviceLevelObjective"
        case elasticPoolName = "elasticPoolName"
        case lastAvailableBackupDate = "lastAvailableBackupDate"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.edition) {
        self.edition = try container.decode(String?.self, forKey: .edition)
    }
    if container.contains(.serviceLevelObjective) {
        self.serviceLevelObjective = try container.decode(String?.self, forKey: .serviceLevelObjective)
    }
    if container.contains(.elasticPoolName) {
        self.elasticPoolName = try container.decode(String?.self, forKey: .elasticPoolName)
    }
    if container.contains(.lastAvailableBackupDate) {
        self.lastAvailableBackupDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastAvailableBackupDate)), 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.edition != nil {try container.encode(self.edition, forKey: .edition)}
    if self.serviceLevelObjective != nil {try container.encode(self.serviceLevelObjective, forKey: .serviceLevelObjective)}
    if self.elasticPoolName != nil {try container.encode(self.elasticPoolName, forKey: .elasticPoolName)}
    if self.lastAvailableBackupDate != nil {
        try container.encode(DateConverter.toString(date: self.lastAvailableBackupDate!, format: .dateTime), forKey: .lastAvailableBackupDate)
    }
  }
}

extension DataFactory {
  public static func createRecoverableDatabasePropertiesProtocol() -> RecoverableDatabasePropertiesProtocol {
    return RecoverableDatabasePropertiesData()
  }
}


// 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 ReplicationLinkData : ReplicationLinkProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: ReplicationLinkPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createReplicationLinkProtocol() -> ReplicationLinkProtocol {
    return ReplicationLinkData()
  }
}


// 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 ReplicationLinkListResultData : ReplicationLinkListResultProtocol {
    public var value: [ReplicationLinkProtocol?]?

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

extension DataFactory {
  public static func createReplicationLinkListResultProtocol() -> ReplicationLinkListResultProtocol {
    return ReplicationLinkListResultData()
  }
}


// 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 ReplicationLinkPropertiesData : ReplicationLinkPropertiesProtocol {
    public var isTerminationAllowed: Bool?
    public var replicationMode: String?
    public var partnerServer: String?
    public var partnerDatabase: String?
    public var partnerLocation: String?
    public var role: ReplicationRoleEnum?
    public var partnerRole: ReplicationRoleEnum?
    public var startTime: Date?
    public var percentComplete: Int32?
    public var replicationState: ReplicationStateEnum?

        enum CodingKeys: String, CodingKey {case isTerminationAllowed = "isTerminationAllowed"
        case replicationMode = "replicationMode"
        case partnerServer = "partnerServer"
        case partnerDatabase = "partnerDatabase"
        case partnerLocation = "partnerLocation"
        case role = "role"
        case partnerRole = "partnerRole"
        case startTime = "startTime"
        case percentComplete = "percentComplete"
        case replicationState = "replicationState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.isTerminationAllowed) {
        self.isTerminationAllowed = try container.decode(Bool?.self, forKey: .isTerminationAllowed)
    }
    if container.contains(.replicationMode) {
        self.replicationMode = try container.decode(String?.self, forKey: .replicationMode)
    }
    if container.contains(.partnerServer) {
        self.partnerServer = try container.decode(String?.self, forKey: .partnerServer)
    }
    if container.contains(.partnerDatabase) {
        self.partnerDatabase = try container.decode(String?.self, forKey: .partnerDatabase)
    }
    if container.contains(.partnerLocation) {
        self.partnerLocation = try container.decode(String?.self, forKey: .partnerLocation)
    }
    if container.contains(.role) {
        self.role = try container.decode(ReplicationRoleEnum?.self, forKey: .role)
    }
    if container.contains(.partnerRole) {
        self.partnerRole = try container.decode(ReplicationRoleEnum?.self, forKey: .partnerRole)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.percentComplete) {
        self.percentComplete = try container.decode(Int32?.self, forKey: .percentComplete)
    }
    if container.contains(.replicationState) {
        self.replicationState = try container.decode(ReplicationStateEnum?.self, forKey: .replicationState)
    }
    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.isTerminationAllowed != nil {try container.encode(self.isTerminationAllowed, forKey: .isTerminationAllowed)}
    if self.replicationMode != nil {try container.encode(self.replicationMode, forKey: .replicationMode)}
    if self.partnerServer != nil {try container.encode(self.partnerServer, forKey: .partnerServer)}
    if self.partnerDatabase != nil {try container.encode(self.partnerDatabase, forKey: .partnerDatabase)}
    if self.partnerLocation != nil {try container.encode(self.partnerLocation, forKey: .partnerLocation)}
    if self.role != nil {try container.encode(self.role, forKey: .role)}
    if self.partnerRole != nil {try container.encode(self.partnerRole, forKey: .partnerRole)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.percentComplete != nil {try container.encode(self.percentComplete, forKey: .percentComplete)}
    if self.replicationState != nil {try container.encode(self.replicationState, forKey: .replicationState)}
  }
}

extension DataFactory {
  public static func createReplicationLinkPropertiesProtocol() -> ReplicationLinkPropertiesProtocol {
    return ReplicationLinkPropertiesData()
  }
}


// ReplicationRole enumerates the values for replication role.

// 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 ReplicationRoleEnum: String, Codable
{
// ReplicationRoleCopy specifies the replication role copy state for replication role.
    case ReplicationRoleCopy = "Copy"
// ReplicationRoleNonReadableSecondary specifies the replication role non readable secondary state for replication
// role.
    case ReplicationRoleNonReadableSecondary = "NonReadableSecondary"
// ReplicationRolePrimary specifies the replication role primary state for replication role.
    case ReplicationRolePrimary = "Primary"
// ReplicationRoleSecondary specifies the replication role secondary state for replication role.
    case ReplicationRoleSecondary = "Secondary"
// ReplicationRoleSource specifies the replication role source state for replication role.
    case ReplicationRoleSource = "Source"
}


// ReplicationState enumerates the values for replication state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ReplicationStateEnum: String, Codable
{
// CATCHUP specifies the catchup state for replication state.
    case CATCHUP = "CATCH_UP"
// PENDING specifies the pending state for replication state.
    case PENDING = "PENDING"
// SEEDING specifies the seeding state for replication state.
    case SEEDING = "SEEDING"
// SUSPENDED specifies the suspended state for replication state.
    case SUSPENDED = "SUSPENDED"
}


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

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

  public init()  {
  }

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

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


// 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 ResourceIdentityData : ResourceIdentityProtocol {
    public var principalId: String?
    public var type: IdentityTypeEnum?
    public var tenantId: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createResourceIdentityProtocol() -> ResourceIdentityProtocol {
    return ResourceIdentityData()
  }
}


// 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 ResourceMoveDefinitionData : ResourceMoveDefinitionProtocol {
    public var id: String

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

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

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

extension DataFactory {
  public static func createResourceMoveDefinitionProtocol(id: String) -> ResourceMoveDefinitionProtocol {
    return ResourceMoveDefinitionData(id: id)
  }
}


// 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 RestorableDroppedDatabaseData : RestorableDroppedDatabaseProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: RestorableDroppedDatabasePropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRestorableDroppedDatabaseProtocol() -> RestorableDroppedDatabaseProtocol {
    return RestorableDroppedDatabaseData()
  }
}


// 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 RestorableDroppedDatabaseListResultData : RestorableDroppedDatabaseListResultProtocol {
    public var value: [RestorableDroppedDatabaseProtocol]

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

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

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

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

extension DataFactory {
  public static func createRestorableDroppedDatabaseListResultProtocol(value: [RestorableDroppedDatabaseProtocol]) -> RestorableDroppedDatabaseListResultProtocol {
    return RestorableDroppedDatabaseListResultData(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 RestorableDroppedDatabasePropertiesData : RestorableDroppedDatabasePropertiesProtocol {
    public var databaseName: String?
    public var edition: String?
    public var maxSizeBytes: String?
    public var serviceLevelObjective: String?
    public var elasticPoolName: String?
    public var creationDate: Date?
    public var deletionDate: Date?
    public var earliestRestoreDate: Date?

        enum CodingKeys: String, CodingKey {case databaseName = "databaseName"
        case edition = "edition"
        case maxSizeBytes = "maxSizeBytes"
        case serviceLevelObjective = "serviceLevelObjective"
        case elasticPoolName = "elasticPoolName"
        case creationDate = "creationDate"
        case deletionDate = "deletionDate"
        case earliestRestoreDate = "earliestRestoreDate"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.databaseName) {
        self.databaseName = try container.decode(String?.self, forKey: .databaseName)
    }
    if container.contains(.edition) {
        self.edition = try container.decode(String?.self, forKey: .edition)
    }
    if container.contains(.maxSizeBytes) {
        self.maxSizeBytes = try container.decode(String?.self, forKey: .maxSizeBytes)
    }
    if container.contains(.serviceLevelObjective) {
        self.serviceLevelObjective = try container.decode(String?.self, forKey: .serviceLevelObjective)
    }
    if container.contains(.elasticPoolName) {
        self.elasticPoolName = try container.decode(String?.self, forKey: .elasticPoolName)
    }
    if container.contains(.creationDate) {
        self.creationDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationDate)), format: .dateTime)
    }
    if container.contains(.deletionDate) {
        self.deletionDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .deletionDate)), format: .dateTime)
    }
    if container.contains(.earliestRestoreDate) {
        self.earliestRestoreDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .earliestRestoreDate)), 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.databaseName != nil {try container.encode(self.databaseName, forKey: .databaseName)}
    if self.edition != nil {try container.encode(self.edition, forKey: .edition)}
    if self.maxSizeBytes != nil {try container.encode(self.maxSizeBytes, forKey: .maxSizeBytes)}
    if self.serviceLevelObjective != nil {try container.encode(self.serviceLevelObjective, forKey: .serviceLevelObjective)}
    if self.elasticPoolName != nil {try container.encode(self.elasticPoolName, forKey: .elasticPoolName)}
    if self.creationDate != nil {
        try container.encode(DateConverter.toString(date: self.creationDate!, format: .dateTime), forKey: .creationDate)
    }
    if self.deletionDate != nil {
        try container.encode(DateConverter.toString(date: self.deletionDate!, format: .dateTime), forKey: .deletionDate)
    }
    if self.earliestRestoreDate != nil {
        try container.encode(DateConverter.toString(date: self.earliestRestoreDate!, format: .dateTime), forKey: .earliestRestoreDate)
    }
  }
}

extension DataFactory {
  public static func createRestorableDroppedDatabasePropertiesProtocol() -> RestorableDroppedDatabasePropertiesProtocol {
    return RestorableDroppedDatabasePropertiesData()
  }
}


// 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 RestorePointData : RestorePointProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: RestorePointPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRestorePointProtocol() -> RestorePointProtocol {
    return RestorePointData()
  }
}


// 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 RestorePointListResultData : RestorePointListResultProtocol {
    public var value: [RestorePointProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRestorePointListResultProtocol() -> RestorePointListResultProtocol {
    return RestorePointListResultData()
  }
}


// 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 RestorePointPropertiesData : RestorePointPropertiesProtocol {
    public var restorePointType: RestorePointTypeEnum?
    public var earliestRestoreDate: Date?
    public var restorePointCreationDate: Date?
    public var restorePointLabel: String?

        enum CodingKeys: String, CodingKey {case restorePointType = "restorePointType"
        case earliestRestoreDate = "earliestRestoreDate"
        case restorePointCreationDate = "restorePointCreationDate"
        case restorePointLabel = "restorePointLabel"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.restorePointType) {
        self.restorePointType = try container.decode(RestorePointTypeEnum?.self, forKey: .restorePointType)
    }
    if container.contains(.earliestRestoreDate) {
        self.earliestRestoreDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .earliestRestoreDate)), format: .dateTime)
    }
    if container.contains(.restorePointCreationDate) {
        self.restorePointCreationDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .restorePointCreationDate)), format: .dateTime)
    }
    if container.contains(.restorePointLabel) {
        self.restorePointLabel = try container.decode(String?.self, forKey: .restorePointLabel)
    }
    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.restorePointType != nil {try container.encode(self.restorePointType, forKey: .restorePointType)}
    if self.earliestRestoreDate != nil {
        try container.encode(DateConverter.toString(date: self.earliestRestoreDate!, format: .dateTime), forKey: .earliestRestoreDate)
    }
    if self.restorePointCreationDate != nil {
        try container.encode(DateConverter.toString(date: self.restorePointCreationDate!, format: .dateTime), forKey: .restorePointCreationDate)
    }
    if self.restorePointLabel != nil {try container.encode(self.restorePointLabel, forKey: .restorePointLabel)}
  }
}

extension DataFactory {
  public static func createRestorePointPropertiesProtocol() -> RestorePointPropertiesProtocol {
    return RestorePointPropertiesData()
  }
}


// RestorePointType enumerates the values for restore point type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum RestorePointTypeEnum: String, Codable
{
// CONTINUOUS specifies the continuous state for restore point type.
    case CONTINUOUS = "CONTINUOUS"
// DISCRETE specifies the discrete state for restore point type.
    case DISCRETE = "DISCRETE"
}


// SampleName enumerates the values for sample 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 SampleNameEnum: String, Codable
{
// AdventureWorksLT specifies the adventure works lt state for sample name.
    case AdventureWorksLT = "AdventureWorksLT"
}


// SecurityAlertPolicyEmailAccountAdmins enumerates the values for security alert policy email account admins.

// 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 SecurityAlertPolicyEmailAccountAdminsEnum: String, Codable
{
// SecurityAlertPolicyEmailAccountAdminsDisabled specifies the security alert policy email account admins disabled
// state for security alert policy email account admins.
    case SecurityAlertPolicyEmailAccountAdminsDisabled = "Disabled"
// SecurityAlertPolicyEmailAccountAdminsEnabled specifies the security alert policy email account admins enabled state
// for security alert policy email account admins.
    case SecurityAlertPolicyEmailAccountAdminsEnabled = "Enabled"
}


// SecurityAlertPolicyState enumerates the values for security alert policy state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SecurityAlertPolicyStateEnum: String, Codable
{
// SecurityAlertPolicyStateDisabled specifies the security alert policy state disabled state for security alert policy
// state.
    case SecurityAlertPolicyStateDisabled = "Disabled"
// SecurityAlertPolicyStateEnabled specifies the security alert policy state enabled state for security alert policy
// state.
    case SecurityAlertPolicyStateEnabled = "Enabled"
// SecurityAlertPolicyStateNew specifies the security alert policy state new state for security alert policy state.
    case SecurityAlertPolicyStateNew = "New"
}


// SecurityAlertPolicyUseServerDefault enumerates the values for security alert policy use server default.

// 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 SecurityAlertPolicyUseServerDefaultEnum: String, Codable
{
// SecurityAlertPolicyUseServerDefaultDisabled specifies the security alert policy use server default disabled state
// for security alert policy use server default.
    case SecurityAlertPolicyUseServerDefaultDisabled = "Disabled"
// SecurityAlertPolicyUseServerDefaultEnabled specifies the security alert policy use server default enabled state for
// security alert policy use server default.
    case SecurityAlertPolicyUseServerDefaultEnabled = "Enabled"
}


// 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 ServerAdministratorListResultData : ServerAdministratorListResultProtocol {
    public var value: [ServerAzureADAdministratorProtocol?]?

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

extension DataFactory {
  public static func createServerAdministratorListResultProtocol() -> ServerAdministratorListResultProtocol {
    return ServerAdministratorListResultData()
  }
}


// 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 ServerAdministratorPropertiesData : ServerAdministratorPropertiesProtocol {
    public var administratorType: String
    public var login: String
    public var sid: String
    public var tenantId: String

        enum CodingKeys: String, CodingKey {case administratorType = "administratorType"
        case login = "login"
        case sid = "sid"
        case tenantId = "tenantId"
        }

  public init(administratorType: String, login: String, sid: String, tenantId: String)  {
    self.administratorType = administratorType
    self.login = login
    self.sid = sid
    self.tenantId = tenantId
  }

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

extension DataFactory {
  public static func createServerAdministratorPropertiesProtocol(administratorType: String, login: String, sid: String, tenantId: String) -> ServerAdministratorPropertiesProtocol {
    return ServerAdministratorPropertiesData(administratorType: administratorType, login: login, sid: sid, tenantId: tenantId)
  }
}


// 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 ServerAutomaticTuningData : ServerAutomaticTuningProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: AutomaticTuningServerPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createServerAutomaticTuningProtocol() -> ServerAutomaticTuningProtocol {
    return ServerAutomaticTuningData()
  }
}


// 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 ServerAzureADAdministratorData : ServerAzureADAdministratorProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: ServerAdministratorPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createServerAzureADAdministratorProtocol() -> ServerAzureADAdministratorProtocol {
    return ServerAzureADAdministratorData()
  }
}


// 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 ServerCommunicationLinkData : ServerCommunicationLinkProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: ServerCommunicationLinkPropertiesProtocol?
    public var location: String?
    public var kind: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createServerCommunicationLinkProtocol() -> ServerCommunicationLinkProtocol {
    return ServerCommunicationLinkData()
  }
}


// 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 ServerCommunicationLinkListResultData : ServerCommunicationLinkListResultProtocol {
    public var value: [ServerCommunicationLinkProtocol?]?

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

extension DataFactory {
  public static func createServerCommunicationLinkListResultProtocol() -> ServerCommunicationLinkListResultProtocol {
    return ServerCommunicationLinkListResultData()
  }
}


// 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 ServerCommunicationLinkPropertiesData : ServerCommunicationLinkPropertiesProtocol {
    public var state: String?
    public var partnerServer: String

        enum CodingKeys: String, CodingKey {case state = "state"
        case partnerServer = "partnerServer"
        }

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

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

extension DataFactory {
  public static func createServerCommunicationLinkPropertiesProtocol(partnerServer: String) -> ServerCommunicationLinkPropertiesProtocol {
    return ServerCommunicationLinkPropertiesData(partnerServer: partnerServer)
  }
}


// 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 ServerConnectionPolicyData : ServerConnectionPolicyProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var kind: String?
    public var location: String?
    public var properties: ServerConnectionPolicyPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createServerConnectionPolicyProtocol() -> ServerConnectionPolicyProtocol {
    return ServerConnectionPolicyData()
  }
}


// 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 ServerConnectionPolicyPropertiesData : ServerConnectionPolicyPropertiesProtocol {
    public var connectionType: ServerConnectionTypeEnum

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

  public init(connectionType: ServerConnectionTypeEnum)  {
    self.connectionType = connectionType
  }

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

extension DataFactory {
  public static func createServerConnectionPolicyPropertiesProtocol(connectionType: ServerConnectionTypeEnum) -> ServerConnectionPolicyPropertiesProtocol {
    return ServerConnectionPolicyPropertiesData(connectionType: connectionType)
  }
}


// ServerConnectionType enumerates the values for server connection type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ServerConnectionTypeEnum: String, Codable
{
// ServerConnectionTypeDefault specifies the server connection type default state for server connection type.
    case ServerConnectionTypeDefault = "Default"
// ServerConnectionTypeProxy specifies the server connection type proxy state for server connection type.
    case ServerConnectionTypeProxy = "Proxy"
// ServerConnectionTypeRedirect specifies the server connection type redirect state for server connection type.
    case ServerConnectionTypeRedirect = "Redirect"
}