// 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
// VirtualNetworkGatewayConnectionListEntityPropertiesFormatProtocol is virtualNetworkGatewayConnection properties
public protocol VirtualNetworkGatewayConnectionListEntityPropertiesFormatProtocol : Codable {
     var authorizationKey: String? { get set }
     var virtualNetworkGateway1: VirtualNetworkConnectionGatewayReferenceProtocol { get set }
     var virtualNetworkGateway2: VirtualNetworkConnectionGatewayReferenceProtocol? { get set }
     var localNetworkGateway2: VirtualNetworkConnectionGatewayReferenceProtocol? { get set }
     var connectionType: VirtualNetworkGatewayConnectionTypeEnum { get set }
     var routingWeight: Int32? { get set }
     var sharedKey: String? { get set }
     var connectionStatus: VirtualNetworkGatewayConnectionStatusEnum? { get set }
     var tunnelConnectionStatus: [TunnelConnectionHealthProtocol?]? { get set }
     var egressBytesTransferred: Int64? { get set }
     var ingressBytesTransferred: Int64? { get set }
     var peer: SubResourceProtocol? { get set }
     var enableBgp: Bool? { get set }
     var usePolicyBasedTrafficSelectors: Bool? { get set }
     var ipsecPolicies: [IpsecPolicyProtocol?]? { get set }
     var resourceGuid: String? { get set }
     var provisioningState: 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
// VirtualNetworkGatewayConnectionListEntityProtocol is a common class for general resource information
public protocol VirtualNetworkGatewayConnectionListEntityProtocol : ResourceProtocol {
     var properties: VirtualNetworkGatewayConnectionListEntityPropertiesFormatProtocol { get set }
     var etag: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VirtualNetworkGatewayConnectionListResultProtocol is response for the ListVirtualNetworkGatewayConnections API
// service call
public protocol VirtualNetworkGatewayConnectionListResultProtocol : Codable {
     var value: [VirtualNetworkGatewayConnectionProtocol?]? { 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
// VirtualNetworkGatewayConnectionPropertiesFormatProtocol is virtualNetworkGatewayConnection properties
public protocol VirtualNetworkGatewayConnectionPropertiesFormatProtocol : Codable {
     var authorizationKey: String? { get set }
     var virtualNetworkGateway1: VirtualNetworkGatewayProtocol { get set }
     var virtualNetworkGateway2: VirtualNetworkGatewayProtocol? { get set }
     var localNetworkGateway2: LocalNetworkGatewayProtocol? { get set }
     var connectionType: VirtualNetworkGatewayConnectionTypeEnum { get set }
     var routingWeight: Int32? { get set }
     var sharedKey: String? { get set }
     var connectionStatus: VirtualNetworkGatewayConnectionStatusEnum? { get set }
     var tunnelConnectionStatus: [TunnelConnectionHealthProtocol?]? { get set }
     var egressBytesTransferred: Int64? { get set }
     var ingressBytesTransferred: Int64? { get set }
     var peer: SubResourceProtocol? { get set }
     var enableBgp: Bool? { get set }
     var usePolicyBasedTrafficSelectors: Bool? { get set }
     var ipsecPolicies: [IpsecPolicyProtocol?]? { get set }
     var resourceGuid: String? { get set }
     var provisioningState: 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
// VirtualNetworkGatewayConnectionProtocol is a common class for general resource information
public protocol VirtualNetworkGatewayConnectionProtocol : ResourceProtocol {
     var properties: VirtualNetworkGatewayConnectionPropertiesFormatProtocol { get set }
     var etag: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VirtualNetworkGatewayIPConfigurationPropertiesFormatProtocol is properties of VirtualNetworkGatewayIPConfiguration
public protocol VirtualNetworkGatewayIPConfigurationPropertiesFormatProtocol : Codable {
     var privateIPAllocationMethod: IPAllocationMethodEnum? { get set }
     var subnet: SubResourceProtocol? { get set }
     var publicIPAddress: SubResourceProtocol? { get set }
     var provisioningState: 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
// VirtualNetworkGatewayIPConfigurationProtocol is IP configuration for virtual network gateway
public protocol VirtualNetworkGatewayIPConfigurationProtocol : SubResourceProtocol {
     var properties: VirtualNetworkGatewayIPConfigurationPropertiesFormatProtocol? { get set }
     var name: String? { get set }
     var etag: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VirtualNetworkGatewayListConnectionsResultProtocol is response for the VirtualNetworkGatewayListConnections API
// service call
public protocol VirtualNetworkGatewayListConnectionsResultProtocol : Codable {
     var value: [VirtualNetworkGatewayConnectionListEntityProtocol?]? { 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
// VirtualNetworkGatewayListResultProtocol is response for the ListVirtualNetworkGateways API service call.
public protocol VirtualNetworkGatewayListResultProtocol : Codable {
     var value: [VirtualNetworkGatewayProtocol?]? { 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
// VirtualNetworkGatewayPropertiesFormatProtocol is virtualNetworkGateway properties
public protocol VirtualNetworkGatewayPropertiesFormatProtocol : Codable {
     var ipConfigurations: [VirtualNetworkGatewayIPConfigurationProtocol?]? { get set }
     var gatewayType: VirtualNetworkGatewayTypeEnum? { get set }
     var vpnType: VpnTypeEnum? { get set }
     var enableBgp: Bool? { get set }
     var activeActive: Bool? { get set }
     var gatewayDefaultSite: SubResourceProtocol? { get set }
     var sku: VirtualNetworkGatewaySkuProtocol? { get set }
     var vpnClientConfiguration: VpnClientConfigurationProtocol? { get set }
     var bgpSettings: BgpSettingsProtocol? { get set }
     var resourceGuid: String? { get set }
     var provisioningState: 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
// VirtualNetworkGatewayProtocol is a common class for general resource information
public protocol VirtualNetworkGatewayProtocol : ResourceProtocol {
     var properties: VirtualNetworkGatewayPropertiesFormatProtocol { get set }
     var etag: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VirtualNetworkGatewaySkuProtocol is virtualNetworkGatewaySku details
public protocol VirtualNetworkGatewaySkuProtocol : Codable {
     var name: VirtualNetworkGatewaySkuNameEnum? { get set }
     var tier: VirtualNetworkGatewaySkuTierEnum? { get set }
     var capacity: 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
// VirtualNetworkListResultProtocol is response for the ListVirtualNetworks API service call.
public protocol VirtualNetworkListResultProtocol : Codable {
     var value: [VirtualNetworkProtocol?]? { 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
// VirtualNetworkListUsageResultProtocol is response for the virtual networks GetUsage API service call.
public protocol VirtualNetworkListUsageResultProtocol : Codable {
     var value: [VirtualNetworkUsageProtocol?]? { 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
// VirtualNetworkPeeringListResultProtocol is response for ListSubnets API service call. Retrieves all subnets that
// belong to a virtual network.
public protocol VirtualNetworkPeeringListResultProtocol : Codable {
     var value: [VirtualNetworkPeeringProtocol?]? { 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
// VirtualNetworkPeeringPropertiesFormatProtocol is properties of the virtual network peering.
public protocol VirtualNetworkPeeringPropertiesFormatProtocol : Codable {
     var allowVirtualNetworkAccess: Bool? { get set }
     var allowForwardedTraffic: Bool? { get set }
     var allowGatewayTransit: Bool? { get set }
     var useRemoteGateways: Bool? { get set }
     var remoteVirtualNetwork: SubResourceProtocol? { get set }
     var remoteAddressSpace: AddressSpaceProtocol? { get set }
     var peeringState: VirtualNetworkPeeringStateEnum? { get set }
     var provisioningState: 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
// VirtualNetworkPeeringProtocol is peerings in a virtual network resource.
public protocol VirtualNetworkPeeringProtocol : SubResourceProtocol {
     var properties: VirtualNetworkPeeringPropertiesFormatProtocol? { get set }
     var name: String? { get set }
     var etag: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VirtualNetworkPropertiesFormatProtocol is properties of the virtual network.
public protocol VirtualNetworkPropertiesFormatProtocol : Codable {
     var addressSpace: AddressSpaceProtocol? { get set }
     var dhcpOptions: DhcpOptionsProtocol? { get set }
     var subnets: [SubnetProtocol?]? { get set }
     var virtualNetworkPeerings: [VirtualNetworkPeeringProtocol?]? { get set }
     var resourceGuid: String? { get set }
     var provisioningState: String? { get set }
     var enableDdosProtection: Bool? { get set }
     var enableVmProtection: Bool? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VirtualNetworkProtocol is virtual Network resource.
public protocol VirtualNetworkProtocol : ResourceProtocol {
     var properties: VirtualNetworkPropertiesFormatProtocol? { get set }
     var etag: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VirtualNetworkUsageNameProtocol is usage strings container.
public protocol VirtualNetworkUsageNameProtocol : Codable {
     var localizedValue: String? { get set }
     var value: 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
// VirtualNetworkUsageProtocol is usage details for subnet.
public protocol VirtualNetworkUsageProtocol : Codable {
     var currentValue: Double? { get set }
     var id: String? { get set }
     var limit: Double? { get set }
     var name: VirtualNetworkUsageNameProtocol? { get set }
     var unit: 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
// VpnClientConfigurationProtocol is vpnClientConfiguration for P2S client.
public protocol VpnClientConfigurationProtocol : Codable {
     var vpnClientAddressPool: AddressSpaceProtocol? { get set }
     var vpnClientRootCertificates: [VpnClientRootCertificateProtocol?]? { get set }
     var vpnClientRevokedCertificates: [VpnClientRevokedCertificateProtocol?]? { get set }
     var vpnClientProtocols: [VpnClientProtocolEnum?]? { get set }
     var radiusServerAddress: String? { get set }
     var radiusServerSecret: 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
// VpnClientParametersProtocol is vpn Client Parameters for package generation
public protocol VpnClientParametersProtocol : Codable {
     var processorArchitecture: ProcessorArchitectureEnum? { get set }
     var authenticationMethod: AuthenticationMethodEnum? { get set }
     var radiusServerAuthCertificate: String? { get set }
     var clientRootCertificates: [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
// VpnClientRevokedCertificatePropertiesFormatProtocol is properties of the revoked VPN client certificate of virtual
// network gateway.
public protocol VpnClientRevokedCertificatePropertiesFormatProtocol : Codable {
     var thumbprint: String? { get set }
     var provisioningState: 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
// VpnClientRevokedCertificateProtocol is VPN client revoked certificate of virtual network gateway.
public protocol VpnClientRevokedCertificateProtocol : SubResourceProtocol {
     var properties: VpnClientRevokedCertificatePropertiesFormatProtocol? { get set }
     var name: String? { get set }
     var etag: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VpnClientRootCertificatePropertiesFormatProtocol is properties of SSL certificates of application gateway
public protocol VpnClientRootCertificatePropertiesFormatProtocol : Codable {
     var publicCertData: String { get set }
     var provisioningState: 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
// VpnClientRootCertificateProtocol is VPN client root certificate of virtual network gateway
public protocol VpnClientRootCertificateProtocol : SubResourceProtocol {
     var properties: VpnClientRootCertificatePropertiesFormatProtocol { get set }
     var name: String? { get set }
     var etag: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VpnDeviceScriptParametersProtocol is vpn device configuration script generation parameters
public protocol VpnDeviceScriptParametersProtocol : Codable {
     var vendor: String? { get set }
     var deviceFamily: String? { get set }
     var firmwareVersion: 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: "notificationhubs",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "notificationhubs",
            targets: ["notificationhubs"]),
    ],
    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: "notificationhubs",
            dependencies: ["Alamofire", "RxSwift", "SwiftyJSON", "azureSwiftRuntime"])
    ]
)


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public class DataFactory {
}
public class Commands {
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.

// Hubs is the azure NotificationHub client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Hubs {
    public static func CheckAvailability(resourceGroupName: String, namespaceName: String, subscriptionId: String, parameters: CheckNameAvailabilityRequestParametersProtocol) -> HubsCheckAvailability {
        return CheckAvailabilityCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, subscriptionId: subscriptionId, parameters: parameters)
    }
}
}


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

extension Commands.Hubs {
// CheckAvailability checks the availability of the given notificationHub in a namespace.
    internal class CheckAvailabilityCommand : BaseCommand, HubsCheckAvailability {
        public var resourceGroupName : String
        public var namespaceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  CheckNameAvailabilityRequestParametersProtocol?

        public init(resourceGroupName: String, namespaceName: String, subscriptionId: String, parameters: CheckNameAvailabilityRequestParametersProtocol) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkHubAvailability"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? CheckNameAvailabilityRequestParametersData)
                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(CheckNameAvailabilityResponseData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CheckNameAvailabilityResponseProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: CheckNameAvailabilityResponseData?, 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.

// Name is the azure NotificationHub client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Name {
    public static func CheckAvailability(subscriptionId: String, parameters: CheckNameAvailabilityRequestParametersProtocol) -> NameCheckAvailability {
        return CheckAvailabilityCommand(subscriptionId: subscriptionId, parameters: parameters)
    }
}
}


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

extension Commands.Name {
// CheckAvailability checks the availability of the given service namespace across all Azure subscriptions. This is
// useful because the domain name is created based on the service namespace name.
    internal class CheckAvailabilityCommand : BaseCommand, NameCheckAvailability {
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  CheckNameAvailabilityRequestParametersProtocol?

        public init(subscriptionId: String, parameters: CheckNameAvailabilityRequestParametersProtocol) {
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNameAvailability"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? CheckNameAvailabilityRequestParametersData)
                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(CheckNameAvailabilityResponseData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CheckNameAvailabilityResponseProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: CheckNameAvailabilityResponseData?, 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.

// Namespaces is the azure NotificationHub client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Namespaces {
    public static func CheckAvailability(subscriptionId: String, parameters: CheckAvailabilityParametersProtocol) -> NamespacesCheckAvailability {
        return CheckAvailabilityCommand(subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func CreateOrUpdate(resourceGroupName: String, namespaceName: String, subscriptionId: String, parameters: NamespaceCreateOrUpdateParametersProtocol) -> NamespacesCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func CreateOrUpdateAuthorizationRule(resourceGroupName: String, namespaceName: String, authorizationRuleName: String, subscriptionId: String, parameters: SharedAccessAuthorizationRuleCreateOrUpdateParametersProtocol) -> NamespacesCreateOrUpdateAuthorizationRule {
        return CreateOrUpdateAuthorizationRuleCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, namespaceName: String, subscriptionId: String) -> NamespacesDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, subscriptionId: subscriptionId)
    }
    public static func DeleteAuthorizationRule(resourceGroupName: String, namespaceName: String, authorizationRuleName: String, subscriptionId: String) -> NamespacesDeleteAuthorizationRule {
        return DeleteAuthorizationRuleCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, namespaceName: String, subscriptionId: String) -> NamespacesGet {
        return GetCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, subscriptionId: subscriptionId)
    }
    public static func GetAuthorizationRule(resourceGroupName: String, namespaceName: String, authorizationRuleName: String, subscriptionId: String) -> NamespacesGetAuthorizationRule {
        return GetAuthorizationRuleCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId)
    }
    public static func List(resourceGroupName: String, subscriptionId: String) -> NamespacesList {
        return ListCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func ListAll(subscriptionId: String) -> NamespacesListAll {
        return ListAllCommand(subscriptionId: subscriptionId)
    }
    public static func ListAuthorizationRules(resourceGroupName: String, namespaceName: String, subscriptionId: String) -> NamespacesListAuthorizationRules {
        return ListAuthorizationRulesCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, subscriptionId: subscriptionId)
    }
    public static func ListKeys(resourceGroupName: String, namespaceName: String, authorizationRuleName: String, subscriptionId: String) -> NamespacesListKeys {
        return ListKeysCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId)
    }
    public static func Patch(resourceGroupName: String, namespaceName: String, subscriptionId: String, parameters: NamespacePatchParametersProtocol) -> NamespacesPatch {
        return PatchCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func RegenerateKeys(resourceGroupName: String, namespaceName: String, authorizationRuleName: String, subscriptionId: String, parameters: PolicykeyResourceProtocol) -> NamespacesRegenerateKeys {
        return RegenerateKeysCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId, parameters: parameters)
    }
}
}


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

extension Commands.Namespaces {
// CheckAvailability checks the availability of the given service namespace across all Azure subscriptions. This is
// useful because the domain name is created based on the service namespace name.
    internal class CheckAvailabilityCommand : BaseCommand, NamespacesCheckAvailability {
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  CheckAvailabilityParametersProtocol?

        public init(subscriptionId: String, parameters: CheckAvailabilityParametersProtocol) {
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.NotificationHubs/checkNamespaceAvailability"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? CheckAvailabilityParametersData)
                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(CheckAvailabilityResultData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CheckAvailabilityResultProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: CheckAvailabilityResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Namespaces {
// CreateOrUpdate creates/Updates a service namespace. Once created, this namespace's resource manifest is immutable.
// This operation is idempotent.
    internal class CreateOrUpdateCommand : BaseCommand, NamespacesCreateOrUpdate {
        public var resourceGroupName : String
        public var namespaceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  NamespaceCreateOrUpdateParametersProtocol?

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

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? NamespaceCreateOrUpdateParametersData)
                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(NamespaceResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (NamespaceResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: NamespaceResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Namespaces {
// CreateOrUpdateAuthorizationRule creates an authorization rule for a namespace
    internal class CreateOrUpdateAuthorizationRuleCommand : BaseCommand, NamespacesCreateOrUpdateAuthorizationRule {
        public var resourceGroupName : String
        public var namespaceName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  SharedAccessAuthorizationRuleCreateOrUpdateParametersProtocol?

        public init(resourceGroupName: String, namespaceName: String, authorizationRuleName: String, subscriptionId: String, parameters: SharedAccessAuthorizationRuleCreateOrUpdateParametersProtocol) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.authorizationRuleName = authorizationRuleName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? SharedAccessAuthorizationRuleCreateOrUpdateParametersData)
                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(SharedAccessAuthorizationRuleResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (SharedAccessAuthorizationRuleResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: SharedAccessAuthorizationRuleResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Namespaces {
// Delete deletes an existing namespace. This operation also removes all associated notificationHubs under the
// namespace. 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, NamespacesDelete {
        public var resourceGroupName : String
        public var namespaceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.Namespaces {
// DeleteAuthorizationRule deletes a namespace authorization rule
    internal class DeleteAuthorizationRuleCommand : BaseCommand, NamespacesDeleteAuthorizationRule {
        public var resourceGroupName : String
        public var namespaceName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.Namespaces {
// Get returns the description for the specified namespace.
    internal class GetCommand : BaseCommand, NamespacesGet {
        public var resourceGroupName : String
        public var namespaceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.Namespaces {
// GetAuthorizationRule gets an authorization rule for a namespace by name.
    internal class GetAuthorizationRuleCommand : BaseCommand, NamespacesGetAuthorizationRule {
        public var resourceGroupName : String
        public var namespaceName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.Namespaces {
// List lists the available namespaces within a resourceGroup.
    internal class ListCommand : BaseCommand, NamespacesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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


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

extension Commands.Namespaces {
// ListAll lists all the available namespaces within the subscription irrespective of the resourceGroups.
    internal class ListAllCommand : BaseCommand, NamespacesListAll {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.Namespaces {
// ListAuthorizationRules gets the authorization rules for a namespace.
    internal class ListAuthorizationRulesCommand : BaseCommand, NamespacesListAuthorizationRules {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var namespaceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.Namespaces {
// ListKeys gets the Primary and Secondary ConnectionStrings to the namespace
    internal class ListKeysCommand : BaseCommand, NamespacesListKeys {
        public var resourceGroupName : String
        public var namespaceName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.Namespaces {
// Patch patches the existing namespace
    internal class PatchCommand : BaseCommand, NamespacesPatch {
        public var resourceGroupName : String
        public var namespaceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  NamespacePatchParametersProtocol?

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

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? NamespacePatchParametersData)
                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(NamespaceResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (NamespaceResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: NamespaceResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Namespaces {
// RegenerateKeys regenerates the Primary/Secondary Keys to the Namespace Authorization Rule
    internal class RegenerateKeysCommand : BaseCommand, NamespacesRegenerateKeys {
        public var resourceGroupName : String
        public var namespaceName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  PolicykeyResourceProtocol?

        public init(resourceGroupName: String, namespaceName: String, authorizationRuleName: String, subscriptionId: String, parameters: PolicykeyResourceProtocol) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.authorizationRuleName = authorizationRuleName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}/regenerateKeys"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? PolicykeyResourceData)
                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(ResourceListKeysData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ResourceListKeysProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: ResourceListKeysData?, 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.

// NotificationHubs is the azure NotificationHub client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct NotificationHubs {
    public static func CheckAvailability(resourceGroupName: String, namespaceName: String, subscriptionId: String, parameters: CheckAvailabilityParametersProtocol) -> NotificationHubsCheckAvailability {
        return CheckAvailabilityCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func CreateOrUpdate(resourceGroupName: String, namespaceName: String, notificationHubName: String, subscriptionId: String, parameters: NotificationHubCreateOrUpdateParametersProtocol) -> NotificationHubsCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func CreateOrUpdateAuthorizationRule(resourceGroupName: String, namespaceName: String, notificationHubName: String, authorizationRuleName: String, subscriptionId: String, parameters: SharedAccessAuthorizationRuleCreateOrUpdateParametersProtocol) -> NotificationHubsCreateOrUpdateAuthorizationRule {
        return CreateOrUpdateAuthorizationRuleCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, namespaceName: String, notificationHubName: String, subscriptionId: String) -> NotificationHubsDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, subscriptionId: subscriptionId)
    }
    public static func DeleteAuthorizationRule(resourceGroupName: String, namespaceName: String, notificationHubName: String, authorizationRuleName: String, subscriptionId: String) -> NotificationHubsDeleteAuthorizationRule {
        return DeleteAuthorizationRuleCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, namespaceName: String, notificationHubName: String, subscriptionId: String) -> NotificationHubsGet {
        return GetCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, subscriptionId: subscriptionId)
    }
    public static func GetAuthorizationRule(resourceGroupName: String, namespaceName: String, notificationHubName: String, authorizationRuleName: String, subscriptionId: String) -> NotificationHubsGetAuthorizationRule {
        return GetAuthorizationRuleCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId)
    }
    public static func GetPnsCredentials(resourceGroupName: String, namespaceName: String, notificationHubName: String, subscriptionId: String) -> NotificationHubsGetPnsCredentials {
        return GetPnsCredentialsCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, subscriptionId: subscriptionId)
    }
    public static func List(resourceGroupName: String, namespaceName: String, subscriptionId: String) -> NotificationHubsList {
        return ListCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, subscriptionId: subscriptionId)
    }
    public static func ListAuthorizationRules(resourceGroupName: String, namespaceName: String, notificationHubName: String, subscriptionId: String) -> NotificationHubsListAuthorizationRules {
        return ListAuthorizationRulesCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, subscriptionId: subscriptionId)
    }
    public static func ListKeys(resourceGroupName: String, namespaceName: String, notificationHubName: String, authorizationRuleName: String, subscriptionId: String) -> NotificationHubsListKeys {
        return ListKeysCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId)
    }
    public static func RegenerateKeys(resourceGroupName: String, namespaceName: String, notificationHubName: String, authorizationRuleName: String, subscriptionId: String, parameters: PolicykeyResourceProtocol) -> NotificationHubsRegenerateKeys {
        return RegenerateKeysCommand(resourceGroupName: resourceGroupName, namespaceName: namespaceName, notificationHubName: notificationHubName, authorizationRuleName: authorizationRuleName, subscriptionId: subscriptionId, parameters: parameters)
    }
}
}


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

extension Commands.NotificationHubs {
// CheckAvailability checks the availability of the given notificationHub in a namespace.
    internal class CheckAvailabilityCommand : BaseCommand, NotificationHubsCheckAvailability {
        public var resourceGroupName : String
        public var namespaceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  CheckAvailabilityParametersProtocol?

        public init(resourceGroupName: String, namespaceName: String, subscriptionId: String, parameters: CheckAvailabilityParametersProtocol) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/checkNotificationHubAvailability"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? CheckAvailabilityParametersData)
                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(CheckAvailabilityResultData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CheckAvailabilityResultProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: CheckAvailabilityResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.NotificationHubs {
// CreateOrUpdate creates/Update a NotificationHub in a namespace.
    internal class CreateOrUpdateCommand : BaseCommand, NotificationHubsCreateOrUpdate {
        public var resourceGroupName : String
        public var namespaceName : String
        public var notificationHubName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  NotificationHubCreateOrUpdateParametersProtocol?

        public init(resourceGroupName: String, namespaceName: String, notificationHubName: String, subscriptionId: String, parameters: NotificationHubCreateOrUpdateParametersProtocol) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.notificationHubName = notificationHubName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? NotificationHubCreateOrUpdateParametersData)
                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(NotificationHubResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (NotificationHubResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: NotificationHubResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol NotificationHubsCreateOrUpdateAuthorizationRule  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var notificationHubName : String { get set }
    var authorizationRuleName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var parameters :  SharedAccessAuthorizationRuleCreateOrUpdateParametersProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (SharedAccessAuthorizationRuleResourceProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.NotificationHubs {
// CreateOrUpdateAuthorizationRule creates/Updates an authorization rule for a NotificationHub
    internal class CreateOrUpdateAuthorizationRuleCommand : BaseCommand, NotificationHubsCreateOrUpdateAuthorizationRule {
        public var resourceGroupName : String
        public var namespaceName : String
        public var notificationHubName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  SharedAccessAuthorizationRuleCreateOrUpdateParametersProtocol?

        public init(resourceGroupName: String, namespaceName: String, notificationHubName: String, authorizationRuleName: String, subscriptionId: String, parameters: SharedAccessAuthorizationRuleCreateOrUpdateParametersProtocol) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.notificationHubName = notificationHubName
            self.authorizationRuleName = authorizationRuleName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? SharedAccessAuthorizationRuleCreateOrUpdateParametersData)
                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(SharedAccessAuthorizationRuleResourceData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (SharedAccessAuthorizationRuleResourceProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: SharedAccessAuthorizationRuleResourceData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.NotificationHubs {
// Delete deletes a notification hub associated with a namespace.
    internal class DeleteCommand : BaseCommand, NotificationHubsDelete {
        public var resourceGroupName : String
        public var namespaceName : String
        public var notificationHubName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.NotificationHubs {
// DeleteAuthorizationRule deletes a notificationHub authorization rule
    internal class DeleteAuthorizationRuleCommand : BaseCommand, NotificationHubsDeleteAuthorizationRule {
        public var resourceGroupName : String
        public var namespaceName : String
        public var notificationHubName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, notificationHubName: String, authorizationRuleName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.notificationHubName = notificationHubName
            self.authorizationRuleName = authorizationRuleName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NotificationHubs/namespaces/{namespaceName}/notificationHubs/{notificationHubName}/AuthorizationRules/{authorizationRuleName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.NotificationHubs {
// Get lists the notification hubs associated with a namespace.
    internal class GetCommand : BaseCommand, NotificationHubsGet {
        public var resourceGroupName : String
        public var namespaceName : String
        public var notificationHubName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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