// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ResourceProtocol is the common properties of an Azure resource.
public protocol ResourceProtocol : 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 }
}


// 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
// RoutePropertiesProtocol is the properties of a routing rule that your IoT hub uses to route messages to endpoints.
public protocol RoutePropertiesProtocol : Codable {
     var name: String { get set }
     var source: RoutingSourceEnum { get set }
     var condition: String? { get set }
     var endpointNames: [String] { get set }
     var isEnabled: Bool { 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
// RoutingEndpointsProtocol is the properties related to the custom endpoints to which your IoT hub routes messages
// based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for paid hubs and
// only 1 custom endpoint is allowed across all endpoint types for free hubs.
public protocol RoutingEndpointsProtocol : Codable {
     var serviceBusQueues: [RoutingServiceBusQueueEndpointPropertiesProtocol?]? { get set }
     var serviceBusTopics: [RoutingServiceBusTopicEndpointPropertiesProtocol?]? { get set }
     var eventHubs: [RoutingEventHubPropertiesProtocol?]? { get set }
     var storageContainers: [RoutingStorageContainerPropertiesProtocol?]? { 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
// RoutingEventHubPropertiesProtocol is the properties related to an event hub endpoint.
public protocol RoutingEventHubPropertiesProtocol : Codable {
     var connectionString: String { get set }
     var name: String { get set }
     var subscriptionId: String? { get set }
     var resourceGroup: 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
// RoutingPropertiesProtocol is the routing related properties of the IoT hub. See:
// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging
public protocol RoutingPropertiesProtocol : Codable {
     var endpoints: RoutingEndpointsProtocol? { get set }
     var routes: [RoutePropertiesProtocol?]? { get set }
     var fallbackRoute: FallbackRoutePropertiesProtocol? { 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
// RoutingServiceBusQueueEndpointPropertiesProtocol is the properties related to service bus queue endpoint types.
public protocol RoutingServiceBusQueueEndpointPropertiesProtocol : Codable {
     var connectionString: String { get set }
     var name: String { get set }
     var subscriptionId: String? { get set }
     var resourceGroup: 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
// RoutingServiceBusTopicEndpointPropertiesProtocol is the properties related to service bus topic endpoint types.
public protocol RoutingServiceBusTopicEndpointPropertiesProtocol : Codable {
     var connectionString: String { get set }
     var name: String { get set }
     var subscriptionId: String? { get set }
     var resourceGroup: 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
// RoutingStorageContainerPropertiesProtocol is the properties related to a storage container endpoint.
public protocol RoutingStorageContainerPropertiesProtocol : Codable {
     var connectionString: String { get set }
     var name: String { get set }
     var subscriptionId: String? { get set }
     var resourceGroup: String? { get set }
     var containerName: String { get set }
     var fileNameFormat: String? { get set }
     var batchFrequencyInSeconds: Int32? { get set }
     var maxChunkSizeInBytes: Int32? { get set }
     var encoding: 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
// SharedAccessSignatureAuthorizationRuleListResultProtocol is the list of shared access policies with a next link.
public protocol SharedAccessSignatureAuthorizationRuleListResultProtocol : Codable {
     var value: [SharedAccessSignatureAuthorizationRuleProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SharedAccessSignatureAuthorizationRuleProtocol is the properties of an IoT hub shared access policy.
public protocol SharedAccessSignatureAuthorizationRuleProtocol : Codable {
     var keyName: String { get set }
     var primaryKey: String? { get set }
     var secondaryKey: String? { get set }
     var rights: AccessRightsEnum { 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
// StorageEndpointPropertiesProtocol is the properties of the Azure Storage endpoint for file upload.
public protocol StorageEndpointPropertiesProtocol : Codable {
     var sasTtlAsIso8601: String? { get set }
     var connectionString: String { get set }
     var containerName: 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: "keyvault",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "keyvault",
            targets: ["keyvault"]),
    ],
    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: "keyvault",
            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 the Azure management API provides a RESTful set of web services that interact with Azure Key
// Vault.
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 (OperationListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Operations {
// List lists all of the available Key Vault Rest API operations.
    internal class ListCommand : BaseCommand, OperationsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var apiVersion = "2016-10-01"

    public override init() {
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/providers/Microsoft.KeyVault/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(OperationListResultData?.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 (OperationListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: OperationListResultData?, 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 the Azure management API provides a RESTful set of web services that interact with Azure Key Vault.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Vaults {
    public static func CheckNameAvailability(subscriptionId: String, vaultName: VaultCheckNameAvailabilityParametersProtocol) -> VaultsCheckNameAvailability {
        return CheckNameAvailabilityCommand(subscriptionId: subscriptionId, vaultName: vaultName)
    }
    public static func CreateOrUpdate(resourceGroupName: String, vaultName: String, subscriptionId: String, parameters: VaultCreateOrUpdateParametersProtocol) -> VaultsCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, vaultName: vaultName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, vaultName: String, subscriptionId: String) -> VaultsDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, vaultName: vaultName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, vaultName: String, subscriptionId: String) -> VaultsGet {
        return GetCommand(resourceGroupName: resourceGroupName, vaultName: vaultName, subscriptionId: subscriptionId)
    }
    public static func GetDeleted(vaultName: String, location: String, subscriptionId: String) -> VaultsGetDeleted {
        return GetDeletedCommand(vaultName: vaultName, location: location, subscriptionId: subscriptionId)
    }
    public static func List(subscriptionId: String, filter: String) -> VaultsList {
        return ListCommand(subscriptionId: subscriptionId, filter: filter)
    }
    public static func ListByResourceGroup(resourceGroupName: String, subscriptionId: String) -> VaultsListByResourceGroup {
        return ListByResourceGroupCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func ListBySubscription(subscriptionId: String) -> VaultsListBySubscription {
        return ListBySubscriptionCommand(subscriptionId: subscriptionId)
    }
    public static func ListDeleted(subscriptionId: String) -> VaultsListDeleted {
        return ListDeletedCommand(subscriptionId: subscriptionId)
    }
    public static func PurgeDeleted(vaultName: String, location: String, subscriptionId: String) -> VaultsPurgeDeleted {
        return PurgeDeletedCommand(vaultName: vaultName, location: location, subscriptionId: subscriptionId)
    }
    public static func Update(resourceGroupName: String, vaultName: String, subscriptionId: String, parameters: VaultPatchParametersProtocol) -> VaultsUpdate {
        return UpdateCommand(resourceGroupName: resourceGroupName, vaultName: vaultName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func UpdateAccessPolicy(resourceGroupName: String, vaultName: String, operationKind: AccessPolicyUpdateKindEnum, subscriptionId: String, parameters: VaultAccessPolicyParametersProtocol) -> VaultsUpdateAccessPolicy {
        return UpdateAccessPolicyCommand(resourceGroupName: resourceGroupName, vaultName: vaultName, operationKind: operationKind, subscriptionId: subscriptionId, parameters: parameters)
    }
}
}


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

extension Commands.Vaults {
// CheckNameAvailability checks that the vault name is valid and is not already in use.
    internal class CheckNameAvailabilityCommand : BaseCommand, VaultsCheckNameAvailability {
        public var subscriptionId : String
        public var apiVersion = "2016-10-01"
    public var vaultName :  VaultCheckNameAvailabilityParametersProtocol?

        public init(subscriptionId: String, vaultName: VaultCheckNameAvailabilityParametersProtocol) {
            self.subscriptionId = subscriptionId
            self.vaultName = vaultName
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/checkNameAvailability"
            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)
            self.body = vaultName

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


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

extension Commands.Vaults {
// CreateOrUpdate create or update a key vault in the specified subscription.
    internal class CreateOrUpdateCommand : BaseCommand, VaultsCreateOrUpdate {
        public var resourceGroupName : String
        public var vaultName : String
        public var subscriptionId : String
        public var apiVersion = "2016-10-01"
    public var parameters :  VaultCreateOrUpdateParametersProtocol?

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

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? VaultCreateOrUpdateParametersData)
                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 resourceGroupName : String { get set }
    var vaultName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

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

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

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{vaultName}"] = String(describing: self.vaultName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            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 resourceGroupName : String { get set }
    var vaultName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (VaultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Vaults {
// Get gets the specified Azure key vault.
    internal class GetCommand : BaseCommand, VaultsGet {
        public var resourceGroupName : String
        public var vaultName : String
        public var subscriptionId : String
        public var apiVersion = "2016-10-01"

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

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(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 VaultsGetDeleted  {
    var headerParameters: [String: String] { get set }
    var vaultName : String { get set }
    var location : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (DeletedVaultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Vaults {
// GetDeleted gets the deleted Azure key vault.
    internal class GetDeletedCommand : BaseCommand, VaultsGetDeleted {
        public var vaultName : String
        public var location : String
        public var subscriptionId : String
        public var apiVersion = "2016-10-01"

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

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

        }

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


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

extension Commands.Vaults {
// List the List operation gets information about the vaults associated with the subscription.
    internal class ListCommand : BaseCommand, VaultsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var filter : String
        public var top : Int32?
        public var apiVersion = "2015-11-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["$filter"] = String(describing: self.filter)
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }
            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(ResourceListResultData?.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 (ResourceListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ResourceListResultData?, 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 resourceGroupName : String { get set }
    var subscriptionId : String { get set }
    var top : Int32? { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (VaultListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Vaults {
// ListByResourceGroup the List operation gets information about the vaults associated with the subscription and within
// the specified resource group.
    internal class ListByResourceGroupCommand : BaseCommand, VaultsListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var top : Int32?
        public var apiVersion = "2016-10-01"

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

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }
            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(VaultListResultData?.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 (VaultListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: VaultListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Vaults {
// ListBySubscription the List operation gets information about the vaults associated with the subscription.
    internal class ListBySubscriptionCommand : BaseCommand, VaultsListBySubscription {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var top : Int32?
        public var apiVersion = "2016-10-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }
            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(VaultListResultData?.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 (VaultListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: VaultListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol VaultsListDeleted  {
    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 (DeletedVaultListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Vaults {
// ListDeleted gets information about the deleted vaults in a subscription.
    internal class ListDeletedCommand : BaseCommand, VaultsListDeleted {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2016-10-01"

        public init(subscriptionId: String) {
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/deletedVaults"
            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(DeletedVaultListResultData?.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 (DeletedVaultListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: DeletedVaultListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Vaults {
// PurgeDeleted permanently deletes the specified vault. aka Purges the deleted Azure key vault. This method may poll
// for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel
// polling and any outstanding HTTP requests.
    internal class PurgeDeletedCommand : BaseCommand, VaultsPurgeDeleted {
        public var vaultName : String
        public var location : String
        public var subscriptionId : String
        public var apiVersion = "2016-10-01"

        public init(vaultName: String, location: String, subscriptionId: String) {
            self.vaultName = vaultName
            self.location = location
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.KeyVault/locations/{location}/deletedVaults/{vaultName}/purge"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Vaults {
// Update update a key vault in the specified subscription.
    internal class UpdateCommand : BaseCommand, VaultsUpdate {
        public var resourceGroupName : String
        public var vaultName : String
        public var subscriptionId : String
        public var apiVersion = "2016-10-01"
    public var parameters :  VaultPatchParametersProtocol?

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

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? VaultPatchParametersData)
                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 VaultsUpdateAccessPolicy  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var vaultName : String { get set }
    var operationKind : AccessPolicyUpdateKindEnum { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var parameters :  VaultAccessPolicyParametersProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (VaultAccessPolicyParametersProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Vaults {
// UpdateAccessPolicy update access policies in a key vault in the specified subscription.
    internal class UpdateAccessPolicyCommand : BaseCommand, VaultsUpdateAccessPolicy {
        public var resourceGroupName : String
        public var vaultName : String
        public var operationKind : AccessPolicyUpdateKindEnum
        public var subscriptionId : String
        public var apiVersion = "2016-10-01"
    public var parameters :  VaultAccessPolicyParametersProtocol?

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

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? VaultAccessPolicyParametersData)
                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(VaultAccessPolicyParametersData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (VaultAccessPolicyParametersProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: VaultAccessPolicyParametersData?, 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.
import Foundation
import azureSwiftRuntime
internal struct AccessPolicyEntryData : AccessPolicyEntryProtocol {
    public var tenantId: String
    public var objectId: String
    public var applicationId: String?
    public var permissions: PermissionsProtocol

        enum CodingKeys: String, CodingKey {case tenantId = "tenantId"
        case objectId = "objectId"
        case applicationId = "applicationId"
        case permissions = "permissions"
        }

  public init(tenantId: String, objectId: String, permissions: PermissionsProtocol)  {
    self.tenantId = tenantId
    self.objectId = objectId
    self.permissions = permissions
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.tenantId, forKey: .tenantId)
    try container.encode(self.objectId, forKey: .objectId)
    if self.applicationId != nil {try container.encode(self.applicationId, forKey: .applicationId)}
    try container.encode(self.permissions as! PermissionsData, forKey: .permissions)
  }
}

extension DataFactory {
  public static func createAccessPolicyEntryProtocol(tenantId: String, objectId: String, permissions: PermissionsProtocol) -> AccessPolicyEntryProtocol {
    return AccessPolicyEntryData(tenantId: tenantId, objectId: objectId, permissions: permissions)
  }
}


// AccessPolicyUpdateKind enumerates the values for access policy update kind.

// 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 AccessPolicyUpdateKindEnum: String, Codable
{
// Add specifies the add state for access policy update kind.
    case Add = "add"
// Remove specifies the remove state for access policy update kind.
    case Remove = "remove"
// Replace specifies the replace state for access policy update kind.
    case Replace = "replace"
}


// CertificatePermissions enumerates the values for certificate permissions.

// 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 CertificatePermissionsEnum: String, Codable
{
// Create specifies the create state for certificate permissions.
    case Create = "create"
// Delete specifies the delete state for certificate permissions.
    case Delete = "delete"
// Deleteissuers specifies the deleteissuers state for certificate permissions.
    case Deleteissuers = "deleteissuers"
// Get specifies the get state for certificate permissions.
    case Get = "get"
// Getissuers specifies the getissuers state for certificate permissions.
    case Getissuers = "getissuers"
// Import specifies the import state for certificate permissions.
    case Import = "import"
// List specifies the list state for certificate permissions.
    case List = "list"
// Listissuers specifies the listissuers state for certificate permissions.
    case Listissuers = "listissuers"
// Managecontacts specifies the managecontacts state for certificate permissions.
    case Managecontacts = "managecontacts"
// Manageissuers specifies the manageissuers state for certificate permissions.
    case Manageissuers = "manageissuers"
// Purge specifies the purge state for certificate permissions.
    case Purge = "purge"
// Recover specifies the recover state for certificate permissions.
    case Recover = "recover"
// Setissuers specifies the setissuers state for certificate permissions.
    case Setissuers = "setissuers"
// Update specifies the update state for certificate permissions.
    case Update = "update"
}


// 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 CheckNameAvailabilityResultData : CheckNameAvailabilityResultProtocol {
    public var nameAvailable: Bool?
    public var reason: ReasonEnum?
    public var message: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCheckNameAvailabilityResultProtocol() -> CheckNameAvailabilityResultProtocol {
    return CheckNameAvailabilityResultData()
  }
}


// CreateMode enumerates the values for create mode.

// 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 CreateModeEnum: String, Codable
{
// CreateModeDefault specifies the create mode default state for create mode.
    case CreateModeDefault = "default"
// CreateModeRecover specifies the create mode recover state for create mode.
    case CreateModeRecover = "recover"
}


// 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 DeletedVaultData : DeletedVaultProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: DeletedVaultPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDeletedVaultProtocol() -> DeletedVaultProtocol {
    return DeletedVaultData()
  }
}


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

extension DataFactory {
  public static func createDeletedVaultListResultProtocol() -> DeletedVaultListResultProtocol {
    return DeletedVaultListResultData()
  }
}


// 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 DeletedVaultPropertiesData : DeletedVaultPropertiesProtocol {
    public var vaultId: String?
    public var location: String?
    public var deletionDate: Date?
    public var scheduledPurgeDate: Date?
    public var tags: [String:String]?

        enum CodingKeys: String, CodingKey {case vaultId = "vaultId"
        case location = "location"
        case deletionDate = "deletionDate"
        case scheduledPurgeDate = "scheduledPurgeDate"
        case tags = "tags"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDeletedVaultPropertiesProtocol() -> DeletedVaultPropertiesProtocol {
    return DeletedVaultPropertiesData()
  }
}


// KeyPermissions enumerates the values for key permissions.

// 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 KeyPermissionsEnum: String, Codable
{
// KeyPermissionsBackup specifies the key permissions backup state for key permissions.
    case KeyPermissionsBackup = "backup"
// KeyPermissionsCreate specifies the key permissions create state for key permissions.
    case KeyPermissionsCreate = "create"
// KeyPermissionsDecrypt specifies the key permissions decrypt state for key permissions.
    case KeyPermissionsDecrypt = "decrypt"
// KeyPermissionsDelete specifies the key permissions delete state for key permissions.
    case KeyPermissionsDelete = "delete"
// KeyPermissionsEncrypt specifies the key permissions encrypt state for key permissions.
    case KeyPermissionsEncrypt = "encrypt"
// KeyPermissionsGet specifies the key permissions get state for key permissions.
    case KeyPermissionsGet = "get"
// KeyPermissionsImport specifies the key permissions import state for key permissions.
    case KeyPermissionsImport = "import"
// KeyPermissionsList specifies the key permissions list state for key permissions.
    case KeyPermissionsList = "list"
// KeyPermissionsPurge specifies the key permissions purge state for key permissions.
    case KeyPermissionsPurge = "purge"
// KeyPermissionsRecover specifies the key permissions recover state for key permissions.
    case KeyPermissionsRecover = "recover"
// KeyPermissionsRestore specifies the key permissions restore state for key permissions.
    case KeyPermissionsRestore = "restore"
// KeyPermissionsSign specifies the key permissions sign state for key permissions.
    case KeyPermissionsSign = "sign"
// KeyPermissionsUnwrapKey specifies the key permissions unwrap key state for key permissions.
    case KeyPermissionsUnwrapKey = "unwrapKey"
// KeyPermissionsUpdate specifies the key permissions update state for key permissions.
    case KeyPermissionsUpdate = "update"
// KeyPermissionsVerify specifies the key permissions verify state for key permissions.
    case KeyPermissionsVerify = "verify"
// KeyPermissionsWrapKey specifies the key permissions wrap key state for key permissions.
    case KeyPermissionsWrapKey = "wrapKey"
}


// 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 LogSpecificationData : LogSpecificationProtocol {
    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 createLogSpecificationProtocol() -> LogSpecificationProtocol {
    return LogSpecificationData()
  }
}


// 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 OperationData : OperationProtocol {
    public var name: String?
    public var display: OperationDisplayProtocol?
    public var origin: String?
    public var operationProperties: OperationPropertiesProtocol?

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

extension DataFactory {
  public static func createOperationProtocol() -> OperationProtocol {
    return OperationData()
  }
}


// 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 OperationDisplayData : OperationDisplayProtocol {
    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 createOperationDisplayProtocol() -> OperationDisplayProtocol {
    return OperationDisplayData()
  }
}


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

extension DataFactory {
  public static func createOperationListResultProtocol() -> OperationListResultProtocol {
    return OperationListResultData()
  }
}


// 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 OperationPropertiesData : OperationPropertiesProtocol {
    public var serviceSpecification: ServiceSpecificationProtocol?

        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(ServiceSpecificationData?.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! ServiceSpecificationData?, forKey: .serviceSpecification)}
  }
}

extension DataFactory {
  public static func createOperationPropertiesProtocol() -> OperationPropertiesProtocol {
    return OperationPropertiesData()
  }
}


// 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 PermissionsData : PermissionsProtocol {
    public var keys: [KeyPermissionsEnum?]?
    public var secrets: [SecretPermissionsEnum?]?
    public var certificates: [CertificatePermissionsEnum?]?
    public var storage: [StoragePermissionsEnum?]?

        enum CodingKeys: String, CodingKey {case keys = "keys"
        case secrets = "secrets"
        case certificates = "certificates"
        case storage = "storage"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.keys) {
        self.keys = try container.decode([KeyPermissionsEnum?]?.self, forKey: .keys)
    }
    if container.contains(.secrets) {
        self.secrets = try container.decode([SecretPermissionsEnum?]?.self, forKey: .secrets)
    }
    if container.contains(.certificates) {
        self.certificates = try container.decode([CertificatePermissionsEnum?]?.self, forKey: .certificates)
    }
    if container.contains(.storage) {
        self.storage = try container.decode([StoragePermissionsEnum?]?.self, forKey: .storage)
    }
    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.keys != nil {try container.encode(self.keys as! [KeyPermissionsEnum?]?, forKey: .keys)}
    if self.secrets != nil {try container.encode(self.secrets as! [SecretPermissionsEnum?]?, forKey: .secrets)}
    if self.certificates != nil {try container.encode(self.certificates as! [CertificatePermissionsEnum?]?, forKey: .certificates)}
    if self.storage != nil {try container.encode(self.storage as! [StoragePermissionsEnum?]?, forKey: .storage)}
  }
}

extension DataFactory {
  public static func createPermissionsProtocol() -> PermissionsProtocol {
    return PermissionsData()
  }
}


// Reason enumerates the values for reason.

// 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 ReasonEnum: String, Codable
{
// AccountNameInvalid specifies the account name invalid state for reason.
    case AccountNameInvalid = "AccountNameInvalid"
// AlreadyExists specifies the already exists state for reason.
    case AlreadyExists = "AlreadyExists"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ResourceData : ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var tags: [String:String]?

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

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

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

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ResourceListResultData : ResourceListResultProtocol {
    public var value: [ResourceProtocol?]?
    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([ResourceData?]?.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! [ResourceData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createResourceListResultProtocol() -> ResourceListResultProtocol {
    return ResourceListResultData()
  }
}


// SecretPermissions enumerates the values for secret permissions.

// 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 SecretPermissionsEnum: String, Codable
{
// SecretPermissionsSet specifies the secret permissions _ set state for secret permissions.
    case SecretPermissionsSet = "set"
// SecretPermissionsBackup specifies the secret permissions backup state for secret permissions.
    case SecretPermissionsBackup = "backup"
// SecretPermissionsDelete specifies the secret permissions delete state for secret permissions.
    case SecretPermissionsDelete = "delete"
// SecretPermissionsGet specifies the secret permissions get state for secret permissions.
    case SecretPermissionsGet = "get"
// SecretPermissionsList specifies the secret permissions list state for secret permissions.
    case SecretPermissionsList = "list"
// SecretPermissionsPurge specifies the secret permissions purge state for secret permissions.
    case SecretPermissionsPurge = "purge"
// SecretPermissionsRecover specifies the secret permissions recover state for secret permissions.
    case SecretPermissionsRecover = "recover"
// SecretPermissionsRestore specifies the secret permissions restore state for secret permissions.
    case SecretPermissionsRestore = "restore"
}


// 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 ServiceSpecificationData : ServiceSpecificationProtocol {
    public var logSpecifications: [LogSpecificationProtocol?]?

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

extension DataFactory {
  public static func createServiceSpecificationProtocol() -> ServiceSpecificationProtocol {
    return ServiceSpecificationData()
  }
}


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

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

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

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

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

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


// SkuName enumerates the values for sku name.

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


// StoragePermissions enumerates the values for storage permissions.

// 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 StoragePermissionsEnum: String, Codable
{
// StoragePermissionsSet specifies the storage permissions _ set state for storage permissions.
    case StoragePermissionsSet = "set"
// StoragePermissionsBackup specifies the storage permissions backup state for storage permissions.
    case StoragePermissionsBackup = "backup"
// StoragePermissionsDelete specifies the storage permissions delete state for storage permissions.
    case StoragePermissionsDelete = "delete"
// StoragePermissionsDeletesas specifies the storage permissions deletesas state for storage permissions.
    case StoragePermissionsDeletesas = "deletesas"
// StoragePermissionsGet specifies the storage permissions get state for storage permissions.
    case StoragePermissionsGet = "get"
// StoragePermissionsGetsas specifies the storage permissions getsas state for storage permissions.
    case StoragePermissionsGetsas = "getsas"
// StoragePermissionsList specifies the storage permissions list state for storage permissions.
    case StoragePermissionsList = "list"
// StoragePermissionsListsas specifies the storage permissions listsas state for storage permissions.
    case StoragePermissionsListsas = "listsas"
// StoragePermissionsPurge specifies the storage permissions purge state for storage permissions.
    case StoragePermissionsPurge = "purge"
// StoragePermissionsRecover specifies the storage permissions recover state for storage permissions.
    case StoragePermissionsRecover = "recover"
// StoragePermissionsRegeneratekey specifies the storage permissions regeneratekey state for storage permissions.
    case StoragePermissionsRegeneratekey = "regeneratekey"
// StoragePermissionsRestore specifies the storage permissions restore state for storage permissions.
    case StoragePermissionsRestore = "restore"
// StoragePermissionsSetsas specifies the storage permissions setsas state for storage permissions.
    case StoragePermissionsSetsas = "setsas"
// StoragePermissionsUpdate specifies the storage permissions update state for storage permissions.
    case StoragePermissionsUpdate = "update"
}


// 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 VaultAccessPolicyParametersData : VaultAccessPolicyParametersProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var properties: VaultAccessPolicyPropertiesProtocol

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

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

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

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

extension DataFactory {
  public static func createVaultAccessPolicyParametersProtocol(properties: VaultAccessPolicyPropertiesProtocol) -> VaultAccessPolicyParametersProtocol {
    return VaultAccessPolicyParametersData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VaultAccessPolicyPropertiesData : VaultAccessPolicyPropertiesProtocol {
    public var accessPolicies: [AccessPolicyEntryProtocol]

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

  public init(accessPolicies: [AccessPolicyEntryProtocol])  {
    self.accessPolicies = accessPolicies
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.accessPolicies as! [AccessPolicyEntryData], forKey: .accessPolicies)
  }
}

extension DataFactory {
  public static func createVaultAccessPolicyPropertiesProtocol(accessPolicies: [AccessPolicyEntryProtocol]) -> VaultAccessPolicyPropertiesProtocol {
    return VaultAccessPolicyPropertiesData(accessPolicies: accessPolicies)
  }
}


// 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 VaultCheckNameAvailabilityParametersData : VaultCheckNameAvailabilityParametersProtocol {
    public var name: String
    public var type: String

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

  public init(name: String, type: String)  {
    self.name = name
    self.type = type
  }

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

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

extension DataFactory {
  public static func createVaultCheckNameAvailabilityParametersProtocol(name: String, type: String) -> VaultCheckNameAvailabilityParametersProtocol {
    return VaultCheckNameAvailabilityParametersData(name: name, type: 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.
import Foundation
import azureSwiftRuntime
internal struct VaultCreateOrUpdateParametersData : VaultCreateOrUpdateParametersProtocol {
    public var location: String
    public var tags: [String:String]?
    public var properties: VaultPropertiesProtocol

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

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

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

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

extension DataFactory {
  public static func createVaultCreateOrUpdateParametersProtocol(location: String, properties: VaultPropertiesProtocol) -> VaultCreateOrUpdateParametersProtocol {
    return VaultCreateOrUpdateParametersData(location: location, properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct VaultData : VaultProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var tags: [String:String]?
    public var properties: VaultPropertiesProtocol

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

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

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

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

extension DataFactory {
  public static func createVaultProtocol(location: String, properties: VaultPropertiesProtocol) -> VaultProtocol {
    return VaultData(location: location, properties: properties)
  }
}