// 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 InMageAzureV2EventDetailsData : InMageAzureV2EventDetailsProtocol, EventProviderSpecificDetailsProtocol {
    public var eventType: String?
    public var category: String?
    public var component: String?
    public var correctiveAction: String?
    public var details: String?
    public var summary: String?
    public var siteName: String?

        enum CodingKeys: String, CodingKey {case eventType = "eventType"
        case category = "category"
        case component = "component"
        case correctiveAction = "correctiveAction"
        case details = "details"
        case summary = "summary"
        case siteName = "siteName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageAzureV2EventDetailsProtocol() -> InMageAzureV2EventDetailsProtocol {
    return InMageAzureV2EventDetailsData()
  }
}


// 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 InMageAzureV2FailoverProviderInputData : InMageAzureV2FailoverProviderInputProtocol, ProviderSpecificFailoverInputProtocol {
    public var vaultLocation: String?
    public var recoveryPointId: String?

        enum CodingKeys: String, CodingKey {case vaultLocation = "vaultLocation"
        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(.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.recoveryPointId != nil {try container.encode(self.recoveryPointId, forKey: .recoveryPointId)}
  }
}

extension DataFactory {
  public static func createInMageAzureV2FailoverProviderInputProtocol() -> InMageAzureV2FailoverProviderInputProtocol {
    return InMageAzureV2FailoverProviderInputData()
  }
}


// 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 InMageAzureV2PolicyDetailsData : InMageAzureV2PolicyDetailsProtocol, PolicyProviderSpecificDetailsProtocol {
    public var crashConsistentFrequencyInMinutes: Int32?
    public var recoveryPointThresholdInMinutes: Int32?
    public var recoveryPointHistory: Int32?
    public var appConsistentFrequencyInMinutes: Int32?
    public var multiVmSyncStatus: String?

        enum CodingKeys: String, CodingKey {case crashConsistentFrequencyInMinutes = "crashConsistentFrequencyInMinutes"
        case recoveryPointThresholdInMinutes = "recoveryPointThresholdInMinutes"
        case recoveryPointHistory = "recoveryPointHistory"
        case appConsistentFrequencyInMinutes = "appConsistentFrequencyInMinutes"
        case multiVmSyncStatus = "multiVmSyncStatus"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageAzureV2PolicyDetailsProtocol() -> InMageAzureV2PolicyDetailsProtocol {
    return InMageAzureV2PolicyDetailsData()
  }
}


// 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 InMageAzureV2PolicyInputData : InMageAzureV2PolicyInputProtocol, PolicyProviderSpecificInputProtocol {
    public var recoveryPointThresholdInMinutes: Int32?
    public var recoveryPointHistory: Int32?
    public var crashConsistentFrequencyInMinutes: Int32?
    public var appConsistentFrequencyInMinutes: Int32?
    public var multiVmSyncStatus: SetMultiVmSyncStatusEnum

        enum CodingKeys: String, CodingKey {case recoveryPointThresholdInMinutes = "recoveryPointThresholdInMinutes"
        case recoveryPointHistory = "recoveryPointHistory"
        case crashConsistentFrequencyInMinutes = "crashConsistentFrequencyInMinutes"
        case appConsistentFrequencyInMinutes = "appConsistentFrequencyInMinutes"
        case multiVmSyncStatus = "multiVmSyncStatus"
        }

  public init(multiVmSyncStatus: SetMultiVmSyncStatusEnum)  {
    self.multiVmSyncStatus = multiVmSyncStatus
  }

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

extension DataFactory {
  public static func createInMageAzureV2PolicyInputProtocol(multiVmSyncStatus: SetMultiVmSyncStatusEnum) -> InMageAzureV2PolicyInputProtocol {
    return InMageAzureV2PolicyInputData(multiVmSyncStatus: multiVmSyncStatus)
  }
}


// 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 InMageAzureV2ProtectedDiskDetailsData : InMageAzureV2ProtectedDiskDetailsProtocol {
    public var diskId: String?
    public var diskName: String?
    public var protectionStage: String?
    public var healthErrorCode: String?
    public var rpoInSeconds: Int64?
    public var resyncRequired: String?
    public var resyncProgressPercentage: Int32?
    public var resyncDurationInSeconds: Int64?
    public var diskCapacityInBytes: Int64?
    public var fileSystemCapacityInBytes: Int64?
    public var sourceDataInMegaBytes: Double?
    public var psDataInMegaBytes: Double?
    public var targetDataInMegaBytes: Double?
    public var diskResized: String?
    public var lastRpoCalculatedTime: Date?

        enum CodingKeys: String, CodingKey {case diskId = "diskId"
        case diskName = "diskName"
        case protectionStage = "protectionStage"
        case healthErrorCode = "healthErrorCode"
        case rpoInSeconds = "rpoInSeconds"
        case resyncRequired = "resyncRequired"
        case resyncProgressPercentage = "resyncProgressPercentage"
        case resyncDurationInSeconds = "resyncDurationInSeconds"
        case diskCapacityInBytes = "diskCapacityInBytes"
        case fileSystemCapacityInBytes = "fileSystemCapacityInBytes"
        case sourceDataInMegaBytes = "sourceDataInMegaBytes"
        case psDataInMegaBytes = "psDataInMegaBytes"
        case targetDataInMegaBytes = "targetDataInMegaBytes"
        case diskResized = "diskResized"
        case lastRpoCalculatedTime = "lastRpoCalculatedTime"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.diskId) {
        self.diskId = try container.decode(String?.self, forKey: .diskId)
    }
    if container.contains(.diskName) {
        self.diskName = try container.decode(String?.self, forKey: .diskName)
    }
    if container.contains(.protectionStage) {
        self.protectionStage = try container.decode(String?.self, forKey: .protectionStage)
    }
    if container.contains(.healthErrorCode) {
        self.healthErrorCode = try container.decode(String?.self, forKey: .healthErrorCode)
    }
    if container.contains(.rpoInSeconds) {
        self.rpoInSeconds = try container.decode(Int64?.self, forKey: .rpoInSeconds)
    }
    if container.contains(.resyncRequired) {
        self.resyncRequired = try container.decode(String?.self, forKey: .resyncRequired)
    }
    if container.contains(.resyncProgressPercentage) {
        self.resyncProgressPercentage = try container.decode(Int32?.self, forKey: .resyncProgressPercentage)
    }
    if container.contains(.resyncDurationInSeconds) {
        self.resyncDurationInSeconds = try container.decode(Int64?.self, forKey: .resyncDurationInSeconds)
    }
    if container.contains(.diskCapacityInBytes) {
        self.diskCapacityInBytes = try container.decode(Int64?.self, forKey: .diskCapacityInBytes)
    }
    if container.contains(.fileSystemCapacityInBytes) {
        self.fileSystemCapacityInBytes = try container.decode(Int64?.self, forKey: .fileSystemCapacityInBytes)
    }
    if container.contains(.sourceDataInMegaBytes) {
        self.sourceDataInMegaBytes = try container.decode(Double?.self, forKey: .sourceDataInMegaBytes)
    }
    if container.contains(.psDataInMegaBytes) {
        self.psDataInMegaBytes = try container.decode(Double?.self, forKey: .psDataInMegaBytes)
    }
    if container.contains(.targetDataInMegaBytes) {
        self.targetDataInMegaBytes = try container.decode(Double?.self, forKey: .targetDataInMegaBytes)
    }
    if container.contains(.diskResized) {
        self.diskResized = try container.decode(String?.self, forKey: .diskResized)
    }
    if container.contains(.lastRpoCalculatedTime) {
        self.lastRpoCalculatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRpoCalculatedTime)), 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.diskId != nil {try container.encode(self.diskId, forKey: .diskId)}
    if self.diskName != nil {try container.encode(self.diskName, forKey: .diskName)}
    if self.protectionStage != nil {try container.encode(self.protectionStage, forKey: .protectionStage)}
    if self.healthErrorCode != nil {try container.encode(self.healthErrorCode, forKey: .healthErrorCode)}
    if self.rpoInSeconds != nil {try container.encode(self.rpoInSeconds, forKey: .rpoInSeconds)}
    if self.resyncRequired != nil {try container.encode(self.resyncRequired, forKey: .resyncRequired)}
    if self.resyncProgressPercentage != nil {try container.encode(self.resyncProgressPercentage, forKey: .resyncProgressPercentage)}
    if self.resyncDurationInSeconds != nil {try container.encode(self.resyncDurationInSeconds, forKey: .resyncDurationInSeconds)}
    if self.diskCapacityInBytes != nil {try container.encode(self.diskCapacityInBytes, forKey: .diskCapacityInBytes)}
    if self.fileSystemCapacityInBytes != nil {try container.encode(self.fileSystemCapacityInBytes, forKey: .fileSystemCapacityInBytes)}
    if self.sourceDataInMegaBytes != nil {try container.encode(self.sourceDataInMegaBytes, forKey: .sourceDataInMegaBytes)}
    if self.psDataInMegaBytes != nil {try container.encode(self.psDataInMegaBytes, forKey: .psDataInMegaBytes)}
    if self.targetDataInMegaBytes != nil {try container.encode(self.targetDataInMegaBytes, forKey: .targetDataInMegaBytes)}
    if self.diskResized != nil {try container.encode(self.diskResized, forKey: .diskResized)}
    if self.lastRpoCalculatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRpoCalculatedTime!, format: .dateTime), forKey: .lastRpoCalculatedTime)
    }
  }
}

extension DataFactory {
  public static func createInMageAzureV2ProtectedDiskDetailsProtocol() -> InMageAzureV2ProtectedDiskDetailsProtocol {
    return InMageAzureV2ProtectedDiskDetailsData()
  }
}


// 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 InMageAzureV2RecoveryPointDetailsData : InMageAzureV2RecoveryPointDetailsProtocol, ProviderSpecificRecoveryPointDetailsProtocol {
    public var isMultiVmSyncPoint: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageAzureV2RecoveryPointDetailsProtocol() -> InMageAzureV2RecoveryPointDetailsProtocol {
    return InMageAzureV2RecoveryPointDetailsData()
  }
}


// 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 InMageAzureV2ReplicationDetailsData : InMageAzureV2ReplicationDetailsProtocol, ReplicationProviderSpecificSettingsProtocol {
    public var infrastructureVmId: String?
    public var vCenterInfrastructureId: String?
    public var protectionStage: String?
    public var vmId: String?
    public var vmProtectionState: String?
    public var vmProtectionStateDescription: String?
    public var resyncProgressPercentage: Int32?
    public var rpoInSeconds: Int64?
    public var compressedDataRateInMB: Double?
    public var uncompressedDataRateInMB: Double?
    public var ipAddress: String?
    public var agentVersion: String?
    public var agentExpiryDate: Date?
    public var isAgentUpdateRequired: String?
    public var isRebootAfterUpdateRequired: String?
    public var lastHeartbeat: Date?
    public var processServerId: String?
    public var multiVmGroupId: String?
    public var multiVmGroupName: String?
    public var multiVmSyncStatus: String?
    public var protectedDisks: [InMageAzureV2ProtectedDiskDetailsProtocol?]?
    public var diskResized: String?
    public var masterTargetId: String?
    public var sourceVmCpuCount: Int32?
    public var sourceVmRamSizeInMB: Int32?
    public var osType: String?
    public var vhdName: String?
    public var osDiskId: String?
    public var azureVMDiskDetails: [AzureVmDiskDetailsProtocol?]?
    public var recoveryAzureVMName: String?
    public var recoveryAzureVMSize: String?
    public var recoveryAzureStorageAccount: String?
    public var recoveryAzureLogStorageAccountId: String?
    public var vmNics: [VMNicDetailsProtocol?]?
    public var selectedRecoveryAzureNetworkId: String?
    public var selectedSourceNicId: String?
    public var discoveryType: String?
    public var enableRdpOnTargetOption: String?
    public var datastores: [String]?
    public var targetVmId: String?
    public var recoveryAzureResourceGroupId: String?
    public var recoveryAvailabilitySetId: String?
    public var useManagedDisks: String?
    public var licenseType: String?
    public var validationErrors: [HealthErrorProtocol?]?
    public var lastRpoCalculatedTime: Date?
    public var lastUpdateReceivedTime: Date?
    public var replicaId: String?
    public var osVersion: String?

        enum CodingKeys: String, CodingKey {case infrastructureVmId = "infrastructureVmId"
        case vCenterInfrastructureId = "vCenterInfrastructureId"
        case protectionStage = "protectionStage"
        case vmId = "vmId"
        case vmProtectionState = "vmProtectionState"
        case vmProtectionStateDescription = "vmProtectionStateDescription"
        case resyncProgressPercentage = "resyncProgressPercentage"
        case rpoInSeconds = "rpoInSeconds"
        case compressedDataRateInMB = "compressedDataRateInMB"
        case uncompressedDataRateInMB = "uncompressedDataRateInMB"
        case ipAddress = "ipAddress"
        case agentVersion = "agentVersion"
        case agentExpiryDate = "agentExpiryDate"
        case isAgentUpdateRequired = "isAgentUpdateRequired"
        case isRebootAfterUpdateRequired = "isRebootAfterUpdateRequired"
        case lastHeartbeat = "lastHeartbeat"
        case processServerId = "processServerId"
        case multiVmGroupId = "multiVmGroupId"
        case multiVmGroupName = "multiVmGroupName"
        case multiVmSyncStatus = "multiVmSyncStatus"
        case protectedDisks = "protectedDisks"
        case diskResized = "diskResized"
        case masterTargetId = "masterTargetId"
        case sourceVmCpuCount = "sourceVmCpuCount"
        case sourceVmRamSizeInMB = "sourceVmRamSizeInMB"
        case osType = "osType"
        case vhdName = "vhdName"
        case osDiskId = "osDiskId"
        case azureVMDiskDetails = "azureVMDiskDetails"
        case recoveryAzureVMName = "recoveryAzureVMName"
        case recoveryAzureVMSize = "recoveryAzureVMSize"
        case recoveryAzureStorageAccount = "recoveryAzureStorageAccount"
        case recoveryAzureLogStorageAccountId = "recoveryAzureLogStorageAccountId"
        case vmNics = "vmNics"
        case selectedRecoveryAzureNetworkId = "selectedRecoveryAzureNetworkId"
        case selectedSourceNicId = "selectedSourceNicId"
        case discoveryType = "discoveryType"
        case enableRdpOnTargetOption = "enableRdpOnTargetOption"
        case datastores = "datastores"
        case targetVmId = "targetVmId"
        case recoveryAzureResourceGroupId = "recoveryAzureResourceGroupId"
        case recoveryAvailabilitySetId = "recoveryAvailabilitySetId"
        case useManagedDisks = "useManagedDisks"
        case licenseType = "licenseType"
        case validationErrors = "validationErrors"
        case lastRpoCalculatedTime = "lastRpoCalculatedTime"
        case lastUpdateReceivedTime = "lastUpdateReceivedTime"
        case replicaId = "replicaId"
        case osVersion = "osVersion"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.infrastructureVmId) {
        self.infrastructureVmId = try container.decode(String?.self, forKey: .infrastructureVmId)
    }
    if container.contains(.vCenterInfrastructureId) {
        self.vCenterInfrastructureId = try container.decode(String?.self, forKey: .vCenterInfrastructureId)
    }
    if container.contains(.protectionStage) {
        self.protectionStage = try container.decode(String?.self, forKey: .protectionStage)
    }
    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(.resyncProgressPercentage) {
        self.resyncProgressPercentage = try container.decode(Int32?.self, forKey: .resyncProgressPercentage)
    }
    if container.contains(.rpoInSeconds) {
        self.rpoInSeconds = try container.decode(Int64?.self, forKey: .rpoInSeconds)
    }
    if container.contains(.compressedDataRateInMB) {
        self.compressedDataRateInMB = try container.decode(Double?.self, forKey: .compressedDataRateInMB)
    }
    if container.contains(.uncompressedDataRateInMB) {
        self.uncompressedDataRateInMB = try container.decode(Double?.self, forKey: .uncompressedDataRateInMB)
    }
    if container.contains(.ipAddress) {
        self.ipAddress = try container.decode(String?.self, forKey: .ipAddress)
    }
    if container.contains(.agentVersion) {
        self.agentVersion = try container.decode(String?.self, forKey: .agentVersion)
    }
    if container.contains(.agentExpiryDate) {
        self.agentExpiryDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .agentExpiryDate)), format: .dateTime)
    }
    if container.contains(.isAgentUpdateRequired) {
        self.isAgentUpdateRequired = try container.decode(String?.self, forKey: .isAgentUpdateRequired)
    }
    if container.contains(.isRebootAfterUpdateRequired) {
        self.isRebootAfterUpdateRequired = try container.decode(String?.self, forKey: .isRebootAfterUpdateRequired)
    }
    if container.contains(.lastHeartbeat) {
        self.lastHeartbeat = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastHeartbeat)), format: .dateTime)
    }
    if container.contains(.processServerId) {
        self.processServerId = try container.decode(String?.self, forKey: .processServerId)
    }
    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(.multiVmSyncStatus) {
        self.multiVmSyncStatus = try container.decode(String?.self, forKey: .multiVmSyncStatus)
    }
    if container.contains(.protectedDisks) {
        self.protectedDisks = try container.decode([InMageAzureV2ProtectedDiskDetailsData?]?.self, forKey: .protectedDisks)
    }
    if container.contains(.diskResized) {
        self.diskResized = try container.decode(String?.self, forKey: .diskResized)
    }
    if container.contains(.masterTargetId) {
        self.masterTargetId = try container.decode(String?.self, forKey: .masterTargetId)
    }
    if container.contains(.sourceVmCpuCount) {
        self.sourceVmCpuCount = try container.decode(Int32?.self, forKey: .sourceVmCpuCount)
    }
    if container.contains(.sourceVmRamSizeInMB) {
        self.sourceVmRamSizeInMB = try container.decode(Int32?.self, forKey: .sourceVmRamSizeInMB)
    }
    if container.contains(.osType) {
        self.osType = try container.decode(String?.self, forKey: .osType)
    }
    if container.contains(.vhdName) {
        self.vhdName = try container.decode(String?.self, forKey: .vhdName)
    }
    if container.contains(.osDiskId) {
        self.osDiskId = try container.decode(String?.self, forKey: .osDiskId)
    }
    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(.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(.discoveryType) {
        self.discoveryType = try container.decode(String?.self, forKey: .discoveryType)
    }
    if container.contains(.enableRdpOnTargetOption) {
        self.enableRdpOnTargetOption = try container.decode(String?.self, forKey: .enableRdpOnTargetOption)
    }
    if container.contains(.datastores) {
        self.datastores = try container.decode([String]?.self, forKey: .datastores)
    }
    if container.contains(.targetVmId) {
        self.targetVmId = try container.decode(String?.self, forKey: .targetVmId)
    }
    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 container.contains(.validationErrors) {
        self.validationErrors = try container.decode([HealthErrorData?]?.self, forKey: .validationErrors)
    }
    if container.contains(.lastRpoCalculatedTime) {
        self.lastRpoCalculatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRpoCalculatedTime)), format: .dateTime)
    }
    if container.contains(.lastUpdateReceivedTime) {
        self.lastUpdateReceivedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUpdateReceivedTime)), format: .dateTime)
    }
    if container.contains(.replicaId) {
        self.replicaId = try container.decode(String?.self, forKey: .replicaId)
    }
    if container.contains(.osVersion) {
        self.osVersion = try container.decode(String?.self, forKey: .osVersion)
    }
    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.infrastructureVmId != nil {try container.encode(self.infrastructureVmId, forKey: .infrastructureVmId)}
    if self.vCenterInfrastructureId != nil {try container.encode(self.vCenterInfrastructureId, forKey: .vCenterInfrastructureId)}
    if self.protectionStage != nil {try container.encode(self.protectionStage, forKey: .protectionStage)}
    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.resyncProgressPercentage != nil {try container.encode(self.resyncProgressPercentage, forKey: .resyncProgressPercentage)}
    if self.rpoInSeconds != nil {try container.encode(self.rpoInSeconds, forKey: .rpoInSeconds)}
    if self.compressedDataRateInMB != nil {try container.encode(self.compressedDataRateInMB, forKey: .compressedDataRateInMB)}
    if self.uncompressedDataRateInMB != nil {try container.encode(self.uncompressedDataRateInMB, forKey: .uncompressedDataRateInMB)}
    if self.ipAddress != nil {try container.encode(self.ipAddress, forKey: .ipAddress)}
    if self.agentVersion != nil {try container.encode(self.agentVersion, forKey: .agentVersion)}
    if self.agentExpiryDate != nil {
        try container.encode(DateConverter.toString(date: self.agentExpiryDate!, format: .dateTime), forKey: .agentExpiryDate)
    }
    if self.isAgentUpdateRequired != nil {try container.encode(self.isAgentUpdateRequired, forKey: .isAgentUpdateRequired)}
    if self.isRebootAfterUpdateRequired != nil {try container.encode(self.isRebootAfterUpdateRequired, forKey: .isRebootAfterUpdateRequired)}
    if self.lastHeartbeat != nil {
        try container.encode(DateConverter.toString(date: self.lastHeartbeat!, format: .dateTime), forKey: .lastHeartbeat)
    }
    if self.processServerId != nil {try container.encode(self.processServerId, forKey: .processServerId)}
    if self.multiVmGroupId != nil {try container.encode(self.multiVmGroupId, forKey: .multiVmGroupId)}
    if self.multiVmGroupName != nil {try container.encode(self.multiVmGroupName, forKey: .multiVmGroupName)}
    if self.multiVmSyncStatus != nil {try container.encode(self.multiVmSyncStatus, forKey: .multiVmSyncStatus)}
    if self.protectedDisks != nil {try container.encode(self.protectedDisks as! [InMageAzureV2ProtectedDiskDetailsData?]?, forKey: .protectedDisks)}
    if self.diskResized != nil {try container.encode(self.diskResized, forKey: .diskResized)}
    if self.masterTargetId != nil {try container.encode(self.masterTargetId, forKey: .masterTargetId)}
    if self.sourceVmCpuCount != nil {try container.encode(self.sourceVmCpuCount, forKey: .sourceVmCpuCount)}
    if self.sourceVmRamSizeInMB != nil {try container.encode(self.sourceVmRamSizeInMB, forKey: .sourceVmRamSizeInMB)}
    if self.osType != nil {try container.encode(self.osType, forKey: .osType)}
    if self.vhdName != nil {try container.encode(self.vhdName, forKey: .vhdName)}
    if self.osDiskId != nil {try container.encode(self.osDiskId, forKey: .osDiskId)}
    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.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.discoveryType != nil {try container.encode(self.discoveryType, forKey: .discoveryType)}
    if self.enableRdpOnTargetOption != nil {try container.encode(self.enableRdpOnTargetOption, forKey: .enableRdpOnTargetOption)}
    if self.datastores != nil {try container.encode(self.datastores as! [String]?, forKey: .datastores)}
    if self.targetVmId != nil {try container.encode(self.targetVmId, forKey: .targetVmId)}
    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)}
    if self.validationErrors != nil {try container.encode(self.validationErrors as! [HealthErrorData?]?, forKey: .validationErrors)}
    if self.lastRpoCalculatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRpoCalculatedTime!, format: .dateTime), forKey: .lastRpoCalculatedTime)
    }
    if self.lastUpdateReceivedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastUpdateReceivedTime!, format: .dateTime), forKey: .lastUpdateReceivedTime)
    }
    if self.replicaId != nil {try container.encode(self.replicaId, forKey: .replicaId)}
    if self.osVersion != nil {try container.encode(self.osVersion, forKey: .osVersion)}
  }
}

extension DataFactory {
  public static func createInMageAzureV2ReplicationDetailsProtocol() -> InMageAzureV2ReplicationDetailsProtocol {
    return InMageAzureV2ReplicationDetailsData()
  }
}


// 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 InMageAzureV2ReprotectInputData : InMageAzureV2ReprotectInputProtocol, ReverseReplicationProviderSpecificInputProtocol {
    public var masterTargetId: String?
    public var processServerId: String?
    public var storageAccountId: String?
    public var runAsAccountId: String?
    public var policyId: String?
    public var logStorageAccountId: String?
    public var disksToInclude: [String]?

        enum CodingKeys: String, CodingKey {case masterTargetId = "masterTargetId"
        case processServerId = "processServerId"
        case storageAccountId = "storageAccountId"
        case runAsAccountId = "runAsAccountId"
        case policyId = "policyId"
        case logStorageAccountId = "logStorageAccountId"
        case disksToInclude = "disksToInclude"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageAzureV2ReprotectInputProtocol() -> InMageAzureV2ReprotectInputProtocol {
    return InMageAzureV2ReprotectInputData()
  }
}


// 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 InMageAzureV2UpdateReplicationProtectedItemInputData : InMageAzureV2UpdateReplicationProtectedItemInputProtocol, 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 createInMageAzureV2UpdateReplicationProtectedItemInputProtocol() -> InMageAzureV2UpdateReplicationProtectedItemInputProtocol {
    return InMageAzureV2UpdateReplicationProtectedItemInputData()
  }
}


// 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 InMageBasePolicyDetailsData : InMageBasePolicyDetailsProtocol, PolicyProviderSpecificDetailsProtocol {
    public var recoveryPointThresholdInMinutes: Int32?
    public var recoveryPointHistory: Int32?
    public var appConsistentFrequencyInMinutes: Int32?
    public var multiVmSyncStatus: String?

        enum CodingKeys: String, CodingKey {case recoveryPointThresholdInMinutes = "recoveryPointThresholdInMinutes"
        case recoveryPointHistory = "recoveryPointHistory"
        case appConsistentFrequencyInMinutes = "appConsistentFrequencyInMinutes"
        case multiVmSyncStatus = "multiVmSyncStatus"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageBasePolicyDetailsProtocol() -> InMageBasePolicyDetailsProtocol {
    return InMageBasePolicyDetailsData()
  }
}


// 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 InMageDisableProtectionProviderSpecificInputData : InMageDisableProtectionProviderSpecificInputProtocol, DisableProtectionProviderSpecificInputProtocol {
    public var replicaVmDeletionStatus: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageDisableProtectionProviderSpecificInputProtocol() -> InMageDisableProtectionProviderSpecificInputProtocol {
    return InMageDisableProtectionProviderSpecificInputData()
  }
}


// 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 InMageDiskDetailsData : InMageDiskDetailsProtocol {
    public var diskId: String?
    public var diskName: String?
    public var diskSizeInMB: String?
    public var diskType: String?
    public var diskConfiguration: String?
    public var volumeList: [DiskVolumeDetailsProtocol?]?

        enum CodingKeys: String, CodingKey {case diskId = "diskId"
        case diskName = "diskName"
        case diskSizeInMB = "diskSizeInMB"
        case diskType = "diskType"
        case diskConfiguration = "diskConfiguration"
        case volumeList = "volumeList"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageDiskDetailsProtocol() -> InMageDiskDetailsProtocol {
    return InMageDiskDetailsData()
  }
}


// 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 InMageDiskExclusionInputData : InMageDiskExclusionInputProtocol {
    public var volumeOptions: [InMageVolumeExclusionOptionsProtocol?]?
    public var diskSignatureOptions: [InMageDiskSignatureExclusionOptionsProtocol?]?

        enum CodingKeys: String, CodingKey {case volumeOptions = "volumeOptions"
        case diskSignatureOptions = "diskSignatureOptions"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageDiskExclusionInputProtocol() -> InMageDiskExclusionInputProtocol {
    return InMageDiskExclusionInputData()
  }
}


// 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 InMageDiskSignatureExclusionOptionsData : InMageDiskSignatureExclusionOptionsProtocol {
    public var diskSignature: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageDiskSignatureExclusionOptionsProtocol() -> InMageDiskSignatureExclusionOptionsProtocol {
    return InMageDiskSignatureExclusionOptionsData()
  }
}


// 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 InMageEnableProtectionInputData : InMageEnableProtectionInputProtocol, EnableProtectionProviderSpecificInputProtocol {
    public var vmFriendlyName: String?
    public var masterTargetId: String
    public var processServerId: String
    public var retentionDrive: String
    public var runAsAccountId: String?
    public var multiVmGroupId: String
    public var multiVmGroupName: String
    public var datastoreName: String?
    public var diskExclusionInput: InMageDiskExclusionInputProtocol?
    public var disksToInclude: [String]?

        enum CodingKeys: String, CodingKey {case vmFriendlyName = "vmFriendlyName"
        case masterTargetId = "masterTargetId"
        case processServerId = "processServerId"
        case retentionDrive = "retentionDrive"
        case runAsAccountId = "runAsAccountId"
        case multiVmGroupId = "multiVmGroupId"
        case multiVmGroupName = "multiVmGroupName"
        case datastoreName = "datastoreName"
        case diskExclusionInput = "diskExclusionInput"
        case disksToInclude = "disksToInclude"
        }

  public init(masterTargetId: String, processServerId: String, retentionDrive: String, multiVmGroupId: String, multiVmGroupName: String)  {
    self.masterTargetId = masterTargetId
    self.processServerId = processServerId
    self.retentionDrive = retentionDrive
    self.multiVmGroupId = multiVmGroupId
    self.multiVmGroupName = multiVmGroupName
  }

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

extension DataFactory {
  public static func createInMageEnableProtectionInputProtocol(masterTargetId: String, processServerId: String, retentionDrive: String, multiVmGroupId: String, multiVmGroupName: String) -> InMageEnableProtectionInputProtocol {
    return InMageEnableProtectionInputData(masterTargetId: masterTargetId, processServerId: processServerId, retentionDrive: retentionDrive, multiVmGroupId: multiVmGroupId, multiVmGroupName: multiVmGroupName)
  }
}


// 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 InMageFailoverProviderInputData : InMageFailoverProviderInputProtocol, ProviderSpecificFailoverInputProtocol {
    public var recoveryPointType: RecoveryPointTypeEnum?
    public var recoveryPointId: String?

        enum CodingKeys: String, CodingKey {case recoveryPointType = "recoveryPointType"
        case recoveryPointId = "recoveryPointId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageFailoverProviderInputProtocol() -> InMageFailoverProviderInputProtocol {
    return InMageFailoverProviderInputData()
  }
}


// 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 InMagePolicyDetailsData : InMagePolicyDetailsProtocol, PolicyProviderSpecificDetailsProtocol {
    public var recoveryPointThresholdInMinutes: Int32?
    public var recoveryPointHistory: Int32?
    public var appConsistentFrequencyInMinutes: Int32?
    public var multiVmSyncStatus: String?

        enum CodingKeys: String, CodingKey {case recoveryPointThresholdInMinutes = "recoveryPointThresholdInMinutes"
        case recoveryPointHistory = "recoveryPointHistory"
        case appConsistentFrequencyInMinutes = "appConsistentFrequencyInMinutes"
        case multiVmSyncStatus = "multiVmSyncStatus"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMagePolicyDetailsProtocol() -> InMagePolicyDetailsProtocol {
    return InMagePolicyDetailsData()
  }
}


// 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 InMagePolicyInputData : InMagePolicyInputProtocol, PolicyProviderSpecificInputProtocol {
    public var recoveryPointThresholdInMinutes: Int32?
    public var recoveryPointHistory: Int32?
    public var appConsistentFrequencyInMinutes: Int32?
    public var multiVmSyncStatus: SetMultiVmSyncStatusEnum

        enum CodingKeys: String, CodingKey {case recoveryPointThresholdInMinutes = "recoveryPointThresholdInMinutes"
        case recoveryPointHistory = "recoveryPointHistory"
        case appConsistentFrequencyInMinutes = "appConsistentFrequencyInMinutes"
        case multiVmSyncStatus = "multiVmSyncStatus"
        }

  public init(multiVmSyncStatus: SetMultiVmSyncStatusEnum)  {
    self.multiVmSyncStatus = multiVmSyncStatus
  }

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

extension DataFactory {
  public static func createInMagePolicyInputProtocol(multiVmSyncStatus: SetMultiVmSyncStatusEnum) -> InMagePolicyInputProtocol {
    return InMagePolicyInputData(multiVmSyncStatus: multiVmSyncStatus)
  }
}


// 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 InMageProtectedDiskDetailsData : InMageProtectedDiskDetailsProtocol {
    public var diskId: String?
    public var diskName: String?
    public var protectionStage: String?
    public var healthErrorCode: String?
    public var rpoInSeconds: Int64?
    public var resyncRequired: String?
    public var resyncProgressPercentage: Int32?
    public var resyncDurationInSeconds: Int64?
    public var diskCapacityInBytes: Int64?
    public var fileSystemCapacityInBytes: Int64?
    public var sourceDataInMB: Double?
    public var psDataInMB: Double?
    public var targetDataInMB: Double?
    public var diskResized: String?
    public var lastRpoCalculatedTime: Date?

        enum CodingKeys: String, CodingKey {case diskId = "diskId"
        case diskName = "diskName"
        case protectionStage = "protectionStage"
        case healthErrorCode = "healthErrorCode"
        case rpoInSeconds = "rpoInSeconds"
        case resyncRequired = "resyncRequired"
        case resyncProgressPercentage = "resyncProgressPercentage"
        case resyncDurationInSeconds = "resyncDurationInSeconds"
        case diskCapacityInBytes = "diskCapacityInBytes"
        case fileSystemCapacityInBytes = "fileSystemCapacityInBytes"
        case sourceDataInMB = "sourceDataInMB"
        case psDataInMB = "psDataInMB"
        case targetDataInMB = "targetDataInMB"
        case diskResized = "diskResized"
        case lastRpoCalculatedTime = "lastRpoCalculatedTime"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.diskId) {
        self.diskId = try container.decode(String?.self, forKey: .diskId)
    }
    if container.contains(.diskName) {
        self.diskName = try container.decode(String?.self, forKey: .diskName)
    }
    if container.contains(.protectionStage) {
        self.protectionStage = try container.decode(String?.self, forKey: .protectionStage)
    }
    if container.contains(.healthErrorCode) {
        self.healthErrorCode = try container.decode(String?.self, forKey: .healthErrorCode)
    }
    if container.contains(.rpoInSeconds) {
        self.rpoInSeconds = try container.decode(Int64?.self, forKey: .rpoInSeconds)
    }
    if container.contains(.resyncRequired) {
        self.resyncRequired = try container.decode(String?.self, forKey: .resyncRequired)
    }
    if container.contains(.resyncProgressPercentage) {
        self.resyncProgressPercentage = try container.decode(Int32?.self, forKey: .resyncProgressPercentage)
    }
    if container.contains(.resyncDurationInSeconds) {
        self.resyncDurationInSeconds = try container.decode(Int64?.self, forKey: .resyncDurationInSeconds)
    }
    if container.contains(.diskCapacityInBytes) {
        self.diskCapacityInBytes = try container.decode(Int64?.self, forKey: .diskCapacityInBytes)
    }
    if container.contains(.fileSystemCapacityInBytes) {
        self.fileSystemCapacityInBytes = try container.decode(Int64?.self, forKey: .fileSystemCapacityInBytes)
    }
    if container.contains(.sourceDataInMB) {
        self.sourceDataInMB = try container.decode(Double?.self, forKey: .sourceDataInMB)
    }
    if container.contains(.psDataInMB) {
        self.psDataInMB = try container.decode(Double?.self, forKey: .psDataInMB)
    }
    if container.contains(.targetDataInMB) {
        self.targetDataInMB = try container.decode(Double?.self, forKey: .targetDataInMB)
    }
    if container.contains(.diskResized) {
        self.diskResized = try container.decode(String?.self, forKey: .diskResized)
    }
    if container.contains(.lastRpoCalculatedTime) {
        self.lastRpoCalculatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRpoCalculatedTime)), 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.diskId != nil {try container.encode(self.diskId, forKey: .diskId)}
    if self.diskName != nil {try container.encode(self.diskName, forKey: .diskName)}
    if self.protectionStage != nil {try container.encode(self.protectionStage, forKey: .protectionStage)}
    if self.healthErrorCode != nil {try container.encode(self.healthErrorCode, forKey: .healthErrorCode)}
    if self.rpoInSeconds != nil {try container.encode(self.rpoInSeconds, forKey: .rpoInSeconds)}
    if self.resyncRequired != nil {try container.encode(self.resyncRequired, forKey: .resyncRequired)}
    if self.resyncProgressPercentage != nil {try container.encode(self.resyncProgressPercentage, forKey: .resyncProgressPercentage)}
    if self.resyncDurationInSeconds != nil {try container.encode(self.resyncDurationInSeconds, forKey: .resyncDurationInSeconds)}
    if self.diskCapacityInBytes != nil {try container.encode(self.diskCapacityInBytes, forKey: .diskCapacityInBytes)}
    if self.fileSystemCapacityInBytes != nil {try container.encode(self.fileSystemCapacityInBytes, forKey: .fileSystemCapacityInBytes)}
    if self.sourceDataInMB != nil {try container.encode(self.sourceDataInMB, forKey: .sourceDataInMB)}
    if self.psDataInMB != nil {try container.encode(self.psDataInMB, forKey: .psDataInMB)}
    if self.targetDataInMB != nil {try container.encode(self.targetDataInMB, forKey: .targetDataInMB)}
    if self.diskResized != nil {try container.encode(self.diskResized, forKey: .diskResized)}
    if self.lastRpoCalculatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRpoCalculatedTime!, format: .dateTime), forKey: .lastRpoCalculatedTime)
    }
  }
}

extension DataFactory {
  public static func createInMageProtectedDiskDetailsProtocol() -> InMageProtectedDiskDetailsProtocol {
    return InMageProtectedDiskDetailsData()
  }
}


// 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 InMageReplicationDetailsData : InMageReplicationDetailsProtocol, ReplicationProviderSpecificSettingsProtocol {
    public var activeSiteType: String?
    public var sourceVmCpuCount: Int32?
    public var sourceVmRamSizeInMB: Int32?
    public var osDetails: OSDiskDetailsProtocol?
    public var protectionStage: String?
    public var vmId: String?
    public var vmProtectionState: String?
    public var vmProtectionStateDescription: String?
    public var resyncDetails: InitialReplicationDetailsProtocol?
    public var retentionWindowStart: Date?
    public var retentionWindowEnd: Date?
    public var compressedDataRateInMB: Double?
    public var uncompressedDataRateInMB: Double?
    public var rpoInSeconds: Int64?
    public var protectedDisks: [InMageProtectedDiskDetailsProtocol?]?
    public var ipAddress: String?
    public var lastHeartbeat: Date?
    public var processServerId: String?
    public var masterTargetId: String?
    public var consistencyPoints: [String:Date]?
    public var diskResized: String?
    public var rebootAfterUpdateStatus: String?
    public var multiVmGroupId: String?
    public var multiVmGroupName: String?
    public var multiVmSyncStatus: String?
    public var agentDetails: InMageAgentDetailsProtocol?
    public var vCenterInfrastructureId: String?
    public var infrastructureVmId: String?
    public var vmNics: [VMNicDetailsProtocol?]?
    public var discoveryType: String?
    public var azureStorageAccountId: String?
    public var datastores: [String]?
    public var validationErrors: [HealthErrorProtocol?]?
    public var lastRpoCalculatedTime: Date?
    public var lastUpdateReceivedTime: Date?
    public var replicaId: String?
    public var osVersion: String?

        enum CodingKeys: String, CodingKey {case activeSiteType = "activeSiteType"
        case sourceVmCpuCount = "sourceVmCpuCount"
        case sourceVmRamSizeInMB = "sourceVmRamSizeInMB"
        case osDetails = "osDetails"
        case protectionStage = "protectionStage"
        case vmId = "vmId"
        case vmProtectionState = "vmProtectionState"
        case vmProtectionStateDescription = "vmProtectionStateDescription"
        case resyncDetails = "resyncDetails"
        case retentionWindowStart = "retentionWindowStart"
        case retentionWindowEnd = "retentionWindowEnd"
        case compressedDataRateInMB = "compressedDataRateInMB"
        case uncompressedDataRateInMB = "uncompressedDataRateInMB"
        case rpoInSeconds = "rpoInSeconds"
        case protectedDisks = "protectedDisks"
        case ipAddress = "ipAddress"
        case lastHeartbeat = "lastHeartbeat"
        case processServerId = "processServerId"
        case masterTargetId = "masterTargetId"
        case consistencyPoints = "consistencyPoints"
        case diskResized = "diskResized"
        case rebootAfterUpdateStatus = "rebootAfterUpdateStatus"
        case multiVmGroupId = "multiVmGroupId"
        case multiVmGroupName = "multiVmGroupName"
        case multiVmSyncStatus = "multiVmSyncStatus"
        case agentDetails = "agentDetails"
        case vCenterInfrastructureId = "vCenterInfrastructureId"
        case infrastructureVmId = "infrastructureVmId"
        case vmNics = "vmNics"
        case discoveryType = "discoveryType"
        case azureStorageAccountId = "azureStorageAccountId"
        case datastores = "datastores"
        case validationErrors = "validationErrors"
        case lastRpoCalculatedTime = "lastRpoCalculatedTime"
        case lastUpdateReceivedTime = "lastUpdateReceivedTime"
        case replicaId = "replicaId"
        case osVersion = "osVersion"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.activeSiteType) {
        self.activeSiteType = try container.decode(String?.self, forKey: .activeSiteType)
    }
    if container.contains(.sourceVmCpuCount) {
        self.sourceVmCpuCount = try container.decode(Int32?.self, forKey: .sourceVmCpuCount)
    }
    if container.contains(.sourceVmRamSizeInMB) {
        self.sourceVmRamSizeInMB = try container.decode(Int32?.self, forKey: .sourceVmRamSizeInMB)
    }
    if container.contains(.osDetails) {
        self.osDetails = try container.decode(OSDiskDetailsData?.self, forKey: .osDetails)
    }
    if container.contains(.protectionStage) {
        self.protectionStage = try container.decode(String?.self, forKey: .protectionStage)
    }
    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(.resyncDetails) {
        self.resyncDetails = try container.decode(InitialReplicationDetailsData?.self, forKey: .resyncDetails)
    }
    if container.contains(.retentionWindowStart) {
        self.retentionWindowStart = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .retentionWindowStart)), format: .dateTime)
    }
    if container.contains(.retentionWindowEnd) {
        self.retentionWindowEnd = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .retentionWindowEnd)), format: .dateTime)
    }
    if container.contains(.compressedDataRateInMB) {
        self.compressedDataRateInMB = try container.decode(Double?.self, forKey: .compressedDataRateInMB)
    }
    if container.contains(.uncompressedDataRateInMB) {
        self.uncompressedDataRateInMB = try container.decode(Double?.self, forKey: .uncompressedDataRateInMB)
    }
    if container.contains(.rpoInSeconds) {
        self.rpoInSeconds = try container.decode(Int64?.self, forKey: .rpoInSeconds)
    }
    if container.contains(.protectedDisks) {
        self.protectedDisks = try container.decode([InMageProtectedDiskDetailsData?]?.self, forKey: .protectedDisks)
    }
    if container.contains(.ipAddress) {
        self.ipAddress = try container.decode(String?.self, forKey: .ipAddress)
    }
    if container.contains(.lastHeartbeat) {
        self.lastHeartbeat = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastHeartbeat)), format: .dateTime)
    }
    if container.contains(.processServerId) {
        self.processServerId = try container.decode(String?.self, forKey: .processServerId)
    }
    if container.contains(.masterTargetId) {
        self.masterTargetId = try container.decode(String?.self, forKey: .masterTargetId)
    }
    if container.contains(.consistencyPoints) {
        self.consistencyPoints = try container.decode([String:Date]?.self, forKey: .consistencyPoints)
    }
    if container.contains(.diskResized) {
        self.diskResized = try container.decode(String?.self, forKey: .diskResized)
    }
    if container.contains(.rebootAfterUpdateStatus) {
        self.rebootAfterUpdateStatus = try container.decode(String?.self, forKey: .rebootAfterUpdateStatus)
    }
    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(.multiVmSyncStatus) {
        self.multiVmSyncStatus = try container.decode(String?.self, forKey: .multiVmSyncStatus)
    }
    if container.contains(.agentDetails) {
        self.agentDetails = try container.decode(InMageAgentDetailsData?.self, forKey: .agentDetails)
    }
    if container.contains(.vCenterInfrastructureId) {
        self.vCenterInfrastructureId = try container.decode(String?.self, forKey: .vCenterInfrastructureId)
    }
    if container.contains(.infrastructureVmId) {
        self.infrastructureVmId = try container.decode(String?.self, forKey: .infrastructureVmId)
    }
    if container.contains(.vmNics) {
        self.vmNics = try container.decode([VMNicDetailsData?]?.self, forKey: .vmNics)
    }
    if container.contains(.discoveryType) {
        self.discoveryType = try container.decode(String?.self, forKey: .discoveryType)
    }
    if container.contains(.azureStorageAccountId) {
        self.azureStorageAccountId = try container.decode(String?.self, forKey: .azureStorageAccountId)
    }
    if container.contains(.datastores) {
        self.datastores = try container.decode([String]?.self, forKey: .datastores)
    }
    if container.contains(.validationErrors) {
        self.validationErrors = try container.decode([HealthErrorData?]?.self, forKey: .validationErrors)
    }
    if container.contains(.lastRpoCalculatedTime) {
        self.lastRpoCalculatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRpoCalculatedTime)), format: .dateTime)
    }
    if container.contains(.lastUpdateReceivedTime) {
        self.lastUpdateReceivedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUpdateReceivedTime)), format: .dateTime)
    }
    if container.contains(.replicaId) {
        self.replicaId = try container.decode(String?.self, forKey: .replicaId)
    }
    if container.contains(.osVersion) {
        self.osVersion = try container.decode(String?.self, forKey: .osVersion)
    }
    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.activeSiteType != nil {try container.encode(self.activeSiteType, forKey: .activeSiteType)}
    if self.sourceVmCpuCount != nil {try container.encode(self.sourceVmCpuCount, forKey: .sourceVmCpuCount)}
    if self.sourceVmRamSizeInMB != nil {try container.encode(self.sourceVmRamSizeInMB, forKey: .sourceVmRamSizeInMB)}
    if self.osDetails != nil {try container.encode(self.osDetails as! OSDiskDetailsData?, forKey: .osDetails)}
    if self.protectionStage != nil {try container.encode(self.protectionStage, forKey: .protectionStage)}
    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.resyncDetails != nil {try container.encode(self.resyncDetails as! InitialReplicationDetailsData?, forKey: .resyncDetails)}
    if self.retentionWindowStart != nil {
        try container.encode(DateConverter.toString(date: self.retentionWindowStart!, format: .dateTime), forKey: .retentionWindowStart)
    }
    if self.retentionWindowEnd != nil {
        try container.encode(DateConverter.toString(date: self.retentionWindowEnd!, format: .dateTime), forKey: .retentionWindowEnd)
    }
    if self.compressedDataRateInMB != nil {try container.encode(self.compressedDataRateInMB, forKey: .compressedDataRateInMB)}
    if self.uncompressedDataRateInMB != nil {try container.encode(self.uncompressedDataRateInMB, forKey: .uncompressedDataRateInMB)}
    if self.rpoInSeconds != nil {try container.encode(self.rpoInSeconds, forKey: .rpoInSeconds)}
    if self.protectedDisks != nil {try container.encode(self.protectedDisks as! [InMageProtectedDiskDetailsData?]?, forKey: .protectedDisks)}
    if self.ipAddress != nil {try container.encode(self.ipAddress, forKey: .ipAddress)}
    if self.lastHeartbeat != nil {
        try container.encode(DateConverter.toString(date: self.lastHeartbeat!, format: .dateTime), forKey: .lastHeartbeat)
    }
    if self.processServerId != nil {try container.encode(self.processServerId, forKey: .processServerId)}
    if self.masterTargetId != nil {try container.encode(self.masterTargetId, forKey: .masterTargetId)}
    if self.consistencyPoints != nil {try container.encode(self.consistencyPoints, forKey: .consistencyPoints)}
    if self.diskResized != nil {try container.encode(self.diskResized, forKey: .diskResized)}
    if self.rebootAfterUpdateStatus != nil {try container.encode(self.rebootAfterUpdateStatus, forKey: .rebootAfterUpdateStatus)}
    if self.multiVmGroupId != nil {try container.encode(self.multiVmGroupId, forKey: .multiVmGroupId)}
    if self.multiVmGroupName != nil {try container.encode(self.multiVmGroupName, forKey: .multiVmGroupName)}
    if self.multiVmSyncStatus != nil {try container.encode(self.multiVmSyncStatus, forKey: .multiVmSyncStatus)}
    if self.agentDetails != nil {try container.encode(self.agentDetails as! InMageAgentDetailsData?, forKey: .agentDetails)}
    if self.vCenterInfrastructureId != nil {try container.encode(self.vCenterInfrastructureId, forKey: .vCenterInfrastructureId)}
    if self.infrastructureVmId != nil {try container.encode(self.infrastructureVmId, forKey: .infrastructureVmId)}
    if self.vmNics != nil {try container.encode(self.vmNics as! [VMNicDetailsData?]?, forKey: .vmNics)}
    if self.discoveryType != nil {try container.encode(self.discoveryType, forKey: .discoveryType)}
    if self.azureStorageAccountId != nil {try container.encode(self.azureStorageAccountId, forKey: .azureStorageAccountId)}
    if self.datastores != nil {try container.encode(self.datastores as! [String]?, forKey: .datastores)}
    if self.validationErrors != nil {try container.encode(self.validationErrors as! [HealthErrorData?]?, forKey: .validationErrors)}
    if self.lastRpoCalculatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRpoCalculatedTime!, format: .dateTime), forKey: .lastRpoCalculatedTime)
    }
    if self.lastUpdateReceivedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastUpdateReceivedTime!, format: .dateTime), forKey: .lastUpdateReceivedTime)
    }
    if self.replicaId != nil {try container.encode(self.replicaId, forKey: .replicaId)}
    if self.osVersion != nil {try container.encode(self.osVersion, forKey: .osVersion)}
  }
}

extension DataFactory {
  public static func createInMageReplicationDetailsProtocol() -> InMageReplicationDetailsProtocol {
    return InMageReplicationDetailsData()
  }
}


// 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 InMageReprotectInputData : InMageReprotectInputProtocol, ReverseReplicationProviderSpecificInputProtocol {
    public var masterTargetId: String
    public var processServerId: String
    public var retentionDrive: String
    public var runAsAccountId: String?
    public var datastoreName: String?
    public var diskExclusionInput: InMageDiskExclusionInputProtocol?
    public var profileId: String
    public var disksToInclude: [String]?

        enum CodingKeys: String, CodingKey {case masterTargetId = "masterTargetId"
        case processServerId = "processServerId"
        case retentionDrive = "retentionDrive"
        case runAsAccountId = "runAsAccountId"
        case datastoreName = "datastoreName"
        case diskExclusionInput = "diskExclusionInput"
        case profileId = "profileId"
        case disksToInclude = "disksToInclude"
        }

  public init(masterTargetId: String, processServerId: String, retentionDrive: String, profileId: String)  {
    self.masterTargetId = masterTargetId
    self.processServerId = processServerId
    self.retentionDrive = retentionDrive
    self.profileId = profileId
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.masterTargetId = try container.decode(String.self, forKey: .masterTargetId)
    self.processServerId = try container.decode(String.self, forKey: .processServerId)
    self.retentionDrive = try container.decode(String.self, forKey: .retentionDrive)
    if container.contains(.runAsAccountId) {
        self.runAsAccountId = try container.decode(String?.self, forKey: .runAsAccountId)
    }
    if container.contains(.datastoreName) {
        self.datastoreName = try container.decode(String?.self, forKey: .datastoreName)
    }
    if container.contains(.diskExclusionInput) {
        self.diskExclusionInput = try container.decode(InMageDiskExclusionInputData?.self, forKey: .diskExclusionInput)
    }
    self.profileId = try container.decode(String.self, forKey: .profileId)
    if container.contains(.disksToInclude) {
        self.disksToInclude = try container.decode([String]?.self, forKey: .disksToInclude)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.masterTargetId, forKey: .masterTargetId)
    try container.encode(self.processServerId, forKey: .processServerId)
    try container.encode(self.retentionDrive, forKey: .retentionDrive)
    if self.runAsAccountId != nil {try container.encode(self.runAsAccountId, forKey: .runAsAccountId)}
    if self.datastoreName != nil {try container.encode(self.datastoreName, forKey: .datastoreName)}
    if self.diskExclusionInput != nil {try container.encode(self.diskExclusionInput as! InMageDiskExclusionInputData?, forKey: .diskExclusionInput)}
    try container.encode(self.profileId, forKey: .profileId)
    if self.disksToInclude != nil {try container.encode(self.disksToInclude as! [String]?, forKey: .disksToInclude)}
  }
}

extension DataFactory {
  public static func createInMageReprotectInputProtocol(masterTargetId: String, processServerId: String, retentionDrive: String, profileId: String) -> InMageReprotectInputProtocol {
    return InMageReprotectInputData(masterTargetId: masterTargetId, processServerId: processServerId, retentionDrive: retentionDrive, profileId: profileId)
  }
}


// InMageV2RpRecoveryPointType enumerates the values for in mage v2 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 InMageV2RpRecoveryPointTypeEnum: String, Codable
{
// InMageV2RpRecoveryPointTypeLatest specifies the in mage v2 rp recovery point type latest state for in mage v2 rp
// recovery point type.
    case InMageV2RpRecoveryPointTypeLatest = "Latest"
// InMageV2RpRecoveryPointTypeLatestApplicationConsistent specifies the in mage v2 rp recovery point type latest
// application consistent state for in mage v2 rp recovery point type.
    case InMageV2RpRecoveryPointTypeLatestApplicationConsistent = "LatestApplicationConsistent"
// InMageV2RpRecoveryPointTypeLatestCrashConsistent specifies the in mage v2 rp recovery point type latest crash
// consistent state for in mage v2 rp recovery point type.
    case InMageV2RpRecoveryPointTypeLatestCrashConsistent = "LatestCrashConsistent"
// InMageV2RpRecoveryPointTypeLatestProcessed specifies the in mage v2 rp recovery point type latest processed state
// for in mage v2 rp recovery point type.
    case InMageV2RpRecoveryPointTypeLatestProcessed = "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 InMageVolumeExclusionOptionsData : InMageVolumeExclusionOptionsProtocol {
    public var volumeLabel: String?
    public var onlyExcludeIfSingleVolume: String?

        enum CodingKeys: String, CodingKey {case volumeLabel = "volumeLabel"
        case onlyExcludeIfSingleVolume = "onlyExcludeIfSingleVolume"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInMageVolumeExclusionOptionsProtocol() -> InMageVolumeExclusionOptionsProtocol {
    return InMageVolumeExclusionOptionsData()
  }
}