// 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 ProtectableItemCollectionData : ProtectableItemCollectionProtocol {
    public var value: [ProtectableItemProtocol?]?
    public var _nextLink: String?

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

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

extension DataFactory {
  public static func createProtectableItemCollectionProtocol() -> ProtectableItemCollectionProtocol {
    return ProtectableItemCollectionData()
  }
}


// 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 ProtectableItemData : ProtectableItemProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: ProtectableItemPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        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(.properties) {
        self.properties = try container.decode(ProtectableItemPropertiesData?.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.properties != nil {try container.encode(self.properties as! ProtectableItemPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createProtectableItemProtocol() -> ProtectableItemProtocol {
    return ProtectableItemData()
  }
}


// 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 ProtectableItemPropertiesData : ProtectableItemPropertiesProtocol {
    public var friendlyName: String?
    public var protectionStatus: String?
    public var replicationProtectedItemId: String?
    public var recoveryServicesProviderId: String?
    public var protectionReadinessErrors: [String]?
    public var supportedReplicationProviders: [String]?
    public var customDetails: ConfigurationSettingsProtocol?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case protectionStatus = "protectionStatus"
        case replicationProtectedItemId = "replicationProtectedItemId"
        case recoveryServicesProviderId = "recoveryServicesProviderId"
        case protectionReadinessErrors = "protectionReadinessErrors"
        case supportedReplicationProviders = "supportedReplicationProviders"
        case customDetails = "customDetails"
        }

  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(.protectionStatus) {
        self.protectionStatus = try container.decode(String?.self, forKey: .protectionStatus)
    }
    if container.contains(.replicationProtectedItemId) {
        self.replicationProtectedItemId = try container.decode(String?.self, forKey: .replicationProtectedItemId)
    }
    if container.contains(.recoveryServicesProviderId) {
        self.recoveryServicesProviderId = try container.decode(String?.self, forKey: .recoveryServicesProviderId)
    }
    if container.contains(.protectionReadinessErrors) {
        self.protectionReadinessErrors = try container.decode([String]?.self, forKey: .protectionReadinessErrors)
    }
    if container.contains(.supportedReplicationProviders) {
        self.supportedReplicationProviders = try container.decode([String]?.self, forKey: .supportedReplicationProviders)
    }
    if container.contains(.customDetails) {
        self.customDetails = try container.decode(ConfigurationSettingsData?.self, forKey: .customDetails)
    }
    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.protectionStatus != nil {try container.encode(self.protectionStatus, forKey: .protectionStatus)}
    if self.replicationProtectedItemId != nil {try container.encode(self.replicationProtectedItemId, forKey: .replicationProtectedItemId)}
    if self.recoveryServicesProviderId != nil {try container.encode(self.recoveryServicesProviderId, forKey: .recoveryServicesProviderId)}
    if self.protectionReadinessErrors != nil {try container.encode(self.protectionReadinessErrors as! [String]?, forKey: .protectionReadinessErrors)}
    if self.supportedReplicationProviders != nil {try container.encode(self.supportedReplicationProviders as! [String]?, forKey: .supportedReplicationProviders)}
    if self.customDetails != nil {try container.encode(self.customDetails as! ConfigurationSettingsData?, forKey: .customDetails)}
  }
}

extension DataFactory {
  public static func createProtectableItemPropertiesProtocol() -> ProtectableItemPropertiesProtocol {
    return ProtectableItemPropertiesData()
  }
}


// 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 ProtectedItemsQueryParameterData : ProtectedItemsQueryParameterProtocol {
    public var sourceFabricName: String?
    public var recoveryPlanName: String?
    public var vCenterName: String?
    public var instanceType: String?
    public var multiVmGroupCreateOption: MultiVmGroupCreateOptionEnum?

        enum CodingKeys: String, CodingKey {case sourceFabricName = "sourceFabricName"
        case recoveryPlanName = "recoveryPlanName"
        case vCenterName = "vCenterName"
        case instanceType = "instanceType"
        case multiVmGroupCreateOption = "multiVmGroupCreateOption"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createProtectedItemsQueryParameterProtocol() -> ProtectedItemsQueryParameterProtocol {
    return ProtectedItemsQueryParameterData()
  }
}


// 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 ProtectionContainerCollectionData : ProtectionContainerCollectionProtocol {
    public var value: [ProtectionContainerProtocol?]?
    public var _nextLink: String?

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

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

extension DataFactory {
  public static func createProtectionContainerCollectionProtocol() -> ProtectionContainerCollectionProtocol {
    return ProtectionContainerCollectionData()
  }
}


// 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 ProtectionContainerData : ProtectionContainerProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: ProtectionContainerPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        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(.properties) {
        self.properties = try container.decode(ProtectionContainerPropertiesData?.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.properties != nil {try container.encode(self.properties as! ProtectionContainerPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createProtectionContainerProtocol() -> ProtectionContainerProtocol {
    return ProtectionContainerData()
  }
}


// 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 ProtectionContainerFabricSpecificDetailsData : ProtectionContainerFabricSpecificDetailsProtocol {
    public var instanceType: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createProtectionContainerFabricSpecificDetailsProtocol() -> ProtectionContainerFabricSpecificDetailsProtocol {
    return ProtectionContainerFabricSpecificDetailsData()
  }
}


// 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 ProtectionContainerMappingCollectionData : ProtectionContainerMappingCollectionProtocol {
    public var value: [ProtectionContainerMappingProtocol?]?
    public var _nextLink: String?

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

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

extension DataFactory {
  public static func createProtectionContainerMappingCollectionProtocol() -> ProtectionContainerMappingCollectionProtocol {
    return ProtectionContainerMappingCollectionData()
  }
}


// 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 ProtectionContainerMappingData : ProtectionContainerMappingProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: ProtectionContainerMappingPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        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(.properties) {
        self.properties = try container.decode(ProtectionContainerMappingPropertiesData?.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.properties != nil {try container.encode(self.properties as! ProtectionContainerMappingPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createProtectionContainerMappingProtocol() -> ProtectionContainerMappingProtocol {
    return ProtectionContainerMappingData()
  }
}


// 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 ProtectionContainerMappingPropertiesData : ProtectionContainerMappingPropertiesProtocol {
    public var targetProtectionContainerId: String?
    public var targetProtectionContainerFriendlyName: String?
    public var providerSpecificDetails: ProtectionContainerMappingProviderSpecificDetailsProtocol?
    public var health: String?
    public var healthErrorDetails: [HealthErrorProtocol?]?
    public var policyId: String?
    public var state: String?
    public var sourceProtectionContainerFriendlyName: String?
    public var sourceFabricFriendlyName: String?
    public var targetFabricFriendlyName: String?
    public var policyFriendlyName: String?

        enum CodingKeys: String, CodingKey {case targetProtectionContainerId = "targetProtectionContainerId"
        case targetProtectionContainerFriendlyName = "targetProtectionContainerFriendlyName"
        case providerSpecificDetails = "providerSpecificDetails"
        case health = "health"
        case healthErrorDetails = "healthErrorDetails"
        case policyId = "policyId"
        case state = "state"
        case sourceProtectionContainerFriendlyName = "sourceProtectionContainerFriendlyName"
        case sourceFabricFriendlyName = "sourceFabricFriendlyName"
        case targetFabricFriendlyName = "targetFabricFriendlyName"
        case policyFriendlyName = "policyFriendlyName"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.targetProtectionContainerId) {
        self.targetProtectionContainerId = try container.decode(String?.self, forKey: .targetProtectionContainerId)
    }
    if container.contains(.targetProtectionContainerFriendlyName) {
        self.targetProtectionContainerFriendlyName = try container.decode(String?.self, forKey: .targetProtectionContainerFriendlyName)
    }
    if container.contains(.providerSpecificDetails) {
        self.providerSpecificDetails = try container.decode(ProtectionContainerMappingProviderSpecificDetailsData?.self, forKey: .providerSpecificDetails)
    }
    if container.contains(.health) {
        self.health = try container.decode(String?.self, forKey: .health)
    }
    if container.contains(.healthErrorDetails) {
        self.healthErrorDetails = try container.decode([HealthErrorData?]?.self, forKey: .healthErrorDetails)
    }
    if container.contains(.policyId) {
        self.policyId = try container.decode(String?.self, forKey: .policyId)
    }
    if container.contains(.state) {
        self.state = try container.decode(String?.self, forKey: .state)
    }
    if container.contains(.sourceProtectionContainerFriendlyName) {
        self.sourceProtectionContainerFriendlyName = try container.decode(String?.self, forKey: .sourceProtectionContainerFriendlyName)
    }
    if container.contains(.sourceFabricFriendlyName) {
        self.sourceFabricFriendlyName = try container.decode(String?.self, forKey: .sourceFabricFriendlyName)
    }
    if container.contains(.targetFabricFriendlyName) {
        self.targetFabricFriendlyName = try container.decode(String?.self, forKey: .targetFabricFriendlyName)
    }
    if container.contains(.policyFriendlyName) {
        self.policyFriendlyName = try container.decode(String?.self, forKey: .policyFriendlyName)
    }
    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.targetProtectionContainerId != nil {try container.encode(self.targetProtectionContainerId, forKey: .targetProtectionContainerId)}
    if self.targetProtectionContainerFriendlyName != nil {try container.encode(self.targetProtectionContainerFriendlyName, forKey: .targetProtectionContainerFriendlyName)}
    if self.providerSpecificDetails != nil {try container.encode(self.providerSpecificDetails as! ProtectionContainerMappingProviderSpecificDetailsData?, forKey: .providerSpecificDetails)}
    if self.health != nil {try container.encode(self.health, forKey: .health)}
    if self.healthErrorDetails != nil {try container.encode(self.healthErrorDetails as! [HealthErrorData?]?, forKey: .healthErrorDetails)}
    if self.policyId != nil {try container.encode(self.policyId, forKey: .policyId)}
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.sourceProtectionContainerFriendlyName != nil {try container.encode(self.sourceProtectionContainerFriendlyName, forKey: .sourceProtectionContainerFriendlyName)}
    if self.sourceFabricFriendlyName != nil {try container.encode(self.sourceFabricFriendlyName, forKey: .sourceFabricFriendlyName)}
    if self.targetFabricFriendlyName != nil {try container.encode(self.targetFabricFriendlyName, forKey: .targetFabricFriendlyName)}
    if self.policyFriendlyName != nil {try container.encode(self.policyFriendlyName, forKey: .policyFriendlyName)}
  }
}

extension DataFactory {
  public static func createProtectionContainerMappingPropertiesProtocol() -> ProtectionContainerMappingPropertiesProtocol {
    return ProtectionContainerMappingPropertiesData()
  }
}


// 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 ProtectionContainerMappingProviderSpecificDetailsData : ProtectionContainerMappingProviderSpecificDetailsProtocol {
    public var instanceType: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createProtectionContainerMappingProviderSpecificDetailsProtocol() -> ProtectionContainerMappingProviderSpecificDetailsProtocol {
    return ProtectionContainerMappingProviderSpecificDetailsData()
  }
}


// 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 ProtectionContainerPropertiesData : ProtectionContainerPropertiesProtocol {
    public var fabricFriendlyName: String?
    public var friendlyName: String?
    public var fabricType: String?
    public var protectedItemCount: Int32?
    public var pairingStatus: String?
    public var role: String?
    public var fabricSpecificDetails: ProtectionContainerFabricSpecificDetailsProtocol?

        enum CodingKeys: String, CodingKey {case fabricFriendlyName = "fabricFriendlyName"
        case friendlyName = "friendlyName"
        case fabricType = "fabricType"
        case protectedItemCount = "protectedItemCount"
        case pairingStatus = "pairingStatus"
        case role = "role"
        case fabricSpecificDetails = "fabricSpecificDetails"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.fabricFriendlyName) {
        self.fabricFriendlyName = try container.decode(String?.self, forKey: .fabricFriendlyName)
    }
    if container.contains(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.fabricType) {
        self.fabricType = try container.decode(String?.self, forKey: .fabricType)
    }
    if container.contains(.protectedItemCount) {
        self.protectedItemCount = try container.decode(Int32?.self, forKey: .protectedItemCount)
    }
    if container.contains(.pairingStatus) {
        self.pairingStatus = try container.decode(String?.self, forKey: .pairingStatus)
    }
    if container.contains(.role) {
        self.role = try container.decode(String?.self, forKey: .role)
    }
    if container.contains(.fabricSpecificDetails) {
        self.fabricSpecificDetails = try container.decode(ProtectionContainerFabricSpecificDetailsData?.self, forKey: .fabricSpecificDetails)
    }
    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.fabricFriendlyName != nil {try container.encode(self.fabricFriendlyName, forKey: .fabricFriendlyName)}
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.fabricType != nil {try container.encode(self.fabricType, forKey: .fabricType)}
    if self.protectedItemCount != nil {try container.encode(self.protectedItemCount, forKey: .protectedItemCount)}
    if self.pairingStatus != nil {try container.encode(self.pairingStatus, forKey: .pairingStatus)}
    if self.role != nil {try container.encode(self.role, forKey: .role)}
    if self.fabricSpecificDetails != nil {try container.encode(self.fabricSpecificDetails as! ProtectionContainerFabricSpecificDetailsData?, forKey: .fabricSpecificDetails)}
  }
}

extension DataFactory {
  public static func createProtectionContainerPropertiesProtocol() -> ProtectionContainerPropertiesProtocol {
    return ProtectionContainerPropertiesData()
  }
}


// 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 ProviderErrorData : ProviderErrorProtocol {
    public var errorCode: Int32?
    public var errorMessage: String?
    public var errorId: String?
    public var possibleCauses: String?
    public var recommendedAction: String?

        enum CodingKeys: String, CodingKey {case errorCode = "errorCode"
        case errorMessage = "errorMessage"
        case errorId = "errorId"
        case possibleCauses = "possibleCauses"
        case recommendedAction = "recommendedAction"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.errorCode != nil {try container.encode(self.errorCode, forKey: .errorCode)}
    if self.errorMessage != nil {try container.encode(self.errorMessage, forKey: .errorMessage)}
    if self.errorId != nil {try container.encode(self.errorId, forKey: .errorId)}
    if self.possibleCauses != nil {try container.encode(self.possibleCauses, forKey: .possibleCauses)}
    if self.recommendedAction != nil {try container.encode(self.recommendedAction, forKey: .recommendedAction)}
  }
}

extension DataFactory {
  public static func createProviderErrorProtocol() -> ProviderErrorProtocol {
    return ProviderErrorData()
  }
}


// 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 ProviderSpecificFailoverInputData : ProviderSpecificFailoverInputProtocol {

  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 createProviderSpecificFailoverInputProtocol() -> ProviderSpecificFailoverInputProtocol {
    return ProviderSpecificFailoverInputData()
  }
}


// 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 ProviderSpecificRecoveryPointDetailsData : ProviderSpecificRecoveryPointDetailsProtocol {

  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 createProviderSpecificRecoveryPointDetailsProtocol() -> ProviderSpecificRecoveryPointDetailsProtocol {
    return ProviderSpecificRecoveryPointDetailsData()
  }
}


// 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 RcmAzureMigrationPolicyDetailsData : RcmAzureMigrationPolicyDetailsProtocol, PolicyProviderSpecificDetailsProtocol {
    public var recoveryPointThresholdInMinutes: Int32?
    public var recoveryPointHistory: Int32?
    public var appConsistentFrequencyInMinutes: Int32?
    public var multiVmSyncStatus: MultiVmSyncStatusEnum?
    public var crashConsistentFrequencyInMinutes: Int32?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.recoveryPointThresholdInMinutes) {
        self.recoveryPointThresholdInMinutes = try container.decode(Int32?.self, forKey: .recoveryPointThresholdInMinutes)
    }
    if container.contains(.recoveryPointHistory) {
        self.recoveryPointHistory = try container.decode(Int32?.self, forKey: .recoveryPointHistory)
    }
    if container.contains(.appConsistentFrequencyInMinutes) {
        self.appConsistentFrequencyInMinutes = try container.decode(Int32?.self, forKey: .appConsistentFrequencyInMinutes)
    }
    if container.contains(.multiVmSyncStatus) {
        self.multiVmSyncStatus = try container.decode(MultiVmSyncStatusEnum?.self, forKey: .multiVmSyncStatus)
    }
    if container.contains(.crashConsistentFrequencyInMinutes) {
        self.crashConsistentFrequencyInMinutes = try container.decode(Int32?.self, forKey: .crashConsistentFrequencyInMinutes)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.recoveryPointThresholdInMinutes != nil {try container.encode(self.recoveryPointThresholdInMinutes, forKey: .recoveryPointThresholdInMinutes)}
    if self.recoveryPointHistory != nil {try container.encode(self.recoveryPointHistory, forKey: .recoveryPointHistory)}
    if self.appConsistentFrequencyInMinutes != nil {try container.encode(self.appConsistentFrequencyInMinutes, forKey: .appConsistentFrequencyInMinutes)}
    if self.multiVmSyncStatus != nil {try container.encode(self.multiVmSyncStatus, forKey: .multiVmSyncStatus)}
    if self.crashConsistentFrequencyInMinutes != nil {try container.encode(self.crashConsistentFrequencyInMinutes, forKey: .crashConsistentFrequencyInMinutes)}
  }
}

extension DataFactory {
  public static func createRcmAzureMigrationPolicyDetailsProtocol() -> RcmAzureMigrationPolicyDetailsProtocol {
    return RcmAzureMigrationPolicyDetailsData()
  }
}


// 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 RecoveryPlanA2AFailoverInputData : RecoveryPlanA2AFailoverInputProtocol, RecoveryPlanProviderSpecificFailoverInputProtocol {
    public var recoveryPointType: A2ARpRecoveryPointTypeEnum
    public var cloudServiceCreationOption: String?
    public var multiVmSyncPointOption: MultiVmSyncPointOptionEnum?

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

  public init(recoveryPointType: A2ARpRecoveryPointTypeEnum)  {
    self.recoveryPointType = recoveryPointType
  }

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

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

extension DataFactory {
  public static func createRecoveryPlanA2AFailoverInputProtocol(recoveryPointType: A2ARpRecoveryPointTypeEnum) -> RecoveryPlanA2AFailoverInputProtocol {
    return RecoveryPlanA2AFailoverInputData(recoveryPointType: recoveryPointType)
  }
}


// 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 RecoveryPlanActionData : RecoveryPlanActionProtocol {
    public var actionName: String
    public var failoverTypes: [ReplicationProtectedItemOperationEnum]
    public var failoverDirections: [PossibleOperationsDirectionsEnum]
    public var customDetails: RecoveryPlanActionDetailsProtocol

        enum CodingKeys: String, CodingKey {case actionName = "actionName"
        case failoverTypes = "failoverTypes"
        case failoverDirections = "failoverDirections"
        case customDetails = "customDetails"
        }

  public init(actionName: String, failoverTypes: [ReplicationProtectedItemOperationEnum], failoverDirections: [PossibleOperationsDirectionsEnum], customDetails: RecoveryPlanActionDetailsProtocol)  {
    self.actionName = actionName
    self.failoverTypes = failoverTypes
    self.failoverDirections = failoverDirections
    self.customDetails = customDetails
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.actionName = try container.decode(String.self, forKey: .actionName)
    self.failoverTypes = try container.decode([ReplicationProtectedItemOperationEnum].self, forKey: .failoverTypes)
    self.failoverDirections = try container.decode([PossibleOperationsDirectionsEnum].self, forKey: .failoverDirections)
    self.customDetails = try container.decode(RecoveryPlanActionDetailsData.self, forKey: .customDetails)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.actionName, forKey: .actionName)
    try container.encode(self.failoverTypes as! [ReplicationProtectedItemOperationEnum], forKey: .failoverTypes)
    try container.encode(self.failoverDirections as! [PossibleOperationsDirectionsEnum], forKey: .failoverDirections)
    try container.encode(self.customDetails as! RecoveryPlanActionDetailsData, forKey: .customDetails)
  }
}

extension DataFactory {
  public static func createRecoveryPlanActionProtocol(actionName: String, failoverTypes: [ReplicationProtectedItemOperationEnum], failoverDirections: [PossibleOperationsDirectionsEnum], customDetails: RecoveryPlanActionDetailsProtocol) -> RecoveryPlanActionProtocol {
    return RecoveryPlanActionData(actionName: actionName, failoverTypes: failoverTypes, failoverDirections: failoverDirections, customDetails: customDetails)
  }
}


// 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 RecoveryPlanActionDetailsData : RecoveryPlanActionDetailsProtocol {

  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 createRecoveryPlanActionDetailsProtocol() -> RecoveryPlanActionDetailsProtocol {
    return RecoveryPlanActionDetailsData()
  }
}


// RecoveryPlanActionLocation enumerates the values for recovery plan action location.

// 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 RecoveryPlanActionLocationEnum: String, Codable
{
// Primary specifies the primary state for recovery plan action location.
    case Primary = "Primary"
// Recovery specifies the recovery state for recovery plan action location.
    case Recovery = "Recovery"
}


// 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 RecoveryPlanAutomationRunbookActionDetailsData : RecoveryPlanAutomationRunbookActionDetailsProtocol, RecoveryPlanActionDetailsProtocol {
    public var runbookId: String?
    public var timeout: String?
    public var fabricLocation: RecoveryPlanActionLocationEnum

        enum CodingKeys: String, CodingKey {case runbookId = "runbookId"
        case timeout = "timeout"
        case fabricLocation = "fabricLocation"
        }

  public init(fabricLocation: RecoveryPlanActionLocationEnum)  {
    self.fabricLocation = fabricLocation
  }

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

extension DataFactory {
  public static func createRecoveryPlanAutomationRunbookActionDetailsProtocol(fabricLocation: RecoveryPlanActionLocationEnum) -> RecoveryPlanAutomationRunbookActionDetailsProtocol {
    return RecoveryPlanAutomationRunbookActionDetailsData(fabricLocation: fabricLocation)
  }
}


// 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 RecoveryPlanCollectionData : RecoveryPlanCollectionProtocol {
    public var value: [RecoveryPlanProtocol?]?
    public var _nextLink: String?

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

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

extension DataFactory {
  public static func createRecoveryPlanCollectionProtocol() -> RecoveryPlanCollectionProtocol {
    return RecoveryPlanCollectionData()
  }
}


// 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 RecoveryPlanData : RecoveryPlanProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: RecoveryPlanPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        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(.properties) {
        self.properties = try container.decode(RecoveryPlanPropertiesData?.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.properties != nil {try container.encode(self.properties as! RecoveryPlanPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createRecoveryPlanProtocol() -> RecoveryPlanProtocol {
    return RecoveryPlanData()
  }
}


// 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 RecoveryPlanGroupData : RecoveryPlanGroupProtocol {
    public var groupType: RecoveryPlanGroupTypeEnum
    public var replicationProtectedItems: [RecoveryPlanProtectedItemProtocol?]?
    public var startGroupActions: [RecoveryPlanActionProtocol?]?
    public var endGroupActions: [RecoveryPlanActionProtocol?]?

        enum CodingKeys: String, CodingKey {case groupType = "groupType"
        case replicationProtectedItems = "replicationProtectedItems"
        case startGroupActions = "startGroupActions"
        case endGroupActions = "endGroupActions"
        }

  public init(groupType: RecoveryPlanGroupTypeEnum)  {
    self.groupType = groupType
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.groupType = try container.decode(RecoveryPlanGroupTypeEnum.self, forKey: .groupType)
    if container.contains(.replicationProtectedItems) {
        self.replicationProtectedItems = try container.decode([RecoveryPlanProtectedItemData?]?.self, forKey: .replicationProtectedItems)
    }
    if container.contains(.startGroupActions) {
        self.startGroupActions = try container.decode([RecoveryPlanActionData?]?.self, forKey: .startGroupActions)
    }
    if container.contains(.endGroupActions) {
        self.endGroupActions = try container.decode([RecoveryPlanActionData?]?.self, forKey: .endGroupActions)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.groupType, forKey: .groupType)
    if self.replicationProtectedItems != nil {try container.encode(self.replicationProtectedItems as! [RecoveryPlanProtectedItemData?]?, forKey: .replicationProtectedItems)}
    if self.startGroupActions != nil {try container.encode(self.startGroupActions as! [RecoveryPlanActionData?]?, forKey: .startGroupActions)}
    if self.endGroupActions != nil {try container.encode(self.endGroupActions as! [RecoveryPlanActionData?]?, forKey: .endGroupActions)}
  }
}

extension DataFactory {
  public static func createRecoveryPlanGroupProtocol(groupType: RecoveryPlanGroupTypeEnum) -> RecoveryPlanGroupProtocol {
    return RecoveryPlanGroupData(groupType: groupType)
  }
}


// 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 RecoveryPlanGroupTaskDetailsData : RecoveryPlanGroupTaskDetailsProtocol, GroupTaskDetailsProtocol {
    public var childTasks: [ASRTaskProtocol?]?
    public var name: String?
    public var groupId: String?
    public var rpGroupType: String?

        enum CodingKeys: String, CodingKey {case childTasks = "childTasks"
        case name = "name"
        case groupId = "groupId"
        case rpGroupType = "rpGroupType"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.childTasks != nil {try container.encode(self.childTasks as! [ASRTaskData?]?, forKey: .childTasks)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.groupId != nil {try container.encode(self.groupId, forKey: .groupId)}
    if self.rpGroupType != nil {try container.encode(self.rpGroupType, forKey: .rpGroupType)}
  }
}

extension DataFactory {
  public static func createRecoveryPlanGroupTaskDetailsProtocol() -> RecoveryPlanGroupTaskDetailsProtocol {
    return RecoveryPlanGroupTaskDetailsData()
  }
}


// RecoveryPlanGroupType enumerates the values for recovery plan group 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 RecoveryPlanGroupTypeEnum: String, Codable
{
// Boot specifies the boot state for recovery plan group type.
    case Boot = "Boot"
// Failover specifies the failover state for recovery plan group type.
    case Failover = "Failover"
// Shutdown specifies the shutdown state for recovery plan group type.
    case Shutdown = "Shutdown"
}


// 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 RecoveryPlanHyperVReplicaAzureFailbackInputData : RecoveryPlanHyperVReplicaAzureFailbackInputProtocol, RecoveryPlanProviderSpecificFailoverInputProtocol {
    public var dataSyncOption: DataSyncStatusEnum
    public var recoveryVmCreationOption: AlternateLocationRecoveryOptionEnum

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

  public init(dataSyncOption: DataSyncStatusEnum, recoveryVmCreationOption: AlternateLocationRecoveryOptionEnum)  {
    self.dataSyncOption = dataSyncOption
    self.recoveryVmCreationOption = recoveryVmCreationOption
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.dataSyncOption, forKey: .dataSyncOption)
    try container.encode(self.recoveryVmCreationOption, forKey: .recoveryVmCreationOption)
  }
}

extension DataFactory {
  public static func createRecoveryPlanHyperVReplicaAzureFailbackInputProtocol(dataSyncOption: DataSyncStatusEnum, recoveryVmCreationOption: AlternateLocationRecoveryOptionEnum) -> RecoveryPlanHyperVReplicaAzureFailbackInputProtocol {
    return RecoveryPlanHyperVReplicaAzureFailbackInputData(dataSyncOption: dataSyncOption, recoveryVmCreationOption: recoveryVmCreationOption)
  }
}


// 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 RecoveryPlanHyperVReplicaAzureFailoverInputData : RecoveryPlanHyperVReplicaAzureFailoverInputProtocol, RecoveryPlanProviderSpecificFailoverInputProtocol {
    public var vaultLocation: String
    public var primaryKekCertificatePfx: String?
    public var secondaryKekCertificatePfx: String?
    public var recoveryPointType: HyperVReplicaAzureRpRecoveryPointTypeEnum?

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

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

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

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

extension DataFactory {
  public static func createRecoveryPlanHyperVReplicaAzureFailoverInputProtocol(vaultLocation: String) -> RecoveryPlanHyperVReplicaAzureFailoverInputProtocol {
    return RecoveryPlanHyperVReplicaAzureFailoverInputData(vaultLocation: vaultLocation)
  }
}


// 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 RecoveryPlanInMageAzureV2FailoverInputData : RecoveryPlanInMageAzureV2FailoverInputProtocol, RecoveryPlanProviderSpecificFailoverInputProtocol {
    public var vaultLocation: String
    public var recoveryPointType: InMageV2RpRecoveryPointTypeEnum
    public var useMultiVmSyncPoint: String?

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

  public init(vaultLocation: String, recoveryPointType: InMageV2RpRecoveryPointTypeEnum)  {
    self.vaultLocation = vaultLocation
    self.recoveryPointType = recoveryPointType
  }

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

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

extension DataFactory {
  public static func createRecoveryPlanInMageAzureV2FailoverInputProtocol(vaultLocation: String, recoveryPointType: InMageV2RpRecoveryPointTypeEnum) -> RecoveryPlanInMageAzureV2FailoverInputProtocol {
    return RecoveryPlanInMageAzureV2FailoverInputData(vaultLocation: vaultLocation, recoveryPointType: recoveryPointType)
  }
}


// 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 RecoveryPlanInMageFailoverInputData : RecoveryPlanInMageFailoverInputProtocol, RecoveryPlanProviderSpecificFailoverInputProtocol {
    public var recoveryPointType: RpInMageRecoveryPointTypeEnum

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

  public init(recoveryPointType: RpInMageRecoveryPointTypeEnum)  {
    self.recoveryPointType = recoveryPointType
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.recoveryPointType, forKey: .recoveryPointType)
  }
}

extension DataFactory {
  public static func createRecoveryPlanInMageFailoverInputProtocol(recoveryPointType: RpInMageRecoveryPointTypeEnum) -> RecoveryPlanInMageFailoverInputProtocol {
    return RecoveryPlanInMageFailoverInputData(recoveryPointType: recoveryPointType)
  }
}


// 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 RecoveryPlanManualActionDetailsData : RecoveryPlanManualActionDetailsProtocol, RecoveryPlanActionDetailsProtocol {
    public var description: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createRecoveryPlanManualActionDetailsProtocol() -> RecoveryPlanManualActionDetailsProtocol {
    return RecoveryPlanManualActionDetailsData()
  }
}


// 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 RecoveryPlanPlannedFailoverInputData : RecoveryPlanPlannedFailoverInputProtocol {
    public var properties: RecoveryPlanPlannedFailoverInputPropertiesProtocol

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

  public init(properties: RecoveryPlanPlannedFailoverInputPropertiesProtocol)  {
    self.properties = properties
  }

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

extension DataFactory {
  public static func createRecoveryPlanPlannedFailoverInputProtocol(properties: RecoveryPlanPlannedFailoverInputPropertiesProtocol) -> RecoveryPlanPlannedFailoverInputProtocol {
    return RecoveryPlanPlannedFailoverInputData(properties: properties)
  }
}


// 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 RecoveryPlanPlannedFailoverInputPropertiesData : RecoveryPlanPlannedFailoverInputPropertiesProtocol {
    public var failoverDirection: PossibleOperationsDirectionsEnum
    public var providerSpecificDetails: [RecoveryPlanProviderSpecificFailoverInputProtocol?]?

        enum CodingKeys: String, CodingKey {case failoverDirection = "failoverDirection"
        case providerSpecificDetails = "providerSpecificDetails"
        }

  public init(failoverDirection: PossibleOperationsDirectionsEnum)  {
    self.failoverDirection = failoverDirection
  }

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

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

extension DataFactory {
  public static func createRecoveryPlanPlannedFailoverInputPropertiesProtocol(failoverDirection: PossibleOperationsDirectionsEnum) -> RecoveryPlanPlannedFailoverInputPropertiesProtocol {
    return RecoveryPlanPlannedFailoverInputPropertiesData(failoverDirection: failoverDirection)
  }
}


// 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 RecoveryPlanPropertiesData : RecoveryPlanPropertiesProtocol {
    public var friendlyName: String?
    public var primaryFabricId: String?
    public var primaryFabricFriendlyName: String?
    public var recoveryFabricId: String?
    public var recoveryFabricFriendlyName: String?
    public var failoverDeploymentModel: String?
    public var replicationProviders: [String]?
    public var allowedOperations: [String]?
    public var lastPlannedFailoverTime: Date?
    public var lastUnplannedFailoverTime: Date?
    public var lastTestFailoverTime: Date?
    public var currentScenario: CurrentScenarioDetailsProtocol?
    public var currentScenarioStatus: String?
    public var currentScenarioStatusDescription: String?
    public var groups: [RecoveryPlanGroupProtocol?]?

        enum CodingKeys: String, CodingKey {case friendlyName = "friendlyName"
        case primaryFabricId = "primaryFabricId"
        case primaryFabricFriendlyName = "primaryFabricFriendlyName"
        case recoveryFabricId = "recoveryFabricId"
        case recoveryFabricFriendlyName = "recoveryFabricFriendlyName"
        case failoverDeploymentModel = "failoverDeploymentModel"
        case replicationProviders = "replicationProviders"
        case allowedOperations = "allowedOperations"
        case lastPlannedFailoverTime = "lastPlannedFailoverTime"
        case lastUnplannedFailoverTime = "lastUnplannedFailoverTime"
        case lastTestFailoverTime = "lastTestFailoverTime"
        case currentScenario = "currentScenario"
        case currentScenarioStatus = "currentScenarioStatus"
        case currentScenarioStatusDescription = "currentScenarioStatusDescription"
        case groups = "groups"
        }

  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(.primaryFabricId) {
        self.primaryFabricId = try container.decode(String?.self, forKey: .primaryFabricId)
    }
    if container.contains(.primaryFabricFriendlyName) {
        self.primaryFabricFriendlyName = try container.decode(String?.self, forKey: .primaryFabricFriendlyName)
    }
    if container.contains(.recoveryFabricId) {
        self.recoveryFabricId = try container.decode(String?.self, forKey: .recoveryFabricId)
    }
    if container.contains(.recoveryFabricFriendlyName) {
        self.recoveryFabricFriendlyName = try container.decode(String?.self, forKey: .recoveryFabricFriendlyName)
    }
    if container.contains(.failoverDeploymentModel) {
        self.failoverDeploymentModel = try container.decode(String?.self, forKey: .failoverDeploymentModel)
    }
    if container.contains(.replicationProviders) {
        self.replicationProviders = try container.decode([String]?.self, forKey: .replicationProviders)
    }
    if container.contains(.allowedOperations) {
        self.allowedOperations = try container.decode([String]?.self, forKey: .allowedOperations)
    }
    if container.contains(.lastPlannedFailoverTime) {
        self.lastPlannedFailoverTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastPlannedFailoverTime)), format: .dateTime)
    }
    if container.contains(.lastUnplannedFailoverTime) {
        self.lastUnplannedFailoverTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUnplannedFailoverTime)), format: .dateTime)
    }
    if container.contains(.lastTestFailoverTime) {
        self.lastTestFailoverTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastTestFailoverTime)), format: .dateTime)
    }
    if container.contains(.currentScenario) {
        self.currentScenario = try container.decode(CurrentScenarioDetailsData?.self, forKey: .currentScenario)
    }
    if container.contains(.currentScenarioStatus) {
        self.currentScenarioStatus = try container.decode(String?.self, forKey: .currentScenarioStatus)
    }
    if container.contains(.currentScenarioStatusDescription) {
        self.currentScenarioStatusDescription = try container.decode(String?.self, forKey: .currentScenarioStatusDescription)
    }
    if container.contains(.groups) {
        self.groups = try container.decode([RecoveryPlanGroupData?]?.self, forKey: .groups)
    }
    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.primaryFabricId != nil {try container.encode(self.primaryFabricId, forKey: .primaryFabricId)}
    if self.primaryFabricFriendlyName != nil {try container.encode(self.primaryFabricFriendlyName, forKey: .primaryFabricFriendlyName)}
    if self.recoveryFabricId != nil {try container.encode(self.recoveryFabricId, forKey: .recoveryFabricId)}
    if self.recoveryFabricFriendlyName != nil {try container.encode(self.recoveryFabricFriendlyName, forKey: .recoveryFabricFriendlyName)}
    if self.failoverDeploymentModel != nil {try container.encode(self.failoverDeploymentModel, forKey: .failoverDeploymentModel)}
    if self.replicationProviders != nil {try container.encode(self.replicationProviders as! [String]?, forKey: .replicationProviders)}
    if self.allowedOperations != nil {try container.encode(self.allowedOperations as! [String]?, forKey: .allowedOperations)}
    if self.lastPlannedFailoverTime != nil {
        try container.encode(DateConverter.toString(date: self.lastPlannedFailoverTime!, format: .dateTime), forKey: .lastPlannedFailoverTime)
    }
    if self.lastUnplannedFailoverTime != nil {
        try container.encode(DateConverter.toString(date: self.lastUnplannedFailoverTime!, format: .dateTime), forKey: .lastUnplannedFailoverTime)
    }
    if self.lastTestFailoverTime != nil {
        try container.encode(DateConverter.toString(date: self.lastTestFailoverTime!, format: .dateTime), forKey: .lastTestFailoverTime)
    }
    if self.currentScenario != nil {try container.encode(self.currentScenario as! CurrentScenarioDetailsData?, forKey: .currentScenario)}
    if self.currentScenarioStatus != nil {try container.encode(self.currentScenarioStatus, forKey: .currentScenarioStatus)}
    if self.currentScenarioStatusDescription != nil {try container.encode(self.currentScenarioStatusDescription, forKey: .currentScenarioStatusDescription)}
    if self.groups != nil {try container.encode(self.groups as! [RecoveryPlanGroupData?]?, forKey: .groups)}
  }
}

extension DataFactory {
  public static func createRecoveryPlanPropertiesProtocol() -> RecoveryPlanPropertiesProtocol {
    return RecoveryPlanPropertiesData()
  }
}


// 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 RecoveryPlanProtectedItemData : RecoveryPlanProtectedItemProtocol {
    public var id: String?
    public var virtualMachineId: String?

        enum CodingKeys: String, CodingKey {case id = "id"
        case virtualMachineId = "virtualMachineId"
        }

  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(.virtualMachineId) {
        self.virtualMachineId = try container.decode(String?.self, forKey: .virtualMachineId)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createRecoveryPlanProtectedItemProtocol() -> RecoveryPlanProtectedItemProtocol {
    return RecoveryPlanProtectedItemData()
  }
}


// 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 RecoveryPlanProviderSpecificFailoverInputData : RecoveryPlanProviderSpecificFailoverInputProtocol {

  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 createRecoveryPlanProviderSpecificFailoverInputProtocol() -> RecoveryPlanProviderSpecificFailoverInputProtocol {
    return RecoveryPlanProviderSpecificFailoverInputData()
  }
}


// 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 RecoveryPlanScriptActionDetailsData : RecoveryPlanScriptActionDetailsProtocol, RecoveryPlanActionDetailsProtocol {
    public var path: String
    public var timeout: String?
    public var fabricLocation: RecoveryPlanActionLocationEnum

        enum CodingKeys: String, CodingKey {case path = "path"
        case timeout = "timeout"
        case fabricLocation = "fabricLocation"
        }

  public init(path: String, fabricLocation: RecoveryPlanActionLocationEnum)  {
    self.path = path
    self.fabricLocation = fabricLocation
  }

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

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

extension DataFactory {
  public static func createRecoveryPlanScriptActionDetailsProtocol(path: String, fabricLocation: RecoveryPlanActionLocationEnum) -> RecoveryPlanScriptActionDetailsProtocol {
    return RecoveryPlanScriptActionDetailsData(path: path, fabricLocation: fabricLocation)
  }
}


// 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 RecoveryPlanShutdownGroupTaskDetailsData : RecoveryPlanShutdownGroupTaskDetailsProtocol, GroupTaskDetailsProtocol {
    public var childTasks: [ASRTaskProtocol?]?
    public var name: String?
    public var groupId: String?
    public var rpGroupType: String?

        enum CodingKeys: String, CodingKey {case childTasks = "childTasks"
        case name = "name"
        case groupId = "groupId"
        case rpGroupType = "rpGroupType"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.childTasks != nil {try container.encode(self.childTasks as! [ASRTaskData?]?, forKey: .childTasks)}
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.groupId != nil {try container.encode(self.groupId, forKey: .groupId)}
    if self.rpGroupType != nil {try container.encode(self.rpGroupType, forKey: .rpGroupType)}
  }
}

extension DataFactory {
  public static func createRecoveryPlanShutdownGroupTaskDetailsProtocol() -> RecoveryPlanShutdownGroupTaskDetailsProtocol {
    return RecoveryPlanShutdownGroupTaskDetailsData()
  }
}


// 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 RecoveryPlanTestFailoverCleanupInputData : RecoveryPlanTestFailoverCleanupInputProtocol {
    public var properties: RecoveryPlanTestFailoverCleanupInputPropertiesProtocol

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

  public init(properties: RecoveryPlanTestFailoverCleanupInputPropertiesProtocol)  {
    self.properties = properties
  }

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

extension DataFactory {
  public static func createRecoveryPlanTestFailoverCleanupInputProtocol(properties: RecoveryPlanTestFailoverCleanupInputPropertiesProtocol) -> RecoveryPlanTestFailoverCleanupInputProtocol {
    return RecoveryPlanTestFailoverCleanupInputData(properties: properties)
  }
}


// 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 RecoveryPlanTestFailoverCleanupInputPropertiesData : RecoveryPlanTestFailoverCleanupInputPropertiesProtocol {
    public var comments: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createRecoveryPlanTestFailoverCleanupInputPropertiesProtocol() -> RecoveryPlanTestFailoverCleanupInputPropertiesProtocol {
    return RecoveryPlanTestFailoverCleanupInputPropertiesData()
  }
}


// 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 RecoveryPlanTestFailoverInputData : RecoveryPlanTestFailoverInputProtocol {
    public var properties: RecoveryPlanTestFailoverInputPropertiesProtocol

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

  public init(properties: RecoveryPlanTestFailoverInputPropertiesProtocol)  {
    self.properties = properties
  }

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

extension DataFactory {
  public static func createRecoveryPlanTestFailoverInputProtocol(properties: RecoveryPlanTestFailoverInputPropertiesProtocol) -> RecoveryPlanTestFailoverInputProtocol {
    return RecoveryPlanTestFailoverInputData(properties: properties)
  }
}


// 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 RecoveryPlanTestFailoverInputPropertiesData : RecoveryPlanTestFailoverInputPropertiesProtocol {
    public var failoverDirection: PossibleOperationsDirectionsEnum
    public var networkType: String
    public var networkId: String?
    public var skipTestFailoverCleanup: String?
    public var providerSpecificDetails: [RecoveryPlanProviderSpecificFailoverInputProtocol?]?

        enum CodingKeys: String, CodingKey {case failoverDirection = "failoverDirection"
        case networkType = "networkType"
        case networkId = "networkId"
        case skipTestFailoverCleanup = "skipTestFailoverCleanup"
        case providerSpecificDetails = "providerSpecificDetails"
        }

  public init(failoverDirection: PossibleOperationsDirectionsEnum, networkType: String)  {
    self.failoverDirection = failoverDirection
    self.networkType = networkType
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.failoverDirection = try container.decode(PossibleOperationsDirectionsEnum.self, forKey: .failoverDirection)
    self.networkType = try container.decode(String.self, forKey: .networkType)
    if container.contains(.networkId) {
        self.networkId = try container.decode(String?.self, forKey: .networkId)
    }
    if container.contains(.skipTestFailoverCleanup) {
        self.skipTestFailoverCleanup = try container.decode(String?.self, forKey: .skipTestFailoverCleanup)
    }
    if container.contains(.providerSpecificDetails) {
        self.providerSpecificDetails = try container.decode([RecoveryPlanProviderSpecificFailoverInputData?]?.self, forKey: .providerSpecificDetails)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.failoverDirection, forKey: .failoverDirection)
    try container.encode(self.networkType, forKey: .networkType)
    if self.networkId != nil {try container.encode(self.networkId, forKey: .networkId)}
    if self.skipTestFailoverCleanup != nil {try container.encode(self.skipTestFailoverCleanup, forKey: .skipTestFailoverCleanup)}
    if self.providerSpecificDetails != nil {try container.encode(self.providerSpecificDetails as! [RecoveryPlanProviderSpecificFailoverInputData?]?, forKey: .providerSpecificDetails)}
  }
}

extension DataFactory {
  public static func createRecoveryPlanTestFailoverInputPropertiesProtocol(failoverDirection: PossibleOperationsDirectionsEnum, networkType: String) -> RecoveryPlanTestFailoverInputPropertiesProtocol {
    return RecoveryPlanTestFailoverInputPropertiesData(failoverDirection: failoverDirection, networkType: networkType)
  }
}


// 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 RecoveryPlanUnplannedFailoverInputData : RecoveryPlanUnplannedFailoverInputProtocol {
    public var properties: RecoveryPlanUnplannedFailoverInputPropertiesProtocol

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

  public init(properties: RecoveryPlanUnplannedFailoverInputPropertiesProtocol)  {
    self.properties = properties
  }

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

extension DataFactory {
  public static func createRecoveryPlanUnplannedFailoverInputProtocol(properties: RecoveryPlanUnplannedFailoverInputPropertiesProtocol) -> RecoveryPlanUnplannedFailoverInputProtocol {
    return RecoveryPlanUnplannedFailoverInputData(properties: properties)
  }
}