// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaAzureFailbackProviderInputData : HyperVReplicaAzureFailbackProviderInputProtocol, ProviderSpecificFailoverInputProtocol {
    public var dataSyncOption: String?
    public var recoveryVmCreationOption: String?
    public var providerIdForAlternateRecovery: String?

        enum CodingKeys: String, CodingKey {case dataSyncOption = "dataSyncOption"
        case recoveryVmCreationOption = "recoveryVmCreationOption"
        case providerIdForAlternateRecovery = "providerIdForAlternateRecovery"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHyperVReplicaAzureFailbackProviderInputProtocol() -> HyperVReplicaAzureFailbackProviderInputProtocol {
    return HyperVReplicaAzureFailbackProviderInputData()
  }
}


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

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

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

extension DataFactory {
  public static func createHyperVReplicaAzureFailoverProviderInputProtocol() -> HyperVReplicaAzureFailoverProviderInputProtocol {
    return HyperVReplicaAzureFailoverProviderInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaAzurePolicyDetailsData : HyperVReplicaAzurePolicyDetailsProtocol, PolicyProviderSpecificDetailsProtocol {
    public var recoveryPointHistoryDurationInHours: Int32?
    public var applicationConsistentSnapshotFrequencyInHours: Int32?
    public var replicationInterval: Int32?
    public var onlineReplicationStartTime: String?
    public var encryption: String?
    public var activeStorageAccountId: String?

        enum CodingKeys: String, CodingKey {case recoveryPointHistoryDurationInHours = "recoveryPointHistoryDurationInHours"
        case applicationConsistentSnapshotFrequencyInHours = "applicationConsistentSnapshotFrequencyInHours"
        case replicationInterval = "replicationInterval"
        case onlineReplicationStartTime = "onlineReplicationStartTime"
        case encryption = "encryption"
        case activeStorageAccountId = "activeStorageAccountId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHyperVReplicaAzurePolicyDetailsProtocol() -> HyperVReplicaAzurePolicyDetailsProtocol {
    return HyperVReplicaAzurePolicyDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaAzurePolicyInputData : HyperVReplicaAzurePolicyInputProtocol, PolicyProviderSpecificInputProtocol {
    public var recoveryPointHistoryDuration: Int32?
    public var applicationConsistentSnapshotFrequencyInHours: Int32?
    public var replicationInterval: Int32?
    public var onlineReplicationStartTime: String?
    public var storageAccounts: [String]?

        enum CodingKeys: String, CodingKey {case recoveryPointHistoryDuration = "recoveryPointHistoryDuration"
        case applicationConsistentSnapshotFrequencyInHours = "applicationConsistentSnapshotFrequencyInHours"
        case replicationInterval = "replicationInterval"
        case onlineReplicationStartTime = "onlineReplicationStartTime"
        case storageAccounts = "storageAccounts"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHyperVReplicaAzurePolicyInputProtocol() -> HyperVReplicaAzurePolicyInputProtocol {
    return HyperVReplicaAzurePolicyInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaAzureReplicationDetailsData : HyperVReplicaAzureReplicationDetailsProtocol, ReplicationProviderSpecificSettingsProtocol {
    public var azureVmDiskDetails: [AzureVmDiskDetailsProtocol?]?
    public var recoveryAzureVmName: String?
    public var recoveryAzureVMSize: String?
    public var recoveryAzureStorageAccount: String?
    public var recoveryAzureLogStorageAccountId: String?
    public var lastReplicatedTime: Date?
    public var rpoInSeconds: Int64?
    public var lastRpoCalculatedTime: Date?
    public var vmId: String?
    public var vmProtectionState: String?
    public var vmProtectionStateDescription: String?
    public var initialReplicationDetails: InitialReplicationDetailsProtocol?
    public var vmNics: [VMNicDetailsProtocol?]?
    public var selectedRecoveryAzureNetworkId: String?
    public var selectedSourceNicId: String?
    public var encryption: String?
    public var oSDetails: OSDetailsProtocol?
    public var sourceVmRamSizeInMB: Int32?
    public var sourceVmCpuCount: Int32?
    public var enableRdpOnTargetOption: String?
    public var recoveryAzureResourceGroupId: String?
    public var recoveryAvailabilitySetId: String?
    public var useManagedDisks: String?
    public var licenseType: String?

        enum CodingKeys: String, CodingKey {case azureVmDiskDetails = "azureVmDiskDetails"
        case recoveryAzureVmName = "recoveryAzureVmName"
        case recoveryAzureVMSize = "recoveryAzureVMSize"
        case recoveryAzureStorageAccount = "recoveryAzureStorageAccount"
        case recoveryAzureLogStorageAccountId = "recoveryAzureLogStorageAccountId"
        case lastReplicatedTime = "lastReplicatedTime"
        case rpoInSeconds = "rpoInSeconds"
        case lastRpoCalculatedTime = "lastRpoCalculatedTime"
        case vmId = "vmId"
        case vmProtectionState = "vmProtectionState"
        case vmProtectionStateDescription = "vmProtectionStateDescription"
        case initialReplicationDetails = "initialReplicationDetails"
        case vmNics = "vmNics"
        case selectedRecoveryAzureNetworkId = "selectedRecoveryAzureNetworkId"
        case selectedSourceNicId = "selectedSourceNicId"
        case encryption = "encryption"
        case oSDetails = "oSDetails"
        case sourceVmRamSizeInMB = "sourceVmRamSizeInMB"
        case sourceVmCpuCount = "sourceVmCpuCount"
        case enableRdpOnTargetOption = "enableRdpOnTargetOption"
        case recoveryAzureResourceGroupId = "recoveryAzureResourceGroupId"
        case recoveryAvailabilitySetId = "recoveryAvailabilitySetId"
        case useManagedDisks = "useManagedDisks"
        case licenseType = "licenseType"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.azureVmDiskDetails) {
        self.azureVmDiskDetails = try container.decode([AzureVmDiskDetailsData?]?.self, forKey: .azureVmDiskDetails)
    }
    if container.contains(.recoveryAzureVmName) {
        self.recoveryAzureVmName = try container.decode(String?.self, forKey: .recoveryAzureVmName)
    }
    if container.contains(.recoveryAzureVMSize) {
        self.recoveryAzureVMSize = try container.decode(String?.self, forKey: .recoveryAzureVMSize)
    }
    if container.contains(.recoveryAzureStorageAccount) {
        self.recoveryAzureStorageAccount = try container.decode(String?.self, forKey: .recoveryAzureStorageAccount)
    }
    if container.contains(.recoveryAzureLogStorageAccountId) {
        self.recoveryAzureLogStorageAccountId = try container.decode(String?.self, forKey: .recoveryAzureLogStorageAccountId)
    }
    if container.contains(.lastReplicatedTime) {
        self.lastReplicatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastReplicatedTime)), format: .dateTime)
    }
    if container.contains(.rpoInSeconds) {
        self.rpoInSeconds = try container.decode(Int64?.self, forKey: .rpoInSeconds)
    }
    if container.contains(.lastRpoCalculatedTime) {
        self.lastRpoCalculatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRpoCalculatedTime)), format: .dateTime)
    }
    if container.contains(.vmId) {
        self.vmId = try container.decode(String?.self, forKey: .vmId)
    }
    if container.contains(.vmProtectionState) {
        self.vmProtectionState = try container.decode(String?.self, forKey: .vmProtectionState)
    }
    if container.contains(.vmProtectionStateDescription) {
        self.vmProtectionStateDescription = try container.decode(String?.self, forKey: .vmProtectionStateDescription)
    }
    if container.contains(.initialReplicationDetails) {
        self.initialReplicationDetails = try container.decode(InitialReplicationDetailsData?.self, forKey: .initialReplicationDetails)
    }
    if container.contains(.vmNics) {
        self.vmNics = try container.decode([VMNicDetailsData?]?.self, forKey: .vmNics)
    }
    if container.contains(.selectedRecoveryAzureNetworkId) {
        self.selectedRecoveryAzureNetworkId = try container.decode(String?.self, forKey: .selectedRecoveryAzureNetworkId)
    }
    if container.contains(.selectedSourceNicId) {
        self.selectedSourceNicId = try container.decode(String?.self, forKey: .selectedSourceNicId)
    }
    if container.contains(.encryption) {
        self.encryption = try container.decode(String?.self, forKey: .encryption)
    }
    if container.contains(.oSDetails) {
        self.oSDetails = try container.decode(OSDetailsData?.self, forKey: .oSDetails)
    }
    if container.contains(.sourceVmRamSizeInMB) {
        self.sourceVmRamSizeInMB = try container.decode(Int32?.self, forKey: .sourceVmRamSizeInMB)
    }
    if container.contains(.sourceVmCpuCount) {
        self.sourceVmCpuCount = try container.decode(Int32?.self, forKey: .sourceVmCpuCount)
    }
    if container.contains(.enableRdpOnTargetOption) {
        self.enableRdpOnTargetOption = try container.decode(String?.self, forKey: .enableRdpOnTargetOption)
    }
    if container.contains(.recoveryAzureResourceGroupId) {
        self.recoveryAzureResourceGroupId = try container.decode(String?.self, forKey: .recoveryAzureResourceGroupId)
    }
    if container.contains(.recoveryAvailabilitySetId) {
        self.recoveryAvailabilitySetId = try container.decode(String?.self, forKey: .recoveryAvailabilitySetId)
    }
    if container.contains(.useManagedDisks) {
        self.useManagedDisks = try container.decode(String?.self, forKey: .useManagedDisks)
    }
    if container.contains(.licenseType) {
        self.licenseType = try container.decode(String?.self, forKey: .licenseType)
    }
    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.azureVmDiskDetails != nil {try container.encode(self.azureVmDiskDetails as! [AzureVmDiskDetailsData?]?, forKey: .azureVmDiskDetails)}
    if self.recoveryAzureVmName != nil {try container.encode(self.recoveryAzureVmName, forKey: .recoveryAzureVmName)}
    if self.recoveryAzureVMSize != nil {try container.encode(self.recoveryAzureVMSize, forKey: .recoveryAzureVMSize)}
    if self.recoveryAzureStorageAccount != nil {try container.encode(self.recoveryAzureStorageAccount, forKey: .recoveryAzureStorageAccount)}
    if self.recoveryAzureLogStorageAccountId != nil {try container.encode(self.recoveryAzureLogStorageAccountId, forKey: .recoveryAzureLogStorageAccountId)}
    if self.lastReplicatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastReplicatedTime!, format: .dateTime), forKey: .lastReplicatedTime)
    }
    if self.rpoInSeconds != nil {try container.encode(self.rpoInSeconds, forKey: .rpoInSeconds)}
    if self.lastRpoCalculatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRpoCalculatedTime!, format: .dateTime), forKey: .lastRpoCalculatedTime)
    }
    if self.vmId != nil {try container.encode(self.vmId, forKey: .vmId)}
    if self.vmProtectionState != nil {try container.encode(self.vmProtectionState, forKey: .vmProtectionState)}
    if self.vmProtectionStateDescription != nil {try container.encode(self.vmProtectionStateDescription, forKey: .vmProtectionStateDescription)}
    if self.initialReplicationDetails != nil {try container.encode(self.initialReplicationDetails as! InitialReplicationDetailsData?, forKey: .initialReplicationDetails)}
    if self.vmNics != nil {try container.encode(self.vmNics as! [VMNicDetailsData?]?, forKey: .vmNics)}
    if self.selectedRecoveryAzureNetworkId != nil {try container.encode(self.selectedRecoveryAzureNetworkId, forKey: .selectedRecoveryAzureNetworkId)}
    if self.selectedSourceNicId != nil {try container.encode(self.selectedSourceNicId, forKey: .selectedSourceNicId)}
    if self.encryption != nil {try container.encode(self.encryption, forKey: .encryption)}
    if self.oSDetails != nil {try container.encode(self.oSDetails as! OSDetailsData?, forKey: .oSDetails)}
    if self.sourceVmRamSizeInMB != nil {try container.encode(self.sourceVmRamSizeInMB, forKey: .sourceVmRamSizeInMB)}
    if self.sourceVmCpuCount != nil {try container.encode(self.sourceVmCpuCount, forKey: .sourceVmCpuCount)}
    if self.enableRdpOnTargetOption != nil {try container.encode(self.enableRdpOnTargetOption, forKey: .enableRdpOnTargetOption)}
    if self.recoveryAzureResourceGroupId != nil {try container.encode(self.recoveryAzureResourceGroupId, forKey: .recoveryAzureResourceGroupId)}
    if self.recoveryAvailabilitySetId != nil {try container.encode(self.recoveryAvailabilitySetId, forKey: .recoveryAvailabilitySetId)}
    if self.useManagedDisks != nil {try container.encode(self.useManagedDisks, forKey: .useManagedDisks)}
    if self.licenseType != nil {try container.encode(self.licenseType, forKey: .licenseType)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaAzureReplicationDetailsProtocol() -> HyperVReplicaAzureReplicationDetailsProtocol {
    return HyperVReplicaAzureReplicationDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaAzureReprotectInputData : HyperVReplicaAzureReprotectInputProtocol, ReverseReplicationProviderSpecificInputProtocol {
    public var hvHostVmId: String?
    public var vmName: String?
    public var osType: String?
    public var vHDId: String?
    public var storageAccountId: String?
    public var logStorageAccountId: String?

        enum CodingKeys: String, CodingKey {case hvHostVmId = "hvHostVmId"
        case vmName = "vmName"
        case osType = "osType"
        case vHDId = "vHDId"
        case storageAccountId = "storageAccountId"
        case logStorageAccountId = "logStorageAccountId"
        }

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

extension DataFactory {
  public static func createHyperVReplicaAzureReprotectInputProtocol() -> HyperVReplicaAzureReprotectInputProtocol {
    return HyperVReplicaAzureReprotectInputData()
  }
}


// HyperVReplicaAzureRpRecoveryPointType enumerates the values for hyper v replica azure rp recovery point type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum HyperVReplicaAzureRpRecoveryPointTypeEnum: String, Codable
{
// HyperVReplicaAzureRpRecoveryPointTypeLatest specifies the hyper v replica azure rp recovery point type latest state
// for hyper v replica azure rp recovery point type.
    case HyperVReplicaAzureRpRecoveryPointTypeLatest = "Latest"
// HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent specifies the hyper v replica azure rp recovery
// point type latest application consistent state for hyper v replica azure rp recovery point type.
    case HyperVReplicaAzureRpRecoveryPointTypeLatestApplicationConsistent = "LatestApplicationConsistent"
// HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed specifies the hyper v replica azure rp recovery point type
// latest processed state for hyper v replica azure rp recovery point type.
    case HyperVReplicaAzureRpRecoveryPointTypeLatestProcessed = "LatestProcessed"
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaAzureUpdateReplicationProtectedItemInputData : HyperVReplicaAzureUpdateReplicationProtectedItemInputProtocol, UpdateReplicationProtectedItemProviderInputProtocol {
    public var recoveryAzureV1ResourceGroupId: String?
    public var recoveryAzureV2ResourceGroupId: String?
    public var useManagedDisks: String?

        enum CodingKeys: String, CodingKey {case recoveryAzureV1ResourceGroupId = "recoveryAzureV1ResourceGroupId"
        case recoveryAzureV2ResourceGroupId = "recoveryAzureV2ResourceGroupId"
        case useManagedDisks = "useManagedDisks"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createHyperVReplicaAzureUpdateReplicationProtectedItemInputProtocol() -> HyperVReplicaAzureUpdateReplicationProtectedItemInputProtocol {
    return HyperVReplicaAzureUpdateReplicationProtectedItemInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaBaseEventDetailsData : HyperVReplicaBaseEventDetailsProtocol, 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 createHyperVReplicaBaseEventDetailsProtocol() -> HyperVReplicaBaseEventDetailsProtocol {
    return HyperVReplicaBaseEventDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaBasePolicyDetailsData : HyperVReplicaBasePolicyDetailsProtocol, PolicyProviderSpecificDetailsProtocol {
    public var recoveryPoints: Int32?
    public var applicationConsistentSnapshotFrequencyInHours: Int32?
    public var compression: String?
    public var initialReplicationMethod: String?
    public var onlineReplicationStartTime: String?
    public var offlineReplicationImportPath: String?
    public var offlineReplicationExportPath: String?
    public var replicationPort: Int32?
    public var allowedAuthenticationType: Int32?
    public var replicaDeletionOption: String?

        enum CodingKeys: String, CodingKey {case recoveryPoints = "recoveryPoints"
        case applicationConsistentSnapshotFrequencyInHours = "applicationConsistentSnapshotFrequencyInHours"
        case compression = "compression"
        case initialReplicationMethod = "initialReplicationMethod"
        case onlineReplicationStartTime = "onlineReplicationStartTime"
        case offlineReplicationImportPath = "offlineReplicationImportPath"
        case offlineReplicationExportPath = "offlineReplicationExportPath"
        case replicationPort = "replicationPort"
        case allowedAuthenticationType = "allowedAuthenticationType"
        case replicaDeletionOption = "replicaDeletionOption"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.recoveryPoints) {
        self.recoveryPoints = try container.decode(Int32?.self, forKey: .recoveryPoints)
    }
    if container.contains(.applicationConsistentSnapshotFrequencyInHours) {
        self.applicationConsistentSnapshotFrequencyInHours = try container.decode(Int32?.self, forKey: .applicationConsistentSnapshotFrequencyInHours)
    }
    if container.contains(.compression) {
        self.compression = try container.decode(String?.self, forKey: .compression)
    }
    if container.contains(.initialReplicationMethod) {
        self.initialReplicationMethod = try container.decode(String?.self, forKey: .initialReplicationMethod)
    }
    if container.contains(.onlineReplicationStartTime) {
        self.onlineReplicationStartTime = try container.decode(String?.self, forKey: .onlineReplicationStartTime)
    }
    if container.contains(.offlineReplicationImportPath) {
        self.offlineReplicationImportPath = try container.decode(String?.self, forKey: .offlineReplicationImportPath)
    }
    if container.contains(.offlineReplicationExportPath) {
        self.offlineReplicationExportPath = try container.decode(String?.self, forKey: .offlineReplicationExportPath)
    }
    if container.contains(.replicationPort) {
        self.replicationPort = try container.decode(Int32?.self, forKey: .replicationPort)
    }
    if container.contains(.allowedAuthenticationType) {
        self.allowedAuthenticationType = try container.decode(Int32?.self, forKey: .allowedAuthenticationType)
    }
    if container.contains(.replicaDeletionOption) {
        self.replicaDeletionOption = try container.decode(String?.self, forKey: .replicaDeletionOption)
    }
    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.recoveryPoints != nil {try container.encode(self.recoveryPoints, forKey: .recoveryPoints)}
    if self.applicationConsistentSnapshotFrequencyInHours != nil {try container.encode(self.applicationConsistentSnapshotFrequencyInHours, forKey: .applicationConsistentSnapshotFrequencyInHours)}
    if self.compression != nil {try container.encode(self.compression, forKey: .compression)}
    if self.initialReplicationMethod != nil {try container.encode(self.initialReplicationMethod, forKey: .initialReplicationMethod)}
    if self.onlineReplicationStartTime != nil {try container.encode(self.onlineReplicationStartTime, forKey: .onlineReplicationStartTime)}
    if self.offlineReplicationImportPath != nil {try container.encode(self.offlineReplicationImportPath, forKey: .offlineReplicationImportPath)}
    if self.offlineReplicationExportPath != nil {try container.encode(self.offlineReplicationExportPath, forKey: .offlineReplicationExportPath)}
    if self.replicationPort != nil {try container.encode(self.replicationPort, forKey: .replicationPort)}
    if self.allowedAuthenticationType != nil {try container.encode(self.allowedAuthenticationType, forKey: .allowedAuthenticationType)}
    if self.replicaDeletionOption != nil {try container.encode(self.replicaDeletionOption, forKey: .replicaDeletionOption)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaBasePolicyDetailsProtocol() -> HyperVReplicaBasePolicyDetailsProtocol {
    return HyperVReplicaBasePolicyDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaBaseReplicationDetailsData : HyperVReplicaBaseReplicationDetailsProtocol, ReplicationProviderSpecificSettingsProtocol {
    public var lastReplicatedTime: Date?
    public var vmNics: [VMNicDetailsProtocol?]?
    public var vmId: String?
    public var vmProtectionState: String?
    public var vmProtectionStateDescription: String?
    public var initialReplicationDetails: InitialReplicationDetailsProtocol?
    public var vMDiskDetails: [DiskDetailsProtocol?]?

        enum CodingKeys: String, CodingKey {case lastReplicatedTime = "lastReplicatedTime"
        case vmNics = "vmNics"
        case vmId = "vmId"
        case vmProtectionState = "vmProtectionState"
        case vmProtectionStateDescription = "vmProtectionStateDescription"
        case initialReplicationDetails = "initialReplicationDetails"
        case vMDiskDetails = "vMDiskDetails"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.lastReplicatedTime) {
        self.lastReplicatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastReplicatedTime)), format: .dateTime)
    }
    if container.contains(.vmNics) {
        self.vmNics = try container.decode([VMNicDetailsData?]?.self, forKey: .vmNics)
    }
    if container.contains(.vmId) {
        self.vmId = try container.decode(String?.self, forKey: .vmId)
    }
    if container.contains(.vmProtectionState) {
        self.vmProtectionState = try container.decode(String?.self, forKey: .vmProtectionState)
    }
    if container.contains(.vmProtectionStateDescription) {
        self.vmProtectionStateDescription = try container.decode(String?.self, forKey: .vmProtectionStateDescription)
    }
    if container.contains(.initialReplicationDetails) {
        self.initialReplicationDetails = try container.decode(InitialReplicationDetailsData?.self, forKey: .initialReplicationDetails)
    }
    if container.contains(.vMDiskDetails) {
        self.vMDiskDetails = try container.decode([DiskDetailsData?]?.self, forKey: .vMDiskDetails)
    }
    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.lastReplicatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastReplicatedTime!, format: .dateTime), forKey: .lastReplicatedTime)
    }
    if self.vmNics != nil {try container.encode(self.vmNics as! [VMNicDetailsData?]?, forKey: .vmNics)}
    if self.vmId != nil {try container.encode(self.vmId, forKey: .vmId)}
    if self.vmProtectionState != nil {try container.encode(self.vmProtectionState, forKey: .vmProtectionState)}
    if self.vmProtectionStateDescription != nil {try container.encode(self.vmProtectionStateDescription, forKey: .vmProtectionStateDescription)}
    if self.initialReplicationDetails != nil {try container.encode(self.initialReplicationDetails as! InitialReplicationDetailsData?, forKey: .initialReplicationDetails)}
    if self.vMDiskDetails != nil {try container.encode(self.vMDiskDetails as! [DiskDetailsData?]?, forKey: .vMDiskDetails)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaBaseReplicationDetailsProtocol() -> HyperVReplicaBaseReplicationDetailsProtocol {
    return HyperVReplicaBaseReplicationDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaBluePolicyDetailsData : HyperVReplicaBluePolicyDetailsProtocol, PolicyProviderSpecificDetailsProtocol {
    public var replicationFrequencyInSeconds: Int32?
    public var recoveryPoints: Int32?
    public var applicationConsistentSnapshotFrequencyInHours: Int32?
    public var compression: String?
    public var initialReplicationMethod: String?
    public var onlineReplicationStartTime: String?
    public var offlineReplicationImportPath: String?
    public var offlineReplicationExportPath: String?
    public var replicationPort: Int32?
    public var allowedAuthenticationType: Int32?
    public var replicaDeletionOption: String?

        enum CodingKeys: String, CodingKey {case replicationFrequencyInSeconds = "replicationFrequencyInSeconds"
        case recoveryPoints = "recoveryPoints"
        case applicationConsistentSnapshotFrequencyInHours = "applicationConsistentSnapshotFrequencyInHours"
        case compression = "compression"
        case initialReplicationMethod = "initialReplicationMethod"
        case onlineReplicationStartTime = "onlineReplicationStartTime"
        case offlineReplicationImportPath = "offlineReplicationImportPath"
        case offlineReplicationExportPath = "offlineReplicationExportPath"
        case replicationPort = "replicationPort"
        case allowedAuthenticationType = "allowedAuthenticationType"
        case replicaDeletionOption = "replicaDeletionOption"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.replicationFrequencyInSeconds) {
        self.replicationFrequencyInSeconds = try container.decode(Int32?.self, forKey: .replicationFrequencyInSeconds)
    }
    if container.contains(.recoveryPoints) {
        self.recoveryPoints = try container.decode(Int32?.self, forKey: .recoveryPoints)
    }
    if container.contains(.applicationConsistentSnapshotFrequencyInHours) {
        self.applicationConsistentSnapshotFrequencyInHours = try container.decode(Int32?.self, forKey: .applicationConsistentSnapshotFrequencyInHours)
    }
    if container.contains(.compression) {
        self.compression = try container.decode(String?.self, forKey: .compression)
    }
    if container.contains(.initialReplicationMethod) {
        self.initialReplicationMethod = try container.decode(String?.self, forKey: .initialReplicationMethod)
    }
    if container.contains(.onlineReplicationStartTime) {
        self.onlineReplicationStartTime = try container.decode(String?.self, forKey: .onlineReplicationStartTime)
    }
    if container.contains(.offlineReplicationImportPath) {
        self.offlineReplicationImportPath = try container.decode(String?.self, forKey: .offlineReplicationImportPath)
    }
    if container.contains(.offlineReplicationExportPath) {
        self.offlineReplicationExportPath = try container.decode(String?.self, forKey: .offlineReplicationExportPath)
    }
    if container.contains(.replicationPort) {
        self.replicationPort = try container.decode(Int32?.self, forKey: .replicationPort)
    }
    if container.contains(.allowedAuthenticationType) {
        self.allowedAuthenticationType = try container.decode(Int32?.self, forKey: .allowedAuthenticationType)
    }
    if container.contains(.replicaDeletionOption) {
        self.replicaDeletionOption = try container.decode(String?.self, forKey: .replicaDeletionOption)
    }
    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.replicationFrequencyInSeconds != nil {try container.encode(self.replicationFrequencyInSeconds, forKey: .replicationFrequencyInSeconds)}
    if self.recoveryPoints != nil {try container.encode(self.recoveryPoints, forKey: .recoveryPoints)}
    if self.applicationConsistentSnapshotFrequencyInHours != nil {try container.encode(self.applicationConsistentSnapshotFrequencyInHours, forKey: .applicationConsistentSnapshotFrequencyInHours)}
    if self.compression != nil {try container.encode(self.compression, forKey: .compression)}
    if self.initialReplicationMethod != nil {try container.encode(self.initialReplicationMethod, forKey: .initialReplicationMethod)}
    if self.onlineReplicationStartTime != nil {try container.encode(self.onlineReplicationStartTime, forKey: .onlineReplicationStartTime)}
    if self.offlineReplicationImportPath != nil {try container.encode(self.offlineReplicationImportPath, forKey: .offlineReplicationImportPath)}
    if self.offlineReplicationExportPath != nil {try container.encode(self.offlineReplicationExportPath, forKey: .offlineReplicationExportPath)}
    if self.replicationPort != nil {try container.encode(self.replicationPort, forKey: .replicationPort)}
    if self.allowedAuthenticationType != nil {try container.encode(self.allowedAuthenticationType, forKey: .allowedAuthenticationType)}
    if self.replicaDeletionOption != nil {try container.encode(self.replicaDeletionOption, forKey: .replicaDeletionOption)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaBluePolicyDetailsProtocol() -> HyperVReplicaBluePolicyDetailsProtocol {
    return HyperVReplicaBluePolicyDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaBluePolicyInputData : HyperVReplicaBluePolicyInputProtocol, PolicyProviderSpecificInputProtocol {
    public var replicationFrequencyInSeconds: Int32?
    public var recoveryPoints: Int32?
    public var applicationConsistentSnapshotFrequencyInHours: Int32?
    public var compression: String?
    public var initialReplicationMethod: String?
    public var onlineReplicationStartTime: String?
    public var offlineReplicationImportPath: String?
    public var offlineReplicationExportPath: String?
    public var replicationPort: Int32?
    public var allowedAuthenticationType: Int32?
    public var replicaDeletion: String?

        enum CodingKeys: String, CodingKey {case replicationFrequencyInSeconds = "replicationFrequencyInSeconds"
        case recoveryPoints = "recoveryPoints"
        case applicationConsistentSnapshotFrequencyInHours = "applicationConsistentSnapshotFrequencyInHours"
        case compression = "compression"
        case initialReplicationMethod = "initialReplicationMethod"
        case onlineReplicationStartTime = "onlineReplicationStartTime"
        case offlineReplicationImportPath = "offlineReplicationImportPath"
        case offlineReplicationExportPath = "offlineReplicationExportPath"
        case replicationPort = "replicationPort"
        case allowedAuthenticationType = "allowedAuthenticationType"
        case replicaDeletion = "replicaDeletion"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.replicationFrequencyInSeconds) {
        self.replicationFrequencyInSeconds = try container.decode(Int32?.self, forKey: .replicationFrequencyInSeconds)
    }
    if container.contains(.recoveryPoints) {
        self.recoveryPoints = try container.decode(Int32?.self, forKey: .recoveryPoints)
    }
    if container.contains(.applicationConsistentSnapshotFrequencyInHours) {
        self.applicationConsistentSnapshotFrequencyInHours = try container.decode(Int32?.self, forKey: .applicationConsistentSnapshotFrequencyInHours)
    }
    if container.contains(.compression) {
        self.compression = try container.decode(String?.self, forKey: .compression)
    }
    if container.contains(.initialReplicationMethod) {
        self.initialReplicationMethod = try container.decode(String?.self, forKey: .initialReplicationMethod)
    }
    if container.contains(.onlineReplicationStartTime) {
        self.onlineReplicationStartTime = try container.decode(String?.self, forKey: .onlineReplicationStartTime)
    }
    if container.contains(.offlineReplicationImportPath) {
        self.offlineReplicationImportPath = try container.decode(String?.self, forKey: .offlineReplicationImportPath)
    }
    if container.contains(.offlineReplicationExportPath) {
        self.offlineReplicationExportPath = try container.decode(String?.self, forKey: .offlineReplicationExportPath)
    }
    if container.contains(.replicationPort) {
        self.replicationPort = try container.decode(Int32?.self, forKey: .replicationPort)
    }
    if container.contains(.allowedAuthenticationType) {
        self.allowedAuthenticationType = try container.decode(Int32?.self, forKey: .allowedAuthenticationType)
    }
    if container.contains(.replicaDeletion) {
        self.replicaDeletion = try container.decode(String?.self, forKey: .replicaDeletion)
    }
    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.replicationFrequencyInSeconds != nil {try container.encode(self.replicationFrequencyInSeconds, forKey: .replicationFrequencyInSeconds)}
    if self.recoveryPoints != nil {try container.encode(self.recoveryPoints, forKey: .recoveryPoints)}
    if self.applicationConsistentSnapshotFrequencyInHours != nil {try container.encode(self.applicationConsistentSnapshotFrequencyInHours, forKey: .applicationConsistentSnapshotFrequencyInHours)}
    if self.compression != nil {try container.encode(self.compression, forKey: .compression)}
    if self.initialReplicationMethod != nil {try container.encode(self.initialReplicationMethod, forKey: .initialReplicationMethod)}
    if self.onlineReplicationStartTime != nil {try container.encode(self.onlineReplicationStartTime, forKey: .onlineReplicationStartTime)}
    if self.offlineReplicationImportPath != nil {try container.encode(self.offlineReplicationImportPath, forKey: .offlineReplicationImportPath)}
    if self.offlineReplicationExportPath != nil {try container.encode(self.offlineReplicationExportPath, forKey: .offlineReplicationExportPath)}
    if self.replicationPort != nil {try container.encode(self.replicationPort, forKey: .replicationPort)}
    if self.allowedAuthenticationType != nil {try container.encode(self.allowedAuthenticationType, forKey: .allowedAuthenticationType)}
    if self.replicaDeletion != nil {try container.encode(self.replicaDeletion, forKey: .replicaDeletion)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaBluePolicyInputProtocol() -> HyperVReplicaBluePolicyInputProtocol {
    return HyperVReplicaBluePolicyInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaBlueReplicationDetailsData : HyperVReplicaBlueReplicationDetailsProtocol, ReplicationProviderSpecificSettingsProtocol {
    public var lastReplicatedTime: Date?
    public var vmNics: [VMNicDetailsProtocol?]?
    public var vmId: String?
    public var vmProtectionState: String?
    public var vmProtectionStateDescription: String?
    public var initialReplicationDetails: InitialReplicationDetailsProtocol?
    public var vMDiskDetails: [DiskDetailsProtocol?]?

        enum CodingKeys: String, CodingKey {case lastReplicatedTime = "lastReplicatedTime"
        case vmNics = "vmNics"
        case vmId = "vmId"
        case vmProtectionState = "vmProtectionState"
        case vmProtectionStateDescription = "vmProtectionStateDescription"
        case initialReplicationDetails = "initialReplicationDetails"
        case vMDiskDetails = "vMDiskDetails"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.lastReplicatedTime) {
        self.lastReplicatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastReplicatedTime)), format: .dateTime)
    }
    if container.contains(.vmNics) {
        self.vmNics = try container.decode([VMNicDetailsData?]?.self, forKey: .vmNics)
    }
    if container.contains(.vmId) {
        self.vmId = try container.decode(String?.self, forKey: .vmId)
    }
    if container.contains(.vmProtectionState) {
        self.vmProtectionState = try container.decode(String?.self, forKey: .vmProtectionState)
    }
    if container.contains(.vmProtectionStateDescription) {
        self.vmProtectionStateDescription = try container.decode(String?.self, forKey: .vmProtectionStateDescription)
    }
    if container.contains(.initialReplicationDetails) {
        self.initialReplicationDetails = try container.decode(InitialReplicationDetailsData?.self, forKey: .initialReplicationDetails)
    }
    if container.contains(.vMDiskDetails) {
        self.vMDiskDetails = try container.decode([DiskDetailsData?]?.self, forKey: .vMDiskDetails)
    }
    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.lastReplicatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastReplicatedTime!, format: .dateTime), forKey: .lastReplicatedTime)
    }
    if self.vmNics != nil {try container.encode(self.vmNics as! [VMNicDetailsData?]?, forKey: .vmNics)}
    if self.vmId != nil {try container.encode(self.vmId, forKey: .vmId)}
    if self.vmProtectionState != nil {try container.encode(self.vmProtectionState, forKey: .vmProtectionState)}
    if self.vmProtectionStateDescription != nil {try container.encode(self.vmProtectionStateDescription, forKey: .vmProtectionStateDescription)}
    if self.initialReplicationDetails != nil {try container.encode(self.initialReplicationDetails as! InitialReplicationDetailsData?, forKey: .initialReplicationDetails)}
    if self.vMDiskDetails != nil {try container.encode(self.vMDiskDetails as! [DiskDetailsData?]?, forKey: .vMDiskDetails)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaBlueReplicationDetailsProtocol() -> HyperVReplicaBlueReplicationDetailsProtocol {
    return HyperVReplicaBlueReplicationDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaPolicyDetailsData : HyperVReplicaPolicyDetailsProtocol, PolicyProviderSpecificDetailsProtocol {
    public var recoveryPoints: Int32?
    public var applicationConsistentSnapshotFrequencyInHours: Int32?
    public var compression: String?
    public var initialReplicationMethod: String?
    public var onlineReplicationStartTime: String?
    public var offlineReplicationImportPath: String?
    public var offlineReplicationExportPath: String?
    public var replicationPort: Int32?
    public var allowedAuthenticationType: Int32?
    public var replicaDeletionOption: String?

        enum CodingKeys: String, CodingKey {case recoveryPoints = "recoveryPoints"
        case applicationConsistentSnapshotFrequencyInHours = "applicationConsistentSnapshotFrequencyInHours"
        case compression = "compression"
        case initialReplicationMethod = "initialReplicationMethod"
        case onlineReplicationStartTime = "onlineReplicationStartTime"
        case offlineReplicationImportPath = "offlineReplicationImportPath"
        case offlineReplicationExportPath = "offlineReplicationExportPath"
        case replicationPort = "replicationPort"
        case allowedAuthenticationType = "allowedAuthenticationType"
        case replicaDeletionOption = "replicaDeletionOption"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.recoveryPoints) {
        self.recoveryPoints = try container.decode(Int32?.self, forKey: .recoveryPoints)
    }
    if container.contains(.applicationConsistentSnapshotFrequencyInHours) {
        self.applicationConsistentSnapshotFrequencyInHours = try container.decode(Int32?.self, forKey: .applicationConsistentSnapshotFrequencyInHours)
    }
    if container.contains(.compression) {
        self.compression = try container.decode(String?.self, forKey: .compression)
    }
    if container.contains(.initialReplicationMethod) {
        self.initialReplicationMethod = try container.decode(String?.self, forKey: .initialReplicationMethod)
    }
    if container.contains(.onlineReplicationStartTime) {
        self.onlineReplicationStartTime = try container.decode(String?.self, forKey: .onlineReplicationStartTime)
    }
    if container.contains(.offlineReplicationImportPath) {
        self.offlineReplicationImportPath = try container.decode(String?.self, forKey: .offlineReplicationImportPath)
    }
    if container.contains(.offlineReplicationExportPath) {
        self.offlineReplicationExportPath = try container.decode(String?.self, forKey: .offlineReplicationExportPath)
    }
    if container.contains(.replicationPort) {
        self.replicationPort = try container.decode(Int32?.self, forKey: .replicationPort)
    }
    if container.contains(.allowedAuthenticationType) {
        self.allowedAuthenticationType = try container.decode(Int32?.self, forKey: .allowedAuthenticationType)
    }
    if container.contains(.replicaDeletionOption) {
        self.replicaDeletionOption = try container.decode(String?.self, forKey: .replicaDeletionOption)
    }
    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.recoveryPoints != nil {try container.encode(self.recoveryPoints, forKey: .recoveryPoints)}
    if self.applicationConsistentSnapshotFrequencyInHours != nil {try container.encode(self.applicationConsistentSnapshotFrequencyInHours, forKey: .applicationConsistentSnapshotFrequencyInHours)}
    if self.compression != nil {try container.encode(self.compression, forKey: .compression)}
    if self.initialReplicationMethod != nil {try container.encode(self.initialReplicationMethod, forKey: .initialReplicationMethod)}
    if self.onlineReplicationStartTime != nil {try container.encode(self.onlineReplicationStartTime, forKey: .onlineReplicationStartTime)}
    if self.offlineReplicationImportPath != nil {try container.encode(self.offlineReplicationImportPath, forKey: .offlineReplicationImportPath)}
    if self.offlineReplicationExportPath != nil {try container.encode(self.offlineReplicationExportPath, forKey: .offlineReplicationExportPath)}
    if self.replicationPort != nil {try container.encode(self.replicationPort, forKey: .replicationPort)}
    if self.allowedAuthenticationType != nil {try container.encode(self.allowedAuthenticationType, forKey: .allowedAuthenticationType)}
    if self.replicaDeletionOption != nil {try container.encode(self.replicaDeletionOption, forKey: .replicaDeletionOption)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaPolicyDetailsProtocol() -> HyperVReplicaPolicyDetailsProtocol {
    return HyperVReplicaPolicyDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaPolicyInputData : HyperVReplicaPolicyInputProtocol, PolicyProviderSpecificInputProtocol {
    public var recoveryPoints: Int32?
    public var applicationConsistentSnapshotFrequencyInHours: Int32?
    public var compression: String?
    public var initialReplicationMethod: String?
    public var onlineReplicationStartTime: String?
    public var offlineReplicationImportPath: String?
    public var offlineReplicationExportPath: String?
    public var replicationPort: Int32?
    public var allowedAuthenticationType: Int32?
    public var replicaDeletion: String?

        enum CodingKeys: String, CodingKey {case recoveryPoints = "recoveryPoints"
        case applicationConsistentSnapshotFrequencyInHours = "applicationConsistentSnapshotFrequencyInHours"
        case compression = "compression"
        case initialReplicationMethod = "initialReplicationMethod"
        case onlineReplicationStartTime = "onlineReplicationStartTime"
        case offlineReplicationImportPath = "offlineReplicationImportPath"
        case offlineReplicationExportPath = "offlineReplicationExportPath"
        case replicationPort = "replicationPort"
        case allowedAuthenticationType = "allowedAuthenticationType"
        case replicaDeletion = "replicaDeletion"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.recoveryPoints) {
        self.recoveryPoints = try container.decode(Int32?.self, forKey: .recoveryPoints)
    }
    if container.contains(.applicationConsistentSnapshotFrequencyInHours) {
        self.applicationConsistentSnapshotFrequencyInHours = try container.decode(Int32?.self, forKey: .applicationConsistentSnapshotFrequencyInHours)
    }
    if container.contains(.compression) {
        self.compression = try container.decode(String?.self, forKey: .compression)
    }
    if container.contains(.initialReplicationMethod) {
        self.initialReplicationMethod = try container.decode(String?.self, forKey: .initialReplicationMethod)
    }
    if container.contains(.onlineReplicationStartTime) {
        self.onlineReplicationStartTime = try container.decode(String?.self, forKey: .onlineReplicationStartTime)
    }
    if container.contains(.offlineReplicationImportPath) {
        self.offlineReplicationImportPath = try container.decode(String?.self, forKey: .offlineReplicationImportPath)
    }
    if container.contains(.offlineReplicationExportPath) {
        self.offlineReplicationExportPath = try container.decode(String?.self, forKey: .offlineReplicationExportPath)
    }
    if container.contains(.replicationPort) {
        self.replicationPort = try container.decode(Int32?.self, forKey: .replicationPort)
    }
    if container.contains(.allowedAuthenticationType) {
        self.allowedAuthenticationType = try container.decode(Int32?.self, forKey: .allowedAuthenticationType)
    }
    if container.contains(.replicaDeletion) {
        self.replicaDeletion = try container.decode(String?.self, forKey: .replicaDeletion)
    }
    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.recoveryPoints != nil {try container.encode(self.recoveryPoints, forKey: .recoveryPoints)}
    if self.applicationConsistentSnapshotFrequencyInHours != nil {try container.encode(self.applicationConsistentSnapshotFrequencyInHours, forKey: .applicationConsistentSnapshotFrequencyInHours)}
    if self.compression != nil {try container.encode(self.compression, forKey: .compression)}
    if self.initialReplicationMethod != nil {try container.encode(self.initialReplicationMethod, forKey: .initialReplicationMethod)}
    if self.onlineReplicationStartTime != nil {try container.encode(self.onlineReplicationStartTime, forKey: .onlineReplicationStartTime)}
    if self.offlineReplicationImportPath != nil {try container.encode(self.offlineReplicationImportPath, forKey: .offlineReplicationImportPath)}
    if self.offlineReplicationExportPath != nil {try container.encode(self.offlineReplicationExportPath, forKey: .offlineReplicationExportPath)}
    if self.replicationPort != nil {try container.encode(self.replicationPort, forKey: .replicationPort)}
    if self.allowedAuthenticationType != nil {try container.encode(self.allowedAuthenticationType, forKey: .allowedAuthenticationType)}
    if self.replicaDeletion != nil {try container.encode(self.replicaDeletion, forKey: .replicaDeletion)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaPolicyInputProtocol() -> HyperVReplicaPolicyInputProtocol {
    return HyperVReplicaPolicyInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVReplicaReplicationDetailsData : HyperVReplicaReplicationDetailsProtocol, ReplicationProviderSpecificSettingsProtocol {
    public var lastReplicatedTime: Date?
    public var vmNics: [VMNicDetailsProtocol?]?
    public var vmId: String?
    public var vmProtectionState: String?
    public var vmProtectionStateDescription: String?
    public var initialReplicationDetails: InitialReplicationDetailsProtocol?
    public var vMDiskDetails: [DiskDetailsProtocol?]?

        enum CodingKeys: String, CodingKey {case lastReplicatedTime = "lastReplicatedTime"
        case vmNics = "vmNics"
        case vmId = "vmId"
        case vmProtectionState = "vmProtectionState"
        case vmProtectionStateDescription = "vmProtectionStateDescription"
        case initialReplicationDetails = "initialReplicationDetails"
        case vMDiskDetails = "vMDiskDetails"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.lastReplicatedTime) {
        self.lastReplicatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastReplicatedTime)), format: .dateTime)
    }
    if container.contains(.vmNics) {
        self.vmNics = try container.decode([VMNicDetailsData?]?.self, forKey: .vmNics)
    }
    if container.contains(.vmId) {
        self.vmId = try container.decode(String?.self, forKey: .vmId)
    }
    if container.contains(.vmProtectionState) {
        self.vmProtectionState = try container.decode(String?.self, forKey: .vmProtectionState)
    }
    if container.contains(.vmProtectionStateDescription) {
        self.vmProtectionStateDescription = try container.decode(String?.self, forKey: .vmProtectionStateDescription)
    }
    if container.contains(.initialReplicationDetails) {
        self.initialReplicationDetails = try container.decode(InitialReplicationDetailsData?.self, forKey: .initialReplicationDetails)
    }
    if container.contains(.vMDiskDetails) {
        self.vMDiskDetails = try container.decode([DiskDetailsData?]?.self, forKey: .vMDiskDetails)
    }
    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.lastReplicatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastReplicatedTime!, format: .dateTime), forKey: .lastReplicatedTime)
    }
    if self.vmNics != nil {try container.encode(self.vmNics as! [VMNicDetailsData?]?, forKey: .vmNics)}
    if self.vmId != nil {try container.encode(self.vmId, forKey: .vmId)}
    if self.vmProtectionState != nil {try container.encode(self.vmProtectionState, forKey: .vmProtectionState)}
    if self.vmProtectionStateDescription != nil {try container.encode(self.vmProtectionStateDescription, forKey: .vmProtectionStateDescription)}
    if self.initialReplicationDetails != nil {try container.encode(self.initialReplicationDetails as! InitialReplicationDetailsData?, forKey: .initialReplicationDetails)}
    if self.vMDiskDetails != nil {try container.encode(self.vMDiskDetails as! [DiskDetailsData?]?, forKey: .vMDiskDetails)}
  }
}

extension DataFactory {
  public static func createHyperVReplicaReplicationDetailsProtocol() -> HyperVReplicaReplicationDetailsProtocol {
    return HyperVReplicaReplicationDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVSiteDetailsData : HyperVSiteDetailsProtocol, 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 createHyperVSiteDetailsProtocol() -> HyperVSiteDetailsProtocol {
    return HyperVSiteDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HyperVVirtualMachineDetailsData : HyperVVirtualMachineDetailsProtocol, ConfigurationSettingsProtocol {
    public var sourceItemId: String?
    public var generation: String?
    public var osDetails: OSDetailsProtocol?
    public var diskDetails: [DiskDetailsProtocol?]?
    public var hasPhysicalDisk: Bool?
    public var hasFibreChannelAdapter: Bool?
    public var hasSharedVhd: Bool?

        enum CodingKeys: String, CodingKey {case sourceItemId = "sourceItemId"
        case generation = "generation"
        case osDetails = "osDetails"
        case diskDetails = "diskDetails"
        case hasPhysicalDisk = "hasPhysicalDisk"
        case hasFibreChannelAdapter = "hasFibreChannelAdapter"
        case hasSharedVhd = "hasSharedVhd"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.sourceItemId) {
        self.sourceItemId = try container.decode(String?.self, forKey: .sourceItemId)
    }
    if container.contains(.generation) {
        self.generation = try container.decode(String?.self, forKey: .generation)
    }
    if container.contains(.osDetails) {
        self.osDetails = try container.decode(OSDetailsData?.self, forKey: .osDetails)
    }
    if container.contains(.diskDetails) {
        self.diskDetails = try container.decode([DiskDetailsData?]?.self, forKey: .diskDetails)
    }
    if container.contains(.hasPhysicalDisk) {
        self.hasPhysicalDisk = try container.decode(Bool?.self, forKey: .hasPhysicalDisk)
    }
    if container.contains(.hasFibreChannelAdapter) {
        self.hasFibreChannelAdapter = try container.decode(Bool?.self, forKey: .hasFibreChannelAdapter)
    }
    if container.contains(.hasSharedVhd) {
        self.hasSharedVhd = try container.decode(Bool?.self, forKey: .hasSharedVhd)
    }
    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.sourceItemId != nil {try container.encode(self.sourceItemId, forKey: .sourceItemId)}
    if self.generation != nil {try container.encode(self.generation, forKey: .generation)}
    if self.osDetails != nil {try container.encode(self.osDetails as! OSDetailsData?, forKey: .osDetails)}
    if self.diskDetails != nil {try container.encode(self.diskDetails as! [DiskDetailsData?]?, forKey: .diskDetails)}
    if self.hasPhysicalDisk != nil {try container.encode(self.hasPhysicalDisk, forKey: .hasPhysicalDisk)}
    if self.hasFibreChannelAdapter != nil {try container.encode(self.hasFibreChannelAdapter, forKey: .hasFibreChannelAdapter)}
    if self.hasSharedVhd != nil {try container.encode(self.hasSharedVhd, forKey: .hasSharedVhd)}
  }
}

extension DataFactory {
  public static func createHyperVVirtualMachineDetailsProtocol() -> HyperVVirtualMachineDetailsProtocol {
    return HyperVVirtualMachineDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 IdentityInformationData : IdentityInformationProtocol {
    public var identityProviderType: IdentityProviderTypeEnum?
    public var tenantId: String?
    public var applicationId: String?
    public var objectId: String?
    public var audience: String?
    public var aadAuthority: String?
    public var certificateThumbprint: String?

        enum CodingKeys: String, CodingKey {case identityProviderType = "identityProviderType"
        case tenantId = "tenantId"
        case applicationId = "applicationId"
        case objectId = "objectId"
        case audience = "audience"
        case aadAuthority = "aadAuthority"
        case certificateThumbprint = "certificateThumbprint"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.identityProviderType != nil {try container.encode(self.identityProviderType, forKey: .identityProviderType)}
    if self.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.applicationId != nil {try container.encode(self.applicationId, forKey: .applicationId)}
    if self.objectId != nil {try container.encode(self.objectId, forKey: .objectId)}
    if self.audience != nil {try container.encode(self.audience, forKey: .audience)}
    if self.aadAuthority != nil {try container.encode(self.aadAuthority, forKey: .aadAuthority)}
    if self.certificateThumbprint != nil {try container.encode(self.certificateThumbprint, forKey: .certificateThumbprint)}
  }
}

extension DataFactory {
  public static func createIdentityInformationProtocol() -> IdentityInformationProtocol {
    return IdentityInformationData()
  }
}


// IdentityProviderType enumerates the values for identity provider type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum IdentityProviderTypeEnum: String, Codable
{
// RecoveryServicesActiveDirectory specifies the recovery services active directory state for identity provider type.
    case RecoveryServicesActiveDirectory = "RecoveryServicesActiveDirectory"
}


// Copyright (c) Microsoft Corporation. All rights 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 InconsistentVmDetailsData : InconsistentVmDetailsProtocol {
    public var vmName: String?
    public var cloudName: String?
    public var details: [String]?
    public var errorIds: [String]?

        enum CodingKeys: String, CodingKey {case vmName = "vmName"
        case cloudName = "cloudName"
        case details = "details"
        case errorIds = "errorIds"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInconsistentVmDetailsProtocol() -> InconsistentVmDetailsProtocol {
    return InconsistentVmDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 InitialReplicationDetailsData : InitialReplicationDetailsProtocol {
    public var initialReplicationType: String?
    public var initialReplicationProgressPercentage: String?

        enum CodingKeys: String, CodingKey {case initialReplicationType = "initialReplicationType"
        case initialReplicationProgressPercentage = "initialReplicationProgressPercentage"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInitialReplicationDetailsProtocol() -> InitialReplicationDetailsProtocol {
    return InitialReplicationDetailsData()
  }
}


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

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

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

extension DataFactory {
  public static func createInlineWorkflowTaskDetailsProtocol() -> InlineWorkflowTaskDetailsProtocol {
    return InlineWorkflowTaskDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 InMageAgentDetailsData : InMageAgentDetailsProtocol {
    public var agentVersion: String?
    public var agentUpdateStatus: String?
    public var postUpdateRebootStatus: String?
    public var agentExpiryDate: Date?

        enum CodingKeys: String, CodingKey {case agentVersion = "agentVersion"
        case agentUpdateStatus = "agentUpdateStatus"
        case postUpdateRebootStatus = "postUpdateRebootStatus"
        case agentExpiryDate = "agentExpiryDate"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageAgentDetailsProtocol() -> InMageAgentDetailsProtocol {
    return InMageAgentDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 InMageAgentVersionDetailsData : InMageAgentVersionDetailsProtocol {
    public var postUpdateRebootStatus: String?
    public var version: String?
    public var expiryDate: Date?
    public var status: AgentVersionStatusEnum?

        enum CodingKeys: String, CodingKey {case postUpdateRebootStatus = "postUpdateRebootStatus"
        case version = "version"
        case expiryDate = "expiryDate"
        case status = "status"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageAgentVersionDetailsProtocol() -> InMageAgentVersionDetailsProtocol {
    return InMageAgentVersionDetailsData()
  }
}


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

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

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

extension DataFactory {
  public static func createInMageAzureV2ApplyRecoveryPointInputProtocol() -> InMageAzureV2ApplyRecoveryPointInputProtocol {
    return InMageAzureV2ApplyRecoveryPointInputData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 InMageAzureV2EnableProtectionInputData : InMageAzureV2EnableProtectionInputProtocol, EnableProtectionProviderSpecificInputProtocol {
    public var masterTargetId: String?
    public var processServerId: String?
    public var storageAccountId: String
    public var runAsAccountId: String?
    public var multiVmGroupId: String?
    public var multiVmGroupName: String?
    public var disksToInclude: [String]?
    public var targetAzureNetworkId: String?
    public var targetAzureSubnetId: String?
    public var enableRdpOnTargetOption: String?
    public var targetAzureVmName: String?
    public var logStorageAccountId: String?
    public var targetAzureV1ResourceGroupId: String?
    public var targetAzureV2ResourceGroupId: String?
    public var useManagedDisks: String?

        enum CodingKeys: String, CodingKey {case masterTargetId = "masterTargetId"
        case processServerId = "processServerId"
        case storageAccountId = "storageAccountId"
        case runAsAccountId = "runAsAccountId"
        case multiVmGroupId = "multiVmGroupId"
        case multiVmGroupName = "multiVmGroupName"
        case disksToInclude = "disksToInclude"
        case targetAzureNetworkId = "targetAzureNetworkId"
        case targetAzureSubnetId = "targetAzureSubnetId"
        case enableRdpOnTargetOption = "enableRdpOnTargetOption"
        case targetAzureVmName = "targetAzureVmName"
        case logStorageAccountId = "logStorageAccountId"
        case targetAzureV1ResourceGroupId = "targetAzureV1ResourceGroupId"
        case targetAzureV2ResourceGroupId = "targetAzureV2ResourceGroupId"
        case useManagedDisks = "useManagedDisks"
        }

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.masterTargetId) {
        self.masterTargetId = try container.decode(String?.self, forKey: .masterTargetId)
    }
    if container.contains(.processServerId) {
        self.processServerId = try container.decode(String?.self, forKey: .processServerId)
    }
    self.storageAccountId = try container.decode(String.self, forKey: .storageAccountId)
    if container.contains(.runAsAccountId) {
        self.runAsAccountId = try container.decode(String?.self, forKey: .runAsAccountId)
    }
    if container.contains(.multiVmGroupId) {
        self.multiVmGroupId = try container.decode(String?.self, forKey: .multiVmGroupId)
    }
    if container.contains(.multiVmGroupName) {
        self.multiVmGroupName = try container.decode(String?.self, forKey: .multiVmGroupName)
    }
    if container.contains(.disksToInclude) {
        self.disksToInclude = try container.decode([String]?.self, forKey: .disksToInclude)
    }
    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(.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.masterTargetId != nil {try container.encode(self.masterTargetId, forKey: .masterTargetId)}
    if self.processServerId != nil {try container.encode(self.processServerId, forKey: .processServerId)}
    try container.encode(self.storageAccountId, forKey: .storageAccountId)
    if self.runAsAccountId != nil {try container.encode(self.runAsAccountId, forKey: .runAsAccountId)}
    if self.multiVmGroupId != nil {try container.encode(self.multiVmGroupId, forKey: .multiVmGroupId)}
    if self.multiVmGroupName != nil {try container.encode(self.multiVmGroupName, forKey: .multiVmGroupName)}
    if self.disksToInclude != nil {try container.encode(self.disksToInclude as! [String]?, forKey: .disksToInclude)}
    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.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 createInMageAzureV2EnableProtectionInputProtocol(storageAccountId: String) -> InMageAzureV2EnableProtectionInputProtocol {
    return InMageAzureV2EnableProtectionInputData(storageAccountId: storageAccountId)
  }
}