// 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
// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationPropertiesProtocol is describes a virtual machines scale set
// IP Configuration's PublicIPAddress configuration
public protocol VirtualMachineScaleSetUpdatePublicIPAddressConfigurationPropertiesProtocol : Codable {
     var idleTimeoutInMinutes: Int32? { get set }
     var dnsSettings: VirtualMachineScaleSetPublicIPAddressConfigurationDnsSettingsProtocol? { 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
// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProtocol is describes a virtual machines scale set IP
// Configuration's PublicIPAddress configuration
public protocol VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProtocol : Codable {
     var name: String? { get set }
     var properties: VirtualMachineScaleSetUpdatePublicIPAddressConfigurationPropertiesProtocol? { 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
// VirtualMachineScaleSetUpdateStorageProfileProtocol is describes a virtual machine scale set storage profile.
public protocol VirtualMachineScaleSetUpdateStorageProfileProtocol : Codable {
     var imageReference: ImageReferenceProtocol? { get set }
     var osDisk: VirtualMachineScaleSetUpdateOSDiskProtocol? { get set }
     var dataDisks: [VirtualMachineScaleSetDataDiskProtocol?]? { 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
// VirtualMachineScaleSetUpdateVMProfileProtocol is describes a virtual machine scale set virtual machine profile.
public protocol VirtualMachineScaleSetUpdateVMProfileProtocol : Codable {
     var osProfile: VirtualMachineScaleSetUpdateOSProfileProtocol? { get set }
     var storageProfile: VirtualMachineScaleSetUpdateStorageProfileProtocol? { get set }
     var networkProfile: VirtualMachineScaleSetUpdateNetworkProfileProtocol? { get set }
     var diagnosticsProfile: DiagnosticsProfileProtocol? { get set }
     var extensionProfile: VirtualMachineScaleSetExtensionProfileProtocol? { get set }
     var licenseType: 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
// VirtualMachineScaleSetVMExtensionsSummaryProtocol is extensions summary for virtual machines of a virtual machine
// scale set.
public protocol VirtualMachineScaleSetVMExtensionsSummaryProtocol : Codable {
     var name: String? { get set }
     var statusesSummary: [VirtualMachineStatusCodeCountProtocol?]? { 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
// VirtualMachineScaleSetVMInstanceIDsProtocol is specifies a list of virtual machine instance IDs from the VM scale
// set.
public protocol VirtualMachineScaleSetVMInstanceIDsProtocol : Codable {
     var instanceIds: [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
// VirtualMachineScaleSetVMInstanceRequiredIDsProtocol is specifies a list of virtual machine instance IDs from the VM
// scale set.
public protocol VirtualMachineScaleSetVMInstanceRequiredIDsProtocol : Codable {
     var instanceIds: [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
// VirtualMachineScaleSetVMInstanceViewProtocol is the instance view of a virtual machine scale set VM.
public protocol VirtualMachineScaleSetVMInstanceViewProtocol : Codable {
     var platformUpdateDomain: Int32? { get set }
     var platformFaultDomain: Int32? { get set }
     var rdpThumbPrint: String? { get set }
     var vmAgent: VirtualMachineAgentInstanceViewProtocol? { get set }
     var disks: [DiskInstanceViewProtocol?]? { get set }
     var extensions: [VirtualMachineExtensionInstanceViewProtocol?]? { get set }
     var vmHealth: VirtualMachineHealthStatusProtocol? { get set }
     var bootDiagnostics: BootDiagnosticsInstanceViewProtocol? { get set }
     var statuses: [InstanceViewStatusProtocol?]? { get set }
     var placementGroupId: 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
// VirtualMachineScaleSetVMListResultProtocol is the List Virtual Machine Scale Set VMs operation response.
public protocol VirtualMachineScaleSetVMListResultProtocol : Codable {
     var value: [VirtualMachineScaleSetVMProtocol] { 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
// VirtualMachineScaleSetVMProfileProtocol is describes a virtual machine scale set virtual machine profile.
public protocol VirtualMachineScaleSetVMProfileProtocol : Codable {
     var osProfile: VirtualMachineScaleSetOSProfileProtocol? { get set }
     var storageProfile: VirtualMachineScaleSetStorageProfileProtocol? { get set }
     var networkProfile: VirtualMachineScaleSetNetworkProfileProtocol? { get set }
     var diagnosticsProfile: DiagnosticsProfileProtocol? { get set }
     var extensionProfile: VirtualMachineScaleSetExtensionProfileProtocol? { get set }
     var licenseType: String? { get set }
     var priority: VirtualMachinePriorityTypesEnum? { 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
// VirtualMachineScaleSetVMPropertiesProtocol is describes the properties of a virtual machine scale set virtual
// machine.
public protocol VirtualMachineScaleSetVMPropertiesProtocol : Codable {
     var latestModelApplied: Bool? { get set }
     var vmId: String? { get set }
     var instanceView: VirtualMachineInstanceViewProtocol? { get set }
     var hardwareProfile: HardwareProfileProtocol? { get set }
     var storageProfile: StorageProfileProtocol? { get set }
     var osProfile: OSProfileProtocol? { get set }
     var networkProfile: NetworkProfileProtocol? { get set }
     var diagnosticsProfile: DiagnosticsProfileProtocol? { get set }
     var availabilitySet: SubResourceProtocol? { get set }
     var provisioningState: String? { get set }
     var licenseType: 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
// VirtualMachineScaleSetVMProtocol is describes a virtual machine scale set virtual machine.
public protocol VirtualMachineScaleSetVMProtocol : ResourceProtocol {
     var instanceId: String? { get set }
     var sku: SkuProtocol? { get set }
     var properties: VirtualMachineScaleSetVMPropertiesProtocol? { get set }
     var plan: PlanProtocol? { get set }
     var resources: [VirtualMachineExtensionProtocol?]? { 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
// VirtualMachineSizeListResultProtocol is the List Virtual Machine operation response.
public protocol VirtualMachineSizeListResultProtocol : Codable {
     var value: [VirtualMachineSizeProtocol?]? { 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
// VirtualMachineSizeProtocol is describes the properties of a VM size.
public protocol VirtualMachineSizeProtocol : Codable {
     var name: String? { get set }
     var numberOfCores: Int32? { get set }
     var osDiskSizeInMB: Int32? { get set }
     var resourceDiskSizeInMB: Int32? { get set }
     var memoryInMB: Int32? { get set }
     var maxDataDiskCount: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VirtualMachineStatusCodeCountProtocol is the status code and count of the virtual machine scale set instance view
// status summary.
public protocol VirtualMachineStatusCodeCountProtocol : Codable {
     var code: String? { get set }
     var count: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WindowsConfigurationProtocol is specifies Windows operating system settings on the virtual machine.
public protocol WindowsConfigurationProtocol : Codable {
     var provisionVMAgent: Bool? { get set }
     var enableAutomaticUpdates: Bool? { get set }
     var timeZone: String? { get set }
     var additionalUnattendContent: [AdditionalUnattendContentProtocol?]? { get set }
     var winRM: WinRMConfigurationProtocol? { 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
// WinRMConfigurationProtocol is describes Windows Remote Management configuration of the VM
public protocol WinRMConfigurationProtocol : Codable {
     var listeners: [WinRMListenerProtocol?]? { 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
// WinRMListenerProtocol is describes Protocol and thumbprint of Windows Remote Management listener
public protocol WinRMListenerProtocol : Codable {
     var _protocol: ProtocolTypesEnum? { get set }
     var certificateUrl: 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: "cosmosdb",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "cosmosdb",
            targets: ["cosmosdb"]),
    ],
    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: "cosmosdb",
            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.

// Collection is the azure Cosmos DB Database Service Resource Provider REST API
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Collection {
    public static func ListMetricDefinitions(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String) -> CollectionListMetricDefinitions {
        return ListMetricDefinitionsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, databaseRid: databaseRid, collectionRid: collectionRid)
    }
    public static func ListMetrics(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String, filter: String) -> CollectionListMetrics {
        return ListMetricsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, databaseRid: databaseRid, collectionRid: collectionRid, filter: filter)
    }
    public static func ListUsages(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String) -> CollectionListUsages {
        return ListUsagesCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, databaseRid: databaseRid, collectionRid: collectionRid)
    }
}
}


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

extension Commands.Collection {
// ListMetricDefinitions retrieves metric defintions for the given collection.
    internal class ListMetricDefinitionsCommand : BaseCommand, CollectionListMetricDefinitions {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var databaseRid : String
        public var collectionRid : String
        public var apiVersion = "2015-04-08"

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.databaseRid = databaseRid
            self.collectionRid = collectionRid
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(MetricDefinitionsListResultData?.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 (MetricDefinitionsListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: MetricDefinitionsListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Collection {
// ListMetrics retrieves the metrics determined by the given filter for the given database account and collection.
    internal class ListMetricsCommand : BaseCommand, CollectionListMetrics {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var databaseRid : String
        public var collectionRid : String
        public var apiVersion = "2015-04-08"
        public var filter : String

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String, filter: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.databaseRid = databaseRid
            self.collectionRid = collectionRid
            self.filter = filter
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(MetricListResultData?.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 (MetricListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: MetricListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Collection {
// ListUsages retrieves the usages (most recent storage data) for the given collection.
    internal class ListUsagesCommand : BaseCommand, CollectionListUsages {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var databaseRid : String
        public var collectionRid : String
        public var apiVersion = "2015-04-08"
        public var filter : String?

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.databaseRid = databaseRid
            self.collectionRid = collectionRid
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(UsagesResultData?.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 (UsagesResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: UsagesResultData?, 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.

// CollectionPartition is the azure Cosmos DB Database Service Resource Provider REST API
import Foundation
import azureSwiftRuntime
extension Commands {
public struct CollectionPartition {
    public static func ListMetrics(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String, filter: String) -> CollectionPartitionListMetrics {
        return ListMetricsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, databaseRid: databaseRid, collectionRid: collectionRid, filter: filter)
    }
    public static func ListUsages(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String) -> CollectionPartitionListUsages {
        return ListUsagesCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, databaseRid: databaseRid, collectionRid: collectionRid)
    }
}
}


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

extension Commands.CollectionPartition {
// ListMetrics retrieves the metrics determined by the given filter for the given collection, split by partition.
    internal class ListMetricsCommand : BaseCommand, CollectionPartitionListMetrics {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var databaseRid : String
        public var collectionRid : String
        public var apiVersion = "2015-04-08"
        public var filter : String

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String, filter: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.databaseRid = databaseRid
            self.collectionRid = collectionRid
            self.filter = filter
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(PartitionMetricListResultData?.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 (PartitionMetricListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: PartitionMetricListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.CollectionPartition {
// ListUsages retrieves the usages (most recent storage data) for the given collection, split by partition.
    internal class ListUsagesCommand : BaseCommand, CollectionPartitionListUsages {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var databaseRid : String
        public var collectionRid : String
        public var apiVersion = "2015-04-08"
        public var filter : String?

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, collectionRid: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.databaseRid = databaseRid
            self.collectionRid = collectionRid
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(PartitionUsagesResultData?.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 (PartitionUsagesResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: PartitionUsagesResultData?, 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.

// CollectionPartitionRegion is the azure Cosmos DB Database Service Resource Provider REST API
import Foundation
import azureSwiftRuntime
extension Commands {
public struct CollectionPartitionRegion {
    public static func ListMetrics(subscriptionId: String, resourceGroupName: String, accountName: String, region: String, databaseRid: String, collectionRid: String, filter: String) -> CollectionPartitionRegionListMetrics {
        return ListMetricsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, region: region, databaseRid: databaseRid, collectionRid: collectionRid, filter: filter)
    }
}
}


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

extension Commands.CollectionPartitionRegion {
// ListMetrics retrieves the metrics determined by the given filter for the given collection and region, split by
// partition.
    internal class ListMetricsCommand : BaseCommand, CollectionPartitionRegionListMetrics {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var region : String
        public var databaseRid : String
        public var collectionRid : String
        public var apiVersion = "2015-04-08"
        public var filter : String

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, region: String, databaseRid: String, collectionRid: String, filter: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.region = region
            self.databaseRid = databaseRid
            self.collectionRid = collectionRid
            self.filter = filter
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{accountName}"] = String(describing: self.accountName)
            self.pathParameters["{region}"] = String(describing: self.region)
            self.pathParameters["{databaseRid}"] = String(describing: self.databaseRid)
            self.pathParameters["{collectionRid}"] = String(describing: self.collectionRid)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.queryParameters["$filter"] = String(describing: self.filter)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(PartitionMetricListResultData?.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 (PartitionMetricListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: PartitionMetricListResultData?, 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.

// CollectionRegion is the azure Cosmos DB Database Service Resource Provider REST API
import Foundation
import azureSwiftRuntime
extension Commands {
public struct CollectionRegion {
    public static func ListMetrics(subscriptionId: String, resourceGroupName: String, accountName: String, region: String, databaseRid: String, collectionRid: String, filter: String) -> CollectionRegionListMetrics {
        return ListMetricsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, region: region, databaseRid: databaseRid, collectionRid: collectionRid, filter: filter)
    }
}
}


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

extension Commands.CollectionRegion {
// ListMetrics retrieves the metrics determined by the given filter for the given database account, collection and
// region.
    internal class ListMetricsCommand : BaseCommand, CollectionRegionListMetrics {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var region : String
        public var databaseRid : String
        public var collectionRid : String
        public var apiVersion = "2015-04-08"
        public var filter : String

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, region: String, databaseRid: String, collectionRid: String, filter: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.region = region
            self.databaseRid = databaseRid
            self.collectionRid = collectionRid
            self.filter = filter
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{accountName}"] = String(describing: self.accountName)
            self.pathParameters["{region}"] = String(describing: self.region)
            self.pathParameters["{databaseRid}"] = String(describing: self.databaseRid)
            self.pathParameters["{collectionRid}"] = String(describing: self.collectionRid)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.queryParameters["$filter"] = String(describing: self.filter)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(MetricListResultData?.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 (MetricListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: MetricListResultData?, 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.

// Database is the azure Cosmos DB Database Service Resource Provider REST API
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Database {
    public static func ListMetricDefinitions(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String) -> DatabaseListMetricDefinitions {
        return ListMetricDefinitionsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, databaseRid: databaseRid)
    }
    public static func ListMetrics(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String, filter: String) -> DatabaseListMetrics {
        return ListMetricsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, databaseRid: databaseRid, filter: filter)
    }
    public static func ListUsages(subscriptionId: String, resourceGroupName: String, accountName: String, databaseRid: String) -> DatabaseListUsages {
        return ListUsagesCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, databaseRid: databaseRid)
    }
}
}


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

// DatabaseAccountRegion is the azure Cosmos DB Database Service Resource Provider REST API
import Foundation
import azureSwiftRuntime
extension Commands {
public struct DatabaseAccountRegion {
    public static func ListMetrics(subscriptionId: String, resourceGroupName: String, accountName: String, region: String, filter: String) -> DatabaseAccountRegionListMetrics {
        return ListMetricsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, region: region, filter: filter)
    }
}
}


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

extension Commands.DatabaseAccountRegion {
// ListMetrics retrieves the metrics determined by the given filter for the given database account and region.
    internal class ListMetricsCommand : BaseCommand, DatabaseAccountRegionListMetrics {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var region : String
        public var apiVersion = "2015-04-08"
        public var filter : String

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

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(MetricListResultData?.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 (MetricListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: MetricListResultData?, 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.

// DatabaseAccounts is the azure Cosmos DB Database Service Resource Provider REST API
import Foundation
import azureSwiftRuntime
extension Commands {
public struct DatabaseAccounts {
    public static func CheckNameExists(accountName: String) -> DatabaseAccountsCheckNameExists {
        return CheckNameExistsCommand(accountName: accountName)
    }
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, accountName: String, createUpdateParameters: DatabaseAccountCreateUpdateParametersProtocol) -> DatabaseAccountsCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, createUpdateParameters: createUpdateParameters)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, accountName: String) -> DatabaseAccountsDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName)
    }
    public static func FailoverPriorityChange(subscriptionId: String, resourceGroupName: String, accountName: String, failoverParameters: FailoverPoliciesProtocol) -> DatabaseAccountsFailoverPriorityChange {
        return FailoverPriorityChangeCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, failoverParameters: failoverParameters)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, accountName: String) -> DatabaseAccountsGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName)
    }
    public static func List(subscriptionId: String) -> DatabaseAccountsList {
        return ListCommand(subscriptionId: subscriptionId)
    }
    public static func ListByResourceGroup(resourceGroupName: String, subscriptionId: String) -> DatabaseAccountsListByResourceGroup {
        return ListByResourceGroupCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func ListConnectionStrings(subscriptionId: String, resourceGroupName: String, accountName: String) -> DatabaseAccountsListConnectionStrings {
        return ListConnectionStringsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName)
    }
    public static func ListKeys(subscriptionId: String, resourceGroupName: String, accountName: String) -> DatabaseAccountsListKeys {
        return ListKeysCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName)
    }
    public static func ListMetricDefinitions(subscriptionId: String, resourceGroupName: String, accountName: String) -> DatabaseAccountsListMetricDefinitions {
        return ListMetricDefinitionsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName)
    }
    public static func ListMetrics(subscriptionId: String, resourceGroupName: String, accountName: String, filter: String) -> DatabaseAccountsListMetrics {
        return ListMetricsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, filter: filter)
    }
    public static func ListReadOnlyKeys(subscriptionId: String, resourceGroupName: String, accountName: String) -> DatabaseAccountsListReadOnlyKeys {
        return ListReadOnlyKeysCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName)
    }
    public static func ListUsages(subscriptionId: String, resourceGroupName: String, accountName: String) -> DatabaseAccountsListUsages {
        return ListUsagesCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName)
    }
    public static func Patch(subscriptionId: String, resourceGroupName: String, accountName: String, updateParameters: DatabaseAccountPatchParametersProtocol) -> DatabaseAccountsPatch {
        return PatchCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, updateParameters: updateParameters)
    }
    public static func RegenerateKey(subscriptionId: String, resourceGroupName: String, accountName: String, keyToRegenerate: DatabaseAccountRegenerateKeyParametersProtocol) -> DatabaseAccountsRegenerateKey {
        return RegenerateKeyCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, accountName: accountName, keyToRegenerate: keyToRegenerate)
    }
}
}


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

extension Commands.DatabaseAccounts {
// CheckNameExists checks that the Azure Cosmos DB account name already exists. A valid account name may contain only
// lowercase letters, numbers, and the '-' character, and must be between 3 and 50 characters.
    internal class CheckNameExistsCommand : BaseCommand, DatabaseAccountsCheckNameExists {
        public var accountName : String
        public var apiVersion = "2015-04-08"

        public init(accountName: String) {
            self.accountName = accountName
            super.init()
            self.method = "Head"
            self.isLongRunningOperation = false
            self.path = "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

extension Commands.DatabaseAccounts {
// CreateOrUpdate creates or updates an Azure Cosmos DB database account. 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 CreateOrUpdateCommand : BaseCommand, DatabaseAccountsCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"
    public var createUpdateParameters :  DatabaseAccountCreateUpdateParametersProtocol?

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, createUpdateParameters: DatabaseAccountCreateUpdateParametersProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.createUpdateParameters = createUpdateParameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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


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

extension Commands.DatabaseAccounts {
// Delete deletes an existing Azure Cosmos DB database account. 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 DeleteCommand : BaseCommand, DatabaseAccountsDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"

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

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

extension Commands.DatabaseAccounts {
// FailoverPriorityChange changes the failover priority for the Azure Cosmos DB database account. A failover priority
// of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover
// priority values must be unique for each of the regions in which the database account exists. 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 FailoverPriorityChangeCommand : BaseCommand, DatabaseAccountsFailoverPriorityChange {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"
    public var failoverParameters :  FailoverPoliciesProtocol?

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, failoverParameters: FailoverPoliciesProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.failoverParameters = failoverParameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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

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


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

extension Commands.DatabaseAccounts {
// Get retrieves the properties of an existing Azure Cosmos DB database account.
    internal class GetCommand : BaseCommand, DatabaseAccountsGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"

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

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


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

extension Commands.DatabaseAccounts {
// List lists all the Azure Cosmos DB database accounts available under the subscription.
    internal class ListCommand : BaseCommand, DatabaseAccountsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2015-04-08"

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


import Foundation
import azureSwiftRuntime
public protocol DatabaseAccountsListByResourceGroup  {
    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 apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (DatabaseAccountsListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.DatabaseAccounts {
// ListByResourceGroup lists all the Azure Cosmos DB database accounts available under the given resource group.
    internal class ListByResourceGroupCommand : BaseCommand, DatabaseAccountsListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2015-04-08"

        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.DocumentDB/databaseAccounts"
            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)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(DatabaseAccountsListResultData?.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 (DatabaseAccountsListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: DatabaseAccountsListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.DatabaseAccounts {
// ListConnectionStrings lists the connection strings for the specified Azure Cosmos DB database account.
    internal class ListConnectionStringsCommand : BaseCommand, DatabaseAccountsListConnectionStrings {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"

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

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


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

extension Commands.DatabaseAccounts {
// ListKeys lists the access keys for the specified Azure Cosmos DB database account.
    internal class ListKeysCommand : BaseCommand, DatabaseAccountsListKeys {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"

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

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


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

extension Commands.DatabaseAccounts {
// ListMetricDefinitions retrieves metric defintions for the given database account.
    internal class ListMetricDefinitionsCommand : BaseCommand, DatabaseAccountsListMetricDefinitions {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"

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

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(MetricDefinitionsListResultData?.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 (MetricDefinitionsListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: MetricDefinitionsListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.DatabaseAccounts {
// ListMetrics retrieves the metrics determined by the given filter for the given database account.
    internal class ListMetricsCommand : BaseCommand, DatabaseAccountsListMetrics {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"
        public var filter : String

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

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(MetricListResultData?.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 (MetricListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: MetricListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.DatabaseAccounts {
// ListReadOnlyKeys lists the read-only access keys for the specified Azure Cosmos DB database account.
    internal class ListReadOnlyKeysCommand : BaseCommand, DatabaseAccountsListReadOnlyKeys {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"

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

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


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

extension Commands.DatabaseAccounts {
// ListUsages retrieves the usages (most recent data) for the given database account.
    internal class ListUsagesCommand : BaseCommand, DatabaseAccountsListUsages {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"
        public var filter : String?

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

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(UsagesResultData?.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 (UsagesResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: UsagesResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.DatabaseAccounts {
// Patch patches the properties of an existing Azure Cosmos DB database account. 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 PatchCommand : BaseCommand, DatabaseAccountsPatch {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var accountName : String
        public var apiVersion = "2015-04-08"
    public var updateParameters :  DatabaseAccountPatchParametersProtocol?

        public init(subscriptionId: String, resourceGroupName: String, accountName: String, updateParameters: DatabaseAccountPatchParametersProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.accountName = accountName
            self.updateParameters = updateParameters
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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