// 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 AzureIaaSClassicComputeVMProtectedItemData : AzureIaaSClassicComputeVMProtectedItemProtocol, AzureIaaSVMProtectedItemProtocol, 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 virtualMachineId: String?
    public var protectionStatus: String?
    public var protectionState: ProtectionStateEnum?
    public var healthStatus: HealthStatusEnum?
    public var healthDetails: [AzureIaaSVMHealthDetailsProtocol?]?
    public var lastBackupStatus: String?
    public var lastBackupTime: Date?
    public var protectedItemDataId: String?
    public var extendedInfo: AzureIaaSVMProtectedItemExtendedInfoProtocol?

        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 virtualMachineId = "virtualMachineId"
        case protectionStatus = "protectionStatus"
        case protectionState = "protectionState"
        case healthStatus = "healthStatus"
        case healthDetails = "healthDetails"
        case lastBackupStatus = "lastBackupStatus"
        case lastBackupTime = "lastBackupTime"
        case protectedItemDataId = "protectedItemDataId"
        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(.virtualMachineId) {
        self.virtualMachineId = try container.decode(String?.self, forKey: .virtualMachineId)
    }
    if container.contains(.protectionStatus) {
        self.protectionStatus = try container.decode(String?.self, forKey: .protectionStatus)
    }
    if container.contains(.protectionState) {
        self.protectionState = try container.decode(ProtectionStateEnum?.self, forKey: .protectionState)
    }
    if container.contains(.healthStatus) {
        self.healthStatus = try container.decode(HealthStatusEnum?.self, forKey: .healthStatus)
    }
    if container.contains(.healthDetails) {
        self.healthDetails = try container.decode([AzureIaaSVMHealthDetailsData?]?.self, forKey: .healthDetails)
    }
    if container.contains(.lastBackupStatus) {
        self.lastBackupStatus = try container.decode(String?.self, forKey: .lastBackupStatus)
    }
    if container.contains(.lastBackupTime) {
        self.lastBackupTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastBackupTime)), format: .dateTime)
    }
    if container.contains(.protectedItemDataId) {
        self.protectedItemDataId = try container.decode(String?.self, forKey: .protectedItemDataId)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(AzureIaaSVMProtectedItemExtendedInfoData?.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.virtualMachineId != nil {try container.encode(self.virtualMachineId, forKey: .virtualMachineId)}
    if self.protectionStatus != nil {try container.encode(self.protectionStatus, forKey: .protectionStatus)}
    if self.protectionState != nil {try container.encode(self.protectionState, forKey: .protectionState)}
    if self.healthStatus != nil {try container.encode(self.healthStatus, forKey: .healthStatus)}
    if self.healthDetails != nil {try container.encode(self.healthDetails as! [AzureIaaSVMHealthDetailsData?]?, forKey: .healthDetails)}
    if self.lastBackupStatus != nil {try container.encode(self.lastBackupStatus, forKey: .lastBackupStatus)}
    if self.lastBackupTime != nil {
        try container.encode(DateConverter.toString(date: self.lastBackupTime!, format: .dateTime), forKey: .lastBackupTime)
    }
    if self.protectedItemDataId != nil {try container.encode(self.protectedItemDataId, forKey: .protectedItemDataId)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! AzureIaaSVMProtectedItemExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createAzureIaaSClassicComputeVMProtectedItemProtocol() -> AzureIaaSClassicComputeVMProtectedItemProtocol {
    return AzureIaaSClassicComputeVMProtectedItemData()
  }
}


// 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 AzureIaaSComputeVMContainerData : AzureIaaSComputeVMContainerProtocol, 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 createAzureIaaSComputeVMContainerProtocol() -> AzureIaaSComputeVMContainerProtocol {
    return AzureIaaSComputeVMContainerData()
  }
}


// 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 AzureIaaSComputeVMProtectableItemData : AzureIaaSComputeVMProtectableItemProtocol, 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 createAzureIaaSComputeVMProtectableItemProtocol() -> AzureIaaSComputeVMProtectableItemProtocol {
    return AzureIaaSComputeVMProtectableItemData()
  }
}


// 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 AzureIaaSComputeVMProtectedItemData : AzureIaaSComputeVMProtectedItemProtocol, AzureIaaSVMProtectedItemProtocol, 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 virtualMachineId: String?
    public var protectionStatus: String?
    public var protectionState: ProtectionStateEnum?
    public var healthStatus: HealthStatusEnum?
    public var healthDetails: [AzureIaaSVMHealthDetailsProtocol?]?
    public var lastBackupStatus: String?
    public var lastBackupTime: Date?
    public var protectedItemDataId: String?
    public var extendedInfo: AzureIaaSVMProtectedItemExtendedInfoProtocol?

        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 virtualMachineId = "virtualMachineId"
        case protectionStatus = "protectionStatus"
        case protectionState = "protectionState"
        case healthStatus = "healthStatus"
        case healthDetails = "healthDetails"
        case lastBackupStatus = "lastBackupStatus"
        case lastBackupTime = "lastBackupTime"
        case protectedItemDataId = "protectedItemDataId"
        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(.virtualMachineId) {
        self.virtualMachineId = try container.decode(String?.self, forKey: .virtualMachineId)
    }
    if container.contains(.protectionStatus) {
        self.protectionStatus = try container.decode(String?.self, forKey: .protectionStatus)
    }
    if container.contains(.protectionState) {
        self.protectionState = try container.decode(ProtectionStateEnum?.self, forKey: .protectionState)
    }
    if container.contains(.healthStatus) {
        self.healthStatus = try container.decode(HealthStatusEnum?.self, forKey: .healthStatus)
    }
    if container.contains(.healthDetails) {
        self.healthDetails = try container.decode([AzureIaaSVMHealthDetailsData?]?.self, forKey: .healthDetails)
    }
    if container.contains(.lastBackupStatus) {
        self.lastBackupStatus = try container.decode(String?.self, forKey: .lastBackupStatus)
    }
    if container.contains(.lastBackupTime) {
        self.lastBackupTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastBackupTime)), format: .dateTime)
    }
    if container.contains(.protectedItemDataId) {
        self.protectedItemDataId = try container.decode(String?.self, forKey: .protectedItemDataId)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(AzureIaaSVMProtectedItemExtendedInfoData?.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.virtualMachineId != nil {try container.encode(self.virtualMachineId, forKey: .virtualMachineId)}
    if self.protectionStatus != nil {try container.encode(self.protectionStatus, forKey: .protectionStatus)}
    if self.protectionState != nil {try container.encode(self.protectionState, forKey: .protectionState)}
    if self.healthStatus != nil {try container.encode(self.healthStatus, forKey: .healthStatus)}
    if self.healthDetails != nil {try container.encode(self.healthDetails as! [AzureIaaSVMHealthDetailsData?]?, forKey: .healthDetails)}
    if self.lastBackupStatus != nil {try container.encode(self.lastBackupStatus, forKey: .lastBackupStatus)}
    if self.lastBackupTime != nil {
        try container.encode(DateConverter.toString(date: self.lastBackupTime!, format: .dateTime), forKey: .lastBackupTime)
    }
    if self.protectedItemDataId != nil {try container.encode(self.protectedItemDataId, forKey: .protectedItemDataId)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! AzureIaaSVMProtectedItemExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createAzureIaaSComputeVMProtectedItemProtocol() -> AzureIaaSComputeVMProtectedItemProtocol {
    return AzureIaaSComputeVMProtectedItemData()
  }
}


// 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 AzureIaaSVMErrorInfoData : AzureIaaSVMErrorInfoProtocol {
    public var errorCode: Int32?
    public var errorTitle: String?
    public var errorString: String?
    public var recommendations: [String]?

        enum CodingKeys: String, CodingKey {case errorCode = "errorCode"
        case errorTitle = "errorTitle"
        case errorString = "errorString"
        case recommendations = "recommendations"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureIaaSVMErrorInfoProtocol() -> AzureIaaSVMErrorInfoProtocol {
    return AzureIaaSVMErrorInfoData()
  }
}


// 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 AzureIaaSVMHealthDetailsData : AzureIaaSVMHealthDetailsProtocol {
    public var code: Int32?
    public var title: String?
    public var message: String?
    public var recommendations: [String]?

        enum CodingKeys: String, CodingKey {case code = "code"
        case title = "title"
        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(Int32?.self, forKey: .code)
    }
    if container.contains(.title) {
        self.title = try container.decode(String?.self, forKey: .title)
    }
    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.title != nil {try container.encode(self.title, forKey: .title)}
    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 createAzureIaaSVMHealthDetailsProtocol() -> AzureIaaSVMHealthDetailsProtocol {
    return AzureIaaSVMHealthDetailsData()
  }
}


// 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 AzureIaaSVMJobData : AzureIaaSVMJobProtocol, 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?
    public var duration: String?
    public var actionsInfo: [JobSupportedActionEnum?]?
    public var errorDetails: [AzureIaaSVMErrorInfoProtocol?]?
    public var virtualMachineVersion: String?
    public var extendedInfo: AzureIaaSVMJobExtendedInfoProtocol?

        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"
        case duration = "duration"
        case actionsInfo = "actionsInfo"
        case errorDetails = "errorDetails"
        case virtualMachineVersion = "virtualMachineVersion"
        case extendedInfo = "extendedInfo"
        }

  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 container.contains(.duration) {
        self.duration = try container.decode(String?.self, forKey: .duration)
    }
    if container.contains(.actionsInfo) {
        self.actionsInfo = try container.decode([JobSupportedActionEnum?]?.self, forKey: .actionsInfo)
    }
    if container.contains(.errorDetails) {
        self.errorDetails = try container.decode([AzureIaaSVMErrorInfoData?]?.self, forKey: .errorDetails)
    }
    if container.contains(.virtualMachineVersion) {
        self.virtualMachineVersion = try container.decode(String?.self, forKey: .virtualMachineVersion)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(AzureIaaSVMJobExtendedInfoData?.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.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)}
    if self.duration != nil {try container.encode(self.duration, forKey: .duration)}
    if self.actionsInfo != nil {try container.encode(self.actionsInfo as! [JobSupportedActionEnum?]?, forKey: .actionsInfo)}
    if self.errorDetails != nil {try container.encode(self.errorDetails as! [AzureIaaSVMErrorInfoData?]?, forKey: .errorDetails)}
    if self.virtualMachineVersion != nil {try container.encode(self.virtualMachineVersion, forKey: .virtualMachineVersion)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! AzureIaaSVMJobExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createAzureIaaSVMJobProtocol() -> AzureIaaSVMJobProtocol {
    return AzureIaaSVMJobData()
  }
}


// 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 AzureIaaSVMJobExtendedInfoData : AzureIaaSVMJobExtendedInfoProtocol {
    public var tasksList: [AzureIaaSVMJobTaskDetailsProtocol?]?
    public var propertyBag: [String:String]?
    public var progressPercentage: Double?
    public var dynamicErrorMessage: String?

        enum CodingKeys: String, CodingKey {case tasksList = "tasksList"
        case propertyBag = "propertyBag"
        case progressPercentage = "progressPercentage"
        case dynamicErrorMessage = "dynamicErrorMessage"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureIaaSVMJobExtendedInfoProtocol() -> AzureIaaSVMJobExtendedInfoProtocol {
    return AzureIaaSVMJobExtendedInfoData()
  }
}


// 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 AzureIaaSVMJobTaskDetailsData : AzureIaaSVMJobTaskDetailsProtocol {
    public var taskId: String?
    public var startTime: Date?
    public var endTime: Date?
    public var instanceId: String?
    public var duration: String?
    public var status: String?
    public var progressPercentage: Double?

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

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

extension DataFactory {
  public static func createAzureIaaSVMJobTaskDetailsProtocol() -> AzureIaaSVMJobTaskDetailsProtocol {
    return AzureIaaSVMJobTaskDetailsData()
  }
}


// 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 AzureIaaSVMProtectedItemData : AzureIaaSVMProtectedItemProtocol, 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 virtualMachineId: String?
    public var protectionStatus: String?
    public var protectionState: ProtectionStateEnum?
    public var healthStatus: HealthStatusEnum?
    public var healthDetails: [AzureIaaSVMHealthDetailsProtocol?]?
    public var lastBackupStatus: String?
    public var lastBackupTime: Date?
    public var protectedItemDataId: String?
    public var extendedInfo: AzureIaaSVMProtectedItemExtendedInfoProtocol?

        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 virtualMachineId = "virtualMachineId"
        case protectionStatus = "protectionStatus"
        case protectionState = "protectionState"
        case healthStatus = "healthStatus"
        case healthDetails = "healthDetails"
        case lastBackupStatus = "lastBackupStatus"
        case lastBackupTime = "lastBackupTime"
        case protectedItemDataId = "protectedItemDataId"
        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(.virtualMachineId) {
        self.virtualMachineId = try container.decode(String?.self, forKey: .virtualMachineId)
    }
    if container.contains(.protectionStatus) {
        self.protectionStatus = try container.decode(String?.self, forKey: .protectionStatus)
    }
    if container.contains(.protectionState) {
        self.protectionState = try container.decode(ProtectionStateEnum?.self, forKey: .protectionState)
    }
    if container.contains(.healthStatus) {
        self.healthStatus = try container.decode(HealthStatusEnum?.self, forKey: .healthStatus)
    }
    if container.contains(.healthDetails) {
        self.healthDetails = try container.decode([AzureIaaSVMHealthDetailsData?]?.self, forKey: .healthDetails)
    }
    if container.contains(.lastBackupStatus) {
        self.lastBackupStatus = try container.decode(String?.self, forKey: .lastBackupStatus)
    }
    if container.contains(.lastBackupTime) {
        self.lastBackupTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastBackupTime)), format: .dateTime)
    }
    if container.contains(.protectedItemDataId) {
        self.protectedItemDataId = try container.decode(String?.self, forKey: .protectedItemDataId)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(AzureIaaSVMProtectedItemExtendedInfoData?.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.virtualMachineId != nil {try container.encode(self.virtualMachineId, forKey: .virtualMachineId)}
    if self.protectionStatus != nil {try container.encode(self.protectionStatus, forKey: .protectionStatus)}
    if self.protectionState != nil {try container.encode(self.protectionState, forKey: .protectionState)}
    if self.healthStatus != nil {try container.encode(self.healthStatus, forKey: .healthStatus)}
    if self.healthDetails != nil {try container.encode(self.healthDetails as! [AzureIaaSVMHealthDetailsData?]?, forKey: .healthDetails)}
    if self.lastBackupStatus != nil {try container.encode(self.lastBackupStatus, forKey: .lastBackupStatus)}
    if self.lastBackupTime != nil {
        try container.encode(DateConverter.toString(date: self.lastBackupTime!, format: .dateTime), forKey: .lastBackupTime)
    }
    if self.protectedItemDataId != nil {try container.encode(self.protectedItemDataId, forKey: .protectedItemDataId)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! AzureIaaSVMProtectedItemExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createAzureIaaSVMProtectedItemProtocol() -> AzureIaaSVMProtectedItemProtocol {
    return AzureIaaSVMProtectedItemData()
  }
}


// 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 AzureIaaSVMProtectedItemExtendedInfoData : AzureIaaSVMProtectedItemExtendedInfoProtocol {
    public var oldestRecoveryPoint: Date?
    public var recoveryPointCount: Int32?
    public var policyInconsistent: Bool?

        enum CodingKeys: String, CodingKey {case oldestRecoveryPoint = "oldestRecoveryPoint"
        case recoveryPointCount = "recoveryPointCount"
        case policyInconsistent = "policyInconsistent"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureIaaSVMProtectedItemExtendedInfoProtocol() -> AzureIaaSVMProtectedItemExtendedInfoProtocol {
    return AzureIaaSVMProtectedItemExtendedInfoData()
  }
}


// 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 AzureIaaSVMProtectionPolicyData : AzureIaaSVMProtectionPolicyProtocol, ProtectionPolicyProtocol {
    public var protectedItemsCount: Int32?
    public var schedulePolicy: SchedulePolicyProtocol?
    public var retentionPolicy: RetentionPolicyProtocol?
    public var timeZone: String?

        enum CodingKeys: String, CodingKey {case protectedItemsCount = "protectedItemsCount"
        case schedulePolicy = "schedulePolicy"
        case retentionPolicy = "retentionPolicy"
        case timeZone = "timeZone"
        }

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

extension DataFactory {
  public static func createAzureIaaSVMProtectionPolicyProtocol() -> AzureIaaSVMProtectionPolicyProtocol {
    return AzureIaaSVMProtectionPolicyData()
  }
}


// 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 AzureResourceProtectionIntentData : AzureResourceProtectionIntentProtocol, ProtectionIntentProtocol {
    public var backupManagementType: BackupManagementTypeEnum?
    public var sourceResourceId: String?
    public var itemId: String?
    public var policyId: String?
    public var protectionState: ProtectionStatusEnum?
    public var friendlyName: String?

        enum CodingKeys: String, CodingKey {case backupManagementType = "backupManagementType"
        case sourceResourceId = "sourceResourceId"
        case itemId = "itemId"
        case policyId = "policyId"
        case protectionState = "protectionState"
        case friendlyName = "friendlyName"
        }

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

extension DataFactory {
  public static func createAzureResourceProtectionIntentProtocol() -> AzureResourceProtectionIntentProtocol {
    return AzureResourceProtectionIntentData()
  }
}


// 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 AzureSQLAGWorkloadContainerProtectionContainerData : AzureSQLAGWorkloadContainerProtectionContainerProtocol, AzureWorkloadContainerProtocol, ProtectionContainerProtocol {
    public var friendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var registrationStatus: String?
    public var healthStatus: String?
    public var sourceResourceId: String?
    public var lastUpdatedTime: Date?
    public var extendedInfo: AzureWorkloadContainerExtendedInfoProtocol?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case backupManagementType = "backupManagementType"
        case registrationStatus = "registrationStatus"
        case healthStatus = "healthStatus"
        case sourceResourceId = "sourceResourceId"
        case lastUpdatedTime = "lastUpdatedTime"
        case extendedInfo = "extendedInfo"
        }

  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(.sourceResourceId) {
        self.sourceResourceId = try container.decode(String?.self, forKey: .sourceResourceId)
    }
    if container.contains(.lastUpdatedTime) {
        self.lastUpdatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUpdatedTime)), format: .dateTime)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(AzureWorkloadContainerExtendedInfoData?.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.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.sourceResourceId != nil {try container.encode(self.sourceResourceId, forKey: .sourceResourceId)}
    if self.lastUpdatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastUpdatedTime!, format: .dateTime), forKey: .lastUpdatedTime)
    }
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! AzureWorkloadContainerExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createAzureSQLAGWorkloadContainerProtectionContainerProtocol() -> AzureSQLAGWorkloadContainerProtectionContainerProtocol {
    return AzureSQLAGWorkloadContainerProtectionContainerData()
  }
}


// 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 AzureSqlContainerData : AzureSqlContainerProtocol, ProtectionContainerProtocol {
    public var friendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var registrationStatus: String?
    public var healthStatus: String?

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

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

extension DataFactory {
  public static func createAzureSqlContainerProtocol() -> AzureSqlContainerProtocol {
    return AzureSqlContainerData()
  }
}


// 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 AzureSqlProtectedItemData : AzureSqlProtectedItemProtocol, 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 protectedItemDataId: String?
    public var protectionState: ProtectedItemStateEnum?
    public var extendedInfo: AzureSqlProtectedItemExtendedInfoProtocol?

        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 protectedItemDataId = "protectedItemDataId"
        case protectionState = "protectionState"
        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(.protectedItemDataId) {
        self.protectedItemDataId = try container.decode(String?.self, forKey: .protectedItemDataId)
    }
    if container.contains(.protectionState) {
        self.protectionState = try container.decode(ProtectedItemStateEnum?.self, forKey: .protectionState)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(AzureSqlProtectedItemExtendedInfoData?.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.protectedItemDataId != nil {try container.encode(self.protectedItemDataId, forKey: .protectedItemDataId)}
    if self.protectionState != nil {try container.encode(self.protectionState, forKey: .protectionState)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! AzureSqlProtectedItemExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createAzureSqlProtectedItemProtocol() -> AzureSqlProtectedItemProtocol {
    return AzureSqlProtectedItemData()
  }
}


// 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 AzureSqlProtectedItemExtendedInfoData : AzureSqlProtectedItemExtendedInfoProtocol {
    public var oldestRecoveryPoint: Date?
    public var recoveryPointCount: Int32?
    public var policyState: String?

        enum CodingKeys: String, CodingKey {case oldestRecoveryPoint = "oldestRecoveryPoint"
        case recoveryPointCount = "recoveryPointCount"
        case policyState = "policyState"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureSqlProtectedItemExtendedInfoProtocol() -> AzureSqlProtectedItemExtendedInfoProtocol {
    return AzureSqlProtectedItemExtendedInfoData()
  }
}


// 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 AzureSqlProtectionPolicyData : AzureSqlProtectionPolicyProtocol, ProtectionPolicyProtocol {
    public var protectedItemsCount: Int32?
    public var retentionPolicy: RetentionPolicyProtocol?

        enum CodingKeys: String, CodingKey {case protectedItemsCount = "protectedItemsCount"
        case retentionPolicy = "retentionPolicy"
        }

  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(.retentionPolicy) {
        self.retentionPolicy = try container.decode(RetentionPolicyData?.self, forKey: .retentionPolicy)
    }
    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.retentionPolicy != nil {try container.encode(self.retentionPolicy as! RetentionPolicyData?, forKey: .retentionPolicy)}
  }
}

extension DataFactory {
  public static func createAzureSqlProtectionPolicyProtocol() -> AzureSqlProtectionPolicyProtocol {
    return AzureSqlProtectionPolicyData()
  }
}


// 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 AzureStorageContainerData : AzureStorageContainerProtocol, ProtectionContainerProtocol {
    public var friendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var registrationStatus: String?
    public var healthStatus: String?
    public var sourceResourceId: String?
    public var storageAccountVersion: String?
    public var resourceGroup: String?
    public var protectedItemCount: Int64?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case backupManagementType = "backupManagementType"
        case registrationStatus = "registrationStatus"
        case healthStatus = "healthStatus"
        case sourceResourceId = "sourceResourceId"
        case storageAccountVersion = "storageAccountVersion"
        case resourceGroup = "resourceGroup"
        case protectedItemCount = "protectedItemCount"
        }

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

extension DataFactory {
  public static func createAzureStorageContainerProtocol() -> AzureStorageContainerProtocol {
    return AzureStorageContainerData()
  }
}


// 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 AzureStorageErrorInfoData : AzureStorageErrorInfoProtocol {
    public var errorCode: Int32?
    public var errorString: String?
    public var recommendations: [String]?

        enum CodingKeys: String, CodingKey {case errorCode = "errorCode"
        case errorString = "errorString"
        case recommendations = "recommendations"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureStorageErrorInfoProtocol() -> AzureStorageErrorInfoProtocol {
    return AzureStorageErrorInfoData()
  }
}


// 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 AzureStorageJobData : AzureStorageJobProtocol, 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?
    public var duration: String?
    public var actionsInfo: [JobSupportedActionEnum?]?
    public var errorDetails: [AzureStorageErrorInfoProtocol?]?
    public var storageAccountName: String?
    public var storageAccountVersion: String?
    public var extendedInfo: AzureStorageJobExtendedInfoProtocol?

        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"
        case duration = "duration"
        case actionsInfo = "actionsInfo"
        case errorDetails = "errorDetails"
        case storageAccountName = "storageAccountName"
        case storageAccountVersion = "storageAccountVersion"
        case extendedInfo = "extendedInfo"
        }

  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 container.contains(.duration) {
        self.duration = try container.decode(String?.self, forKey: .duration)
    }
    if container.contains(.actionsInfo) {
        self.actionsInfo = try container.decode([JobSupportedActionEnum?]?.self, forKey: .actionsInfo)
    }
    if container.contains(.errorDetails) {
        self.errorDetails = try container.decode([AzureStorageErrorInfoData?]?.self, forKey: .errorDetails)
    }
    if container.contains(.storageAccountName) {
        self.storageAccountName = try container.decode(String?.self, forKey: .storageAccountName)
    }
    if container.contains(.storageAccountVersion) {
        self.storageAccountVersion = try container.decode(String?.self, forKey: .storageAccountVersion)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(AzureStorageJobExtendedInfoData?.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.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)}
    if self.duration != nil {try container.encode(self.duration, forKey: .duration)}
    if self.actionsInfo != nil {try container.encode(self.actionsInfo as! [JobSupportedActionEnum?]?, forKey: .actionsInfo)}
    if self.errorDetails != nil {try container.encode(self.errorDetails as! [AzureStorageErrorInfoData?]?, forKey: .errorDetails)}
    if self.storageAccountName != nil {try container.encode(self.storageAccountName, forKey: .storageAccountName)}
    if self.storageAccountVersion != nil {try container.encode(self.storageAccountVersion, forKey: .storageAccountVersion)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! AzureStorageJobExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createAzureStorageJobProtocol() -> AzureStorageJobProtocol {
    return AzureStorageJobData()
  }
}


// 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 AzureStorageJobExtendedInfoData : AzureStorageJobExtendedInfoProtocol {
    public var tasksList: [AzureStorageJobTaskDetailsProtocol?]?
    public var propertyBag: [String:String]?
    public var dynamicErrorMessage: String?

        enum CodingKeys: String, CodingKey {case tasksList = "tasksList"
        case propertyBag = "propertyBag"
        case dynamicErrorMessage = "dynamicErrorMessage"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureStorageJobExtendedInfoProtocol() -> AzureStorageJobExtendedInfoProtocol {
    return AzureStorageJobExtendedInfoData()
  }
}


// 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 AzureStorageJobTaskDetailsData : AzureStorageJobTaskDetailsProtocol {
    public var taskId: String?
    public var status: String?

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

extension DataFactory {
  public static func createAzureStorageJobTaskDetailsProtocol() -> AzureStorageJobTaskDetailsProtocol {
    return AzureStorageJobTaskDetailsData()
  }
}


// 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 AzureStorageProtectableContainerData : AzureStorageProtectableContainerProtocol, ProtectableContainerProtocol {
    public var friendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var healthStatus: String?
    public var containerId: String?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case backupManagementType = "backupManagementType"
        case healthStatus = "healthStatus"
        case containerId = "containerId"
        }

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

extension DataFactory {
  public static func createAzureStorageProtectableContainerProtocol() -> AzureStorageProtectableContainerProtocol {
    return AzureStorageProtectableContainerData()
  }
}


// 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 AzureVMAppContainerProtectableContainerData : AzureVMAppContainerProtectableContainerProtocol, ProtectableContainerProtocol {
    public var friendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var healthStatus: String?
    public var containerId: String?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case backupManagementType = "backupManagementType"
        case healthStatus = "healthStatus"
        case containerId = "containerId"
        }

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

extension DataFactory {
  public static func createAzureVMAppContainerProtectableContainerProtocol() -> AzureVMAppContainerProtectableContainerProtocol {
    return AzureVMAppContainerProtectableContainerData()
  }
}


// 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 AzureVMAppContainerProtectionContainerData : AzureVMAppContainerProtectionContainerProtocol, AzureWorkloadContainerProtocol, ProtectionContainerProtocol {
    public var friendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var registrationStatus: String?
    public var healthStatus: String?
    public var sourceResourceId: String?
    public var lastUpdatedTime: Date?
    public var extendedInfo: AzureWorkloadContainerExtendedInfoProtocol?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case backupManagementType = "backupManagementType"
        case registrationStatus = "registrationStatus"
        case healthStatus = "healthStatus"
        case sourceResourceId = "sourceResourceId"
        case lastUpdatedTime = "lastUpdatedTime"
        case extendedInfo = "extendedInfo"
        }

  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(.sourceResourceId) {
        self.sourceResourceId = try container.decode(String?.self, forKey: .sourceResourceId)
    }
    if container.contains(.lastUpdatedTime) {
        self.lastUpdatedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUpdatedTime)), format: .dateTime)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(AzureWorkloadContainerExtendedInfoData?.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.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.sourceResourceId != nil {try container.encode(self.sourceResourceId, forKey: .sourceResourceId)}
    if self.lastUpdatedTime != nil {
        try container.encode(DateConverter.toString(date: self.lastUpdatedTime!, format: .dateTime), forKey: .lastUpdatedTime)
    }
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! AzureWorkloadContainerExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createAzureVMAppContainerProtectionContainerProtocol() -> AzureVMAppContainerProtectionContainerProtocol {
    return AzureVMAppContainerProtectionContainerData()
  }
}


// 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 AzureVMResourceFeatureSupportRequestData : AzureVMResourceFeatureSupportRequestProtocol, FeatureSupportRequestProtocol {
    public var vmSize: String?
    public var vmSku: String?

        enum CodingKeys: String, CodingKey {case vmSize = "vmSize"
        case vmSku = "vmSku"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureVMResourceFeatureSupportRequestProtocol() -> AzureVMResourceFeatureSupportRequestProtocol {
    return AzureVMResourceFeatureSupportRequestData()
  }
}


// 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 AzureVMResourceFeatureSupportResponseData : AzureVMResourceFeatureSupportResponseProtocol {
    public var supportStatus: SupportStatusEnum?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createAzureVMResourceFeatureSupportResponseProtocol() -> AzureVMResourceFeatureSupportResponseProtocol {
    return AzureVMResourceFeatureSupportResponseData()
  }
}


// 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 AzureVmWorkloadItemData : AzureVmWorkloadItemProtocol, WorkloadItemProtocol {
    public var backupManagementType: String?
    public var workloadType: String?
    public var friendlyName: String?
    public var protectionState: ProtectionStatusEnum?
    public var parentName: String?
    public var serverName: String?
    public var isAutoProtectable: Bool?
    public var subinquireditemcount: Int32?
    public var subWorkloadItemCount: Int32?

        enum CodingKeys: String, CodingKey {case backupManagementType = "backupManagementType"
        case workloadType = "workloadType"
        case friendlyName = "friendlyName"
        case protectionState = "protectionState"
        case parentName = "parentName"
        case serverName = "serverName"
        case isAutoProtectable = "isAutoProtectable"
        case subinquireditemcount = "subinquireditemcount"
        case subWorkloadItemCount = "subWorkloadItemCount"
        }

  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(.parentName) {
        self.parentName = try container.decode(String?.self, forKey: .parentName)
    }
    if container.contains(.serverName) {
        self.serverName = try container.decode(String?.self, forKey: .serverName)
    }
    if container.contains(.isAutoProtectable) {
        self.isAutoProtectable = try container.decode(Bool?.self, forKey: .isAutoProtectable)
    }
    if container.contains(.subinquireditemcount) {
        self.subinquireditemcount = try container.decode(Int32?.self, forKey: .subinquireditemcount)
    }
    if container.contains(.subWorkloadItemCount) {
        self.subWorkloadItemCount = try container.decode(Int32?.self, forKey: .subWorkloadItemCount)
    }
    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.parentName != nil {try container.encode(self.parentName, forKey: .parentName)}
    if self.serverName != nil {try container.encode(self.serverName, forKey: .serverName)}
    if self.isAutoProtectable != nil {try container.encode(self.isAutoProtectable, forKey: .isAutoProtectable)}
    if self.subinquireditemcount != nil {try container.encode(self.subinquireditemcount, forKey: .subinquireditemcount)}
    if self.subWorkloadItemCount != nil {try container.encode(self.subWorkloadItemCount, forKey: .subWorkloadItemCount)}
  }
}

extension DataFactory {
  public static func createAzureVmWorkloadItemProtocol() -> AzureVmWorkloadItemProtocol {
    return AzureVmWorkloadItemData()
  }
}