// 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 DpmJobTaskDetailsData : DpmJobTaskDetailsProtocol {
    public var taskId: String?
    public var startTime: Date?
    public var endTime: Date?
    public var duration: String?
    public var status: String?

        enum CodingKeys: String, CodingKey {case taskId = "taskId"
        case startTime = "startTime"
        case endTime = "endTime"
        case duration = "duration"
        case status = "status"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDpmJobTaskDetailsProtocol() -> DpmJobTaskDetailsProtocol {
    return DpmJobTaskDetailsData()
  }
}


// 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 DPMProtectedItemData : DPMProtectedItemProtocol, ProtectedItemProtocol {
    public var backupManagementType: BackupManagementTypeEnum?
    public var workloadType: DataSourceTypeEnum?
    public var containerName: String?
    public var sourceResourceId: String?
    public var policyId: String?
    public var lastRecoveryPoint: Date?
    public var backupSetName: String?
    public var friendlyName: String?
    public var backupEngineName: String?
    public var protectionState: ProtectedItemStateEnum?
    public var isScheduledForDeferredDelete: Bool?
    public var extendedInfo: DPMProtectedItemExtendedInfoProtocol?

        enum CodingKeys: String, CodingKey {case backupManagementType = "backupManagementType"
        case workloadType = "workloadType"
        case containerName = "containerName"
        case sourceResourceId = "sourceResourceId"
        case policyId = "policyId"
        case lastRecoveryPoint = "lastRecoveryPoint"
        case backupSetName = "backupSetName"
        case friendlyName = "friendlyName"
        case backupEngineName = "backupEngineName"
        case protectionState = "protectionState"
        case isScheduledForDeferredDelete = "isScheduledForDeferredDelete"
        case extendedInfo = "extendedInfo"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.backupManagementType) {
        self.backupManagementType = try container.decode(BackupManagementTypeEnum?.self, forKey: .backupManagementType)
    }
    if container.contains(.workloadType) {
        self.workloadType = try container.decode(DataSourceTypeEnum?.self, forKey: .workloadType)
    }
    if container.contains(.containerName) {
        self.containerName = try container.decode(String?.self, forKey: .containerName)
    }
    if container.contains(.sourceResourceId) {
        self.sourceResourceId = try container.decode(String?.self, forKey: .sourceResourceId)
    }
    if container.contains(.policyId) {
        self.policyId = try container.decode(String?.self, forKey: .policyId)
    }
    if container.contains(.lastRecoveryPoint) {
        self.lastRecoveryPoint = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRecoveryPoint)), format: .dateTime)
    }
    if container.contains(.backupSetName) {
        self.backupSetName = try container.decode(String?.self, forKey: .backupSetName)
    }
    if container.contains(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.backupEngineName) {
        self.backupEngineName = try container.decode(String?.self, forKey: .backupEngineName)
    }
    if container.contains(.protectionState) {
        self.protectionState = try container.decode(ProtectedItemStateEnum?.self, forKey: .protectionState)
    }
    if container.contains(.isScheduledForDeferredDelete) {
        self.isScheduledForDeferredDelete = try container.decode(Bool?.self, forKey: .isScheduledForDeferredDelete)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(DPMProtectedItemExtendedInfoData?.self, forKey: .extendedInfo)
    }
    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.backupManagementType != nil {try container.encode(self.backupManagementType, forKey: .backupManagementType)}
    if self.workloadType != nil {try container.encode(self.workloadType, forKey: .workloadType)}
    if self.containerName != nil {try container.encode(self.containerName, forKey: .containerName)}
    if self.sourceResourceId != nil {try container.encode(self.sourceResourceId, forKey: .sourceResourceId)}
    if self.policyId != nil {try container.encode(self.policyId, forKey: .policyId)}
    if self.lastRecoveryPoint != nil {
        try container.encode(DateConverter.toString(date: self.lastRecoveryPoint!, format: .dateTime), forKey: .lastRecoveryPoint)
    }
    if self.backupSetName != nil {try container.encode(self.backupSetName, forKey: .backupSetName)}
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.backupEngineName != nil {try container.encode(self.backupEngineName, forKey: .backupEngineName)}
    if self.protectionState != nil {try container.encode(self.protectionState, forKey: .protectionState)}
    if self.isScheduledForDeferredDelete != nil {try container.encode(self.isScheduledForDeferredDelete, forKey: .isScheduledForDeferredDelete)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! DPMProtectedItemExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createDPMProtectedItemProtocol() -> DPMProtectedItemProtocol {
    return DPMProtectedItemData()
  }
}


// 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 DPMProtectedItemExtendedInfoData : DPMProtectedItemExtendedInfoProtocol {
    public var protectableObjectLoadPath: [String:String]?
    public var protected: Bool?
    public var isPresentOnCloud: Bool?
    public var lastBackupStatus: String?
    public var lastRefreshedAt: Date?
    public var oldestRecoveryPoint: Date?
    public var recoveryPointCount: Int32?
    public var onPremiseOldestRecoveryPoint: Date?
    public var onPremiseLatestRecoveryPoint: Date?
    public var onPremiseRecoveryPointCount: Int32?
    public var isCollocated: Bool?
    public var protectionGroupName: String?
    public var diskStorageUsedInBytes: String?
    public var totalDiskStorageSizeInBytes: String?

        enum CodingKeys: String, CodingKey {case protectableObjectLoadPath = "protectableObjectLoadPath"
        case protected = "protected"
        case isPresentOnCloud = "isPresentOnCloud"
        case lastBackupStatus = "lastBackupStatus"
        case lastRefreshedAt = "lastRefreshedAt"
        case oldestRecoveryPoint = "oldestRecoveryPoint"
        case recoveryPointCount = "recoveryPointCount"
        case onPremiseOldestRecoveryPoint = "onPremiseOldestRecoveryPoint"
        case onPremiseLatestRecoveryPoint = "onPremiseLatestRecoveryPoint"
        case onPremiseRecoveryPointCount = "onPremiseRecoveryPointCount"
        case isCollocated = "isCollocated"
        case protectionGroupName = "protectionGroupName"
        case diskStorageUsedInBytes = "diskStorageUsedInBytes"
        case totalDiskStorageSizeInBytes = "totalDiskStorageSizeInBytes"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.protectableObjectLoadPath) {
        self.protectableObjectLoadPath = try container.decode([String:String]?.self, forKey: .protectableObjectLoadPath)
    }
    if container.contains(.protected) {
        self.protected = try container.decode(Bool?.self, forKey: .protected)
    }
    if container.contains(.isPresentOnCloud) {
        self.isPresentOnCloud = try container.decode(Bool?.self, forKey: .isPresentOnCloud)
    }
    if container.contains(.lastBackupStatus) {
        self.lastBackupStatus = try container.decode(String?.self, forKey: .lastBackupStatus)
    }
    if container.contains(.lastRefreshedAt) {
        self.lastRefreshedAt = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRefreshedAt)), format: .dateTime)
    }
    if container.contains(.oldestRecoveryPoint) {
        self.oldestRecoveryPoint = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .oldestRecoveryPoint)), format: .dateTime)
    }
    if container.contains(.recoveryPointCount) {
        self.recoveryPointCount = try container.decode(Int32?.self, forKey: .recoveryPointCount)
    }
    if container.contains(.onPremiseOldestRecoveryPoint) {
        self.onPremiseOldestRecoveryPoint = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .onPremiseOldestRecoveryPoint)), format: .dateTime)
    }
    if container.contains(.onPremiseLatestRecoveryPoint) {
        self.onPremiseLatestRecoveryPoint = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .onPremiseLatestRecoveryPoint)), format: .dateTime)
    }
    if container.contains(.onPremiseRecoveryPointCount) {
        self.onPremiseRecoveryPointCount = try container.decode(Int32?.self, forKey: .onPremiseRecoveryPointCount)
    }
    if container.contains(.isCollocated) {
        self.isCollocated = try container.decode(Bool?.self, forKey: .isCollocated)
    }
    if container.contains(.protectionGroupName) {
        self.protectionGroupName = try container.decode(String?.self, forKey: .protectionGroupName)
    }
    if container.contains(.diskStorageUsedInBytes) {
        self.diskStorageUsedInBytes = try container.decode(String?.self, forKey: .diskStorageUsedInBytes)
    }
    if container.contains(.totalDiskStorageSizeInBytes) {
        self.totalDiskStorageSizeInBytes = try container.decode(String?.self, forKey: .totalDiskStorageSizeInBytes)
    }
    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.protectableObjectLoadPath != nil {try container.encode(self.protectableObjectLoadPath, forKey: .protectableObjectLoadPath)}
    if self.protected != nil {try container.encode(self.protected, forKey: .protected)}
    if self.isPresentOnCloud != nil {try container.encode(self.isPresentOnCloud, forKey: .isPresentOnCloud)}
    if self.lastBackupStatus != nil {try container.encode(self.lastBackupStatus, forKey: .lastBackupStatus)}
    if self.lastRefreshedAt != nil {
        try container.encode(DateConverter.toString(date: self.lastRefreshedAt!, format: .dateTime), forKey: .lastRefreshedAt)
    }
    if self.oldestRecoveryPoint != nil {
        try container.encode(DateConverter.toString(date: self.oldestRecoveryPoint!, format: .dateTime), forKey: .oldestRecoveryPoint)
    }
    if self.recoveryPointCount != nil {try container.encode(self.recoveryPointCount, forKey: .recoveryPointCount)}
    if self.onPremiseOldestRecoveryPoint != nil {
        try container.encode(DateConverter.toString(date: self.onPremiseOldestRecoveryPoint!, format: .dateTime), forKey: .onPremiseOldestRecoveryPoint)
    }
    if self.onPremiseLatestRecoveryPoint != nil {
        try container.encode(DateConverter.toString(date: self.onPremiseLatestRecoveryPoint!, format: .dateTime), forKey: .onPremiseLatestRecoveryPoint)
    }
    if self.onPremiseRecoveryPointCount != nil {try container.encode(self.onPremiseRecoveryPointCount, forKey: .onPremiseRecoveryPointCount)}
    if self.isCollocated != nil {try container.encode(self.isCollocated, forKey: .isCollocated)}
    if self.protectionGroupName != nil {try container.encode(self.protectionGroupName, forKey: .protectionGroupName)}
    if self.diskStorageUsedInBytes != nil {try container.encode(self.diskStorageUsedInBytes, forKey: .diskStorageUsedInBytes)}
    if self.totalDiskStorageSizeInBytes != nil {try container.encode(self.totalDiskStorageSizeInBytes, forKey: .totalDiskStorageSizeInBytes)}
  }
}

extension DataFactory {
  public static func createDPMProtectedItemExtendedInfoProtocol() -> DPMProtectedItemExtendedInfoProtocol {
    return DPMProtectedItemExtendedInfoData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct EncryptionDetailsData : EncryptionDetailsProtocol {
    public var encryptionEnabled: Bool?
    public var kekUrl: String?
    public var secretKeyUrl: String?
    public var kekVaultId: String?
    public var secretKeyVaultId: String?

        enum CodingKeys: String, CodingKey {case encryptionEnabled = "encryptionEnabled"
        case kekUrl = "kekUrl"
        case secretKeyUrl = "secretKeyUrl"
        case kekVaultId = "kekVaultId"
        case secretKeyVaultId = "secretKeyVaultId"
        }

  public init()  {
  }

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

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


// EnhancedSecurityState enumerates the values for enhanced security state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum EnhancedSecurityStateEnum: String, Codable
{
// EnhancedSecurityStateDisabled specifies the enhanced security state disabled state for enhanced security state.
    case EnhancedSecurityStateDisabled = "Disabled"
// EnhancedSecurityStateEnabled specifies the enhanced security state enabled state for enhanced security state.
    case EnhancedSecurityStateEnabled = "Enabled"
// EnhancedSecurityStateInvalid specifies the enhanced security state invalid state for enhanced security state.
    case EnhancedSecurityStateInvalid = "Invalid"
}


// 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 ErrorDetailData : ErrorDetailProtocol {
    public var code: String?
    public var message: String?
    public var recommendations: [String]?

        enum CodingKeys: String, CodingKey {case code = "code"
        case message = "message"
        case recommendations = "recommendations"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createErrorDetailProtocol() -> ErrorDetailProtocol {
    return ErrorDetailData()
  }
}


// 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 ExportJobsOperationResultInfoData : ExportJobsOperationResultInfoProtocol, OperationResultInfoBaseProtocol {
    public var blobUrl: String?
    public var blobSasKey: String?

        enum CodingKeys: String, CodingKey {case blobUrl = "blobUrl"
        case blobSasKey = "blobSasKey"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createExportJobsOperationResultInfoProtocol() -> ExportJobsOperationResultInfoProtocol {
    return ExportJobsOperationResultInfoData()
  }
}


// FabricName enumerates the values for fabric name.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum FabricNameEnum: String, Codable
{
// FabricNameAzure specifies the fabric name azure state for fabric name.
    case FabricNameAzure = "Azure"
// FabricNameInvalid specifies the fabric name invalid state for fabric name.
    case FabricNameInvalid = "Invalid"
}


// 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 FeatureSupportRequestData : FeatureSupportRequestProtocol {

  public init()  {
  }

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

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

extension DataFactory {
  public static func createFeatureSupportRequestProtocol() -> FeatureSupportRequestProtocol {
    return FeatureSupportRequestData()
  }
}


// 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 GenericContainerData : GenericContainerProtocol, ProtectionContainerProtocol {
    public var friendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var registrationStatus: String?
    public var healthStatus: String?
    public var fabricName: String?
    public var extendedInformation: GenericContainerExtendedInfoProtocol?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case backupManagementType = "backupManagementType"
        case registrationStatus = "registrationStatus"
        case healthStatus = "healthStatus"
        case fabricName = "fabricName"
        case extendedInformation = "extendedInformation"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.backupManagementType != nil {try container.encode(self.backupManagementType, forKey: .backupManagementType)}
    if self.registrationStatus != nil {try container.encode(self.registrationStatus, forKey: .registrationStatus)}
    if self.healthStatus != nil {try container.encode(self.healthStatus, forKey: .healthStatus)}
    if self.fabricName != nil {try container.encode(self.fabricName, forKey: .fabricName)}
    if self.extendedInformation != nil {try container.encode(self.extendedInformation as! GenericContainerExtendedInfoData?, forKey: .extendedInformation)}
  }
}

extension DataFactory {
  public static func createGenericContainerProtocol() -> GenericContainerProtocol {
    return GenericContainerData()
  }
}


// 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 GenericContainerExtendedInfoData : GenericContainerExtendedInfoProtocol {
    public var rawCertData: String?
    public var containerIdentityInfo: ContainerIdentityInfoProtocol?
    public var serviceEndpoints: [String:String]?

        enum CodingKeys: String, CodingKey {case rawCertData = "rawCertData"
        case containerIdentityInfo = "containerIdentityInfo"
        case serviceEndpoints = "serviceEndpoints"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createGenericContainerExtendedInfoProtocol() -> GenericContainerExtendedInfoProtocol {
    return GenericContainerExtendedInfoData()
  }
}


// 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 GenericProtectedItemData : GenericProtectedItemProtocol, ProtectedItemProtocol {
    public var backupManagementType: BackupManagementTypeEnum?
    public var workloadType: DataSourceTypeEnum?
    public var containerName: String?
    public var sourceResourceId: String?
    public var policyId: String?
    public var lastRecoveryPoint: Date?
    public var backupSetName: String?
    public var friendlyName: String?
    public var policyState: String?
    public var protectionState: ProtectionStateEnum?
    public var protectedItemId: Int64?
    public var sourceAssociations: [String:String]?
    public var fabricName: String?

        enum CodingKeys: String, CodingKey {case backupManagementType = "backupManagementType"
        case workloadType = "workloadType"
        case containerName = "containerName"
        case sourceResourceId = "sourceResourceId"
        case policyId = "policyId"
        case lastRecoveryPoint = "lastRecoveryPoint"
        case backupSetName = "backupSetName"
        case friendlyName = "friendlyName"
        case policyState = "policyState"
        case protectionState = "protectionState"
        case protectedItemId = "protectedItemId"
        case sourceAssociations = "sourceAssociations"
        case fabricName = "fabricName"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.backupManagementType) {
        self.backupManagementType = try container.decode(BackupManagementTypeEnum?.self, forKey: .backupManagementType)
    }
    if container.contains(.workloadType) {
        self.workloadType = try container.decode(DataSourceTypeEnum?.self, forKey: .workloadType)
    }
    if container.contains(.containerName) {
        self.containerName = try container.decode(String?.self, forKey: .containerName)
    }
    if container.contains(.sourceResourceId) {
        self.sourceResourceId = try container.decode(String?.self, forKey: .sourceResourceId)
    }
    if container.contains(.policyId) {
        self.policyId = try container.decode(String?.self, forKey: .policyId)
    }
    if container.contains(.lastRecoveryPoint) {
        self.lastRecoveryPoint = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRecoveryPoint)), format: .dateTime)
    }
    if container.contains(.backupSetName) {
        self.backupSetName = try container.decode(String?.self, forKey: .backupSetName)
    }
    if container.contains(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.policyState) {
        self.policyState = try container.decode(String?.self, forKey: .policyState)
    }
    if container.contains(.protectionState) {
        self.protectionState = try container.decode(ProtectionStateEnum?.self, forKey: .protectionState)
    }
    if container.contains(.protectedItemId) {
        self.protectedItemId = try container.decode(Int64?.self, forKey: .protectedItemId)
    }
    if container.contains(.sourceAssociations) {
        self.sourceAssociations = try container.decode([String:String]?.self, forKey: .sourceAssociations)
    }
    if container.contains(.fabricName) {
        self.fabricName = try container.decode(String?.self, forKey: .fabricName)
    }
    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.backupManagementType != nil {try container.encode(self.backupManagementType, forKey: .backupManagementType)}
    if self.workloadType != nil {try container.encode(self.workloadType, forKey: .workloadType)}
    if self.containerName != nil {try container.encode(self.containerName, forKey: .containerName)}
    if self.sourceResourceId != nil {try container.encode(self.sourceResourceId, forKey: .sourceResourceId)}
    if self.policyId != nil {try container.encode(self.policyId, forKey: .policyId)}
    if self.lastRecoveryPoint != nil {
        try container.encode(DateConverter.toString(date: self.lastRecoveryPoint!, format: .dateTime), forKey: .lastRecoveryPoint)
    }
    if self.backupSetName != nil {try container.encode(self.backupSetName, forKey: .backupSetName)}
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.policyState != nil {try container.encode(self.policyState, forKey: .policyState)}
    if self.protectionState != nil {try container.encode(self.protectionState, forKey: .protectionState)}
    if self.protectedItemId != nil {try container.encode(self.protectedItemId, forKey: .protectedItemId)}
    if self.sourceAssociations != nil {try container.encode(self.sourceAssociations, forKey: .sourceAssociations)}
    if self.fabricName != nil {try container.encode(self.fabricName, forKey: .fabricName)}
  }
}

extension DataFactory {
  public static func createGenericProtectedItemProtocol() -> GenericProtectedItemProtocol {
    return GenericProtectedItemData()
  }
}


// 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 GenericProtectionPolicyData : GenericProtectionPolicyProtocol, ProtectionPolicyProtocol {
    public var protectedItemsCount: Int32?
    public var subProtectionPolicy: [SubProtectionPolicyProtocol?]?
    public var timeZone: String?
    public var fabricName: String?

        enum CodingKeys: String, CodingKey {case protectedItemsCount = "protectedItemsCount"
        case subProtectionPolicy = "subProtectionPolicy"
        case timeZone = "timeZone"
        case fabricName = "fabricName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createGenericProtectionPolicyProtocol() -> GenericProtectionPolicyProtocol {
    return GenericProtectionPolicyData()
  }
}


// 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 GenericRecoveryPointData : GenericRecoveryPointProtocol, RecoveryPointProtocol {
    public var friendlyName: String?
    public var recoveryPointType: String?
    public var recoveryPointTime: Date?
    public var recoveryPointAdditionalInfo: String?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case recoveryPointType = "recoveryPointType"
        case recoveryPointTime = "recoveryPointTime"
        case recoveryPointAdditionalInfo = "recoveryPointAdditionalInfo"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createGenericRecoveryPointProtocol() -> GenericRecoveryPointProtocol {
    return GenericRecoveryPointData()
  }
}


// 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 GetProtectedItemQueryObjectData : GetProtectedItemQueryObjectProtocol {
    public var expand: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createGetProtectedItemQueryObjectProtocol() -> GetProtectedItemQueryObjectProtocol {
    return GetProtectedItemQueryObjectData()
  }
}


// HealthState enumerates the values for health state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum HealthStateEnum: String, Codable
{
// HealthStateActionRequired specifies the health state action required state for health state.
    case HealthStateActionRequired = "ActionRequired"
// HealthStateActionSuggested specifies the health state action suggested state for health state.
    case HealthStateActionSuggested = "ActionSuggested"
// HealthStateInvalid specifies the health state invalid state for health state.
    case HealthStateInvalid = "Invalid"
// HealthStatePassed specifies the health state passed state for health state.
    case HealthStatePassed = "Passed"
}


// HealthStatus enumerates the values for health status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum HealthStatusEnum: String, Codable
{
// HealthStatusActionRequired specifies the health status action required state for health status.
    case HealthStatusActionRequired = "ActionRequired"
// HealthStatusActionSuggested specifies the health status action suggested state for health status.
    case HealthStatusActionSuggested = "ActionSuggested"
// HealthStatusInvalid specifies the health status invalid state for health status.
    case HealthStatusInvalid = "Invalid"
// HealthStatusPassed specifies the health status passed state for health status.
    case HealthStatusPassed = "Passed"
}


// HttpStatusCode enumerates the values for http status code.

// 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 HttpStatusCodeEnum: String, Codable
{
// Accepted specifies the accepted state for http status code.
    case Accepted = "Accepted"
// Ambiguous specifies the ambiguous state for http status code.
    case Ambiguous = "Ambiguous"
// BadGateway specifies the bad gateway state for http status code.
    case BadGateway = "BadGateway"
// BadRequest specifies the bad request state for http status code.
    case BadRequest = "BadRequest"
// Conflict specifies the conflict state for http status code.
    case Conflict = "Conflict"
// Continue specifies the continue state for http status code.
    case Continue = "Continue"
// Created specifies the created state for http status code.
    case Created = "Created"
// ExpectationFailed specifies the expectation failed state for http status code.
    case ExpectationFailed = "ExpectationFailed"
// Forbidden specifies the forbidden state for http status code.
    case Forbidden = "Forbidden"
// Found specifies the found state for http status code.
    case Found = "Found"
// GatewayTimeout specifies the gateway timeout state for http status code.
    case GatewayTimeout = "GatewayTimeout"
// Gone specifies the gone state for http status code.
    case Gone = "Gone"
// HttpVersionNotSupported specifies the http version not supported state for http status code.
    case HttpVersionNotSupported = "HttpVersionNotSupported"
// InternalServerError specifies the internal server error state for http status code.
    case InternalServerError = "InternalServerError"
// LengthRequired specifies the length required state for http status code.
    case LengthRequired = "LengthRequired"
// MethodNotAllowed specifies the method not allowed state for http status code.
    case MethodNotAllowed = "MethodNotAllowed"
// Moved specifies the moved state for http status code.
    case Moved = "Moved"
// MovedPermanently specifies the moved permanently state for http status code.
    case MovedPermanently = "MovedPermanently"
// MultipleChoices specifies the multiple choices state for http status code.
    case MultipleChoices = "MultipleChoices"
// NoContent specifies the no content state for http status code.
    case NoContent = "NoContent"
// NonAuthoritativeInformation specifies the non authoritative information state for http status code.
    case NonAuthoritativeInformation = "NonAuthoritativeInformation"
// NotAcceptable specifies the not acceptable state for http status code.
    case NotAcceptable = "NotAcceptable"
// NotFound specifies the not found state for http status code.
    case NotFound = "NotFound"
// NotImplemented specifies the not implemented state for http status code.
    case NotImplemented = "NotImplemented"
// NotModified specifies the not modified state for http status code.
    case NotModified = "NotModified"
// OK specifies the ok state for http status code.
    case OK = "OK"
// PartialContent specifies the partial content state for http status code.
    case PartialContent = "PartialContent"
// PaymentRequired specifies the payment required state for http status code.
    case PaymentRequired = "PaymentRequired"
// PreconditionFailed specifies the precondition failed state for http status code.
    case PreconditionFailed = "PreconditionFailed"
// ProxyAuthenticationRequired specifies the proxy authentication required state for http status code.
    case ProxyAuthenticationRequired = "ProxyAuthenticationRequired"
// Redirect specifies the redirect state for http status code.
    case Redirect = "Redirect"
// RedirectKeepVerb specifies the redirect keep verb state for http status code.
    case RedirectKeepVerb = "RedirectKeepVerb"
// RedirectMethod specifies the redirect method state for http status code.
    case RedirectMethod = "RedirectMethod"
// RequestedRangeNotSatisfiable specifies the requested range not satisfiable state for http status code.
    case RequestedRangeNotSatisfiable = "RequestedRangeNotSatisfiable"
// RequestEntityTooLarge specifies the request entity too large state for http status code.
    case RequestEntityTooLarge = "RequestEntityTooLarge"
// RequestTimeout specifies the request timeout state for http status code.
    case RequestTimeout = "RequestTimeout"
// RequestUriTooLong specifies the request uri too long state for http status code.
    case RequestUriTooLong = "RequestUriTooLong"
// ResetContent specifies the reset content state for http status code.
    case ResetContent = "ResetContent"
// SeeOther specifies the see other state for http status code.
    case SeeOther = "SeeOther"
// ServiceUnavailable specifies the service unavailable state for http status code.
    case ServiceUnavailable = "ServiceUnavailable"
// SwitchingProtocols specifies the switching protocols state for http status code.
    case SwitchingProtocols = "SwitchingProtocols"
// TemporaryRedirect specifies the temporary redirect state for http status code.
    case TemporaryRedirect = "TemporaryRedirect"
// Unauthorized specifies the unauthorized state for http status code.
    case Unauthorized = "Unauthorized"
// UnsupportedMediaType specifies the unsupported media type state for http status code.
    case UnsupportedMediaType = "UnsupportedMediaType"
// Unused specifies the unused state for http status code.
    case Unused = "Unused"
// UpgradeRequired specifies the upgrade required state for http status code.
    case UpgradeRequired = "UpgradeRequired"
// UseProxy specifies the use proxy state for http status code.
    case UseProxy = "UseProxy"
}


// 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 IaasVMBackupRequestData : IaasVMBackupRequestProtocol, BackupRequestProtocol {
    public var recoveryPointExpiryTimeInUTC: Date?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createIaasVMBackupRequestProtocol() -> IaasVMBackupRequestProtocol {
    return IaasVMBackupRequestData()
  }
}


// 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 IaaSVMContainerData : IaaSVMContainerProtocol, ProtectionContainerProtocol {
    public var friendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var registrationStatus: String?
    public var healthStatus: String?
    public var virtualMachineId: String?
    public var virtualMachineVersion: String?
    public var resourceGroup: String?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case backupManagementType = "backupManagementType"
        case registrationStatus = "registrationStatus"
        case healthStatus = "healthStatus"
        case virtualMachineId = "virtualMachineId"
        case virtualMachineVersion = "virtualMachineVersion"
        case resourceGroup = "resourceGroup"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.backupManagementType != nil {try container.encode(self.backupManagementType, forKey: .backupManagementType)}
    if self.registrationStatus != nil {try container.encode(self.registrationStatus, forKey: .registrationStatus)}
    if self.healthStatus != nil {try container.encode(self.healthStatus, forKey: .healthStatus)}
    if self.virtualMachineId != nil {try container.encode(self.virtualMachineId, forKey: .virtualMachineId)}
    if self.virtualMachineVersion != nil {try container.encode(self.virtualMachineVersion, forKey: .virtualMachineVersion)}
    if self.resourceGroup != nil {try container.encode(self.resourceGroup, forKey: .resourceGroup)}
  }
}

extension DataFactory {
  public static func createIaaSVMContainerProtocol() -> IaaSVMContainerProtocol {
    return IaaSVMContainerData()
  }
}


// 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 IaasVMILRRegistrationRequestData : IaasVMILRRegistrationRequestProtocol, ILRRequestProtocol {
    public var recoveryPointId: String?
    public var virtualMachineId: String?
    public var initiatorName: String?
    public var renewExistingRegistration: Bool?

        enum CodingKeys: String, CodingKey {case recoveryPointId = "recoveryPointId"
        case virtualMachineId = "virtualMachineId"
        case initiatorName = "initiatorName"
        case renewExistingRegistration = "renewExistingRegistration"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createIaasVMILRRegistrationRequestProtocol() -> IaasVMILRRegistrationRequestProtocol {
    return IaasVMILRRegistrationRequestData()
  }
}


// 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 IaaSVMProtectableItemData : IaaSVMProtectableItemProtocol, WorkloadProtectableItemProtocol {
    public var backupManagementType: String?
    public var workloadType: String?
    public var friendlyName: String?
    public var protectionState: ProtectionStatusEnum?
    public var virtualMachineId: String?

        enum CodingKeys: String, CodingKey {case backupManagementType = "backupManagementType"
        case workloadType = "workloadType"
        case friendlyName = "friendlyName"
        case protectionState = "protectionState"
        case virtualMachineId = "virtualMachineId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createIaaSVMProtectableItemProtocol() -> IaaSVMProtectableItemProtocol {
    return IaaSVMProtectableItemData()
  }
}


// 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 IaasVMRecoveryPointData : IaasVMRecoveryPointProtocol, RecoveryPointProtocol {
    public var recoveryPointType: String?
    public var recoveryPointTime: Date?
    public var recoveryPointAdditionalInfo: String?
    public var sourceVMStorageType: String?
    public var isSourceVMEncrypted: Bool?
    public var keyAndSecret: KeyAndSecretDetailsProtocol?
    public var isInstantIlrSessionActive: Bool?
    public var recoveryPointTierDetails: [RecoveryPointTierInformationProtocol?]?
    public var isManagedVirtualMachine: Bool?
    public var virtualMachineSize: String?
    public var originalStorageAccountOption: Bool?

        enum CodingKeys: String, CodingKey {case recoveryPointType = "recoveryPointType"
        case recoveryPointTime = "recoveryPointTime"
        case recoveryPointAdditionalInfo = "recoveryPointAdditionalInfo"
        case sourceVMStorageType = "sourceVMStorageType"
        case isSourceVMEncrypted = "isSourceVMEncrypted"
        case keyAndSecret = "keyAndSecret"
        case isInstantIlrSessionActive = "isInstantIlrSessionActive"
        case recoveryPointTierDetails = "recoveryPointTierDetails"
        case isManagedVirtualMachine = "isManagedVirtualMachine"
        case virtualMachineSize = "virtualMachineSize"
        case originalStorageAccountOption = "originalStorageAccountOption"
        }

  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(String?.self, forKey: .recoveryPointType)
    }
    if container.contains(.recoveryPointTime) {
        self.recoveryPointTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .recoveryPointTime)), format: .dateTime)
    }
    if container.contains(.recoveryPointAdditionalInfo) {
        self.recoveryPointAdditionalInfo = try container.decode(String?.self, forKey: .recoveryPointAdditionalInfo)
    }
    if container.contains(.sourceVMStorageType) {
        self.sourceVMStorageType = try container.decode(String?.self, forKey: .sourceVMStorageType)
    }
    if container.contains(.isSourceVMEncrypted) {
        self.isSourceVMEncrypted = try container.decode(Bool?.self, forKey: .isSourceVMEncrypted)
    }
    if container.contains(.keyAndSecret) {
        self.keyAndSecret = try container.decode(KeyAndSecretDetailsData?.self, forKey: .keyAndSecret)
    }
    if container.contains(.isInstantIlrSessionActive) {
        self.isInstantIlrSessionActive = try container.decode(Bool?.self, forKey: .isInstantIlrSessionActive)
    }
    if container.contains(.recoveryPointTierDetails) {
        self.recoveryPointTierDetails = try container.decode([RecoveryPointTierInformationData?]?.self, forKey: .recoveryPointTierDetails)
    }
    if container.contains(.isManagedVirtualMachine) {
        self.isManagedVirtualMachine = try container.decode(Bool?.self, forKey: .isManagedVirtualMachine)
    }
    if container.contains(.virtualMachineSize) {
        self.virtualMachineSize = try container.decode(String?.self, forKey: .virtualMachineSize)
    }
    if container.contains(.originalStorageAccountOption) {
        self.originalStorageAccountOption = try container.decode(Bool?.self, forKey: .originalStorageAccountOption)
    }
    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.recoveryPointTime != nil {
        try container.encode(DateConverter.toString(date: self.recoveryPointTime!, format: .dateTime), forKey: .recoveryPointTime)
    }
    if self.recoveryPointAdditionalInfo != nil {try container.encode(self.recoveryPointAdditionalInfo, forKey: .recoveryPointAdditionalInfo)}
    if self.sourceVMStorageType != nil {try container.encode(self.sourceVMStorageType, forKey: .sourceVMStorageType)}
    if self.isSourceVMEncrypted != nil {try container.encode(self.isSourceVMEncrypted, forKey: .isSourceVMEncrypted)}
    if self.keyAndSecret != nil {try container.encode(self.keyAndSecret as! KeyAndSecretDetailsData?, forKey: .keyAndSecret)}
    if self.isInstantIlrSessionActive != nil {try container.encode(self.isInstantIlrSessionActive, forKey: .isInstantIlrSessionActive)}
    if self.recoveryPointTierDetails != nil {try container.encode(self.recoveryPointTierDetails as! [RecoveryPointTierInformationData?]?, forKey: .recoveryPointTierDetails)}
    if self.isManagedVirtualMachine != nil {try container.encode(self.isManagedVirtualMachine, forKey: .isManagedVirtualMachine)}
    if self.virtualMachineSize != nil {try container.encode(self.virtualMachineSize, forKey: .virtualMachineSize)}
    if self.originalStorageAccountOption != nil {try container.encode(self.originalStorageAccountOption, forKey: .originalStorageAccountOption)}
  }
}

extension DataFactory {
  public static func createIaasVMRecoveryPointProtocol() -> IaasVMRecoveryPointProtocol {
    return IaasVMRecoveryPointData()
  }
}


// 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 IaasVMRestoreRequestData : IaasVMRestoreRequestProtocol, RestoreRequestProtocol {
    public var recoveryPointId: String?
    public var recoveryType: RecoveryTypeEnum?
    public var sourceResourceId: String?
    public var targetVirtualMachineId: String?
    public var targetResourceGroupId: String?
    public var storageAccountId: String?
    public var virtualNetworkId: String?
    public var subnetId: String?
    public var targetDomainNameId: String?
    public var region: String?
    public var affinityGroup: String?
    public var createNewCloudService: Bool?
    public var originalStorageAccountOption: Bool?
    public var encryptionDetails: EncryptionDetailsProtocol?

        enum CodingKeys: String, CodingKey {case recoveryPointId = "recoveryPointId"
        case recoveryType = "recoveryType"
        case sourceResourceId = "sourceResourceId"
        case targetVirtualMachineId = "targetVirtualMachineId"
        case targetResourceGroupId = "targetResourceGroupId"
        case storageAccountId = "storageAccountId"
        case virtualNetworkId = "virtualNetworkId"
        case subnetId = "subnetId"
        case targetDomainNameId = "targetDomainNameId"
        case region = "region"
        case affinityGroup = "affinityGroup"
        case createNewCloudService = "createNewCloudService"
        case originalStorageAccountOption = "originalStorageAccountOption"
        case encryptionDetails = "encryptionDetails"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.recoveryPointId) {
        self.recoveryPointId = try container.decode(String?.self, forKey: .recoveryPointId)
    }
    if container.contains(.recoveryType) {
        self.recoveryType = try container.decode(RecoveryTypeEnum?.self, forKey: .recoveryType)
    }
    if container.contains(.sourceResourceId) {
        self.sourceResourceId = try container.decode(String?.self, forKey: .sourceResourceId)
    }
    if container.contains(.targetVirtualMachineId) {
        self.targetVirtualMachineId = try container.decode(String?.self, forKey: .targetVirtualMachineId)
    }
    if container.contains(.targetResourceGroupId) {
        self.targetResourceGroupId = try container.decode(String?.self, forKey: .targetResourceGroupId)
    }
    if container.contains(.storageAccountId) {
        self.storageAccountId = try container.decode(String?.self, forKey: .storageAccountId)
    }
    if container.contains(.virtualNetworkId) {
        self.virtualNetworkId = try container.decode(String?.self, forKey: .virtualNetworkId)
    }
    if container.contains(.subnetId) {
        self.subnetId = try container.decode(String?.self, forKey: .subnetId)
    }
    if container.contains(.targetDomainNameId) {
        self.targetDomainNameId = try container.decode(String?.self, forKey: .targetDomainNameId)
    }
    if container.contains(.region) {
        self.region = try container.decode(String?.self, forKey: .region)
    }
    if container.contains(.affinityGroup) {
        self.affinityGroup = try container.decode(String?.self, forKey: .affinityGroup)
    }
    if container.contains(.createNewCloudService) {
        self.createNewCloudService = try container.decode(Bool?.self, forKey: .createNewCloudService)
    }
    if container.contains(.originalStorageAccountOption) {
        self.originalStorageAccountOption = try container.decode(Bool?.self, forKey: .originalStorageAccountOption)
    }
    if container.contains(.encryptionDetails) {
        self.encryptionDetails = try container.decode(EncryptionDetailsData?.self, forKey: .encryptionDetails)
    }
    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.recoveryPointId != nil {try container.encode(self.recoveryPointId, forKey: .recoveryPointId)}
    if self.recoveryType != nil {try container.encode(self.recoveryType, forKey: .recoveryType)}
    if self.sourceResourceId != nil {try container.encode(self.sourceResourceId, forKey: .sourceResourceId)}
    if self.targetVirtualMachineId != nil {try container.encode(self.targetVirtualMachineId, forKey: .targetVirtualMachineId)}
    if self.targetResourceGroupId != nil {try container.encode(self.targetResourceGroupId, forKey: .targetResourceGroupId)}
    if self.storageAccountId != nil {try container.encode(self.storageAccountId, forKey: .storageAccountId)}
    if self.virtualNetworkId != nil {try container.encode(self.virtualNetworkId, forKey: .virtualNetworkId)}
    if self.subnetId != nil {try container.encode(self.subnetId, forKey: .subnetId)}
    if self.targetDomainNameId != nil {try container.encode(self.targetDomainNameId, forKey: .targetDomainNameId)}
    if self.region != nil {try container.encode(self.region, forKey: .region)}
    if self.affinityGroup != nil {try container.encode(self.affinityGroup, forKey: .affinityGroup)}
    if self.createNewCloudService != nil {try container.encode(self.createNewCloudService, forKey: .createNewCloudService)}
    if self.originalStorageAccountOption != nil {try container.encode(self.originalStorageAccountOption, forKey: .originalStorageAccountOption)}
    if self.encryptionDetails != nil {try container.encode(self.encryptionDetails as! EncryptionDetailsData?, forKey: .encryptionDetails)}
  }
}

extension DataFactory {
  public static func createIaasVMRestoreRequestProtocol() -> IaasVMRestoreRequestProtocol {
    return IaasVMRestoreRequestData()
  }
}


// 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 ILRRequestData : ILRRequestProtocol {

  public init()  {
  }

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

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

extension DataFactory {
  public static func createILRRequestProtocol() -> ILRRequestProtocol {
    return ILRRequestData()
  }
}


// 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 ILRRequestResourceData : ILRRequestResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var eTag: String?
    public var properties: ILRRequestProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createILRRequestResourceProtocol() -> ILRRequestResourceProtocol {
    return ILRRequestResourceData()
  }
}


// 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 InquiryInfoData : InquiryInfoProtocol {
    public var status: String?
    public var errorDetail: ErrorDetailProtocol?
    public var inquiryDetails: [WorkloadInquiryDetailsProtocol?]?

        enum CodingKeys: String, CodingKey {case status = "status"
        case errorDetail = "errorDetail"
        case inquiryDetails = "inquiryDetails"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInquiryInfoProtocol() -> InquiryInfoProtocol {
    return InquiryInfoData()
  }
}


// InquiryStatus enumerates the values for inquiry status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum InquiryStatusEnum: String, Codable
{
// InquiryStatusFailed specifies the inquiry status failed state for inquiry status.
    case InquiryStatusFailed = "Failed"
// InquiryStatusInvalid specifies the inquiry status invalid state for inquiry status.
    case InquiryStatusInvalid = "Invalid"
// InquiryStatusSuccess specifies the inquiry status success state for inquiry status.
    case InquiryStatusSuccess = "Success"
}


// 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 InquiryValidationData : InquiryValidationProtocol {
    public var status: String?
    public var errorDetail: ErrorDetailProtocol?

        enum CodingKeys: String, CodingKey {case status = "status"
        case errorDetail = "errorDetail"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInquiryValidationProtocol() -> InquiryValidationProtocol {
    return InquiryValidationData()
  }
}


// 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 InstantItemRecoveryTargetData : InstantItemRecoveryTargetProtocol {
    public var clientScripts: [ClientScriptForConnectProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createInstantItemRecoveryTargetProtocol() -> InstantItemRecoveryTargetProtocol {
    return InstantItemRecoveryTargetData()
  }
}


// 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 JobData : JobProtocol {
    public var entityFriendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var operation: String?
    public var status: String?
    public var startTime: Date?
    public var endTime: Date?
    public var activityId: String?

        enum CodingKeys: String, CodingKey {case entityFriendlyName = "entityFriendlyName"
        case backupManagementType = "backupManagementType"
        case operation = "operation"
        case status = "status"
        case startTime = "startTime"
        case endTime = "endTime"
        case activityId = "activityId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createJobProtocol() -> JobProtocol {
    return JobData()
  }
}


// JobOperationType enumerates the values for job operation 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 JobOperationTypeEnum: String, Codable
{
// JobOperationTypeBackup specifies the job operation type backup state for job operation type.
    case JobOperationTypeBackup = "Backup"
// JobOperationTypeConfigureBackup specifies the job operation type configure backup state for job operation type.
    case JobOperationTypeConfigureBackup = "ConfigureBackup"
// JobOperationTypeDeleteBackupData specifies the job operation type delete backup data state for job operation type.
    case JobOperationTypeDeleteBackupData = "DeleteBackupData"
// JobOperationTypeDisableBackup specifies the job operation type disable backup state for job operation type.
    case JobOperationTypeDisableBackup = "DisableBackup"
// JobOperationTypeInvalid specifies the job operation type invalid state for job operation type.
    case JobOperationTypeInvalid = "Invalid"
// JobOperationTypeRegister specifies the job operation type register state for job operation type.
    case JobOperationTypeRegister = "Register"
// JobOperationTypeRestore specifies the job operation type restore state for job operation type.
    case JobOperationTypeRestore = "Restore"
// JobOperationTypeUnRegister specifies the job operation type un register state for job operation type.
    case JobOperationTypeUnRegister = "UnRegister"
}


// 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 JobQueryObjectData : JobQueryObjectProtocol {
    public var status: JobStatusEnum?
    public var backupManagementType: BackupManagementTypeEnum?
    public var operation: JobOperationTypeEnum?
    public var jobId: String?
    public var startTime: Date?
    public var endTime: Date?

        enum CodingKeys: String, CodingKey {case status = "status"
        case backupManagementType = "backupManagementType"
        case operation = "operation"
        case jobId = "jobId"
        case startTime = "startTime"
        case endTime = "endTime"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createJobQueryObjectProtocol() -> JobQueryObjectProtocol {
    return JobQueryObjectData()
  }
}


// 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 JobResourceData : JobResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var eTag: String?
    public var properties: JobProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createJobResourceProtocol() -> JobResourceProtocol {
    return JobResourceData()
  }
}


// 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 JobResourceListData : JobResourceListProtocol, ResourceListProtocol {
    public var _nextLink: String?
    public var value: [JobResourceProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createJobResourceListProtocol() -> JobResourceListProtocol {
    return JobResourceListData()
  }
}


// JobStatus enumerates the values for job status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum JobStatusEnum: String, Codable
{
// JobStatusCancelled specifies the job status cancelled state for job status.
    case JobStatusCancelled = "Cancelled"
// JobStatusCancelling specifies the job status cancelling state for job status.
    case JobStatusCancelling = "Cancelling"
// JobStatusCompleted specifies the job status completed state for job status.
    case JobStatusCompleted = "Completed"
// JobStatusCompletedWithWarnings specifies the job status completed with warnings state for job status.
    case JobStatusCompletedWithWarnings = "CompletedWithWarnings"
// JobStatusFailed specifies the job status failed state for job status.
    case JobStatusFailed = "Failed"
// JobStatusInProgress specifies the job status in progress state for job status.
    case JobStatusInProgress = "InProgress"
// JobStatusInvalid specifies the job status invalid state for job status.
    case JobStatusInvalid = "Invalid"
}


// JobSupportedAction enumerates the values for job supported action.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum JobSupportedActionEnum: String, Codable
{
// JobSupportedActionCancellable specifies the job supported action cancellable state for job supported action.
    case JobSupportedActionCancellable = "Cancellable"
// JobSupportedActionInvalid specifies the job supported action invalid state for job supported action.
    case JobSupportedActionInvalid = "Invalid"
// JobSupportedActionRetriable specifies the job supported action retriable state for job supported action.
    case JobSupportedActionRetriable = "Retriable"
}


// 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 KEKDetailsData : KEKDetailsProtocol {
    public var keyUrl: String?
    public var keyVaultId: String?
    public var keyBackupData: String?

        enum CodingKeys: String, CodingKey {case keyUrl = "keyUrl"
        case keyVaultId = "keyVaultId"
        case keyBackupData = "keyBackupData"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createKEKDetailsProtocol() -> KEKDetailsProtocol {
    return KEKDetailsData()
  }
}


// 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 KeyAndSecretDetailsData : KeyAndSecretDetailsProtocol {
    public var kekDetails: KEKDetailsProtocol?
    public var bekDetails: BEKDetailsProtocol?

        enum CodingKeys: String, CodingKey {case kekDetails = "kekDetails"
        case bekDetails = "bekDetails"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createKeyAndSecretDetailsProtocol() -> KeyAndSecretDetailsProtocol {
    return KeyAndSecretDetailsData()
  }
}