// Copyright (c) Microsoft Corporation. All rights 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 CurrentScenarioDetailsData : CurrentScenarioDetailsProtocol {
    public var scenarioName: String?
    public var jobId: String?
    public var startTime: Date?

        enum CodingKeys: String, CodingKey {case scenarioName = "scenarioName"
        case jobId = "jobId"
        case startTime = "startTime"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.scenarioName != nil {try container.encode(self.scenarioName, forKey: .scenarioName)}
    if self.jobId != nil {try container.encode(self.jobId, forKey: .jobId)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
  }
}

extension DataFactory {
  public static func createCurrentScenarioDetailsProtocol() -> CurrentScenarioDetailsProtocol {
    return CurrentScenarioDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DataStoreData : DataStoreProtocol {
    public var symbolicName: String?
    public var uuid: String?
    public var capacity: String?
    public var freeSpace: String?
    public var type: String?

        enum CodingKeys: String, CodingKey {case symbolicName = "symbolicName"
        case uuid = "uuid"
        case capacity = "capacity"
        case freeSpace = "freeSpace"
        case type = "type"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDataStoreProtocol() -> DataStoreProtocol {
    return DataStoreData()
  }
}


// DataSyncStatus enumerates the values for data sync status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum DataSyncStatusEnum: String, Codable
{
// ForDownTime specifies the for down time state for data sync status.
    case ForDownTime = "ForDownTime"
// ForSynchronization specifies the for synchronization state for data sync status.
    case ForSynchronization = "ForSynchronization"
}


// Copyright (c) Microsoft Corporation. All rights 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 DisableProtectionInputData : DisableProtectionInputProtocol {
    public var properties: DisableProtectionInputPropertiesProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDisableProtectionInputProtocol() -> DisableProtectionInputProtocol {
    return DisableProtectionInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DisableProtectionInputPropertiesData : DisableProtectionInputPropertiesProtocol {
    public var disableProtectionReason: DisableProtectionReasonEnum?
    public var replicationProviderInput: DisableProtectionProviderSpecificInputProtocol?

        enum CodingKeys: String, CodingKey {case disableProtectionReason = "disableProtectionReason"
        case replicationProviderInput = "replicationProviderInput"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDisableProtectionInputPropertiesProtocol() -> DisableProtectionInputPropertiesProtocol {
    return DisableProtectionInputPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DisableProtectionProviderSpecificInputData : DisableProtectionProviderSpecificInputProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
  }
}

extension DataFactory {
  public static func createDisableProtectionProviderSpecificInputProtocol() -> DisableProtectionProviderSpecificInputProtocol {
    return DisableProtectionProviderSpecificInputData()
  }
}


// DisableProtectionReason enumerates the values for disable protection reason.

// Copyright (c) Microsoft Corporation. All rights 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 DisableProtectionReasonEnum: String, Codable
{
// MigrationComplete specifies the migration complete state for disable protection reason.
    case MigrationComplete = "MigrationComplete"
// NotSpecified specifies the not specified state for disable protection reason.
    case NotSpecified = "NotSpecified"
}


// Copyright (c) Microsoft Corporation. All rights 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 DiscoverProtectableItemRequestData : DiscoverProtectableItemRequestProtocol {
    public var properties: DiscoverProtectableItemRequestPropertiesProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDiscoverProtectableItemRequestProtocol() -> DiscoverProtectableItemRequestProtocol {
    return DiscoverProtectableItemRequestData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiscoverProtectableItemRequestPropertiesData : DiscoverProtectableItemRequestPropertiesProtocol {
    public var friendlyName: String?
    public var ipAddress: String?
    public var osType: String?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case ipAddress = "ipAddress"
        case osType = "osType"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDiscoverProtectableItemRequestPropertiesProtocol() -> DiscoverProtectableItemRequestPropertiesProtocol {
    return DiscoverProtectableItemRequestPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiskDetailsData : DiskDetailsProtocol {
    public var maxSizeMB: Int64?
    public var vhdType: String?
    public var vhdId: String?
    public var vhdName: String?

        enum CodingKeys: String, CodingKey {case maxSizeMB = "maxSizeMB"
        case vhdType = "vhdType"
        case vhdId = "vhdId"
        case vhdName = "vhdName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDiskDetailsProtocol() -> DiskDetailsProtocol {
    return DiskDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiskVolumeDetailsData : DiskVolumeDetailsProtocol {
    public var label: String?
    public var name: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDiskVolumeDetailsProtocol() -> DiskVolumeDetailsProtocol {
    return DiskVolumeDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DisplayData : DisplayProtocol {
    public var provider: String?
    public var resource: String?
    public var operation: String?
    public var description: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDisplayProtocol() -> DisplayProtocol {
    return DisplayData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EnableProtectionInputData : EnableProtectionInputProtocol {
    public var properties: EnableProtectionInputPropertiesProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createEnableProtectionInputProtocol() -> EnableProtectionInputProtocol {
    return EnableProtectionInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EnableProtectionInputPropertiesData : EnableProtectionInputPropertiesProtocol {
    public var policyId: String?
    public var protectableItemId: String?
    public var providerSpecificDetails: EnableProtectionProviderSpecificInputProtocol?

        enum CodingKeys: String, CodingKey {case policyId = "policyId"
        case protectableItemId = "protectableItemId"
        case providerSpecificDetails = "providerSpecificDetails"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createEnableProtectionInputPropertiesProtocol() -> EnableProtectionInputPropertiesProtocol {
    return EnableProtectionInputPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EnableProtectionProviderSpecificInputData : EnableProtectionProviderSpecificInputProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
  }
}

extension DataFactory {
  public static func createEnableProtectionProviderSpecificInputProtocol() -> EnableProtectionProviderSpecificInputProtocol {
    return EnableProtectionProviderSpecificInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EncryptionDetailsData : EncryptionDetailsProtocol {
    public var kekState: String?
    public var kekCertThumbprint: String?
    public var kekCertExpiryDate: Date?

        enum CodingKeys: String, CodingKey {case kekState = "kekState"
        case kekCertThumbprint = "kekCertThumbprint"
        case kekCertExpiryDate = "kekCertExpiryDate"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.kekState != nil {try container.encode(self.kekState, forKey: .kekState)}
    if self.kekCertThumbprint != nil {try container.encode(self.kekCertThumbprint, forKey: .kekCertThumbprint)}
    if self.kekCertExpiryDate != nil {
        try container.encode(DateConverter.toString(date: self.kekCertExpiryDate!, format: .dateTime), forKey: .kekCertExpiryDate)
    }
  }
}

extension DataFactory {
  public static func createEncryptionDetailsProtocol() -> EncryptionDetailsProtocol {
    return EncryptionDetailsData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createEventCollectionProtocol() -> EventCollectionProtocol {
    return EventCollectionData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EventData : EventProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: EventPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createEventProtocol() -> EventProtocol {
    return EventData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EventPropertiesData : EventPropertiesProtocol {
    public var eventCode: String?
    public var description: String?
    public var eventType: String?
    public var affectedObjectFriendlyName: String?
    public var severity: String?
    public var timeOfOccurrence: Date?
    public var fabricId: String?
    public var providerSpecificDetails: EventProviderSpecificDetailsProtocol?
    public var eventSpecificDetails: EventSpecificDetailsProtocol?
    public var healthErrors: [HealthErrorProtocol?]?

        enum CodingKeys: String, CodingKey {case eventCode = "eventCode"
        case description = "description"
        case eventType = "eventType"
        case affectedObjectFriendlyName = "affectedObjectFriendlyName"
        case severity = "severity"
        case timeOfOccurrence = "timeOfOccurrence"
        case fabricId = "fabricId"
        case providerSpecificDetails = "providerSpecificDetails"
        case eventSpecificDetails = "eventSpecificDetails"
        case healthErrors = "healthErrors"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.eventCode) {
        self.eventCode = try container.decode(String?.self, forKey: .eventCode)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.eventType) {
        self.eventType = try container.decode(String?.self, forKey: .eventType)
    }
    if container.contains(.affectedObjectFriendlyName) {
        self.affectedObjectFriendlyName = try container.decode(String?.self, forKey: .affectedObjectFriendlyName)
    }
    if container.contains(.severity) {
        self.severity = try container.decode(String?.self, forKey: .severity)
    }
    if container.contains(.timeOfOccurrence) {
        self.timeOfOccurrence = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .timeOfOccurrence)), format: .dateTime)
    }
    if container.contains(.fabricId) {
        self.fabricId = try container.decode(String?.self, forKey: .fabricId)
    }
    if container.contains(.providerSpecificDetails) {
        self.providerSpecificDetails = try container.decode(EventProviderSpecificDetailsData?.self, forKey: .providerSpecificDetails)
    }
    if container.contains(.eventSpecificDetails) {
        self.eventSpecificDetails = try container.decode(EventSpecificDetailsData?.self, forKey: .eventSpecificDetails)
    }
    if container.contains(.healthErrors) {
        self.healthErrors = try container.decode([HealthErrorData?]?.self, forKey: .healthErrors)
    }
    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.eventCode != nil {try container.encode(self.eventCode, forKey: .eventCode)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.eventType != nil {try container.encode(self.eventType, forKey: .eventType)}
    if self.affectedObjectFriendlyName != nil {try container.encode(self.affectedObjectFriendlyName, forKey: .affectedObjectFriendlyName)}
    if self.severity != nil {try container.encode(self.severity, forKey: .severity)}
    if self.timeOfOccurrence != nil {
        try container.encode(DateConverter.toString(date: self.timeOfOccurrence!, format: .dateTime), forKey: .timeOfOccurrence)
    }
    if self.fabricId != nil {try container.encode(self.fabricId, forKey: .fabricId)}
    if self.providerSpecificDetails != nil {try container.encode(self.providerSpecificDetails as! EventProviderSpecificDetailsData?, forKey: .providerSpecificDetails)}
    if self.eventSpecificDetails != nil {try container.encode(self.eventSpecificDetails as! EventSpecificDetailsData?, forKey: .eventSpecificDetails)}
    if self.healthErrors != nil {try container.encode(self.healthErrors as! [HealthErrorData?]?, forKey: .healthErrors)}
  }
}

extension DataFactory {
  public static func createEventPropertiesProtocol() -> EventPropertiesProtocol {
    return EventPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EventProviderSpecificDetailsData : EventProviderSpecificDetailsProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
  }
}

extension DataFactory {
  public static func createEventProviderSpecificDetailsProtocol() -> EventProviderSpecificDetailsProtocol {
    return EventProviderSpecificDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EventQueryParameterData : EventQueryParameterProtocol {
    public var eventCode: String?
    public var severity: String?
    public var eventType: String?
    public var fabricName: String?
    public var affectedObjectFriendlyName: String?
    public var startTime: Date?
    public var endTime: Date?

        enum CodingKeys: String, CodingKey {case eventCode = "eventCode"
        case severity = "severity"
        case eventType = "eventType"
        case fabricName = "fabricName"
        case affectedObjectFriendlyName = "affectedObjectFriendlyName"
        case startTime = "startTime"
        case endTime = "endTime"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createEventQueryParameterProtocol() -> EventQueryParameterProtocol {
    return EventQueryParameterData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EventSpecificDetailsData : EventSpecificDetailsProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
  }
}

extension DataFactory {
  public static func createEventSpecificDetailsProtocol() -> EventSpecificDetailsProtocol {
    return EventSpecificDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ExportJobDetailsData : ExportJobDetailsProtocol, JobDetailsProtocol {
    public var affectedObjectDetails: [String:String]?
    public var blobUri: String?
    public var sasToken: String?

        enum CodingKeys: String, CodingKey {case affectedObjectDetails = "affectedObjectDetails"
        case blobUri = "blobUri"
        case sasToken = "sasToken"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createExportJobDetailsProtocol() -> ExportJobDetailsProtocol {
    return ExportJobDetailsData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createFabricCollectionProtocol() -> FabricCollectionProtocol {
    return FabricCollectionData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FabricCreationInputData : FabricCreationInputProtocol {
    public var properties: FabricCreationInputPropertiesProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createFabricCreationInputProtocol() -> FabricCreationInputProtocol {
    return FabricCreationInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FabricCreationInputPropertiesData : FabricCreationInputPropertiesProtocol {
    public var customDetails: FabricSpecificCreationInputProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createFabricCreationInputPropertiesProtocol() -> FabricCreationInputPropertiesProtocol {
    return FabricCreationInputPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FabricData : FabricProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: FabricPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createFabricProtocol() -> FabricProtocol {
    return FabricData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FabricPropertiesData : FabricPropertiesProtocol {
    public var friendlyName: String?
    public var encryptionDetails: EncryptionDetailsProtocol?
    public var rolloverEncryptionDetails: EncryptionDetailsProtocol?
    public var internalIdentifier: String?
    public var bcdrState: String?
    public var customDetails: FabricSpecificDetailsProtocol?
    public var healthErrorDetails: [HealthErrorProtocol?]?
    public var health: String?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case encryptionDetails = "encryptionDetails"
        case rolloverEncryptionDetails = "rolloverEncryptionDetails"
        case internalIdentifier = "internalIdentifier"
        case bcdrState = "bcdrState"
        case customDetails = "customDetails"
        case healthErrorDetails = "healthErrorDetails"
        case health = "health"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.encryptionDetails) {
        self.encryptionDetails = try container.decode(EncryptionDetailsData?.self, forKey: .encryptionDetails)
    }
    if container.contains(.rolloverEncryptionDetails) {
        self.rolloverEncryptionDetails = try container.decode(EncryptionDetailsData?.self, forKey: .rolloverEncryptionDetails)
    }
    if container.contains(.internalIdentifier) {
        self.internalIdentifier = try container.decode(String?.self, forKey: .internalIdentifier)
    }
    if container.contains(.bcdrState) {
        self.bcdrState = try container.decode(String?.self, forKey: .bcdrState)
    }
    if container.contains(.customDetails) {
        self.customDetails = try container.decode(FabricSpecificDetailsData?.self, forKey: .customDetails)
    }
    if container.contains(.healthErrorDetails) {
        self.healthErrorDetails = try container.decode([HealthErrorData?]?.self, forKey: .healthErrorDetails)
    }
    if container.contains(.health) {
        self.health = try container.decode(String?.self, forKey: .health)
    }
    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.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.encryptionDetails != nil {try container.encode(self.encryptionDetails as! EncryptionDetailsData?, forKey: .encryptionDetails)}
    if self.rolloverEncryptionDetails != nil {try container.encode(self.rolloverEncryptionDetails as! EncryptionDetailsData?, forKey: .rolloverEncryptionDetails)}
    if self.internalIdentifier != nil {try container.encode(self.internalIdentifier, forKey: .internalIdentifier)}
    if self.bcdrState != nil {try container.encode(self.bcdrState, forKey: .bcdrState)}
    if self.customDetails != nil {try container.encode(self.customDetails as! FabricSpecificDetailsData?, forKey: .customDetails)}
    if self.healthErrorDetails != nil {try container.encode(self.healthErrorDetails as! [HealthErrorData?]?, forKey: .healthErrorDetails)}
    if self.health != nil {try container.encode(self.health, forKey: .health)}
  }
}

extension DataFactory {
  public static func createFabricPropertiesProtocol() -> FabricPropertiesProtocol {
    return FabricPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FabricReplicationGroupTaskDetailsData : FabricReplicationGroupTaskDetailsProtocol, TaskTypeDetailsProtocol {
    public var skippedReason: String?
    public var skippedReasonString: String?
    public var jobTask: JobEntityProtocol?

        enum CodingKeys: String, CodingKey {case skippedReason = "skippedReason"
        case skippedReasonString = "skippedReasonString"
        case jobTask = "jobTask"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createFabricReplicationGroupTaskDetailsProtocol() -> FabricReplicationGroupTaskDetailsProtocol {
    return FabricReplicationGroupTaskDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FabricSpecificCreateNetworkMappingInputData : FabricSpecificCreateNetworkMappingInputProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
  }
}

extension DataFactory {
  public static func createFabricSpecificCreateNetworkMappingInputProtocol() -> FabricSpecificCreateNetworkMappingInputProtocol {
    return FabricSpecificCreateNetworkMappingInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FabricSpecificCreationInputData : FabricSpecificCreationInputProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
  }
}

extension DataFactory {
  public static func createFabricSpecificCreationInputProtocol() -> FabricSpecificCreationInputProtocol {
    return FabricSpecificCreationInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FabricSpecificDetailsData : FabricSpecificDetailsProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
  }
}

extension DataFactory {
  public static func createFabricSpecificDetailsProtocol() -> FabricSpecificDetailsProtocol {
    return FabricSpecificDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FabricSpecificUpdateNetworkMappingInputData : FabricSpecificUpdateNetworkMappingInputProtocol {

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
  }
}

extension DataFactory {
  public static func createFabricSpecificUpdateNetworkMappingInputProtocol() -> FabricSpecificUpdateNetworkMappingInputProtocol {
    return FabricSpecificUpdateNetworkMappingInputData()
  }
}


// FailoverDeploymentModel enumerates the values for failover deployment model.

// Copyright (c) Microsoft Corporation. All rights 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 FailoverDeploymentModelEnum: String, Codable
{
// Classic specifies the classic state for failover deployment model.
    case Classic = "Classic"
// NotApplicable specifies the not applicable state for failover deployment model.
    case NotApplicable = "NotApplicable"
// ResourceManager specifies the resource manager state for failover deployment model.
    case ResourceManager = "ResourceManager"
}


// Copyright (c) Microsoft Corporation. All rights 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 FailoverJobDetailsData : FailoverJobDetailsProtocol, JobDetailsProtocol {
    public var affectedObjectDetails: [String:String]?
    public var protectedItemDetails: [FailoverReplicationProtectedItemDetailsProtocol?]?

        enum CodingKeys: String, CodingKey {case affectedObjectDetails = "affectedObjectDetails"
        case protectedItemDetails = "protectedItemDetails"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createFailoverJobDetailsProtocol() -> FailoverJobDetailsProtocol {
    return FailoverJobDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FailoverProcessServerRequestData : FailoverProcessServerRequestProtocol {
    public var properties: FailoverProcessServerRequestPropertiesProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createFailoverProcessServerRequestProtocol() -> FailoverProcessServerRequestProtocol {
    return FailoverProcessServerRequestData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FailoverProcessServerRequestPropertiesData : FailoverProcessServerRequestPropertiesProtocol {
    public var containerName: String?
    public var sourceProcessServerId: String?
    public var targetProcessServerId: String?
    public var vmsToMigrate: [String]?
    public var updateType: String?

        enum CodingKeys: String, CodingKey {case containerName = "containerName"
        case sourceProcessServerId = "sourceProcessServerId"
        case targetProcessServerId = "targetProcessServerId"
        case vmsToMigrate = "vmsToMigrate"
        case updateType = "updateType"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createFailoverProcessServerRequestPropertiesProtocol() -> FailoverProcessServerRequestPropertiesProtocol {
    return FailoverProcessServerRequestPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FailoverReplicationProtectedItemDetailsData : FailoverReplicationProtectedItemDetailsProtocol {
    public var name: String?
    public var friendlyName: String?
    public var testVmName: String?
    public var testVmFriendlyName: String?
    public var networkConnectionStatus: String?
    public var networkFriendlyName: String?
    public var subnet: String?
    public var recoveryPointId: String?
    public var recoveryPointTime: Date?

        enum CodingKeys: String, CodingKey {case name = "name"
        case friendlyName = "friendlyName"
        case testVmName = "testVmName"
        case testVmFriendlyName = "testVmFriendlyName"
        case networkConnectionStatus = "networkConnectionStatus"
        case networkFriendlyName = "networkFriendlyName"
        case subnet = "subnet"
        case recoveryPointId = "recoveryPointId"
        case recoveryPointTime = "recoveryPointTime"
        }

  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(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.testVmName) {
        self.testVmName = try container.decode(String?.self, forKey: .testVmName)
    }
    if container.contains(.testVmFriendlyName) {
        self.testVmFriendlyName = try container.decode(String?.self, forKey: .testVmFriendlyName)
    }
    if container.contains(.networkConnectionStatus) {
        self.networkConnectionStatus = try container.decode(String?.self, forKey: .networkConnectionStatus)
    }
    if container.contains(.networkFriendlyName) {
        self.networkFriendlyName = try container.decode(String?.self, forKey: .networkFriendlyName)
    }
    if container.contains(.subnet) {
        self.subnet = try container.decode(String?.self, forKey: .subnet)
    }
    if container.contains(.recoveryPointId) {
        self.recoveryPointId = try container.decode(String?.self, forKey: .recoveryPointId)
    }
    if container.contains(.recoveryPointTime) {
        self.recoveryPointTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .recoveryPointTime)), format: .dateTime)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.testVmName != nil {try container.encode(self.testVmName, forKey: .testVmName)}
    if self.testVmFriendlyName != nil {try container.encode(self.testVmFriendlyName, forKey: .testVmFriendlyName)}
    if self.networkConnectionStatus != nil {try container.encode(self.networkConnectionStatus, forKey: .networkConnectionStatus)}
    if self.networkFriendlyName != nil {try container.encode(self.networkFriendlyName, forKey: .networkFriendlyName)}
    if self.subnet != nil {try container.encode(self.subnet, forKey: .subnet)}
    if self.recoveryPointId != nil {try container.encode(self.recoveryPointId, forKey: .recoveryPointId)}
    if self.recoveryPointTime != nil {
        try container.encode(DateConverter.toString(date: self.recoveryPointTime!, format: .dateTime), forKey: .recoveryPointTime)
    }
  }
}

extension DataFactory {
  public static func createFailoverReplicationProtectedItemDetailsProtocol() -> FailoverReplicationProtectedItemDetailsProtocol {
    return FailoverReplicationProtectedItemDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 GroupTaskDetailsData : GroupTaskDetailsProtocol {
    public var childTasks: [ASRTaskProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createGroupTaskDetailsProtocol() -> GroupTaskDetailsProtocol {
    return GroupTaskDetailsData()
  }
}


// HealthErrorCategory enumerates the values for health error category.

// Copyright (c) Microsoft Corporation. All rights 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 HealthErrorCategoryEnum: String, Codable
{
// Configuration specifies the configuration state for health error category.
    case Configuration = "Configuration"
// FabricInfrastructure specifies the fabric infrastructure state for health error category.
    case FabricInfrastructure = "FabricInfrastructure"
// None specifies the none state for health error category.
    case None = "None"
// Replication specifies the replication state for health error category.
    case Replication = "Replication"
// TestFailover specifies the test failover state for health error category.
    case TestFailover = "TestFailover"
// VersionExpiry specifies the version expiry state for health error category.
    case VersionExpiry = "VersionExpiry"
}


// Copyright (c) Microsoft Corporation. All rights 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 HealthErrorData : HealthErrorProtocol {
    public var innerHealthErrors: [InnerHealthErrorProtocol?]?
    public var errorSource: String?
    public var errorType: String?
    public var errorLevel: String?
    public var errorCategory: String?
    public var errorCode: String?
    public var summaryMessage: String?
    public var errorMessage: String?
    public var possibleCauses: String?
    public var recommendedAction: String?
    public var creationTimeUtc: Date?
    public var recoveryProviderErrorMessage: String?
    public var entityId: String?

        enum CodingKeys: String, CodingKey {case innerHealthErrors = "innerHealthErrors"
        case errorSource = "errorSource"
        case errorType = "errorType"
        case errorLevel = "errorLevel"
        case errorCategory = "errorCategory"
        case errorCode = "errorCode"
        case summaryMessage = "summaryMessage"
        case errorMessage = "errorMessage"
        case possibleCauses = "possibleCauses"
        case recommendedAction = "recommendedAction"
        case creationTimeUtc = "creationTimeUtc"
        case recoveryProviderErrorMessage = "recoveryProviderErrorMessage"
        case entityId = "entityId"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.innerHealthErrors) {
        self.innerHealthErrors = try container.decode([InnerHealthErrorData?]?.self, forKey: .innerHealthErrors)
    }
    if container.contains(.errorSource) {
        self.errorSource = try container.decode(String?.self, forKey: .errorSource)
    }
    if container.contains(.errorType) {
        self.errorType = try container.decode(String?.self, forKey: .errorType)
    }
    if container.contains(.errorLevel) {
        self.errorLevel = try container.decode(String?.self, forKey: .errorLevel)
    }
    if container.contains(.errorCategory) {
        self.errorCategory = try container.decode(String?.self, forKey: .errorCategory)
    }
    if container.contains(.errorCode) {
        self.errorCode = try container.decode(String?.self, forKey: .errorCode)
    }
    if container.contains(.summaryMessage) {
        self.summaryMessage = try container.decode(String?.self, forKey: .summaryMessage)
    }
    if container.contains(.errorMessage) {
        self.errorMessage = try container.decode(String?.self, forKey: .errorMessage)
    }
    if container.contains(.possibleCauses) {
        self.possibleCauses = try container.decode(String?.self, forKey: .possibleCauses)
    }
    if container.contains(.recommendedAction) {
        self.recommendedAction = try container.decode(String?.self, forKey: .recommendedAction)
    }
    if container.contains(.creationTimeUtc) {
        self.creationTimeUtc = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTimeUtc)), format: .dateTime)
    }
    if container.contains(.recoveryProviderErrorMessage) {
        self.recoveryProviderErrorMessage = try container.decode(String?.self, forKey: .recoveryProviderErrorMessage)
    }
    if container.contains(.entityId) {
        self.entityId = try container.decode(String?.self, forKey: .entityId)
    }
    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.innerHealthErrors != nil {try container.encode(self.innerHealthErrors as! [InnerHealthErrorData?]?, forKey: .innerHealthErrors)}
    if self.errorSource != nil {try container.encode(self.errorSource, forKey: .errorSource)}
    if self.errorType != nil {try container.encode(self.errorType, forKey: .errorType)}
    if self.errorLevel != nil {try container.encode(self.errorLevel, forKey: .errorLevel)}
    if self.errorCategory != nil {try container.encode(self.errorCategory, forKey: .errorCategory)}
    if self.errorCode != nil {try container.encode(self.errorCode, forKey: .errorCode)}
    if self.summaryMessage != nil {try container.encode(self.summaryMessage, forKey: .summaryMessage)}
    if self.errorMessage != nil {try container.encode(self.errorMessage, forKey: .errorMessage)}
    if self.possibleCauses != nil {try container.encode(self.possibleCauses, forKey: .possibleCauses)}
    if self.recommendedAction != nil {try container.encode(self.recommendedAction, forKey: .recommendedAction)}
    if self.creationTimeUtc != nil {
        try container.encode(DateConverter.toString(date: self.creationTimeUtc!, format: .dateTime), forKey: .creationTimeUtc)
    }
    if self.recoveryProviderErrorMessage != nil {try container.encode(self.recoveryProviderErrorMessage, forKey: .recoveryProviderErrorMessage)}
    if self.entityId != nil {try container.encode(self.entityId, forKey: .entityId)}
  }
}

extension DataFactory {
  public static func createHealthErrorProtocol() -> HealthErrorProtocol {
    return HealthErrorData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HealthErrorSummaryData : HealthErrorSummaryProtocol {
    public var summaryCode: String?
    public var category: HealthErrorCategoryEnum?
    public var severity: SeverityEnum?
    public var summaryMessage: String?
    public var affectedResourceType: String?
    public var affectedResourceSubtype: String?
    public var affectedResourceCorrelationIds: [String]?

        enum CodingKeys: String, CodingKey {case summaryCode = "summaryCode"
        case category = "category"
        case severity = "severity"
        case summaryMessage = "summaryMessage"
        case affectedResourceType = "affectedResourceType"
        case affectedResourceSubtype = "affectedResourceSubtype"
        case affectedResourceCorrelationIds = "affectedResourceCorrelationIds"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHealthErrorSummaryProtocol() -> HealthErrorSummaryProtocol {
    return HealthErrorSummaryData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplica2012EventDetailsData : HyperVReplica2012EventDetailsProtocol, EventProviderSpecificDetailsProtocol {
    public var containerName: String?
    public var fabricName: String?
    public var remoteContainerName: String?
    public var remoteFabricName: String?

        enum CodingKeys: String, CodingKey {case containerName = "containerName"
        case fabricName = "fabricName"
        case remoteContainerName = "remoteContainerName"
        case remoteFabricName = "remoteFabricName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHyperVReplica2012EventDetailsProtocol() -> HyperVReplica2012EventDetailsProtocol {
    return HyperVReplica2012EventDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplica2012R2EventDetailsData : HyperVReplica2012R2EventDetailsProtocol, EventProviderSpecificDetailsProtocol {
    public var containerName: String?
    public var fabricName: String?
    public var remoteContainerName: String?
    public var remoteFabricName: String?

        enum CodingKeys: String, CodingKey {case containerName = "containerName"
        case fabricName = "fabricName"
        case remoteContainerName = "remoteContainerName"
        case remoteFabricName = "remoteFabricName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHyperVReplica2012R2EventDetailsProtocol() -> HyperVReplica2012R2EventDetailsProtocol {
    return HyperVReplica2012R2EventDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaAzureApplyRecoveryPointInputData : HyperVReplicaAzureApplyRecoveryPointInputProtocol, ApplyRecoveryPointProviderSpecificInputProtocol {
    public var vaultLocation: String?
    public var primaryKekCertificatePfx: String?
    public var secondaryKekCertificatePfx: String?

        enum CodingKeys: String, CodingKey {case vaultLocation = "vaultLocation"
        case primaryKekCertificatePfx = "primaryKekCertificatePfx"
        case secondaryKekCertificatePfx = "secondaryKekCertificatePfx"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHyperVReplicaAzureApplyRecoveryPointInputProtocol() -> HyperVReplicaAzureApplyRecoveryPointInputProtocol {
    return HyperVReplicaAzureApplyRecoveryPointInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaAzureEnableProtectionInputData : HyperVReplicaAzureEnableProtectionInputProtocol, EnableProtectionProviderSpecificInputProtocol {
    public var hvHostVmId: String?
    public var vmName: String?
    public var osType: String?
    public var vhdId: String?
    public var targetStorageAccountId: String?
    public var targetAzureNetworkId: String?
    public var targetAzureSubnetId: String?
    public var enableRdpOnTargetOption: String?
    public var targetAzureVmName: String?
    public var logStorageAccountId: String?
    public var disksToInclude: [String]?
    public var targetAzureV1ResourceGroupId: String?
    public var targetAzureV2ResourceGroupId: String?
    public var useManagedDisks: String?

        enum CodingKeys: String, CodingKey {case hvHostVmId = "hvHostVmId"
        case vmName = "vmName"
        case osType = "osType"
        case vhdId = "vhdId"
        case targetStorageAccountId = "targetStorageAccountId"
        case targetAzureNetworkId = "targetAzureNetworkId"
        case targetAzureSubnetId = "targetAzureSubnetId"
        case enableRdpOnTargetOption = "enableRdpOnTargetOption"
        case targetAzureVmName = "targetAzureVmName"
        case logStorageAccountId = "logStorageAccountId"
        case disksToInclude = "disksToInclude"
        case targetAzureV1ResourceGroupId = "targetAzureV1ResourceGroupId"
        case targetAzureV2ResourceGroupId = "targetAzureV2ResourceGroupId"
        case useManagedDisks = "useManagedDisks"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.hvHostVmId) {
        self.hvHostVmId = try container.decode(String?.self, forKey: .hvHostVmId)
    }
    if container.contains(.vmName) {
        self.vmName = try container.decode(String?.self, forKey: .vmName)
    }
    if container.contains(.osType) {
        self.osType = try container.decode(String?.self, forKey: .osType)
    }
    if container.contains(.vhdId) {
        self.vhdId = try container.decode(String?.self, forKey: .vhdId)
    }
    if container.contains(.targetStorageAccountId) {
        self.targetStorageAccountId = try container.decode(String?.self, forKey: .targetStorageAccountId)
    }
    if container.contains(.targetAzureNetworkId) {
        self.targetAzureNetworkId = try container.decode(String?.self, forKey: .targetAzureNetworkId)
    }
    if container.contains(.targetAzureSubnetId) {
        self.targetAzureSubnetId = try container.decode(String?.self, forKey: .targetAzureSubnetId)
    }
    if container.contains(.enableRdpOnTargetOption) {
        self.enableRdpOnTargetOption = try container.decode(String?.self, forKey: .enableRdpOnTargetOption)
    }
    if container.contains(.targetAzureVmName) {
        self.targetAzureVmName = try container.decode(String?.self, forKey: .targetAzureVmName)
    }
    if container.contains(.logStorageAccountId) {
        self.logStorageAccountId = try container.decode(String?.self, forKey: .logStorageAccountId)
    }
    if container.contains(.disksToInclude) {
        self.disksToInclude = try container.decode([String]?.self, forKey: .disksToInclude)
    }
    if container.contains(.targetAzureV1ResourceGroupId) {
        self.targetAzureV1ResourceGroupId = try container.decode(String?.self, forKey: .targetAzureV1ResourceGroupId)
    }
    if container.contains(.targetAzureV2ResourceGroupId) {
        self.targetAzureV2ResourceGroupId = try container.decode(String?.self, forKey: .targetAzureV2ResourceGroupId)
    }
    if container.contains(.useManagedDisks) {
        self.useManagedDisks = try container.decode(String?.self, forKey: .useManagedDisks)
    }
    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.hvHostVmId != nil {try container.encode(self.hvHostVmId, forKey: .hvHostVmId)}
    if self.vmName != nil {try container.encode(self.vmName, forKey: .vmName)}
    if self.osType != nil {try container.encode(self.osType, forKey: .osType)}
    if self.vhdId != nil {try container.encode(self.vhdId, forKey: .vhdId)}
    if self.targetStorageAccountId != nil {try container.encode(self.targetStorageAccountId, forKey: .targetStorageAccountId)}
    if self.targetAzureNetworkId != nil {try container.encode(self.targetAzureNetworkId, forKey: .targetAzureNetworkId)}
    if self.targetAzureSubnetId != nil {try container.encode(self.targetAzureSubnetId, forKey: .targetAzureSubnetId)}
    if self.enableRdpOnTargetOption != nil {try container.encode(self.enableRdpOnTargetOption, forKey: .enableRdpOnTargetOption)}
    if self.targetAzureVmName != nil {try container.encode(self.targetAzureVmName, forKey: .targetAzureVmName)}
    if self.logStorageAccountId != nil {try container.encode(self.logStorageAccountId, forKey: .logStorageAccountId)}
    if self.disksToInclude != nil {try container.encode(self.disksToInclude as! [String]?, forKey: .disksToInclude)}
    if self.targetAzureV1ResourceGroupId != nil {try container.encode(self.targetAzureV1ResourceGroupId, forKey: .targetAzureV1ResourceGroupId)}
    if self.targetAzureV2ResourceGroupId != nil {try container.encode(self.targetAzureV2ResourceGroupId, forKey: .targetAzureV2ResourceGroupId)}
    if self.useManagedDisks != nil {try container.encode(self.useManagedDisks, forKey: .useManagedDisks)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaAzureEnableProtectionInputProtocol() -> HyperVReplicaAzureEnableProtectionInputProtocol {
    return HyperVReplicaAzureEnableProtectionInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaAzureEventDetailsData : HyperVReplicaAzureEventDetailsProtocol, EventProviderSpecificDetailsProtocol {
    public var containerName: String?
    public var fabricName: String?
    public var remoteContainerName: String?

        enum CodingKeys: String, CodingKey {case containerName = "containerName"
        case fabricName = "fabricName"
        case remoteContainerName = "remoteContainerName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHyperVReplicaAzureEventDetailsProtocol() -> HyperVReplicaAzureEventDetailsProtocol {
    return HyperVReplicaAzureEventDetailsData()
  }
}