// 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
// CheckNameRequestProtocol is
public protocol CheckNameRequestProtocol : Codable {
     var name: String? { get set }
     var type: 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
// CheckNameResponseProtocol is
public protocol CheckNameResponseProtocol : Codable {
     var nameAvailable: Bool? { get set }
     var reason: CheckNameReasonEnum? { get set }
     var message: 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
// CreateWorkspaceCollectionRequestProtocol is
public protocol CreateWorkspaceCollectionRequestProtocol : Codable {
     var location: String? { get set }
     var tags: [String:String]? { get set }
     var sku: AzureSkuProtocol? { 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
// DisplayProtocol is
public protocol DisplayProtocol : Codable {
     var provider: String? { get set }
     var resource: String? { get set }
     var operation: String? { get set }
     var description: String? { get set }
     var origin: 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
// ErrorDetailProtocol is
public protocol ErrorDetailProtocol : Codable {
     var code: String? { get set }
     var message: String? { get set }
     var target: 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
// ErrorProtocol is
public protocol ErrorProtocol : Codable {
     var code: String? { get set }
     var message: String? { get set }
     var target: String? { get set }
     var details: [ErrorDetailProtocol?]? { 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
// MigrateWorkspaceCollectionRequestProtocol is
public protocol MigrateWorkspaceCollectionRequestProtocol : Codable {
     var targetResourceGroup: String? { get set }
     var resources: [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
// OperationListProtocol is
public protocol OperationListProtocol : Codable {
     var value: [OperationProtocol?]? { 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
// OperationProtocol is
public protocol OperationProtocol : Codable {
     var name: String? { get set }
     var display: DisplayProtocol? { 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
// UpdateWorkspaceCollectionRequestProtocol is
public protocol UpdateWorkspaceCollectionRequestProtocol : Codable {
     var tags: [String:String]? { get set }
     var sku: AzureSkuProtocol? { 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
// WorkspaceCollectionAccessKeyProtocol is
public protocol WorkspaceCollectionAccessKeyProtocol : Codable {
     var keyName: AccessKeyNameEnum? { 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
// WorkspaceCollectionAccessKeysProtocol is
public protocol WorkspaceCollectionAccessKeysProtocol : Codable {
     var key1: String? { get set }
     var key2: 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
// WorkspaceCollectionListProtocol is
public protocol WorkspaceCollectionListProtocol : Codable {
     var value: [WorkspaceCollectionProtocol?]? { 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
// WorkspaceCollectionProtocol is
public protocol WorkspaceCollectionProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var location: String? { get set }
     var tags: [String:String]? { get set }
     var sku: AzureSkuProtocol? { get set }
     var properties: [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
// WorkspaceListProtocol is
public protocol WorkspaceListProtocol : Codable {
     var value: [WorkspaceProtocol?]? { 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
// WorkspaceProtocol is
public protocol WorkspaceProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var properties: [String: String?]? { 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: "recoveryservices",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "recoveryservices",
            targets: ["recoveryservices"]),
    ],
    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: "recoveryservices",
            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.
public class DataFactory {
}
public class Commands {
}


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

// Operations is the recovery Services Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Operations {
    public static func List() -> OperationsList {
        return ListCommand()
    }
}
}


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

extension Commands.Operations {
// List returns the list of available operations.
    internal class ListCommand : BaseCommand, OperationsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var apiVersion = "2016-06-01"

    public override init() {
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/providers/Microsoft.RecoveryServices/operations"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            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)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(ClientDiscoveryResponseData?.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 (ClientDiscoveryResponseProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ClientDiscoveryResponseData?, 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.

// RegisteredIdentities is the recovery Services Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct RegisteredIdentities {
    public static func Delete(subscriptionId: String, resourceGroupName: String, vaultName: String, identityName: String) -> RegisteredIdentitiesDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName, identityName: identityName)
    }
}
}


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

extension Commands.RegisteredIdentities {
// Delete unregisters the given container from your Recovery Services vault.
    internal class DeleteCommand : BaseCommand, RegisteredIdentitiesDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var identityName : String
        public var apiVersion = "2016-06-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{identityName}"] = String(describing: self.identityName)
            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.

// ReplicationUsages is the recovery Services Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct ReplicationUsages {
    public static func List(subscriptionId: String, resourceGroupName: String, vaultName: String) -> ReplicationUsagesList {
        return ListCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName)
    }
}
}


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

extension Commands.ReplicationUsages {
// List fetches the replication usages of the vault.
    internal class ListCommand : BaseCommand, ReplicationUsagesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var apiVersion = "2016-06-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            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)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(ReplicationUsageListData?.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 (ReplicationUsageListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ReplicationUsageListData?, 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.

// Usages is the recovery Services Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Usages {
    public static func ListByVaults(subscriptionId: String, resourceGroupName: String, vaultName: String) -> UsagesListByVaults {
        return ListByVaultsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName)
    }
}
}


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

extension Commands.Usages {
// ListByVaults fetches the usages of the vault.
    internal class ListByVaultsCommand : BaseCommand, UsagesListByVaults {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var apiVersion = "2016-06-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            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)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(VaultUsageListData?.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 (VaultUsageListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: VaultUsageListData?, 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.

// VaultCertificates is the recovery Services Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct VaultCertificates {
    public static func Create(subscriptionId: String, resourceGroupName: String, vaultName: String, certificateName: String, certificateRequest: CertificateRequestProtocol) -> VaultCertificatesCreate {
        return CreateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName, certificateName: certificateName, certificateRequest: certificateRequest)
    }
}
}


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

extension Commands.VaultCertificates {
// Create uploads a certificate for a resource.
    internal class CreateCommand : BaseCommand, VaultCertificatesCreate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var certificateName : String
        public var apiVersion = "2016-06-01"
    public var certificateRequest :  CertificateRequestProtocol?

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

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

        }
        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(certificateRequest as? CertificateRequestData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        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(VaultCertificateResponseData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (VaultCertificateResponseProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: VaultCertificateResponseData?, 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.

// VaultExtendedInfo is the recovery Services Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct VaultExtendedInfo {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, vaultName: String, resourceResourceExtendedInfoDetails: VaultExtendedInfoResourceProtocol) -> VaultExtendedInfoCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName, resourceResourceExtendedInfoDetails: resourceResourceExtendedInfoDetails)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, vaultName: String) -> VaultExtendedInfoGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, vaultName: String, resourceResourceExtendedInfoDetails: VaultExtendedInfoResourceProtocol) -> VaultExtendedInfoUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName, resourceResourceExtendedInfoDetails: resourceResourceExtendedInfoDetails)
    }
}
}


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

extension Commands.VaultExtendedInfo {
// CreateOrUpdate create vault extended info.
    internal class CreateOrUpdateCommand : BaseCommand, VaultExtendedInfoCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var apiVersion = "2016-06-01"
    public var resourceResourceExtendedInfoDetails :  VaultExtendedInfoResourceProtocol?

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

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

        }
        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(resourceResourceExtendedInfoDetails as? VaultExtendedInfoResourceData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        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(VaultExtendedInfoResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (VaultExtendedInfoResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: VaultExtendedInfoResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.VaultExtendedInfo {
// Get get the vault extended info.
    internal class GetCommand : BaseCommand, VaultExtendedInfoGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var apiVersion = "2016-06-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            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(VaultExtendedInfoResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (VaultExtendedInfoResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: VaultExtendedInfoResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.VaultExtendedInfo {
// Update update vault extended info.
    internal class UpdateCommand : BaseCommand, VaultExtendedInfoUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var apiVersion = "2016-06-01"
    public var resourceResourceExtendedInfoDetails :  VaultExtendedInfoResourceProtocol?

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

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

        }
        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(resourceResourceExtendedInfoDetails as? VaultExtendedInfoResourceData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        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(VaultExtendedInfoResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (VaultExtendedInfoResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: VaultExtendedInfoResourceData?, 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.

// Vaults is the recovery Services Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Vaults {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, vaultName: String, vault: VaultProtocol) -> VaultsCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName, vault: vault)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, vaultName: String) -> VaultsDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, vaultName: String) -> VaultsGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName)
    }
    public static func ListByResourceGroup(subscriptionId: String, resourceGroupName: String) -> VaultsListByResourceGroup {
        return ListByResourceGroupCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName)
    }
    public static func ListBySubscriptionId(subscriptionId: String) -> VaultsListBySubscriptionId {
        return ListBySubscriptionIdCommand(subscriptionId: subscriptionId)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, vaultName: String, vault: PatchVaultProtocol) -> VaultsUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, vaultName: vaultName, vault: vault)
    }
}
}


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

extension Commands.Vaults {
// CreateOrUpdate creates or updates a Recovery Services vault.
    internal class CreateOrUpdateCommand : BaseCommand, VaultsCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var apiVersion = "2016-06-01"
    public var vault :  VaultProtocol?

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

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

        }
        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(vault as? VaultData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        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(VaultData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (VaultProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: VaultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Vaults {
// Delete deletes a vault.
    internal class DeleteCommand : BaseCommand, VaultsDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var apiVersion = "2016-06-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            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)
            }
        }
    }
}


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

extension Commands.Vaults {
// Get get the Vault details.
    internal class GetCommand : BaseCommand, VaultsGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var apiVersion = "2016-06-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            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(VaultData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (VaultProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: VaultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Vaults {
// ListByResourceGroup retrieve a list of Vaults.
    internal class ListByResourceGroupCommand : BaseCommand, VaultsListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var apiVersion = "2016-06-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            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)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(VaultListData?.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 (VaultListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: VaultListData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Vaults {
// ListBySubscriptionId fetches all the resources of the specified type in the subscription.
    internal class ListBySubscriptionIdCommand : BaseCommand, VaultsListBySubscriptionId {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2016-06-01"

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

        public override func preCall()  {
            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)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(VaultListData?.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 (VaultListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: VaultListData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Vaults {
// Update updates the vault.
    internal class UpdateCommand : BaseCommand, VaultsUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var vaultName : String
        public var apiVersion = "2016-06-01"
    public var vault :  PatchVaultProtocol?

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

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

        }
        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(vault as? PatchVaultData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        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(VaultData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (VaultProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: VaultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// AuthType enumerates the values for auth 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 AuthTypeEnum: String, Codable
{
// AAD specifies the aad state for auth type.
    case AAD = "AAD"
// AccessControlService specifies the access control service state for auth type.
    case AccessControlService = "AccessControlService"
// ACS specifies the acs state for auth type.
    case ACS = "ACS"
// AzureActiveDirectory specifies the azure active directory state for auth type.
    case AzureActiveDirectory = "AzureActiveDirectory"
// Invalid specifies the invalid state for auth type.
    case Invalid = "Invalid"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CertificateRequestData : CertificateRequestProtocol {
    public var properties: RawCertificateDataProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createCertificateRequestProtocol() -> CertificateRequestProtocol {
    return CertificateRequestData()
  }
}


// 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 ClientDiscoveryDisplayData : ClientDiscoveryDisplayProtocol {
    public var provider: String?
    public var resource: String?
    public var operation: String?
    public var description: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createClientDiscoveryDisplayProtocol() -> ClientDiscoveryDisplayProtocol {
    return ClientDiscoveryDisplayData()
  }
}


// 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 ClientDiscoveryForLogSpecificationData : ClientDiscoveryForLogSpecificationProtocol {
    public var name: String?
    public var displayName: String?
    public var blobDuration: String?

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

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

extension DataFactory {
  public static func createClientDiscoveryForLogSpecificationProtocol() -> ClientDiscoveryForLogSpecificationProtocol {
    return ClientDiscoveryForLogSpecificationData()
  }
}


// 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 ClientDiscoveryForPropertiesData : ClientDiscoveryForPropertiesProtocol {
    public var serviceSpecification: ClientDiscoveryForServiceSpecificationProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createClientDiscoveryForPropertiesProtocol() -> ClientDiscoveryForPropertiesProtocol {
    return ClientDiscoveryForPropertiesData()
  }
}


// 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 ClientDiscoveryForServiceSpecificationData : ClientDiscoveryForServiceSpecificationProtocol {
    public var logSpecifications: [ClientDiscoveryForLogSpecificationProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createClientDiscoveryForServiceSpecificationProtocol() -> ClientDiscoveryForServiceSpecificationProtocol {
    return ClientDiscoveryForServiceSpecificationData()
  }
}


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

extension DataFactory {
  public static func createClientDiscoveryResponseProtocol() -> ClientDiscoveryResponseProtocol {
    return ClientDiscoveryResponseData()
  }
}


// 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 ClientDiscoveryValueForSingleApiData : ClientDiscoveryValueForSingleApiProtocol {
    public var name: String?
    public var display: ClientDiscoveryDisplayProtocol?
    public var origin: String?
    public var properties: ClientDiscoveryForPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case name = "name"
        case display = "display"
        case origin = "origin"
        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(.display) {
        self.display = try container.decode(ClientDiscoveryDisplayData?.self, forKey: .display)
    }
    if container.contains(.origin) {
        self.origin = try container.decode(String?.self, forKey: .origin)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(ClientDiscoveryForPropertiesData?.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.display != nil {try container.encode(self.display as! ClientDiscoveryDisplayData?, forKey: .display)}
    if self.origin != nil {try container.encode(self.origin, forKey: .origin)}
    if self.properties != nil {try container.encode(self.properties as! ClientDiscoveryForPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createClientDiscoveryValueForSingleApiProtocol() -> ClientDiscoveryValueForSingleApiProtocol {
    return ClientDiscoveryValueForSingleApiData()
  }
}


// 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 JobsSummaryData : JobsSummaryProtocol {
    public var failedJobs: Int32?
    public var suspendedJobs: Int32?
    public var inProgressJobs: Int32?

        enum CodingKeys: String, CodingKey {case failedJobs = "failedJobs"
        case suspendedJobs = "suspendedJobs"
        case inProgressJobs = "inProgressJobs"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createJobsSummaryProtocol() -> JobsSummaryProtocol {
    return JobsSummaryData()
  }
}


// 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 MonitoringSummaryData : MonitoringSummaryProtocol {
    public var unHealthyVmCount: Int32?
    public var unHealthyProviderCount: Int32?
    public var eventsCount: Int32?
    public var deprecatedProviderCount: Int32?
    public var supportedProviderCount: Int32?
    public var unsupportedProviderCount: Int32?

        enum CodingKeys: String, CodingKey {case unHealthyVmCount = "unHealthyVmCount"
        case unHealthyProviderCount = "unHealthyProviderCount"
        case eventsCount = "eventsCount"
        case deprecatedProviderCount = "deprecatedProviderCount"
        case supportedProviderCount = "supportedProviderCount"
        case unsupportedProviderCount = "unsupportedProviderCount"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createMonitoringSummaryProtocol() -> MonitoringSummaryProtocol {
    return MonitoringSummaryData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct NameInfoData : NameInfoProtocol {
    public var value: String?
    public var localizedValue: String?

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

  public init()  {
  }

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

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

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct PatchTrackedResourceData : PatchTrackedResourceProtocol, 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()  {
  }

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

extension DataFactory {
  public static func createPatchTrackedResourceProtocol() -> PatchTrackedResourceProtocol {
    return PatchTrackedResourceData()
  }
}


// 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 PatchVaultData : PatchVaultProtocol, PatchTrackedResourceProtocol, 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()  {
  }

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


// 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 RawCertificateDataData : RawCertificateDataProtocol {
    public var authType: AuthTypeEnum?
    public var certificate: [UInt8]?

        enum CodingKeys: String, CodingKey {case authType = "authType"
        case certificate = "certificate"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRawCertificateDataProtocol() -> RawCertificateDataProtocol {
    return RawCertificateDataData()
  }
}


// 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 ReplicationUsageData : ReplicationUsageProtocol {
    public var monitoringSummary: MonitoringSummaryProtocol?
    public var jobsSummary: JobsSummaryProtocol?
    public var protectedItemCount: Int32?
    public var recoveryPlanCount: Int32?
    public var registeredServersCount: Int32?
    public var recoveryServicesProviderAuthType: Int32?

        enum CodingKeys: String, CodingKey {case monitoringSummary = "monitoringSummary"
        case jobsSummary = "jobsSummary"
        case protectedItemCount = "protectedItemCount"
        case recoveryPlanCount = "recoveryPlanCount"
        case registeredServersCount = "registeredServersCount"
        case recoveryServicesProviderAuthType = "recoveryServicesProviderAuthType"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.monitoringSummary) {
        self.monitoringSummary = try container.decode(MonitoringSummaryData?.self, forKey: .monitoringSummary)
    }
    if container.contains(.jobsSummary) {
        self.jobsSummary = try container.decode(JobsSummaryData?.self, forKey: .jobsSummary)
    }
    if container.contains(.protectedItemCount) {
        self.protectedItemCount = try container.decode(Int32?.self, forKey: .protectedItemCount)
    }
    if container.contains(.recoveryPlanCount) {
        self.recoveryPlanCount = try container.decode(Int32?.self, forKey: .recoveryPlanCount)
    }
    if container.contains(.registeredServersCount) {
        self.registeredServersCount = try container.decode(Int32?.self, forKey: .registeredServersCount)
    }
    if container.contains(.recoveryServicesProviderAuthType) {
        self.recoveryServicesProviderAuthType = try container.decode(Int32?.self, forKey: .recoveryServicesProviderAuthType)
    }
    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.monitoringSummary != nil {try container.encode(self.monitoringSummary as! MonitoringSummaryData?, forKey: .monitoringSummary)}
    if self.jobsSummary != nil {try container.encode(self.jobsSummary as! JobsSummaryData?, forKey: .jobsSummary)}
    if self.protectedItemCount != nil {try container.encode(self.protectedItemCount, forKey: .protectedItemCount)}
    if self.recoveryPlanCount != nil {try container.encode(self.recoveryPlanCount, forKey: .recoveryPlanCount)}
    if self.registeredServersCount != nil {try container.encode(self.registeredServersCount, forKey: .registeredServersCount)}
    if self.recoveryServicesProviderAuthType != nil {try container.encode(self.recoveryServicesProviderAuthType, forKey: .recoveryServicesProviderAuthType)}
  }
}

extension DataFactory {
  public static func createReplicationUsageProtocol() -> ReplicationUsageProtocol {
    return ReplicationUsageData()
  }
}


// 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 ReplicationUsageListData : ReplicationUsageListProtocol {
    public var value: [ReplicationUsageProtocol?]?

        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([ReplicationUsageData?]?.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! [ReplicationUsageData?]?, forKey: .value)}
  }
}

extension DataFactory {
  public static func createReplicationUsageListProtocol() -> ReplicationUsageListProtocol {
    return ReplicationUsageListData()
  }
}


// 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 ResourceCertificateAndAadDetailsData : ResourceCertificateAndAadDetailsProtocol, 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 aadAuthority: String
    public var aadTenantId: String
    public var servicePrincipalClientId: String
    public var servicePrincipalObjectId: String
    public var azureManagementEndpointAudience: 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 aadAuthority = "aadAuthority"
        case aadTenantId = "aadTenantId"
        case servicePrincipalClientId = "servicePrincipalClientId"
        case servicePrincipalObjectId = "servicePrincipalObjectId"
        case azureManagementEndpointAudience = "azureManagementEndpointAudience"
        }

  public init(aadAuthority: String, aadTenantId: String, servicePrincipalClientId: String, servicePrincipalObjectId: String, azureManagementEndpointAudience: String)  {
    self.aadAuthority = aadAuthority
    self.aadTenantId = aadTenantId
    self.servicePrincipalClientId = servicePrincipalClientId
    self.servicePrincipalObjectId = servicePrincipalObjectId
    self.azureManagementEndpointAudience = azureManagementEndpointAudience
  }

  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.aadAuthority = try container.decode(String.self, forKey: .aadAuthority)
    self.aadTenantId = try container.decode(String.self, forKey: .aadTenantId)
    self.servicePrincipalClientId = try container.decode(String.self, forKey: .servicePrincipalClientId)
    self.servicePrincipalObjectId = try container.decode(String.self, forKey: .servicePrincipalObjectId)
    self.azureManagementEndpointAudience = try container.decode(String.self, forKey: .azureManagementEndpointAudience)
    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.aadAuthority, forKey: .aadAuthority)
    try container.encode(self.aadTenantId, forKey: .aadTenantId)
    try container.encode(self.servicePrincipalClientId, forKey: .servicePrincipalClientId)
    try container.encode(self.servicePrincipalObjectId, forKey: .servicePrincipalObjectId)
    try container.encode(self.azureManagementEndpointAudience, forKey: .azureManagementEndpointAudience)
  }
}

extension DataFactory {
  public static func createResourceCertificateAndAadDetailsProtocol(aadAuthority: String, aadTenantId: String, servicePrincipalClientId: String, servicePrincipalObjectId: String, azureManagementEndpointAudience: String) -> ResourceCertificateAndAadDetailsProtocol {
    return ResourceCertificateAndAadDetailsData(aadAuthority: aadAuthority, aadTenantId: aadTenantId, servicePrincipalClientId: servicePrincipalClientId, servicePrincipalObjectId: servicePrincipalObjectId, azureManagementEndpointAudience: azureManagementEndpointAudience)
  }
}