// Copyright (c) Microsoft Corporation. All rights 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 CsmUsageQuotaData : CsmUsageQuotaProtocol {
    public var unit: String?
    public var nextResetTime: Date?
    public var currentValue: Int64?
    public var limit: Int64?
    public var name: LocalizableStringProtocol?

        enum CodingKeys: String, CodingKey {case unit = "unit"
        case nextResetTime = "nextResetTime"
        case currentValue = "currentValue"
        case limit = "limit"
        case name = "name"
        }

  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(String?.self, forKey: .unit)
    }
    if container.contains(.nextResetTime) {
        self.nextResetTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .nextResetTime)), format: .dateTime)
    }
    if container.contains(.currentValue) {
        self.currentValue = try container.decode(Int64?.self, forKey: .currentValue)
    }
    if container.contains(.limit) {
        self.limit = try container.decode(Int64?.self, forKey: .limit)
    }
    if container.contains(.name) {
        self.name = try container.decode(LocalizableStringData?.self, forKey: .name)
    }
    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.nextResetTime != nil {
        try container.encode(DateConverter.toString(date: self.nextResetTime!, format: .dateTime), forKey: .nextResetTime)
    }
    if self.currentValue != nil {try container.encode(self.currentValue, forKey: .currentValue)}
    if self.limit != nil {try container.encode(self.limit, forKey: .limit)}
    if self.name != nil {try container.encode(self.name as! LocalizableStringData?, forKey: .name)}
  }
}

extension DataFactory {
  public static func createCsmUsageQuotaProtocol() -> CsmUsageQuotaProtocol {
    return CsmUsageQuotaData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 CustomHostnameAnalysisResultData : CustomHostnameAnalysisResultProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: CustomHostnameAnalysisResultPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case kind = "kind"
        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(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(CustomHostnameAnalysisResultPropertiesData?.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.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.properties != nil {try container.encode(self.properties as! CustomHostnameAnalysisResultPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createCustomHostnameAnalysisResultProtocol() -> CustomHostnameAnalysisResultProtocol {
    return CustomHostnameAnalysisResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 CustomHostnameAnalysisResultPropertiesData : CustomHostnameAnalysisResultPropertiesProtocol {
    public var isHostnameAlreadyVerified: Bool?
    public var customDomainVerificationTest: DnsVerificationTestResultEnum?
    public var customDomainVerificationFailureInfo: ErrorEntityProtocol?
    public var hasConflictOnScaleUnit: Bool?
    public var hasConflictAcrossSubscription: Bool?
    public var conflictingAppResourceId: String?
    public var cNameRecords: [String]?
    public var txtRecords: [String]?
    public var aRecords: [String]?
    public var alternateCNameRecords: [String]?
    public var alternateTxtRecords: [String]?

        enum CodingKeys: String, CodingKey {case isHostnameAlreadyVerified = "isHostnameAlreadyVerified"
        case customDomainVerificationTest = "customDomainVerificationTest"
        case customDomainVerificationFailureInfo = "customDomainVerificationFailureInfo"
        case hasConflictOnScaleUnit = "hasConflictOnScaleUnit"
        case hasConflictAcrossSubscription = "hasConflictAcrossSubscription"
        case conflictingAppResourceId = "conflictingAppResourceId"
        case cNameRecords = "cNameRecords"
        case txtRecords = "txtRecords"
        case aRecords = "aRecords"
        case alternateCNameRecords = "alternateCNameRecords"
        case alternateTxtRecords = "alternateTxtRecords"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.isHostnameAlreadyVerified) {
        self.isHostnameAlreadyVerified = try container.decode(Bool?.self, forKey: .isHostnameAlreadyVerified)
    }
    if container.contains(.customDomainVerificationTest) {
        self.customDomainVerificationTest = try container.decode(DnsVerificationTestResultEnum?.self, forKey: .customDomainVerificationTest)
    }
    if container.contains(.customDomainVerificationFailureInfo) {
        self.customDomainVerificationFailureInfo = try container.decode(ErrorEntityData?.self, forKey: .customDomainVerificationFailureInfo)
    }
    if container.contains(.hasConflictOnScaleUnit) {
        self.hasConflictOnScaleUnit = try container.decode(Bool?.self, forKey: .hasConflictOnScaleUnit)
    }
    if container.contains(.hasConflictAcrossSubscription) {
        self.hasConflictAcrossSubscription = try container.decode(Bool?.self, forKey: .hasConflictAcrossSubscription)
    }
    if container.contains(.conflictingAppResourceId) {
        self.conflictingAppResourceId = try container.decode(String?.self, forKey: .conflictingAppResourceId)
    }
    if container.contains(.cNameRecords) {
        self.cNameRecords = try container.decode([String]?.self, forKey: .cNameRecords)
    }
    if container.contains(.txtRecords) {
        self.txtRecords = try container.decode([String]?.self, forKey: .txtRecords)
    }
    if container.contains(.aRecords) {
        self.aRecords = try container.decode([String]?.self, forKey: .aRecords)
    }
    if container.contains(.alternateCNameRecords) {
        self.alternateCNameRecords = try container.decode([String]?.self, forKey: .alternateCNameRecords)
    }
    if container.contains(.alternateTxtRecords) {
        self.alternateTxtRecords = try container.decode([String]?.self, forKey: .alternateTxtRecords)
    }
    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.isHostnameAlreadyVerified != nil {try container.encode(self.isHostnameAlreadyVerified, forKey: .isHostnameAlreadyVerified)}
    if self.customDomainVerificationTest != nil {try container.encode(self.customDomainVerificationTest, forKey: .customDomainVerificationTest)}
    if self.customDomainVerificationFailureInfo != nil {try container.encode(self.customDomainVerificationFailureInfo as! ErrorEntityData?, forKey: .customDomainVerificationFailureInfo)}
    if self.hasConflictOnScaleUnit != nil {try container.encode(self.hasConflictOnScaleUnit, forKey: .hasConflictOnScaleUnit)}
    if self.hasConflictAcrossSubscription != nil {try container.encode(self.hasConflictAcrossSubscription, forKey: .hasConflictAcrossSubscription)}
    if self.conflictingAppResourceId != nil {try container.encode(self.conflictingAppResourceId, forKey: .conflictingAppResourceId)}
    if self.cNameRecords != nil {try container.encode(self.cNameRecords as! [String]?, forKey: .cNameRecords)}
    if self.txtRecords != nil {try container.encode(self.txtRecords as! [String]?, forKey: .txtRecords)}
    if self.aRecords != nil {try container.encode(self.aRecords as! [String]?, forKey: .aRecords)}
    if self.alternateCNameRecords != nil {try container.encode(self.alternateCNameRecords as! [String]?, forKey: .alternateCNameRecords)}
    if self.alternateTxtRecords != nil {try container.encode(self.alternateTxtRecords as! [String]?, forKey: .alternateTxtRecords)}
  }
}

extension DataFactory {
  public static func createCustomHostnameAnalysisResultPropertiesProtocol() -> CustomHostnameAnalysisResultPropertiesProtocol {
    return CustomHostnameAnalysisResultPropertiesData()
  }
}


// CustomHostNameDnsRecordType enumerates the values for custom host name dns record 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 CustomHostNameDnsRecordTypeEnum: String, Codable
{
// A specifies the a state for custom host name dns record type.
    case A = "A"
// CName specifies the c name state for custom host name dns record type.
    case CName = "CName"
}


// Copyright (c) Microsoft Corporation. All rights 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 DatabaseBackupSettingData : DatabaseBackupSettingProtocol {
    public var databaseType: DatabaseTypeEnum
    public var name: String?
    public var connectionStringName: String?
    public var connectionString: String?

        enum CodingKeys: String, CodingKey {case databaseType = "databaseType"
        case name = "name"
        case connectionStringName = "connectionStringName"
        case connectionString = "connectionString"
        }

  public init(databaseType: DatabaseTypeEnum)  {
    self.databaseType = databaseType
  }

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

extension DataFactory {
  public static func createDatabaseBackupSettingProtocol(databaseType: DatabaseTypeEnum) -> DatabaseBackupSettingProtocol {
    return DatabaseBackupSettingData(databaseType: databaseType)
  }
}


// DatabaseType enumerates the values for database 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 DatabaseTypeEnum: String, Codable
{
// DatabaseTypeLocalMySql specifies the database type local my sql state for database type.
    case DatabaseTypeLocalMySql = "LocalMySql"
// DatabaseTypeMySql specifies the database type my sql state for database type.
    case DatabaseTypeMySql = "MySql"
// DatabaseTypePostgreSql specifies the database type postgre sql state for database type.
    case DatabaseTypePostgreSql = "PostgreSql"
// DatabaseTypeSqlAzure specifies the database type sql azure state for database type.
    case DatabaseTypeSqlAzure = "SqlAzure"
}


// Copyright (c) Microsoft Corporation. All rights 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 DataSourceData : DataSourceProtocol {
    public var instructions: [String]?
    public var dataSourceUri: [NameValuePairProtocol?]?

        enum CodingKeys: String, CodingKey {case instructions = "instructions"
        case dataSourceUri = "dataSourceUri"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDataSourceProtocol() -> DataSourceProtocol {
    return DataSourceData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DeletedSiteData : DeletedSiteProtocol {
    public var id: Int32?
    public var deletedTimestamp: String?
    public var subscription: String?
    public var resourceGroup: String?
    public var name: String?
    public var slot: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case deletedTimestamp = "deletedTimestamp"
        case subscription = "subscription"
        case resourceGroup = "resourceGroup"
        case name = "name"
        case slot = "slot"
        }

  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(Int32?.self, forKey: .id)
    }
    if container.contains(.deletedTimestamp) {
        self.deletedTimestamp = try container.decode(String?.self, forKey: .deletedTimestamp)
    }
    if container.contains(.subscription) {
        self.subscription = try container.decode(String?.self, forKey: .subscription)
    }
    if container.contains(.resourceGroup) {
        self.resourceGroup = try container.decode(String?.self, forKey: .resourceGroup)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.slot) {
        self.slot = try container.decode(String?.self, forKey: .slot)
    }
    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.deletedTimestamp != nil {try container.encode(self.deletedTimestamp, forKey: .deletedTimestamp)}
    if self.subscription != nil {try container.encode(self.subscription, forKey: .subscription)}
    if self.resourceGroup != nil {try container.encode(self.resourceGroup, forKey: .resourceGroup)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.slot != nil {try container.encode(self.slot, forKey: .slot)}
  }
}

extension DataFactory {
  public static func createDeletedSiteProtocol() -> DeletedSiteProtocol {
    return DeletedSiteData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DeletedWebAppCollectionData : DeletedWebAppCollectionProtocol {
    public var value: [DeletedSiteProtocol]
    public var _nextLink: String?

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

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

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

extension DataFactory {
  public static func createDeletedWebAppCollectionProtocol(value: [DeletedSiteProtocol]) -> DeletedWebAppCollectionProtocol {
    return DeletedWebAppCollectionData(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 DeploymentCollectionData : DeploymentCollectionProtocol {
    public var value: [DeploymentProtocol]
    public var _nextLink: String?

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

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

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

extension DataFactory {
  public static func createDeploymentCollectionProtocol(value: [DeploymentProtocol]) -> DeploymentCollectionProtocol {
    return DeploymentCollectionData(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 DeploymentData : DeploymentProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: DeploymentPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case kind = "kind"
        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(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(DeploymentPropertiesData?.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.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.properties != nil {try container.encode(self.properties as! DeploymentPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createDeploymentProtocol() -> DeploymentProtocol {
    return DeploymentData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DeploymentLocationsData : DeploymentLocationsProtocol {
    public var locations: [GeoRegionProtocol?]?
    public var hostingEnvironments: [AppServiceEnvironmentProtocol?]?
    public var hostingEnvironmentDeploymentInfos: [HostingEnvironmentDeploymentInfoProtocol?]?

        enum CodingKeys: String, CodingKey {case locations = "locations"
        case hostingEnvironments = "hostingEnvironments"
        case hostingEnvironmentDeploymentInfos = "hostingEnvironmentDeploymentInfos"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDeploymentLocationsProtocol() -> DeploymentLocationsProtocol {
    return DeploymentLocationsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DeploymentPropertiesData : DeploymentPropertiesProtocol {
    public var id: String?
    public var status: Int32?
    public var message: String?
    public var author: String?
    public var deployer: String?
    public var authorEmail: String?
    public var startTime: Date?
    public var endTime: Date?
    public var active: Bool?
    public var details: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case status = "status"
        case message = "message"
        case author = "author"
        case deployer = "deployer"
        case authorEmail = "authorEmail"
        case startTime = "startTime"
        case endTime = "endTime"
        case active = "active"
        case details = "details"
        }

  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(.status) {
        self.status = try container.decode(Int32?.self, forKey: .status)
    }
    if container.contains(.message) {
        self.message = try container.decode(String?.self, forKey: .message)
    }
    if container.contains(.author) {
        self.author = try container.decode(String?.self, forKey: .author)
    }
    if container.contains(.deployer) {
        self.deployer = try container.decode(String?.self, forKey: .deployer)
    }
    if container.contains(.authorEmail) {
        self.authorEmail = try container.decode(String?.self, forKey: .authorEmail)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.active) {
        self.active = try container.decode(Bool?.self, forKey: .active)
    }
    if container.contains(.details) {
        self.details = try container.decode(String?.self, forKey: .details)
    }
    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.status != nil {try container.encode(self.status, forKey: .status)}
    if self.message != nil {try container.encode(self.message, forKey: .message)}
    if self.author != nil {try container.encode(self.author, forKey: .author)}
    if self.deployer != nil {try container.encode(self.deployer, forKey: .deployer)}
    if self.authorEmail != nil {try container.encode(self.authorEmail, forKey: .authorEmail)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.active != nil {try container.encode(self.active, forKey: .active)}
    if self.details != nil {try container.encode(self.details, forKey: .details)}
  }
}

extension DataFactory {
  public static func createDeploymentPropertiesProtocol() -> DeploymentPropertiesProtocol {
    return DeploymentPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DetectorAbnormalTimePeriodData : DetectorAbnormalTimePeriodProtocol {
    public var startTime: Date?
    public var endTime: Date?
    public var message: String?
    public var source: String?
    public var priority: Double?
    public var metaData: [[NameValuePairProtocol?]?]?
    public var type: IssueTypeEnum?
    public var solutions: [SolutionProtocol?]?

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case message = "message"
        case source = "source"
        case priority = "priority"
        case metaData = "metaData"
        case type = "type"
        case solutions = "solutions"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.message) {
        self.message = try container.decode(String?.self, forKey: .message)
    }
    if container.contains(.source) {
        self.source = try container.decode(String?.self, forKey: .source)
    }
    if container.contains(.priority) {
        self.priority = try container.decode(Double?.self, forKey: .priority)
    }
    if container.contains(.metaData) {
        self.metaData = try container.decode([[NameValuePairData?]?]?.self, forKey: .metaData)
    }
    if container.contains(.type) {
        self.type = try container.decode(IssueTypeEnum?.self, forKey: .type)
    }
    if container.contains(.solutions) {
        self.solutions = try container.decode([SolutionData?]?.self, forKey: .solutions)
    }
    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.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.message != nil {try container.encode(self.message, forKey: .message)}
    if self.source != nil {try container.encode(self.source, forKey: .source)}
    if self.priority != nil {try container.encode(self.priority, forKey: .priority)}
    if self.metaData != nil {try container.encode(self.metaData as! [[NameValuePairData?]?]?, forKey: .metaData)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.solutions != nil {try container.encode(self.solutions as! [SolutionData?]?, forKey: .solutions)}
  }
}

extension DataFactory {
  public static func createDetectorAbnormalTimePeriodProtocol() -> DetectorAbnormalTimePeriodProtocol {
    return DetectorAbnormalTimePeriodData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DetectorDefinitionData : DetectorDefinitionProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: DetectorDefinitionPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case kind = "kind"
        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(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(DetectorDefinitionPropertiesData?.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.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.properties != nil {try container.encode(self.properties as! DetectorDefinitionPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createDetectorDefinitionProtocol() -> DetectorDefinitionProtocol {
    return DetectorDefinitionData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DetectorDefinitionPropertiesData : DetectorDefinitionPropertiesProtocol {
    public var displayName: String?
    public var description: String?
    public var rank: Double?
    public var isEnabled: Bool?

        enum CodingKeys: String, CodingKey {case displayName = "displayName"
        case description = "description"
        case rank = "rank"
        case isEnabled = "isEnabled"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDetectorDefinitionPropertiesProtocol() -> DetectorDefinitionPropertiesProtocol {
    return DetectorDefinitionPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiagnosticAnalysisCollectionData : DiagnosticAnalysisCollectionProtocol {
    public var value: [AnalysisDefinitionProtocol]
    public var _nextLink: String?

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

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

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

extension DataFactory {
  public static func createDiagnosticAnalysisCollectionProtocol(value: [AnalysisDefinitionProtocol]) -> DiagnosticAnalysisCollectionProtocol {
    return DiagnosticAnalysisCollectionData(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 DiagnosticAnalysisData : DiagnosticAnalysisProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: DiagnosticAnalysisPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case kind = "kind"
        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(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(DiagnosticAnalysisPropertiesData?.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.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.properties != nil {try container.encode(self.properties as! DiagnosticAnalysisPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createDiagnosticAnalysisProtocol() -> DiagnosticAnalysisProtocol {
    return DiagnosticAnalysisData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiagnosticAnalysisPropertiesData : DiagnosticAnalysisPropertiesProtocol {
    public var startTime: Date?
    public var endTime: Date?
    public var abnormalTimePeriods: [AbnormalTimePeriodProtocol?]?
    public var payload: [AnalysisDataProtocol?]?
    public var nonCorrelatedDetectors: [DetectorDefinitionProtocol?]?

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case abnormalTimePeriods = "abnormalTimePeriods"
        case payload = "payload"
        case nonCorrelatedDetectors = "nonCorrelatedDetectors"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.abnormalTimePeriods) {
        self.abnormalTimePeriods = try container.decode([AbnormalTimePeriodData?]?.self, forKey: .abnormalTimePeriods)
    }
    if container.contains(.payload) {
        self.payload = try container.decode([AnalysisDataData?]?.self, forKey: .payload)
    }
    if container.contains(.nonCorrelatedDetectors) {
        self.nonCorrelatedDetectors = try container.decode([DetectorDefinitionData?]?.self, forKey: .nonCorrelatedDetectors)
    }
    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.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.abnormalTimePeriods != nil {try container.encode(self.abnormalTimePeriods as! [AbnormalTimePeriodData?]?, forKey: .abnormalTimePeriods)}
    if self.payload != nil {try container.encode(self.payload as! [AnalysisDataData?]?, forKey: .payload)}
    if self.nonCorrelatedDetectors != nil {try container.encode(self.nonCorrelatedDetectors as! [DetectorDefinitionData?]?, forKey: .nonCorrelatedDetectors)}
  }
}

extension DataFactory {
  public static func createDiagnosticAnalysisPropertiesProtocol() -> DiagnosticAnalysisPropertiesProtocol {
    return DiagnosticAnalysisPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiagnosticCategoryCollectionData : DiagnosticCategoryCollectionProtocol {
    public var value: [DiagnosticCategoryProtocol]
    public var _nextLink: String?

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

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

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

extension DataFactory {
  public static func createDiagnosticCategoryCollectionProtocol(value: [DiagnosticCategoryProtocol]) -> DiagnosticCategoryCollectionProtocol {
    return DiagnosticCategoryCollectionData(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 DiagnosticCategoryData : DiagnosticCategoryProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: DiagnosticCategoryPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case kind = "kind"
        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(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(DiagnosticCategoryPropertiesData?.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.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.properties != nil {try container.encode(self.properties as! DiagnosticCategoryPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createDiagnosticCategoryProtocol() -> DiagnosticCategoryProtocol {
    return DiagnosticCategoryData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiagnosticCategoryPropertiesData : DiagnosticCategoryPropertiesProtocol {
    public var description: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDiagnosticCategoryPropertiesProtocol() -> DiagnosticCategoryPropertiesProtocol {
    return DiagnosticCategoryPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiagnosticDetectorCollectionData : DiagnosticDetectorCollectionProtocol {
    public var value: [DetectorDefinitionProtocol]
    public var _nextLink: String?

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

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

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

extension DataFactory {
  public static func createDiagnosticDetectorCollectionProtocol(value: [DetectorDefinitionProtocol]) -> DiagnosticDetectorCollectionProtocol {
    return DiagnosticDetectorCollectionData(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 DiagnosticDetectorResponseData : DiagnosticDetectorResponseProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: DiagnosticDetectorResponsePropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case kind = "kind"
        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(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(DiagnosticDetectorResponsePropertiesData?.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.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.properties != nil {try container.encode(self.properties as! DiagnosticDetectorResponsePropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createDiagnosticDetectorResponseProtocol() -> DiagnosticDetectorResponseProtocol {
    return DiagnosticDetectorResponseData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiagnosticDetectorResponsePropertiesData : DiagnosticDetectorResponsePropertiesProtocol {
    public var startTime: Date?
    public var endTime: Date?
    public var issueDetected: Bool?
    public var detectorDefinition: DetectorDefinitionProtocol?
    public var metrics: [DiagnosticMetricSetProtocol?]?
    public var abnormalTimePeriods: [DetectorAbnormalTimePeriodProtocol?]?
    public var data: [[NameValuePairProtocol?]?]?
    public var responseMetaData: ResponseMetaDataProtocol?

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case issueDetected = "issueDetected"
        case detectorDefinition = "detectorDefinition"
        case metrics = "metrics"
        case abnormalTimePeriods = "abnormalTimePeriods"
        case data = "data"
        case responseMetaData = "responseMetaData"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.issueDetected) {
        self.issueDetected = try container.decode(Bool?.self, forKey: .issueDetected)
    }
    if container.contains(.detectorDefinition) {
        self.detectorDefinition = try container.decode(DetectorDefinitionData?.self, forKey: .detectorDefinition)
    }
    if container.contains(.metrics) {
        self.metrics = try container.decode([DiagnosticMetricSetData?]?.self, forKey: .metrics)
    }
    if container.contains(.abnormalTimePeriods) {
        self.abnormalTimePeriods = try container.decode([DetectorAbnormalTimePeriodData?]?.self, forKey: .abnormalTimePeriods)
    }
    if container.contains(.data) {
        self.data = try container.decode([[NameValuePairData?]?]?.self, forKey: .data)
    }
    if container.contains(.responseMetaData) {
        self.responseMetaData = try container.decode(ResponseMetaDataData?.self, forKey: .responseMetaData)
    }
    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.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.issueDetected != nil {try container.encode(self.issueDetected, forKey: .issueDetected)}
    if self.detectorDefinition != nil {try container.encode(self.detectorDefinition as! DetectorDefinitionData?, forKey: .detectorDefinition)}
    if self.metrics != nil {try container.encode(self.metrics as! [DiagnosticMetricSetData?]?, forKey: .metrics)}
    if self.abnormalTimePeriods != nil {try container.encode(self.abnormalTimePeriods as! [DetectorAbnormalTimePeriodData?]?, forKey: .abnormalTimePeriods)}
    if self.data != nil {try container.encode(self.data as! [[NameValuePairData?]?]?, forKey: .data)}
    if self.responseMetaData != nil {try container.encode(self.responseMetaData as! ResponseMetaDataData?, forKey: .responseMetaData)}
  }
}

extension DataFactory {
  public static func createDiagnosticDetectorResponsePropertiesProtocol() -> DiagnosticDetectorResponsePropertiesProtocol {
    return DiagnosticDetectorResponsePropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiagnosticMetricSampleData : DiagnosticMetricSampleProtocol {
    public var timestamp: Date?
    public var roleInstance: String?
    public var total: Double?
    public var maximum: Double?
    public var minimum: Double?
    public var isAggregated: Bool?

        enum CodingKeys: String, CodingKey {case timestamp = "timestamp"
        case roleInstance = "roleInstance"
        case total = "total"
        case maximum = "maximum"
        case minimum = "minimum"
        case isAggregated = "isAggregated"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDiagnosticMetricSampleProtocol() -> DiagnosticMetricSampleProtocol {
    return DiagnosticMetricSampleData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiagnosticMetricSetData : DiagnosticMetricSetProtocol {
    public var name: String?
    public var unit: String?
    public var startTime: Date?
    public var endTime: Date?
    public var timeGrain: String?
    public var values: [DiagnosticMetricSampleProtocol?]?

        enum CodingKeys: String, CodingKey {case name = "name"
        case unit = "unit"
        case startTime = "startTime"
        case endTime = "endTime"
        case timeGrain = "timeGrain"
        case values = "values"
        }

  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(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.timeGrain) {
        self.timeGrain = try container.decode(String?.self, forKey: .timeGrain)
    }
    if container.contains(.values) {
        self.values = try container.decode([DiagnosticMetricSampleData?]?.self, forKey: .values)
    }
    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.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.timeGrain != nil {try container.encode(self.timeGrain, forKey: .timeGrain)}
    if self.values != nil {try container.encode(self.values as! [DiagnosticMetricSampleData?]?, forKey: .values)}
  }
}

extension DataFactory {
  public static func createDiagnosticMetricSetProtocol() -> DiagnosticMetricSetProtocol {
    return DiagnosticMetricSetData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DimensionData : DimensionProtocol {
    public var name: String?
    public var displayName: String?
    public var internalName: String?
    public var toBeExportedForShoebox: Bool?

        enum CodingKeys: String, CodingKey {case name = "name"
        case displayName = "displayName"
        case internalName = "internalName"
        case toBeExportedForShoebox = "toBeExportedForShoebox"
        }

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

extension DataFactory {
  public static func createDimensionProtocol() -> DimensionProtocol {
    return DimensionData()
  }
}


// DnsType enumerates the values for dns 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 DnsTypeEnum: String, Codable
{
// AzureDns specifies the azure dns state for dns type.
    case AzureDns = "AzureDns"
// DefaultDomainRegistrarDns specifies the default domain registrar dns state for dns type.
    case DefaultDomainRegistrarDns = "DefaultDomainRegistrarDns"
}


// DnsVerificationTestResult enumerates the values for dns verification test result.

// Copyright (c) Microsoft Corporation. All rights 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 DnsVerificationTestResultEnum: String, Codable
{
// DnsVerificationTestResultFailed specifies the dns verification test result failed state for dns verification test
// result.
    case DnsVerificationTestResultFailed = "Failed"
// DnsVerificationTestResultPassed specifies the dns verification test result passed state for dns verification test
// result.
    case DnsVerificationTestResultPassed = "Passed"
// DnsVerificationTestResultSkipped specifies the dns verification test result skipped state for dns verification test
// result.
    case DnsVerificationTestResultSkipped = "Skipped"
}


// Copyright (c) Microsoft Corporation. All rights 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 DomainAvailablilityCheckResultData : DomainAvailablilityCheckResultProtocol {
    public var name: String?
    public var available: Bool?
    public var domainType: DomainTypeEnum?

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

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

extension DataFactory {
  public static func createDomainAvailablilityCheckResultProtocol() -> DomainAvailablilityCheckResultProtocol {
    return DomainAvailablilityCheckResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DomainCollectionData : DomainCollectionProtocol {
    public var value: [DomainProtocol]
    public var _nextLink: String?

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

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

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

extension DataFactory {
  public static func createDomainCollectionProtocol(value: [DomainProtocol]) -> DomainCollectionProtocol {
    return DomainCollectionData(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 DomainControlCenterSsoRequestData : DomainControlCenterSsoRequestProtocol {
    public var url: String?
    public var postParameterKey: String?
    public var postParameterValue: String?

        enum CodingKeys: String, CodingKey {case url = "url"
        case postParameterKey = "postParameterKey"
        case postParameterValue = "postParameterValue"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDomainControlCenterSsoRequestProtocol() -> DomainControlCenterSsoRequestProtocol {
    return DomainControlCenterSsoRequestData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DomainData : DomainProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var location: String
    public var type: String?
    public var tags: [String:String]?
    public var properties: DomainPropertiesProtocol?

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

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

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

extension DataFactory {
  public static func createDomainProtocol(location: String) -> DomainProtocol {
    return DomainData(location: location)
  }
}


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

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

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

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

extension DataFactory {
  public static func createDomainOwnershipIdentifierCollectionProtocol(value: [DomainOwnershipIdentifierProtocol]) -> DomainOwnershipIdentifierCollectionProtocol {
    return DomainOwnershipIdentifierCollectionData(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 DomainOwnershipIdentifierData : DomainOwnershipIdentifierProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: DomainOwnershipIdentifierPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case kind = "kind"
        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(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(DomainOwnershipIdentifierPropertiesData?.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.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.properties != nil {try container.encode(self.properties as! DomainOwnershipIdentifierPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createDomainOwnershipIdentifierProtocol() -> DomainOwnershipIdentifierProtocol {
    return DomainOwnershipIdentifierData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DomainOwnershipIdentifierPropertiesData : DomainOwnershipIdentifierPropertiesProtocol {
    public var ownershipId: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDomainOwnershipIdentifierPropertiesProtocol() -> DomainOwnershipIdentifierPropertiesProtocol {
    return DomainOwnershipIdentifierPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DomainPatchResourceData : DomainPatchResourceProtocol, ProxyOnlyResourceProtocol {
    public var id: String?
    public var name: String?
    public var kind: String?
    public var type: String?
    public var properties: DomainPatchResourcePropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case kind = "kind"
        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(.kind) {
        self.kind = try container.decode(String?.self, forKey: .kind)
    }
    if container.contains(.type) {
        self.type = try container.decode(String?.self, forKey: .type)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(DomainPatchResourcePropertiesData?.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.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.properties != nil {try container.encode(self.properties as! DomainPatchResourcePropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createDomainPatchResourceProtocol() -> DomainPatchResourceProtocol {
    return DomainPatchResourceData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DomainPatchResourcePropertiesData : DomainPatchResourcePropertiesProtocol {
    public var contactAdmin: ContactProtocol?
    public var contactBilling: ContactProtocol?
    public var contactRegistrant: ContactProtocol?
    public var contactTech: ContactProtocol?
    public var registrationStatus: DomainStatusEnum?
    public var provisioningState: ProvisioningStateEnum?
    public var nameServers: [String]?
    public var privacy: Bool?
    public var createdTime: Date?
    public var expirationTime: Date?
    public var lastRenewedTime: Date?
    public var autoRenew: Bool?
    public var readyForDnsRecordManagement: Bool?
    public var managedHostNames: [HostNameProtocol?]?
    public var consent: DomainPurchaseConsentProtocol?
    public var domainNotRenewableReasons: [String?]?
    public var dnsType: DnsTypeEnum?
    public var dnsZoneId: String?
    public var targetDnsType: DnsTypeEnum?
    public var authCode: String?

        enum CodingKeys: String, CodingKey {case contactAdmin = "contactAdmin"
        case contactBilling = "contactBilling"
        case contactRegistrant = "contactRegistrant"
        case contactTech = "contactTech"
        case registrationStatus = "registrationStatus"
        case provisioningState = "provisioningState"
        case nameServers = "nameServers"
        case privacy = "privacy"
        case createdTime = "createdTime"
        case expirationTime = "expirationTime"
        case lastRenewedTime = "lastRenewedTime"
        case autoRenew = "autoRenew"
        case readyForDnsRecordManagement = "readyForDnsRecordManagement"
        case managedHostNames = "managedHostNames"
        case consent = "consent"
        case domainNotRenewableReasons = "domainNotRenewableReasons"
        case dnsType = "dnsType"
        case dnsZoneId = "dnsZoneId"
        case targetDnsType = "targetDnsType"
        case authCode = "authCode"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.contactAdmin) {
        self.contactAdmin = try container.decode(ContactData?.self, forKey: .contactAdmin)
    }
    if container.contains(.contactBilling) {
        self.contactBilling = try container.decode(ContactData?.self, forKey: .contactBilling)
    }
    if container.contains(.contactRegistrant) {
        self.contactRegistrant = try container.decode(ContactData?.self, forKey: .contactRegistrant)
    }
    if container.contains(.contactTech) {
        self.contactTech = try container.decode(ContactData?.self, forKey: .contactTech)
    }
    if container.contains(.registrationStatus) {
        self.registrationStatus = try container.decode(DomainStatusEnum?.self, forKey: .registrationStatus)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.nameServers) {
        self.nameServers = try container.decode([String]?.self, forKey: .nameServers)
    }
    if container.contains(.privacy) {
        self.privacy = try container.decode(Bool?.self, forKey: .privacy)
    }
    if container.contains(.createdTime) {
        self.createdTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdTime)), format: .dateTime)
    }
    if container.contains(.expirationTime) {
        self.expirationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .expirationTime)), format: .dateTime)
    }
    if container.contains(.lastRenewedTime) {
        self.lastRenewedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRenewedTime)), format: .dateTime)
    }
    if container.contains(.autoRenew) {
        self.autoRenew = try container.decode(Bool?.self, forKey: .autoRenew)
    }
    if container.contains(.readyForDnsRecordManagement) {
        self.readyForDnsRecordManagement = try container.decode(Bool?.self, forKey: .readyForDnsRecordManagement)
    }
    if container.contains(.managedHostNames) {
        self.managedHostNames = try container.decode([HostNameData?]?.self, forKey: .managedHostNames)
    }
    if container.contains(.consent) {
        self.consent = try container.decode(DomainPurchaseConsentData?.self, forKey: .consent)
    }
    if container.contains(.domainNotRenewableReasons) {
        self.domainNotRenewableReasons = try container.decode([String?]?.self, forKey: .domainNotRenewableReasons)
    }
    if container.contains(.dnsType) {
        self.dnsType = try container.decode(DnsTypeEnum?.self, forKey: .dnsType)
    }
    if container.contains(.dnsZoneId) {
        self.dnsZoneId = try container.decode(String?.self, forKey: .dnsZoneId)
    }
    if container.contains(.targetDnsType) {
        self.targetDnsType = try container.decode(DnsTypeEnum?.self, forKey: .targetDnsType)
    }
    if container.contains(.authCode) {
        self.authCode = try container.decode(String?.self, forKey: .authCode)
    }
    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.contactAdmin != nil {try container.encode(self.contactAdmin as! ContactData?, forKey: .contactAdmin)}
    if self.contactBilling != nil {try container.encode(self.contactBilling as! ContactData?, forKey: .contactBilling)}
    if self.contactRegistrant != nil {try container.encode(self.contactRegistrant as! ContactData?, forKey: .contactRegistrant)}
    if self.contactTech != nil {try container.encode(self.contactTech as! ContactData?, forKey: .contactTech)}
    if self.registrationStatus != nil {try container.encode(self.registrationStatus, forKey: .registrationStatus)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.nameServers != nil {try container.encode(self.nameServers as! [String]?, forKey: .nameServers)}
    if self.privacy != nil {try container.encode(self.privacy, forKey: .privacy)}
    if self.createdTime != nil {
        try container.encode(DateConverter.toString(date: self.createdTime!, format: .dateTime), forKey: .createdTime)
    }
    if self.expirationTime != nil {
        try container.encode(DateConverter.toString(date: self.expirationTime!, format: .dateTime), forKey: .expirationTime)
    }
    if self.lastRenewedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRenewedTime!, format: .dateTime), forKey: .lastRenewedTime)
    }
    if self.autoRenew != nil {try container.encode(self.autoRenew, forKey: .autoRenew)}
    if self.readyForDnsRecordManagement != nil {try container.encode(self.readyForDnsRecordManagement, forKey: .readyForDnsRecordManagement)}
    if self.managedHostNames != nil {try container.encode(self.managedHostNames as! [HostNameData?]?, forKey: .managedHostNames)}
    if self.consent != nil {try container.encode(self.consent as! DomainPurchaseConsentData?, forKey: .consent)}
    if self.domainNotRenewableReasons != nil {try container.encode(self.domainNotRenewableReasons as! [String?]?, forKey: .domainNotRenewableReasons)}
    if self.dnsType != nil {try container.encode(self.dnsType, forKey: .dnsType)}
    if self.dnsZoneId != nil {try container.encode(self.dnsZoneId, forKey: .dnsZoneId)}
    if self.targetDnsType != nil {try container.encode(self.targetDnsType, forKey: .targetDnsType)}
    if self.authCode != nil {try container.encode(self.authCode, forKey: .authCode)}
  }
}

extension DataFactory {
  public static func createDomainPatchResourcePropertiesProtocol() -> DomainPatchResourcePropertiesProtocol {
    return DomainPatchResourcePropertiesData()
  }
}