// LastBackupStatus enumerates the values for last backup status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum LastBackupStatusEnum: String, Codable
{
// LastBackupStatusHealthy specifies the last backup status healthy state for last backup status.
    case LastBackupStatusHealthy = "Healthy"
// LastBackupStatusInvalid specifies the last backup status invalid state for last backup status.
    case LastBackupStatusInvalid = "Invalid"
// LastBackupStatusIRPending specifies the last backup status ir pending state for last backup status.
    case LastBackupStatusIRPending = "IRPending"
// LastBackupStatusUnhealthy specifies the last backup status unhealthy state for last backup status.
    case LastBackupStatusUnhealthy = "Unhealthy"
}


// 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 LogSchedulePolicyData : LogSchedulePolicyProtocol, SchedulePolicyProtocol {
    public var scheduleFrequencyInMins: Int32?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createLogSchedulePolicyProtocol() -> LogSchedulePolicyProtocol {
    return LogSchedulePolicyData()
  }
}


// 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 LongTermRetentionPolicyData : LongTermRetentionPolicyProtocol, RetentionPolicyProtocol {
    public var dailySchedule: DailyRetentionScheduleProtocol?
    public var weeklySchedule: WeeklyRetentionScheduleProtocol?
    public var monthlySchedule: MonthlyRetentionScheduleProtocol?
    public var yearlySchedule: YearlyRetentionScheduleProtocol?

        enum CodingKeys: String, CodingKey {case dailySchedule = "dailySchedule"
        case weeklySchedule = "weeklySchedule"
        case monthlySchedule = "monthlySchedule"
        case yearlySchedule = "yearlySchedule"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.dailySchedule) {
        self.dailySchedule = try container.decode(DailyRetentionScheduleData?.self, forKey: .dailySchedule)
    }
    if container.contains(.weeklySchedule) {
        self.weeklySchedule = try container.decode(WeeklyRetentionScheduleData?.self, forKey: .weeklySchedule)
    }
    if container.contains(.monthlySchedule) {
        self.monthlySchedule = try container.decode(MonthlyRetentionScheduleData?.self, forKey: .monthlySchedule)
    }
    if container.contains(.yearlySchedule) {
        self.yearlySchedule = try container.decode(YearlyRetentionScheduleData?.self, forKey: .yearlySchedule)
    }
    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.dailySchedule != nil {try container.encode(self.dailySchedule as! DailyRetentionScheduleData?, forKey: .dailySchedule)}
    if self.weeklySchedule != nil {try container.encode(self.weeklySchedule as! WeeklyRetentionScheduleData?, forKey: .weeklySchedule)}
    if self.monthlySchedule != nil {try container.encode(self.monthlySchedule as! MonthlyRetentionScheduleData?, forKey: .monthlySchedule)}
    if self.yearlySchedule != nil {try container.encode(self.yearlySchedule as! YearlyRetentionScheduleData?, forKey: .yearlySchedule)}
  }
}

extension DataFactory {
  public static func createLongTermRetentionPolicyProtocol() -> LongTermRetentionPolicyProtocol {
    return LongTermRetentionPolicyData()
  }
}


// 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 LongTermSchedulePolicyData : LongTermSchedulePolicyProtocol, SchedulePolicyProtocol {

  public init()  {
  }

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

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

extension DataFactory {
  public static func createLongTermSchedulePolicyProtocol() -> LongTermSchedulePolicyProtocol {
    return LongTermSchedulePolicyData()
  }
}


// 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 MabContainerData : MabContainerProtocol, ProtectionContainerProtocol {
    public var friendlyName: String?
    public var backupManagementType: BackupManagementTypeEnum?
    public var registrationStatus: String?
    public var healthStatus: String?
    public var canReRegister: Bool?
    public var containerId: Int64?
    public var protectedItemCount: Int64?
    public var agentVersion: String?
    public var extendedInfo: MabContainerExtendedInfoProtocol?
    public var mabContainerHealthDetails: [MABContainerHealthDetailsProtocol?]?
    public var containerHealthState: String?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case backupManagementType = "backupManagementType"
        case registrationStatus = "registrationStatus"
        case healthStatus = "healthStatus"
        case canReRegister = "canReRegister"
        case containerId = "containerId"
        case protectedItemCount = "protectedItemCount"
        case agentVersion = "agentVersion"
        case extendedInfo = "extendedInfo"
        case mabContainerHealthDetails = "mabContainerHealthDetails"
        case containerHealthState = "containerHealthState"
        }

  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(.canReRegister) {
        self.canReRegister = try container.decode(Bool?.self, forKey: .canReRegister)
    }
    if container.contains(.containerId) {
        self.containerId = try container.decode(Int64?.self, forKey: .containerId)
    }
    if container.contains(.protectedItemCount) {
        self.protectedItemCount = try container.decode(Int64?.self, forKey: .protectedItemCount)
    }
    if container.contains(.agentVersion) {
        self.agentVersion = try container.decode(String?.self, forKey: .agentVersion)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(MabContainerExtendedInfoData?.self, forKey: .extendedInfo)
    }
    if container.contains(.mabContainerHealthDetails) {
        self.mabContainerHealthDetails = try container.decode([MABContainerHealthDetailsData?]?.self, forKey: .mabContainerHealthDetails)
    }
    if container.contains(.containerHealthState) {
        self.containerHealthState = try container.decode(String?.self, forKey: .containerHealthState)
    }
    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.canReRegister != nil {try container.encode(self.canReRegister, forKey: .canReRegister)}
    if self.containerId != nil {try container.encode(self.containerId, forKey: .containerId)}
    if self.protectedItemCount != nil {try container.encode(self.protectedItemCount, forKey: .protectedItemCount)}
    if self.agentVersion != nil {try container.encode(self.agentVersion, forKey: .agentVersion)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! MabContainerExtendedInfoData?, forKey: .extendedInfo)}
    if self.mabContainerHealthDetails != nil {try container.encode(self.mabContainerHealthDetails as! [MABContainerHealthDetailsData?]?, forKey: .mabContainerHealthDetails)}
    if self.containerHealthState != nil {try container.encode(self.containerHealthState, forKey: .containerHealthState)}
  }
}

extension DataFactory {
  public static func createMabContainerProtocol() -> MabContainerProtocol {
    return MabContainerData()
  }
}


// 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 MabContainerExtendedInfoData : MabContainerExtendedInfoProtocol {
    public var lastRefreshedAt: Date?
    public var backupItemType: BackupItemTypeEnum?
    public var backupItems: [String]?
    public var policyName: String?
    public var lastBackupStatus: String?

        enum CodingKeys: String, CodingKey {case lastRefreshedAt = "lastRefreshedAt"
        case backupItemType = "backupItemType"
        case backupItems = "backupItems"
        case policyName = "policyName"
        case lastBackupStatus = "lastBackupStatus"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createMabContainerExtendedInfoProtocol() -> MabContainerExtendedInfoProtocol {
    return MabContainerExtendedInfoData()
  }
}


// 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 MABContainerHealthDetailsData : MABContainerHealthDetailsProtocol {
    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 createMABContainerHealthDetailsProtocol() -> MABContainerHealthDetailsProtocol {
    return MABContainerHealthDetailsData()
  }
}


// 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 MabErrorInfoData : MabErrorInfoProtocol {
    public var errorString: String?
    public var recommendations: [String]?

        enum CodingKeys: String, CodingKey {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(.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.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 createMabErrorInfoProtocol() -> MabErrorInfoProtocol {
    return MabErrorInfoData()
  }
}


// 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 MabFileFolderProtectedItemData : MabFileFolderProtectedItemProtocol, 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 computerName: String?
    public var lastBackupStatus: String?
    public var protectionState: String?
    public var isScheduledForDeferredDelete: Bool?
    public var deferredDeleteSyncTimeInUTC: Int64?
    public var extendedInfo: MabFileFolderProtectedItemExtendedInfoProtocol?

        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 computerName = "computerName"
        case lastBackupStatus = "lastBackupStatus"
        case protectionState = "protectionState"
        case isScheduledForDeferredDelete = "isScheduledForDeferredDelete"
        case deferredDeleteSyncTimeInUTC = "deferredDeleteSyncTimeInUTC"
        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(.computerName) {
        self.computerName = try container.decode(String?.self, forKey: .computerName)
    }
    if container.contains(.lastBackupStatus) {
        self.lastBackupStatus = try container.decode(String?.self, forKey: .lastBackupStatus)
    }
    if container.contains(.protectionState) {
        self.protectionState = try container.decode(String?.self, forKey: .protectionState)
    }
    if container.contains(.isScheduledForDeferredDelete) {
        self.isScheduledForDeferredDelete = try container.decode(Bool?.self, forKey: .isScheduledForDeferredDelete)
    }
    if container.contains(.deferredDeleteSyncTimeInUTC) {
        self.deferredDeleteSyncTimeInUTC = try container.decode(Int64?.self, forKey: .deferredDeleteSyncTimeInUTC)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(MabFileFolderProtectedItemExtendedInfoData?.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.computerName != nil {try container.encode(self.computerName, forKey: .computerName)}
    if self.lastBackupStatus != nil {try container.encode(self.lastBackupStatus, forKey: .lastBackupStatus)}
    if self.protectionState != nil {try container.encode(self.protectionState, forKey: .protectionState)}
    if self.isScheduledForDeferredDelete != nil {try container.encode(self.isScheduledForDeferredDelete, forKey: .isScheduledForDeferredDelete)}
    if self.deferredDeleteSyncTimeInUTC != nil {try container.encode(self.deferredDeleteSyncTimeInUTC, forKey: .deferredDeleteSyncTimeInUTC)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! MabFileFolderProtectedItemExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createMabFileFolderProtectedItemProtocol() -> MabFileFolderProtectedItemProtocol {
    return MabFileFolderProtectedItemData()
  }
}


// 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 MabFileFolderProtectedItemExtendedInfoData : MabFileFolderProtectedItemExtendedInfoProtocol {
    public var lastRefreshedAt: Date?
    public var oldestRecoveryPoint: Date?
    public var recoveryPointCount: Int32?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createMabFileFolderProtectedItemExtendedInfoProtocol() -> MabFileFolderProtectedItemExtendedInfoProtocol {
    return MabFileFolderProtectedItemExtendedInfoData()
  }
}


// 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 MabJobData : MabJobProtocol, 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 mabServerName: String?
    public var mabServerType: MabServerTypeEnum?
    public var workloadType: WorkloadTypeEnum?
    public var errorDetails: [MabErrorInfoProtocol?]?
    public var extendedInfo: MabJobExtendedInfoProtocol?

        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 mabServerName = "mabServerName"
        case mabServerType = "mabServerType"
        case workloadType = "workloadType"
        case errorDetails = "errorDetails"
        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(.mabServerName) {
        self.mabServerName = try container.decode(String?.self, forKey: .mabServerName)
    }
    if container.contains(.mabServerType) {
        self.mabServerType = try container.decode(MabServerTypeEnum?.self, forKey: .mabServerType)
    }
    if container.contains(.workloadType) {
        self.workloadType = try container.decode(WorkloadTypeEnum?.self, forKey: .workloadType)
    }
    if container.contains(.errorDetails) {
        self.errorDetails = try container.decode([MabErrorInfoData?]?.self, forKey: .errorDetails)
    }
    if container.contains(.extendedInfo) {
        self.extendedInfo = try container.decode(MabJobExtendedInfoData?.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.mabServerName != nil {try container.encode(self.mabServerName, forKey: .mabServerName)}
    if self.mabServerType != nil {try container.encode(self.mabServerType, forKey: .mabServerType)}
    if self.workloadType != nil {try container.encode(self.workloadType, forKey: .workloadType)}
    if self.errorDetails != nil {try container.encode(self.errorDetails as! [MabErrorInfoData?]?, forKey: .errorDetails)}
    if self.extendedInfo != nil {try container.encode(self.extendedInfo as! MabJobExtendedInfoData?, forKey: .extendedInfo)}
  }
}

extension DataFactory {
  public static func createMabJobProtocol() -> MabJobProtocol {
    return MabJobData()
  }
}


// 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 MabJobExtendedInfoData : MabJobExtendedInfoProtocol {
    public var tasksList: [MabJobTaskDetailsProtocol?]?
    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([MabJobTaskDetailsData?]?.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! [MabJobTaskDetailsData?]?, 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 createMabJobExtendedInfoProtocol() -> MabJobExtendedInfoProtocol {
    return MabJobExtendedInfoData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createMabJobTaskDetailsProtocol() -> MabJobTaskDetailsProtocol {
    return MabJobTaskDetailsData()
  }
}


// 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 MabProtectionPolicyData : MabProtectionPolicyProtocol, ProtectionPolicyProtocol {
    public var protectedItemsCount: Int32?
    public var schedulePolicy: SchedulePolicyProtocol?
    public var retentionPolicy: RetentionPolicyProtocol?

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

extension DataFactory {
  public static func createMabProtectionPolicyProtocol() -> MabProtectionPolicyProtocol {
    return MabProtectionPolicyData()
  }
}


// MabServerType enumerates the values for mab server type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum MabServerTypeEnum: String, Codable
{
// MabServerTypeAzureBackupServerContainer specifies the mab server type azure backup server container state for mab
// server type.
    case MabServerTypeAzureBackupServerContainer = "AzureBackupServerContainer"
// MabServerTypeAzureSqlContainer specifies the mab server type azure sql container state for mab server type.
    case MabServerTypeAzureSqlContainer = "AzureSqlContainer"
// MabServerTypeCluster specifies the mab server type cluster state for mab server type.
    case MabServerTypeCluster = "Cluster"
// MabServerTypeDPMContainer specifies the mab server type dpm container state for mab server type.
    case MabServerTypeDPMContainer = "DPMContainer"
// MabServerTypeGenericContainer specifies the mab server type generic container state for mab server type.
    case MabServerTypeGenericContainer = "GenericContainer"
// MabServerTypeIaasVMContainer specifies the mab server type iaas vm container state for mab server type.
    case MabServerTypeIaasVMContainer = "IaasVMContainer"
// MabServerTypeIaasVMServiceContainer specifies the mab server type iaas vm service container state for mab server
// type.
    case MabServerTypeIaasVMServiceContainer = "IaasVMServiceContainer"
// MabServerTypeInvalid specifies the mab server type invalid state for mab server type.
    case MabServerTypeInvalid = "Invalid"
// MabServerTypeMABContainer specifies the mab server type mab container state for mab server type.
    case MabServerTypeMABContainer = "MABContainer"
// MabServerTypeSQLAGWorkLoadContainer specifies the mab server type sqlag work load container state for mab server
// type.
    case MabServerTypeSQLAGWorkLoadContainer = "SQLAGWorkLoadContainer"
// MabServerTypeStorageContainer specifies the mab server type storage container state for mab server type.
    case MabServerTypeStorageContainer = "StorageContainer"
// MabServerTypeUnknown specifies the mab server type unknown state for mab server type.
    case MabServerTypeUnknown = "Unknown"
// MabServerTypeVCenter specifies the mab server type v center state for mab server type.
    case MabServerTypeVCenter = "VCenter"
// MabServerTypeVMAppContainer specifies the mab server type vm app container state for mab server type.
    case MabServerTypeVMAppContainer = "VMAppContainer"
// MabServerTypeWindows specifies the mab server type windows state for mab server type.
    case MabServerTypeWindows = "Windows"
}


// 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 MonthlyRetentionScheduleData : MonthlyRetentionScheduleProtocol {
    public var retentionScheduleFormatType: RetentionScheduleFormatEnum?
    public var retentionScheduleDaily: DailyRetentionFormatProtocol?
    public var retentionScheduleWeekly: WeeklyRetentionFormatProtocol?
    public var retentionTimes: [Date]?
    public var retentionDuration: RetentionDurationProtocol?

        enum CodingKeys: String, CodingKey {case retentionScheduleFormatType = "retentionScheduleFormatType"
        case retentionScheduleDaily = "retentionScheduleDaily"
        case retentionScheduleWeekly = "retentionScheduleWeekly"
        case retentionTimes = "retentionTimes"
        case retentionDuration = "retentionDuration"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.retentionScheduleFormatType) {
        self.retentionScheduleFormatType = try container.decode(RetentionScheduleFormatEnum?.self, forKey: .retentionScheduleFormatType)
    }
    if container.contains(.retentionScheduleDaily) {
        self.retentionScheduleDaily = try container.decode(DailyRetentionFormatData?.self, forKey: .retentionScheduleDaily)
    }
    if container.contains(.retentionScheduleWeekly) {
        self.retentionScheduleWeekly = try container.decode(WeeklyRetentionFormatData?.self, forKey: .retentionScheduleWeekly)
    }
    if container.contains(.retentionTimes) {
        self.retentionTimes = try container.decode([Date]?.self, forKey: .retentionTimes)
    }
    if container.contains(.retentionDuration) {
        self.retentionDuration = try container.decode(RetentionDurationData?.self, forKey: .retentionDuration)
    }
    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.retentionScheduleFormatType != nil {try container.encode(self.retentionScheduleFormatType, forKey: .retentionScheduleFormatType)}
    if self.retentionScheduleDaily != nil {try container.encode(self.retentionScheduleDaily as! DailyRetentionFormatData?, forKey: .retentionScheduleDaily)}
    if self.retentionScheduleWeekly != nil {try container.encode(self.retentionScheduleWeekly as! WeeklyRetentionFormatData?, forKey: .retentionScheduleWeekly)}
    if self.retentionTimes != nil {try container.encode(self.retentionTimes as! [Date]?, forKey: .retentionTimes)}
    if self.retentionDuration != nil {try container.encode(self.retentionDuration as! RetentionDurationData?, forKey: .retentionDuration)}
  }
}

extension DataFactory {
  public static func createMonthlyRetentionScheduleProtocol() -> MonthlyRetentionScheduleProtocol {
    return MonthlyRetentionScheduleData()
  }
}


// MonthOfYear enumerates the values for month of year.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum MonthOfYearEnum: String, Codable
{
// MonthOfYearApril specifies the month of year april state for month of year.
    case MonthOfYearApril = "April"
// MonthOfYearAugust specifies the month of year august state for month of year.
    case MonthOfYearAugust = "August"
// MonthOfYearDecember specifies the month of year december state for month of year.
    case MonthOfYearDecember = "December"
// MonthOfYearFebruary specifies the month of year february state for month of year.
    case MonthOfYearFebruary = "February"
// MonthOfYearInvalid specifies the month of year invalid state for month of year.
    case MonthOfYearInvalid = "Invalid"
// MonthOfYearJanuary specifies the month of year january state for month of year.
    case MonthOfYearJanuary = "January"
// MonthOfYearJuly specifies the month of year july state for month of year.
    case MonthOfYearJuly = "July"
// MonthOfYearJune specifies the month of year june state for month of year.
    case MonthOfYearJune = "June"
// MonthOfYearMarch specifies the month of year march state for month of year.
    case MonthOfYearMarch = "March"
// MonthOfYearMay specifies the month of year may state for month of year.
    case MonthOfYearMay = "May"
// MonthOfYearNovember specifies the month of year november state for month of year.
    case MonthOfYearNovember = "November"
// MonthOfYearOctober specifies the month of year october state for month of year.
    case MonthOfYearOctober = "October"
// MonthOfYearSeptember specifies the month of year september state for month of year.
    case MonthOfYearSeptember = "September"
}


// 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 NameInfoData : NameInfoProtocol {
    public var value: String?
    public var localizedValue: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createNameInfoProtocol() -> NameInfoProtocol {
    return NameInfoData()
  }
}


// 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 OperationResultInfoBaseData : OperationResultInfoBaseProtocol {

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationResultInfoBaseProtocol() -> OperationResultInfoBaseProtocol {
    return OperationResultInfoBaseData()
  }
}


// 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 OperationResultInfoBaseResourceData : OperationResultInfoBaseResourceProtocol, OperationWorkerResponseProtocol {
    public var statusCode: HttpStatusCodeEnum?
    public var headers: [String:[String]?]?
    public var operation: OperationResultInfoBaseProtocol?

        enum CodingKeys: String, CodingKey {case statusCode = "statusCode"
        case headers = "headers"
        case operation = "operation"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationResultInfoBaseResourceProtocol() -> OperationResultInfoBaseResourceProtocol {
    return OperationResultInfoBaseResourceData()
  }
}


// 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 OperationResultInfoData : OperationResultInfoProtocol, OperationResultInfoBaseProtocol {
    public var jobList: [String]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationResultInfoProtocol() -> OperationResultInfoProtocol {
    return OperationResultInfoData()
  }
}


// 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 OperationStatusData : OperationStatusProtocol {
    public var id: String?
    public var name: String?
    public var status: OperationStatusValuesEnum?
    public var startTime: Date?
    public var endTime: Date?
    public var error: OperationStatusErrorProtocol?
    public var properties: OperationStatusExtendedInfoProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case status = "status"
        case startTime = "startTime"
        case endTime = "endTime"
        case error = "error"
        case properties = "properties"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.id) {
        self.id = try container.decode(String?.self, forKey: .id)
    }
    if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.status) {
        self.status = try container.decode(OperationStatusValuesEnum?.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(.error) {
        self.error = try container.decode(OperationStatusErrorData?.self, forKey: .error)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(OperationStatusExtendedInfoData?.self, forKey: .properties)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.id != nil {try container.encode(self.id, forKey: .id)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.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.error != nil {try container.encode(self.error as! OperationStatusErrorData?, forKey: .error)}
    if self.properties != nil {try container.encode(self.properties as! OperationStatusExtendedInfoData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createOperationStatusProtocol() -> OperationStatusProtocol {
    return OperationStatusData()
  }
}


// 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 OperationStatusErrorData : OperationStatusErrorProtocol {
    public var code: String?
    public var message: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationStatusErrorProtocol() -> OperationStatusErrorProtocol {
    return OperationStatusErrorData()
  }
}


// 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 OperationStatusExtendedInfoData : OperationStatusExtendedInfoProtocol {

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationStatusExtendedInfoProtocol() -> OperationStatusExtendedInfoProtocol {
    return OperationStatusExtendedInfoData()
  }
}


// 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 OperationStatusJobExtendedInfoData : OperationStatusJobExtendedInfoProtocol, OperationStatusExtendedInfoProtocol {
    public var jobId: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationStatusJobExtendedInfoProtocol() -> OperationStatusJobExtendedInfoProtocol {
    return OperationStatusJobExtendedInfoData()
  }
}


// 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 OperationStatusJobsExtendedInfoData : OperationStatusJobsExtendedInfoProtocol, OperationStatusExtendedInfoProtocol {
    public var jobIds: [String]?
    public var failedJobsError: [String:String]?

        enum CodingKeys: String, CodingKey {case jobIds = "jobIds"
        case failedJobsError = "failedJobsError"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationStatusJobsExtendedInfoProtocol() -> OperationStatusJobsExtendedInfoProtocol {
    return OperationStatusJobsExtendedInfoData()
  }
}


// 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 OperationStatusProvisionILRExtendedInfoData : OperationStatusProvisionILRExtendedInfoProtocol, OperationStatusExtendedInfoProtocol {
    public var recoveryTarget: InstantItemRecoveryTargetProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationStatusProvisionILRExtendedInfoProtocol() -> OperationStatusProvisionILRExtendedInfoProtocol {
    return OperationStatusProvisionILRExtendedInfoData()
  }
}


// OperationStatusValues enumerates the values for operation status values.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum OperationStatusValuesEnum: String, Codable
{
// OperationStatusValuesCanceled specifies the operation status values canceled state for operation status values.
    case OperationStatusValuesCanceled = "Canceled"
// OperationStatusValuesFailed specifies the operation status values failed state for operation status values.
    case OperationStatusValuesFailed = "Failed"
// OperationStatusValuesInProgress specifies the operation status values in progress state for operation status values.
    case OperationStatusValuesInProgress = "InProgress"
// OperationStatusValuesInvalid specifies the operation status values invalid state for operation status values.
    case OperationStatusValuesInvalid = "Invalid"
// OperationStatusValuesSucceeded specifies the operation status values succeeded state for operation status values.
    case OperationStatusValuesSucceeded = "Succeeded"
}


// 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 OperationWorkerResponseData : OperationWorkerResponseProtocol {
    public var statusCode: HttpStatusCodeEnum?
    public var headers: [String:[String]?]?

        enum CodingKeys: String, CodingKey {case statusCode = "statusCode"
        case headers = "headers"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationWorkerResponseProtocol() -> OperationWorkerResponseProtocol {
    return OperationWorkerResponseData()
  }
}


// OverwriteOptions enumerates the values for overwrite options.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum OverwriteOptionsEnum: String, Codable
{
// OverwriteOptionsFailOnConflict specifies the overwrite options fail on conflict state for overwrite options.
    case OverwriteOptionsFailOnConflict = "FailOnConflict"
// OverwriteOptionsInvalid specifies the overwrite options invalid state for overwrite options.
    case OverwriteOptionsInvalid = "Invalid"
// OverwriteOptionsOverwrite specifies the overwrite options overwrite state for overwrite options.
    case OverwriteOptionsOverwrite = "Overwrite"
}


// 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 PointInTimeRangeData : PointInTimeRangeProtocol {
    public var startTime: Date?
    public var endTime: Date?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createPointInTimeRangeProtocol() -> PointInTimeRangeProtocol {
    return PointInTimeRangeData()
  }
}


// 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 PreBackupValidationData : PreBackupValidationProtocol {
    public var status: InquiryStatusEnum?
    public var code: String?
    public var message: String?

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

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.code != nil {try container.encode(self.code, forKey: .code)}
    if self.message != nil {try container.encode(self.message, forKey: .message)}
  }
}

extension DataFactory {
  public static func createPreBackupValidationProtocol() -> PreBackupValidationProtocol {
    return PreBackupValidationData()
  }
}


// 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 PreValidateEnableBackupRequestData : PreValidateEnableBackupRequestProtocol {
    public var resourceType: DataSourceTypeEnum?
    public var resourceId: String?
    public var vaultId: String?
    public var properties: String?

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

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.resourceType != nil {try container.encode(self.resourceType, forKey: .resourceType)}
    if self.resourceId != nil {try container.encode(self.resourceId, forKey: .resourceId)}
    if self.vaultId != nil {try container.encode(self.vaultId, forKey: .vaultId)}
    if self.properties != nil {try container.encode(self.properties, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createPreValidateEnableBackupRequestProtocol() -> PreValidateEnableBackupRequestProtocol {
    return PreValidateEnableBackupRequestData()
  }
}


// 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 PreValidateEnableBackupResponseData : PreValidateEnableBackupResponseProtocol {
    public var status: ValidationStatusEnum?
    public var errorCode: String?
    public var errorMessage: String?
    public var recommendation: String?
    public var containerName: String?
    public var protectedItemName: String?

        enum CodingKeys: String, CodingKey {case status = "status"
        case errorCode = "errorCode"
        case errorMessage = "errorMessage"
        case recommendation = "recommendation"
        case containerName = "containerName"
        case protectedItemName = "protectedItemName"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.status) {
        self.status = try container.decode(ValidationStatusEnum?.self, forKey: .status)
    }
    if container.contains(.errorCode) {
        self.errorCode = try container.decode(String?.self, forKey: .errorCode)
    }
    if container.contains(.errorMessage) {
        self.errorMessage = try container.decode(String?.self, forKey: .errorMessage)
    }
    if container.contains(.recommendation) {
        self.recommendation = try container.decode(String?.self, forKey: .recommendation)
    }
    if container.contains(.containerName) {
        self.containerName = try container.decode(String?.self, forKey: .containerName)
    }
    if container.contains(.protectedItemName) {
        self.protectedItemName = try container.decode(String?.self, forKey: .protectedItemName)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.errorCode != nil {try container.encode(self.errorCode, forKey: .errorCode)}
    if self.errorMessage != nil {try container.encode(self.errorMessage, forKey: .errorMessage)}
    if self.recommendation != nil {try container.encode(self.recommendation, forKey: .recommendation)}
    if self.containerName != nil {try container.encode(self.containerName, forKey: .containerName)}
    if self.protectedItemName != nil {try container.encode(self.protectedItemName, forKey: .protectedItemName)}
  }
}

extension DataFactory {
  public static func createPreValidateEnableBackupResponseProtocol() -> PreValidateEnableBackupResponseProtocol {
    return PreValidateEnableBackupResponseData()
  }
}


// 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 ProtectableContainerData : 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 createProtectableContainerProtocol() -> ProtectableContainerProtocol {
    return ProtectableContainerData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProtectableContainerResourceProtocol() -> ProtectableContainerResourceProtocol {
    return ProtectableContainerResourceData()
  }
}


// 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 ProtectableContainerResourceListData : ProtectableContainerResourceListProtocol, ResourceListProtocol {
    public var _nextLink: String?
    public var value: [ProtectableContainerResourceProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProtectableContainerResourceListProtocol() -> ProtectableContainerResourceListProtocol {
    return ProtectableContainerResourceListData()
  }
}


// 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 ProtectedItemData : 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?

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

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

extension DataFactory {
  public static func createProtectedItemProtocol() -> ProtectedItemProtocol {
    return ProtectedItemData()
  }
}


// ProtectedItemHealthStatus enumerates the values for protected item health status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ProtectedItemHealthStatusEnum: String, Codable
{
// ProtectedItemHealthStatusHealthy specifies the protected item health status healthy state for protected item health
// status.
    case ProtectedItemHealthStatusHealthy = "Healthy"
// ProtectedItemHealthStatusInvalid specifies the protected item health status invalid state for protected item health
// status.
    case ProtectedItemHealthStatusInvalid = "Invalid"
// ProtectedItemHealthStatusIRPending specifies the protected item health status ir pending state for protected item
// health status.
    case ProtectedItemHealthStatusIRPending = "IRPending"
// ProtectedItemHealthStatusNotReachable specifies the protected item health status not reachable state for protected
// item health status.
    case ProtectedItemHealthStatusNotReachable = "NotReachable"
// ProtectedItemHealthStatusUnhealthy specifies the protected item health status unhealthy state for protected item
// health status.
    case ProtectedItemHealthStatusUnhealthy = "Unhealthy"
}


// 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 ProtectedItemQueryObjectData : ProtectedItemQueryObjectProtocol {
    public var healthState: HealthStateEnum?
    public var backupManagementType: BackupManagementTypeEnum?
    public var itemType: DataSourceTypeEnum?
    public var policyName: String?
    public var containerName: String?
    public var backupEngineName: String?
    public var friendlyName: String?
    public var fabricName: String?
    public var backupSetName: String?

        enum CodingKeys: String, CodingKey {case healthState = "healthState"
        case backupManagementType = "backupManagementType"
        case itemType = "itemType"
        case policyName = "policyName"
        case containerName = "containerName"
        case backupEngineName = "backupEngineName"
        case friendlyName = "friendlyName"
        case fabricName = "fabricName"
        case backupSetName = "backupSetName"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.healthState) {
        self.healthState = try container.decode(HealthStateEnum?.self, forKey: .healthState)
    }
    if container.contains(.backupManagementType) {
        self.backupManagementType = try container.decode(BackupManagementTypeEnum?.self, forKey: .backupManagementType)
    }
    if container.contains(.itemType) {
        self.itemType = try container.decode(DataSourceTypeEnum?.self, forKey: .itemType)
    }
    if container.contains(.policyName) {
        self.policyName = try container.decode(String?.self, forKey: .policyName)
    }
    if container.contains(.containerName) {
        self.containerName = try container.decode(String?.self, forKey: .containerName)
    }
    if container.contains(.backupEngineName) {
        self.backupEngineName = try container.decode(String?.self, forKey: .backupEngineName)
    }
    if container.contains(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.fabricName) {
        self.fabricName = try container.decode(String?.self, forKey: .fabricName)
    }
    if container.contains(.backupSetName) {
        self.backupSetName = try container.decode(String?.self, forKey: .backupSetName)
    }
    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.healthState != nil {try container.encode(self.healthState, forKey: .healthState)}
    if self.backupManagementType != nil {try container.encode(self.backupManagementType, forKey: .backupManagementType)}
    if self.itemType != nil {try container.encode(self.itemType, forKey: .itemType)}
    if self.policyName != nil {try container.encode(self.policyName, forKey: .policyName)}
    if self.containerName != nil {try container.encode(self.containerName, forKey: .containerName)}
    if self.backupEngineName != nil {try container.encode(self.backupEngineName, forKey: .backupEngineName)}
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.fabricName != nil {try container.encode(self.fabricName, forKey: .fabricName)}
    if self.backupSetName != nil {try container.encode(self.backupSetName, forKey: .backupSetName)}
  }
}

extension DataFactory {
  public static func createProtectedItemQueryObjectProtocol() -> ProtectedItemQueryObjectProtocol {
    return ProtectedItemQueryObjectData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProtectedItemResourceProtocol() -> ProtectedItemResourceProtocol {
    return ProtectedItemResourceData()
  }
}


// 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 ProtectedItemResourceListData : ProtectedItemResourceListProtocol, ResourceListProtocol {
    public var _nextLink: String?
    public var value: [ProtectedItemResourceProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProtectedItemResourceListProtocol() -> ProtectedItemResourceListProtocol {
    return ProtectedItemResourceListData()
  }
}


// ProtectedItemState enumerates the values for protected item state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ProtectedItemStateEnum: String, Codable
{
// ProtectedItemStateInvalid specifies the protected item state invalid state for protected item state.
    case ProtectedItemStateInvalid = "Invalid"
// ProtectedItemStateIRPending specifies the protected item state ir pending state for protected item state.
    case ProtectedItemStateIRPending = "IRPending"
// ProtectedItemStateProtected specifies the protected item state protected state for protected item state.
    case ProtectedItemStateProtected = "Protected"
// ProtectedItemStateProtectionError specifies the protected item state protection error state for protected item
// state.
    case ProtectedItemStateProtectionError = "ProtectionError"
// ProtectedItemStateProtectionPaused specifies the protected item state protection paused state for protected item
// state.
    case ProtectedItemStateProtectionPaused = "ProtectionPaused"
// ProtectedItemStateProtectionStopped specifies the protected item state protection stopped state for protected item
// state.
    case ProtectedItemStateProtectionStopped = "ProtectionStopped"
}