// 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 ResourceCertificateAndAcsDetailsData : ResourceCertificateAndAcsDetailsProtocol, ResourceCertificateDetailsProtocol {
    public var certificate: [UInt8]?
    public var friendlyName: String?
    public var issuer: String?
    public var resourceId: Int64?
    public var subject: String?
    public var thumbprint: String?
    public var validFrom: Date?
    public var validTo: Date?
    public var globalAcsNamespace: String
    public var globalAcsHostName: String
    public var globalAcsRPRealm: String

        enum CodingKeys: String, CodingKey {case certificate = "certificate"
        case friendlyName = "friendlyName"
        case issuer = "issuer"
        case resourceId = "resourceId"
        case subject = "subject"
        case thumbprint = "thumbprint"
        case validFrom = "validFrom"
        case validTo = "validTo"
        case globalAcsNamespace = "globalAcsNamespace"
        case globalAcsHostName = "globalAcsHostName"
        case globalAcsRPRealm = "globalAcsRPRealm"
        }

  public init(globalAcsNamespace: String, globalAcsHostName: String, globalAcsRPRealm: String)  {
    self.globalAcsNamespace = globalAcsNamespace
    self.globalAcsHostName = globalAcsHostName
    self.globalAcsRPRealm = globalAcsRPRealm
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.certificate) {
        self.certificate = try container.decode([UInt8]?.self, forKey: .certificate)
    }
    if container.contains(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.issuer) {
        self.issuer = try container.decode(String?.self, forKey: .issuer)
    }
    if container.contains(.resourceId) {
        self.resourceId = try container.decode(Int64?.self, forKey: .resourceId)
    }
    if container.contains(.subject) {
        self.subject = try container.decode(String?.self, forKey: .subject)
    }
    if container.contains(.thumbprint) {
        self.thumbprint = try container.decode(String?.self, forKey: .thumbprint)
    }
    if container.contains(.validFrom) {
        self.validFrom = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .validFrom)), format: .dateTime)
    }
    if container.contains(.validTo) {
        self.validTo = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .validTo)), format: .dateTime)
    }
    self.globalAcsNamespace = try container.decode(String.self, forKey: .globalAcsNamespace)
    self.globalAcsHostName = try container.decode(String.self, forKey: .globalAcsHostName)
    self.globalAcsRPRealm = try container.decode(String.self, forKey: .globalAcsRPRealm)
    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.certificate != nil {try container.encode(self.certificate, forKey: .certificate)}
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.issuer != nil {try container.encode(self.issuer, forKey: .issuer)}
    if self.resourceId != nil {try container.encode(self.resourceId, forKey: .resourceId)}
    if self.subject != nil {try container.encode(self.subject, forKey: .subject)}
    if self.thumbprint != nil {try container.encode(self.thumbprint, forKey: .thumbprint)}
    if self.validFrom != nil {
        try container.encode(DateConverter.toString(date: self.validFrom!, format: .dateTime), forKey: .validFrom)
    }
    if self.validTo != nil {
        try container.encode(DateConverter.toString(date: self.validTo!, format: .dateTime), forKey: .validTo)
    }
    try container.encode(self.globalAcsNamespace, forKey: .globalAcsNamespace)
    try container.encode(self.globalAcsHostName, forKey: .globalAcsHostName)
    try container.encode(self.globalAcsRPRealm, forKey: .globalAcsRPRealm)
  }
}

extension DataFactory {
  public static func createResourceCertificateAndAcsDetailsProtocol(globalAcsNamespace: String, globalAcsHostName: String, globalAcsRPRealm: String) -> ResourceCertificateAndAcsDetailsProtocol {
    return ResourceCertificateAndAcsDetailsData(globalAcsNamespace: globalAcsNamespace, globalAcsHostName: globalAcsHostName, globalAcsRPRealm: globalAcsRPRealm)
  }
}


// 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 ResourceCertificateDetailsData : ResourceCertificateDetailsProtocol {
    public var certificate: [UInt8]?
    public var friendlyName: String?
    public var issuer: String?
    public var resourceId: Int64?
    public var subject: String?
    public var thumbprint: String?
    public var validFrom: Date?
    public var validTo: Date?

        enum CodingKeys: String, CodingKey {case certificate = "certificate"
        case friendlyName = "friendlyName"
        case issuer = "issuer"
        case resourceId = "resourceId"
        case subject = "subject"
        case thumbprint = "thumbprint"
        case validFrom = "validFrom"
        case validTo = "validTo"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.certificate) {
        self.certificate = try container.decode([UInt8]?.self, forKey: .certificate)
    }
    if container.contains(.friendlyName) {
        self.friendlyName = try container.decode(String?.self, forKey: .friendlyName)
    }
    if container.contains(.issuer) {
        self.issuer = try container.decode(String?.self, forKey: .issuer)
    }
    if container.contains(.resourceId) {
        self.resourceId = try container.decode(Int64?.self, forKey: .resourceId)
    }
    if container.contains(.subject) {
        self.subject = try container.decode(String?.self, forKey: .subject)
    }
    if container.contains(.thumbprint) {
        self.thumbprint = try container.decode(String?.self, forKey: .thumbprint)
    }
    if container.contains(.validFrom) {
        self.validFrom = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .validFrom)), format: .dateTime)
    }
    if container.contains(.validTo) {
        self.validTo = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .validTo)), format: .dateTime)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.certificate != nil {try container.encode(self.certificate, forKey: .certificate)}
    if self.friendlyName != nil {try container.encode(self.friendlyName, forKey: .friendlyName)}
    if self.issuer != nil {try container.encode(self.issuer, forKey: .issuer)}
    if self.resourceId != nil {try container.encode(self.resourceId, forKey: .resourceId)}
    if self.subject != nil {try container.encode(self.subject, forKey: .subject)}
    if self.thumbprint != nil {try container.encode(self.thumbprint, forKey: .thumbprint)}
    if self.validFrom != nil {
        try container.encode(DateConverter.toString(date: self.validFrom!, format: .dateTime), forKey: .validFrom)
    }
    if self.validTo != nil {
        try container.encode(DateConverter.toString(date: self.validTo!, format: .dateTime), forKey: .validTo)
    }
  }
}

extension DataFactory {
  public static func createResourceCertificateDetailsProtocol() -> ResourceCertificateDetailsProtocol {
    return ResourceCertificateDetailsData()
  }
}


// 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 ResourceData : ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var eTag: String?

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

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

extension DataFactory {
  public static func createResourceProtocol() -> ResourceProtocol {
    return ResourceData()
  }
}


// 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 SkuData : SkuProtocol {
    public var name: SkuNameEnum

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

  public init(name: SkuNameEnum)  {
    self.name = name
  }

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

extension DataFactory {
  public static func createSkuProtocol(name: SkuNameEnum) -> SkuProtocol {
    return SkuData(name: name)
  }
}


// SkuName enumerates the values for sku name.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SkuNameEnum: String, Codable
{
// RS0 specifies the rs0 state for sku name.
    case RS0 = "RS0"
// Standard specifies the standard state for sku name.
    case Standard = "Standard"
}


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

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

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

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

extension DataFactory {
  public static func createTrackedResourceProtocol(location: String) -> TrackedResourceProtocol {
    return TrackedResourceData(location: location)
  }
}


// TriggerType enumerates the values for trigger 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 TriggerTypeEnum: String, Codable
{
// ForcedUpgrade specifies the forced upgrade state for trigger type.
    case ForcedUpgrade = "ForcedUpgrade"
// UserTriggered specifies the user triggered state for trigger type.
    case UserTriggered = "UserTriggered"
}


// 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 UpgradeDetailsData : UpgradeDetailsProtocol {
    public var operationId: String?
    public var startTimeUtc: Date?
    public var lastUpdatedTimeUtc: Date?
    public var endTimeUtc: Date?
    public var status: VaultUpgradeStateEnum?
    public var message: String?
    public var triggerType: TriggerTypeEnum?
    public var upgradedResourceId: String?
    public var previousResourceId: String?

        enum CodingKeys: String, CodingKey {case operationId = "operationId"
        case startTimeUtc = "startTimeUtc"
        case lastUpdatedTimeUtc = "lastUpdatedTimeUtc"
        case endTimeUtc = "endTimeUtc"
        case status = "status"
        case message = "message"
        case triggerType = "triggerType"
        case upgradedResourceId = "upgradedResourceId"
        case previousResourceId = "previousResourceId"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.operationId) {
        self.operationId = try container.decode(String?.self, forKey: .operationId)
    }
    if container.contains(.startTimeUtc) {
        self.startTimeUtc = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTimeUtc)), format: .dateTime)
    }
    if container.contains(.lastUpdatedTimeUtc) {
        self.lastUpdatedTimeUtc = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUpdatedTimeUtc)), format: .dateTime)
    }
    if container.contains(.endTimeUtc) {
        self.endTimeUtc = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTimeUtc)), format: .dateTime)
    }
    if container.contains(.status) {
        self.status = try container.decode(VaultUpgradeStateEnum?.self, forKey: .status)
    }
    if container.contains(.message) {
        self.message = try container.decode(String?.self, forKey: .message)
    }
    if container.contains(.triggerType) {
        self.triggerType = try container.decode(TriggerTypeEnum?.self, forKey: .triggerType)
    }
    if container.contains(.upgradedResourceId) {
        self.upgradedResourceId = try container.decode(String?.self, forKey: .upgradedResourceId)
    }
    if container.contains(.previousResourceId) {
        self.previousResourceId = try container.decode(String?.self, forKey: .previousResourceId)
    }
    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.operationId != nil {try container.encode(self.operationId, forKey: .operationId)}
    if self.startTimeUtc != nil {
        try container.encode(DateConverter.toString(date: self.startTimeUtc!, format: .dateTime), forKey: .startTimeUtc)
    }
    if self.lastUpdatedTimeUtc != nil {
        try container.encode(DateConverter.toString(date: self.lastUpdatedTimeUtc!, format: .dateTime), forKey: .lastUpdatedTimeUtc)
    }
    if self.endTimeUtc != nil {
        try container.encode(DateConverter.toString(date: self.endTimeUtc!, format: .dateTime), forKey: .endTimeUtc)
    }
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.message != nil {try container.encode(self.message, forKey: .message)}
    if self.triggerType != nil {try container.encode(self.triggerType, forKey: .triggerType)}
    if self.upgradedResourceId != nil {try container.encode(self.upgradedResourceId, forKey: .upgradedResourceId)}
    if self.previousResourceId != nil {try container.encode(self.previousResourceId, forKey: .previousResourceId)}
  }
}

extension DataFactory {
  public static func createUpgradeDetailsProtocol() -> UpgradeDetailsProtocol {
    return UpgradeDetailsData()
  }
}


// UsagesUnit enumerates the values for usages unit.

// 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 UsagesUnitEnum: String, Codable
{
// Bytes specifies the bytes state for usages unit.
    case Bytes = "Bytes"
// BytesPerSecond specifies the bytes per second state for usages unit.
    case BytesPerSecond = "BytesPerSecond"
// Count specifies the count state for usages unit.
    case Count = "Count"
// CountPerSecond specifies the count per second state for usages unit.
    case CountPerSecond = "CountPerSecond"
// Percent specifies the percent state for usages unit.
    case Percent = "Percent"
// Seconds specifies the seconds state for usages unit.
    case Seconds = "Seconds"
}


// 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 VaultCertificateResponseData : VaultCertificateResponseProtocol {
    public var name: String?
    public var type: String?
    public var id: String?
    public var properties: ResourceCertificateDetailsProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createVaultCertificateResponseProtocol() -> VaultCertificateResponseProtocol {
    return VaultCertificateResponseData()
  }
}


// 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 VaultData : VaultProtocol, TrackedResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var eTag: String?
    public var location: String
    public var tags: [String:String]?
    public var properties: VaultPropertiesProtocol?
    public var sku: SkuProtocol?

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

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

  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(.eTag) {
        self.eTag = try container.decode(String?.self, forKey: .eTag)
    }
    self.location = try container.decode(String.self, forKey: .location)
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(VaultPropertiesData?.self, forKey: .properties)
    }
    if container.contains(.sku) {
        self.sku = try container.decode(SkuData?.self, forKey: .sku)
    }
    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.eTag != nil {try container.encode(self.eTag, forKey: .eTag)}
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.properties != nil {try container.encode(self.properties as! VaultPropertiesData?, forKey: .properties)}
    if self.sku != nil {try container.encode(self.sku as! SkuData?, forKey: .sku)}
  }
}

extension DataFactory {
  public static func createVaultProtocol(location: String) -> VaultProtocol {
    return VaultData(location: 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.
import Foundation
import azureSwiftRuntime
internal struct VaultExtendedInfoData : VaultExtendedInfoProtocol {
    public var integrityKey: String?
    public var encryptionKey: String?
    public var encryptionKeyThumbprint: String?
    public var algorithm: String?

        enum CodingKeys: String, CodingKey {case integrityKey = "integrityKey"
        case encryptionKey = "encryptionKey"
        case encryptionKeyThumbprint = "encryptionKeyThumbprint"
        case algorithm = "algorithm"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createVaultExtendedInfoProtocol() -> VaultExtendedInfoProtocol {
    return VaultExtendedInfoData()
  }
}


// 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 VaultExtendedInfoResourceData : VaultExtendedInfoResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var eTag: String?
    public var properties: VaultExtendedInfoProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createVaultExtendedInfoResourceProtocol() -> VaultExtendedInfoResourceProtocol {
    return VaultExtendedInfoResourceData()
  }
}


// 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 VaultListData : VaultListProtocol {
    public var value: [VaultProtocol?]?
    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([VaultData?]?.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! [VaultData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createVaultListProtocol() -> VaultListProtocol {
    return VaultListData()
  }
}


// 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 VaultPropertiesData : VaultPropertiesProtocol {
    public var provisioningState: String?
    public var upgradeDetails: UpgradeDetailsProtocol?

        enum CodingKeys: String, CodingKey {case provisioningState = "provisioningState"
        case upgradeDetails = "upgradeDetails"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createVaultPropertiesProtocol() -> VaultPropertiesProtocol {
    return VaultPropertiesData()
  }
}


// VaultUpgradeState enumerates the values for vault upgrade state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum VaultUpgradeStateEnum: String, Codable
{
// Failed specifies the failed state for vault upgrade state.
    case Failed = "Failed"
// InProgress specifies the in progress state for vault upgrade state.
    case InProgress = "InProgress"
// Unknown specifies the unknown state for vault upgrade state.
    case Unknown = "Unknown"
// Upgraded specifies the upgraded state for vault upgrade state.
    case Upgraded = "Upgraded"
}


// 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 VaultUsageData : VaultUsageProtocol {
    public var unit: UsagesUnitEnum?
    public var quotaPeriod: String?
    public var nextResetTime: Date?
    public var currentValue: Int64?
    public var limit: Int64?
    public var name: NameInfoProtocol?

        enum CodingKeys: String, CodingKey {case unit = "unit"
        case quotaPeriod = "quotaPeriod"
        case nextResetTime = "nextResetTime"
        case currentValue = "currentValue"
        case limit = "limit"
        case name = "name"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createVaultUsageProtocol() -> VaultUsageProtocol {
    return VaultUsageData()
  }
}


// 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 VaultUsageListData : VaultUsageListProtocol {
    public var value: [VaultUsageProtocol?]?

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

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

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

extension DataFactory {
  public static func createVaultUsageListProtocol() -> VaultUsageListProtocol {
    return VaultUsageListData()
  }
}


// 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
// CertificateRequestProtocol is details of the certificate to be uploaded to the vault.
public protocol CertificateRequestProtocol : Codable {
     var properties: RawCertificateDataProtocol? { get set }
}


// 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
// ClientDiscoveryDisplayProtocol is localized display information of an operation.
public protocol ClientDiscoveryDisplayProtocol : Codable {
     var provider: String? { get set }
     var resource: String? { get set }
     var operation: String? { get set }
     var description: String? { get set }
}


// 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
// ClientDiscoveryForLogSpecificationProtocol is class to represent shoebox log specification in json client discovery.
public protocol ClientDiscoveryForLogSpecificationProtocol : Codable {
     var name: String? { get set }
     var displayName: String? { get set }
     var blobDuration: String? { get set }
}


// 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
// ClientDiscoveryForPropertiesProtocol is class to represent shoebox properties in json client discovery.
public protocol ClientDiscoveryForPropertiesProtocol : Codable {
     var serviceSpecification: ClientDiscoveryForServiceSpecificationProtocol? { get set }
}


// 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
// ClientDiscoveryForServiceSpecificationProtocol is class to represent shoebox service specification in json client
// discovery.
public protocol ClientDiscoveryForServiceSpecificationProtocol : Codable {
     var logSpecifications: [ClientDiscoveryForLogSpecificationProtocol?]? { get set }
}


// 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
// ClientDiscoveryResponseProtocol is operations List response which contains list of available APIs.
public protocol ClientDiscoveryResponseProtocol : Codable {
     var value: [ClientDiscoveryValueForSingleApiProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// 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
// ClientDiscoveryValueForSingleApiProtocol is available operation details.
public protocol ClientDiscoveryValueForSingleApiProtocol : Codable {
     var name: String? { get set }
     var display: ClientDiscoveryDisplayProtocol? { get set }
     var origin: String? { get set }
     var properties: ClientDiscoveryForPropertiesProtocol? { get set }
}


// 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
// JobsSummaryProtocol is summary of the replication job data for this vault.
public protocol JobsSummaryProtocol : Codable {
     var failedJobs: Int32? { get set }
     var suspendedJobs: Int32? { get set }
     var inProgressJobs: Int32? { get set }
}


// 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
// MonitoringSummaryProtocol is summary of the replication monitoring data for this vault.
public protocol MonitoringSummaryProtocol : Codable {
     var unHealthyVmCount: Int32? { get set }
     var unHealthyProviderCount: Int32? { get set }
     var eventsCount: Int32? { get set }
     var deprecatedProviderCount: Int32? { get set }
     var supportedProviderCount: Int32? { get set }
     var unsupportedProviderCount: Int32? { get set }
}


// 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
// NameInfoProtocol is the name of usage.
public protocol NameInfoProtocol : Codable {
     var value: String? { get set }
     var localizedValue: String? { get set }
}


// 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
// PatchTrackedResourceProtocol is tracked resource with location.
public protocol PatchTrackedResourceProtocol : ResourceProtocol {
     var location: String? { get set }
     var tags: [String:String]? { get set }
}


// 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
// PatchVaultProtocol is patch Resource information, as returned by the resource provider.
public protocol PatchVaultProtocol : PatchTrackedResourceProtocol {
     var properties: VaultPropertiesProtocol? { get set }
     var sku: SkuProtocol? { get set }
}


// 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
// RawCertificateDataProtocol is raw certificate data.
public protocol RawCertificateDataProtocol : Codable {
     var authType: AuthTypeEnum? { get set }
     var certificate: [UInt8]? { get set }
}


// 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
// ReplicationUsageListProtocol is replication usages for vault.
public protocol ReplicationUsageListProtocol : Codable {
     var value: [ReplicationUsageProtocol?]? { get set }
}


// 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
// ReplicationUsageProtocol is replication usages of a vault.
public protocol ReplicationUsageProtocol : Codable {
     var monitoringSummary: MonitoringSummaryProtocol? { get set }
     var jobsSummary: JobsSummaryProtocol? { get set }
     var protectedItemCount: Int32? { get set }
     var recoveryPlanCount: Int32? { get set }
     var registeredServersCount: Int32? { get set }
     var recoveryServicesProviderAuthType: Int32? { get set }
}


// 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
// ResourceCertificateAndAadDetailsProtocol is certificate details representing the Vault credentials for AAD.
public protocol ResourceCertificateAndAadDetailsProtocol : ResourceCertificateDetailsProtocol {
     var aadAuthority: String { get set }
     var aadTenantId: String { get set }
     var servicePrincipalClientId: String { get set }
     var servicePrincipalObjectId: String { get set }
     var azureManagementEndpointAudience: String { get set }
}


// 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
// ResourceCertificateAndAcsDetailsProtocol is certificate details representing the Vault credentials for ACS.
public protocol ResourceCertificateAndAcsDetailsProtocol : ResourceCertificateDetailsProtocol {
     var globalAcsNamespace: String { get set }
     var globalAcsHostName: String { get set }
     var globalAcsRPRealm: String { get set }
}


// 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
// ResourceCertificateDetailsProtocol is certificate details representing the Vault credentials.
public protocol ResourceCertificateDetailsProtocol : Codable {
     var certificate: [UInt8]? { get set }
     var friendlyName: String? { get set }
     var issuer: String? { get set }
     var resourceId: Int64? { get set }
     var subject: String? { get set }
     var thumbprint: String? { get set }
     var validFrom: Date? { get set }
     var validTo: Date? { get set }
}


// 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
// ResourceProtocol is ARM Resource.
public protocol ResourceProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var eTag: String? { get set }
}


// 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
// SkuProtocol is identifies the unique system identifier for each Azure resource.
public protocol SkuProtocol : Codable {
     var name: SkuNameEnum { get set }
}


// 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
// TrackedResourceProtocol is tracked resource with location.
public protocol TrackedResourceProtocol : ResourceProtocol {
     var location: String { get set }
     var tags: [String:String]? { get set }
}


// 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
// UpgradeDetailsProtocol is details for upgrading vault.
public protocol UpgradeDetailsProtocol : Codable {
     var operationId: String? { get set }
     var startTimeUtc: Date? { get set }
     var lastUpdatedTimeUtc: Date? { get set }
     var endTimeUtc: Date? { get set }
     var status: VaultUpgradeStateEnum? { get set }
     var message: String? { get set }
     var triggerType: TriggerTypeEnum? { get set }
     var upgradedResourceId: String? { get set }
     var previousResourceId: String? { get set }
}


// 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
// VaultCertificateResponseProtocol is certificate corresponding to a vault that can be used by clients to register
// themselves with the vault.
public protocol VaultCertificateResponseProtocol : Codable {
     var name: String? { get set }
     var type: String? { get set }
     var id: String? { get set }
     var properties: ResourceCertificateDetailsProtocol? { get set }
}


// 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
// VaultExtendedInfoProtocol is vault extended information.
public protocol VaultExtendedInfoProtocol : Codable {
     var integrityKey: String? { get set }
     var encryptionKey: String? { get set }
     var encryptionKeyThumbprint: String? { get set }
     var algorithm: String? { get set }
}


// 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
// VaultExtendedInfoResourceProtocol is vault extended information.
public protocol VaultExtendedInfoResourceProtocol : ResourceProtocol {
     var properties: VaultExtendedInfoProtocol? { get set }
}


// 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
// VaultListProtocol is the response model for a list of Vaults.
public protocol VaultListProtocol : Codable {
     var value: [VaultProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// 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
// VaultPropertiesProtocol is properties of the vault.
public protocol VaultPropertiesProtocol : Codable {
     var provisioningState: String? { get set }
     var upgradeDetails: UpgradeDetailsProtocol? { get set }
}


// 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
// VaultProtocol is resource information, as returned by the resource provider.
public protocol VaultProtocol : TrackedResourceProtocol {
     var properties: VaultPropertiesProtocol? { get set }
     var sku: SkuProtocol? { get set }
}


// 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
// VaultUsageListProtocol is usage for vault.
public protocol VaultUsageListProtocol : Codable {
     var value: [VaultUsageProtocol?]? { get set }
}


// 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
// VaultUsageProtocol is usages of a vault.
public protocol VaultUsageProtocol : Codable {
     var unit: UsagesUnitEnum? { get set }
     var quotaPeriod: String? { get set }
     var nextResetTime: Date? { get set }
     var currentValue: Int64? { get set }
     var limit: Int64? { get set }
     var name: NameInfoProtocol? { get set }
}


// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
    name: "recoveryservicesbackup",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "recoveryservicesbackup",
            targets: ["recoveryservicesbackup"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.0.10"),
        .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "3.4.2"),
        .package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "3.1.4"),
        .package(url: "git@github.com:alvadb/autorest-clientruntime-for-swift.git", .branch("master"))
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages which this package depends on.
        .target(
            name: "recoveryservicesbackup",
            dependencies: ["Alamofire", "RxSwift", "SwiftyJSON", "azureSwiftRuntime"])
    ]
)


// 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.

// BackupEngines is the open API 2.0 Specs for Azure RecoveryServices Backup service
import Foundation
import azureSwiftRuntime
extension Commands {
public struct BackupEngines {
    public static func Get(vaultName: String, resourceGroupName: String, subscriptionId: String, backupEngineName: String) -> BackupEnginesGet {
        return GetCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId, backupEngineName: backupEngineName)
    }
    public static func List(vaultName: String, resourceGroupName: String, subscriptionId: String) -> BackupEnginesList {
        return ListCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol BackupEnginesGet  {
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var backupEngineName : String { get set }
    var apiVersion : String { get set }
    var filter : String? { get set }
    var skipToken : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (BackupEngineBaseResourceProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.BackupEngines {
// Get returns backup management server registered to Recovery Services Vault.
    internal class GetCommand : BaseCommand, BackupEnginesGet {
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var backupEngineName : String
        public var apiVersion = "2016-12-01"
        public var filter : String?
        public var skipToken : String?

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String, backupEngineName: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            self.backupEngineName = backupEngineName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{backupEngineName}"] = String(describing: self.backupEngineName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.skipToken != nil { queryParameters["$skipToken"] = String(describing: self.skipToken!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(BackupEngineBaseResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (BackupEngineBaseResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: BackupEngineBaseResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol BackupEnginesList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var filter : String? { get set }
    var skipToken : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (BackupEngineBaseResourceListProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.BackupEngines {
// List backup management servers registered to Recovery Services Vault. Returns a pageable list of servers.
    internal class ListCommand : BaseCommand, BackupEnginesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2016-12-01"
        public var filter : String?
        public var skipToken : String?

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.skipToken != nil { queryParameters["$skipToken"] = String(describing: self.skipToken!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(BackupEngineBaseResourceListData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (BackupEngineBaseResourceListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: BackupEngineBaseResourceListData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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.

// BackupJobs is the open API 2.0 Specs for Azure RecoveryServices Backup service
import Foundation
import azureSwiftRuntime
extension Commands {
public struct BackupJobs {
    public static func List(vaultName: String, resourceGroupName: String, subscriptionId: String) -> BackupJobsList {
        return ListCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol BackupJobsList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var filter : String? { get set }
    var skipToken : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (JobResourceListProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.BackupJobs {
// List provides a pageable list of jobs.
    internal class ListCommand : BaseCommand, BackupJobsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-07-01"
        public var filter : String?
        public var skipToken : String?

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.skipToken != nil { queryParameters["$skipToken"] = String(describing: self.skipToken!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(JobResourceListData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (JobResourceListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: JobResourceListData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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.

// BackupOperationResults is the open API 2.0 Specs for Azure RecoveryServices Backup service
import Foundation
import azureSwiftRuntime
extension Commands {
public struct BackupOperationResults {
    public static func Get(vaultName: String, resourceGroupName: String, subscriptionId: String, operationId: String) -> BackupOperationResultsGet {
        return GetCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId, operationId: operationId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol BackupOperationResultsGet  {
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var operationId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.BackupOperationResults {
// Get provides the status of the delete operations such as deleting backed up item. Once the operation has started,
// the status code in the response would be Accepted. It will continue to be in this state till it reaches completion.
// On successful completion, the status code will be OK. This method expects OperationID as an argument. OperationID is
// part of the Location header of the operation response.
    internal class GetCommand : BaseCommand, BackupOperationResultsGet {
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var operationId : String
        public var apiVersion = "2016-12-01"

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String, operationId: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            self.operationId = operationId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{operationId}"] = String(describing: self.operationId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


// 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.

// BackupOperationStatuses is the open API 2.0 Specs for Azure RecoveryServices Backup service
import Foundation
import azureSwiftRuntime
extension Commands {
public struct BackupOperationStatuses {
    public static func Get(vaultName: String, resourceGroupName: String, subscriptionId: String, operationId: String) -> BackupOperationStatusesGet {
        return GetCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId, operationId: operationId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol BackupOperationStatusesGet  {
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var operationId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (OperationStatusProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.BackupOperationStatuses {
// Get fetches the status of an operation such as triggering a backup, restore. The status can be in progress,
// completed or failed. You can refer to the OperationStatus enum for all the possible states of an operation. Some
// operations create jobs. This method returns the list of jobs when the operation is complete.
    internal class GetCommand : BaseCommand, BackupOperationStatusesGet {
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var operationId : String
        public var apiVersion = "2016-12-01"

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String, operationId: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            self.operationId = operationId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{operationId}"] = String(describing: self.operationId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(OperationStatusData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (OperationStatusProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: OperationStatusData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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.

// BackupPolicies is the open API 2.0 Specs for Azure RecoveryServices Backup service
import Foundation
import azureSwiftRuntime
extension Commands {
public struct BackupPolicies {
    public static func List(vaultName: String, resourceGroupName: String, subscriptionId: String) -> BackupPoliciesList {
        return ListCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol BackupPoliciesList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var filter : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ProtectionPolicyResourceListProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.BackupPolicies {
// List lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to fetch
// scoped results.
    internal class ListCommand : BaseCommand, BackupPoliciesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-07-01"
        public var filter : String?

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(ProtectionPolicyResourceListData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ProtectionPolicyResourceListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ProtectionPolicyResourceListData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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.

// BackupProtectableItems is the open API 2.0 Specs for Azure RecoveryServices Backup service
import Foundation
import azureSwiftRuntime
extension Commands {
public struct BackupProtectableItems {
    public static func List(vaultName: String, resourceGroupName: String, subscriptionId: String) -> BackupProtectableItemsList {
        return ListCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol BackupProtectableItemsList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var filter : String? { get set }
    var skipToken : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (WorkloadProtectableItemResourceListProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.BackupProtectableItems {
// List provides a pageable list of protectable objects within your subscription according to the query filter and the
// pagination parameters.
    internal class ListCommand : BaseCommand, BackupProtectableItemsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2016-12-01"
        public var filter : String?
        public var skipToken : String?

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.skipToken != nil { queryParameters["$skipToken"] = String(describing: self.skipToken!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(WorkloadProtectableItemResourceListData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (WorkloadProtectableItemResourceListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: WorkloadProtectableItemResourceListData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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.

// BackupProtectedItems is the open API 2.0 Specs for Azure RecoveryServices Backup service
import Foundation
import azureSwiftRuntime
extension Commands {
public struct BackupProtectedItems {
    public static func List(vaultName: String, resourceGroupName: String, subscriptionId: String) -> BackupProtectedItemsList {
        return ListCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol BackupProtectedItemsList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var filter : String? { get set }
    var skipToken : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ProtectedItemResourceListProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.BackupProtectedItems {
// List provides a pageable list of all items that are backed up within a vault.
    internal class ListCommand : BaseCommand, BackupProtectedItemsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-07-01"
        public var filter : String?
        public var skipToken : String?

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectedItems"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.skipToken != nil { queryParameters["$skipToken"] = String(describing: self.skipToken!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(ProtectedItemResourceListData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ProtectedItemResourceListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ProtectedItemResourceListData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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.

// BackupProtectionContainers is the open API 2.0 Specs for Azure RecoveryServices Backup service
import Foundation
import azureSwiftRuntime
extension Commands {
public struct BackupProtectionContainers {
    public static func List(vaultName: String, resourceGroupName: String, subscriptionId: String) -> BackupProtectionContainersList {
        return ListCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol BackupProtectionContainersList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var filter : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ProtectionContainerResourceListProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.BackupProtectionContainers {
// List lists the containers registered to Recovery Services Vault.
    internal class ListCommand : BaseCommand, BackupProtectionContainersList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2016-12-01"
        public var filter : String?

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(ProtectionContainerResourceListData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ProtectionContainerResourceListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ProtectionContainerResourceListData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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.

// BackupResourceStorageConfigs is the open API 2.0 Specs for Azure RecoveryServices Backup service
import Foundation
import azureSwiftRuntime
extension Commands {
public struct BackupResourceStorageConfigs {
    public static func Get(vaultName: String, resourceGroupName: String, subscriptionId: String) -> BackupResourceStorageConfigsGet {
        return GetCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func Update(vaultName: String, resourceGroupName: String, subscriptionId: String, parameters: BackupResourceConfigResourceProtocol) -> BackupResourceStorageConfigsUpdate {
        return UpdateCommand(vaultName: vaultName, resourceGroupName: resourceGroupName, subscriptionId: subscriptionId, parameters: parameters)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol BackupResourceStorageConfigsGet  {
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (BackupResourceConfigResourceProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.BackupResourceStorageConfigs {
// Get fetches resource storage config.
    internal class GetCommand : BaseCommand, BackupResourceStorageConfigsGet {
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2016-12-01"

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(BackupResourceConfigResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (BackupResourceConfigResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: BackupResourceConfigResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol BackupResourceStorageConfigsUpdate  {
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var parameters :  BackupResourceConfigResourceProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.BackupResourceStorageConfigs {
// Update updates vault storage model type.
    internal class UpdateCommand : BaseCommand, BackupResourceStorageConfigsUpdate {
        public var vaultName : String
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2016-12-01"
    public var parameters :  BackupResourceConfigResourceProtocol?

        public init(vaultName: String, resourceGroupName: String, subscriptionId: String, parameters: BackupResourceConfigResourceProtocol) {
            self.vaultName = vaultName
            self.resourceGroupName = resourceGroupName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = parameters

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? BackupResourceConfigResourceData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}