// 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
// StreamingJobsUpdateHeadersProtocol is defines headers for Update operation.
public protocol StreamingJobsUpdateHeadersProtocol : Codable {
     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
// StreamInputDataSourceProtocol is describes an input data source that contains stream data.
public protocol StreamInputDataSourceProtocol : Codable {
}


// 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
// StreamInputPropertiesProtocol is the properties that are associated with an input containing stream data.
public protocol StreamInputPropertiesProtocol : InputPropertiesProtocol {
     var datasource: StreamInputDataSourceProtocol? { 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
// SubResourceProtocol is the base sub-resource model definition.
public protocol SubResourceProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SubscriptionQuotaPropertiesProtocol is describes the properties of the quota.
public protocol SubscriptionQuotaPropertiesProtocol : Codable {
     var maxCount: Int32? { get set }
     var currentCount: 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
// SubscriptionQuotaProtocol is describes the current quota for the subscription.
public protocol SubscriptionQuotaProtocol : SubResourceProtocol {
     var properties: SubscriptionQuotaPropertiesProtocol? { 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
// SubscriptionQuotasListResultProtocol is result of the GetQuotas operation. It contains a list of quotas for the
// subscription in a particular region.
public protocol SubscriptionQuotasListResultProtocol : Codable {
     var value: [SubscriptionQuotaProtocol?]? { 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
// TransformationPropertiesProtocol is the properties that are associated with a transformation.
public protocol TransformationPropertiesProtocol : Codable {
     var streamingUnits: Int32? { get set }
     var query: 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
// TransformationProtocol is a transformation object, containing all information associated with the named
// transformation. All transformations are contained under a streaming job.
public protocol TransformationProtocol : SubResourceProtocol {
     var properties: TransformationPropertiesProtocol? { 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
// TransformationsCreateOrReplaceHeadersProtocol is defines headers for CreateOrReplace operation.
public protocol TransformationsCreateOrReplaceHeadersProtocol : Codable {
     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
// TransformationsGetHeadersProtocol is defines headers for Get operation.
public protocol TransformationsGetHeadersProtocol : Codable {
     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
// TransformationsUpdateHeadersProtocol is defines headers for Update operation.
public protocol TransformationsUpdateHeadersProtocol : Codable {
     var eTag: 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: "trafficmanager",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "trafficmanager",
            targets: ["trafficmanager"]),
    ],
    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: "trafficmanager",
            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.

// Endpoints is the client for the Endpoints methods of the TrafficManagerManagementClient service.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Endpoints {
    public static func CreateOrUpdate(resourceGroupName: String, profileName: String, endpointType: String, endpointName: String, subscriptionId: String, parameters: EndpointProtocol) -> EndpointsCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, profileName: profileName, endpointType: endpointType, endpointName: endpointName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, profileName: String, endpointType: String, endpointName: String, subscriptionId: String) -> EndpointsDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, profileName: profileName, endpointType: endpointType, endpointName: endpointName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, profileName: String, endpointType: String, endpointName: String, subscriptionId: String) -> EndpointsGet {
        return GetCommand(resourceGroupName: resourceGroupName, profileName: profileName, endpointType: endpointType, endpointName: endpointName, subscriptionId: subscriptionId)
    }
    public static func Update(resourceGroupName: String, profileName: String, endpointType: String, endpointName: String, subscriptionId: String, parameters: EndpointProtocol) -> EndpointsUpdate {
        return UpdateCommand(resourceGroupName: resourceGroupName, profileName: profileName, endpointType: endpointType, endpointName: endpointName, subscriptionId: subscriptionId, parameters: parameters)
    }
}
}


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

extension Commands.Endpoints {
// CreateOrUpdate create or update a Traffic Manager endpoint.
    internal class CreateOrUpdateCommand : BaseCommand, EndpointsCreateOrUpdate {
        public var resourceGroupName : String
        public var profileName : String
        public var endpointType : String
        public var endpointName : String
        public var subscriptionId : String
        public var apiVersion = "2017-05-01"
    public var parameters :  EndpointProtocol?

        public init(resourceGroupName: String, profileName: String, endpointType: String, endpointName: String, subscriptionId: String, parameters: EndpointProtocol) {
            self.resourceGroupName = resourceGroupName
            self.profileName = profileName
            self.endpointType = endpointType
            self.endpointName = endpointName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.Endpoints {
// Delete deletes a Traffic Manager endpoint.
    internal class DeleteCommand : BaseCommand, EndpointsDelete {
        public var resourceGroupName : String
        public var profileName : String
        public var endpointType : String
        public var endpointName : String
        public var subscriptionId : String
        public var apiVersion = "2017-05-01"

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

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


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

extension Commands.Endpoints {
// Get gets a Traffic Manager endpoint.
    internal class GetCommand : BaseCommand, EndpointsGet {
        public var resourceGroupName : String
        public var profileName : String
        public var endpointType : String
        public var endpointName : String
        public var subscriptionId : String
        public var apiVersion = "2017-05-01"

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

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


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

extension Commands.Endpoints {
// Update update a Traffic Manager endpoint.
    internal class UpdateCommand : BaseCommand, EndpointsUpdate {
        public var resourceGroupName : String
        public var profileName : String
        public var endpointType : String
        public var endpointName : String
        public var subscriptionId : String
        public var apiVersion = "2017-05-01"
    public var parameters :  EndpointProtocol?

        public init(resourceGroupName: String, profileName: String, endpointType: String, endpointName: String, subscriptionId: String, parameters: EndpointProtocol) {
            self.resourceGroupName = resourceGroupName
            self.profileName = profileName
            self.endpointType = endpointType
            self.endpointName = endpointName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficmanagerprofiles/{profileName}/{endpointType}/{endpointName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

// GeographicHierarchies is the client for the GeographicHierarchies methods of the TrafficManagerManagementClient
// service.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct GeographicHierarchies {
    public static func GetDefault() -> GeographicHierarchiesGetDefault {
        return GetDefaultCommand()
    }
}
}


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

extension Commands.GeographicHierarchies {
// GetDefault gets the default Geographic Hierarchy used by the Geographic traffic routing method.
    internal class GetDefaultCommand : BaseCommand, GeographicHierarchiesGetDefault {
        public var apiVersion = "2017-05-01"

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

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

        }

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

// HeatMap is the client for the HeatMap methods of the TrafficManagerManagementClient service.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct HeatMap {
    public static func Get(subscriptionId: String, resourceGroupName: String, profileName: String, heatMapType: String) -> HeatMapGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, profileName: profileName, heatMapType: heatMapType)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol HeatMapGet  {
    var headerParameters: [String: String] { get set }
    var subscriptionId : String { get set }
    var resourceGroupName : String { get set }
    var profileName : String { get set }
    var heatMapType : String { get set }
    var topLeft : [Double]? { get set }
    var botRight : [Double]? { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (HeatMapModelProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.HeatMap {
// Get gets latest heatmap for Traffic Manager profile.
    internal class GetCommand : BaseCommand, HeatMapGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var profileName : String
        public var heatMapType : String
        public var topLeft : [Double]?
        public var botRight : [Double]?
        public var apiVersion = "2017-09-01-preview"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{profileName}"] = String(describing: self.profileName)
            self.pathParameters["{heatMapType}"] = String(describing: self.heatMapType)
            if self.topLeft != nil { queryParameters["topLeft"] = String(describing: self.topLeft!) }
            if self.botRight != nil { queryParameters["botRight"] = String(describing: self.botRight!) }
            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(HeatMapModelData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (HeatMapModelProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: HeatMapModelData?, 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.

// Profiles is the client for the Profiles methods of the TrafficManagerManagementClient service.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Profiles {
    public static func CheckTrafficManagerRelativeDnsNameAvailability(parameters: CheckTrafficManagerRelativeDnsNameAvailabilityParametersProtocol) -> ProfilesCheckTrafficManagerRelativeDnsNameAvailability {
        return CheckTrafficManagerRelativeDnsNameAvailabilityCommand(parameters: parameters)
    }
    public static func CreateOrUpdate(resourceGroupName: String, profileName: String, subscriptionId: String, parameters: ProfileProtocol) -> ProfilesCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, profileName: profileName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, profileName: String, subscriptionId: String) -> ProfilesDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, profileName: profileName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, profileName: String, subscriptionId: String) -> ProfilesGet {
        return GetCommand(resourceGroupName: resourceGroupName, profileName: profileName, subscriptionId: subscriptionId)
    }
    public static func ListByResourceGroup(resourceGroupName: String, subscriptionId: String) -> ProfilesListByResourceGroup {
        return ListByResourceGroupCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func ListBySubscription(subscriptionId: String) -> ProfilesListBySubscription {
        return ListBySubscriptionCommand(subscriptionId: subscriptionId)
    }
    public static func Update(resourceGroupName: String, profileName: String, subscriptionId: String, parameters: ProfileProtocol) -> ProfilesUpdate {
        return UpdateCommand(resourceGroupName: resourceGroupName, profileName: profileName, subscriptionId: subscriptionId, parameters: parameters)
    }
}
}


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

extension Commands.Profiles {
// CheckTrafficManagerRelativeDnsNameAvailability checks the availability of a Traffic Manager Relative DNS name.
    internal class CheckTrafficManagerRelativeDnsNameAvailabilityCommand : BaseCommand, ProfilesCheckTrafficManagerRelativeDnsNameAvailability {
        public var apiVersion = "2017-05-01"
    public var parameters :  CheckTrafficManagerRelativeDnsNameAvailabilityParametersProtocol?

        public init(parameters: CheckTrafficManagerRelativeDnsNameAvailabilityParametersProtocol) {
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/providers/Microsoft.Network/checkTrafficManagerNameAvailability"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.Profiles {
// CreateOrUpdate create or update a Traffic Manager profile.
    internal class CreateOrUpdateCommand : BaseCommand, ProfilesCreateOrUpdate {
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-05-01"
    public var parameters :  ProfileProtocol?

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

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


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

extension Commands.Profiles {
// Delete deletes a Traffic Manager profile.
    internal class DeleteCommand : BaseCommand, ProfilesDelete {
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-05-01"

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

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


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

extension Commands.Profiles {
// Get gets a Traffic Manager profile.
    internal class GetCommand : BaseCommand, ProfilesGet {
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-05-01"

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

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


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

extension Commands.Profiles {
// ListByResourceGroup lists all Traffic Manager profiles within a resource group.
    internal class ListByResourceGroupCommand : BaseCommand, ProfilesListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-05-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.Network/trafficmanagerprofiles"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Profiles {
// ListBySubscription lists all Traffic Manager profiles within a subscription.
    internal class ListBySubscriptionCommand : BaseCommand, ProfilesListBySubscription {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2017-05-01"

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

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

        }

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


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

extension Commands.Profiles {
// Update update a Traffic Manager profile.
    internal class UpdateCommand : BaseCommand, ProfilesUpdate {
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-05-01"
    public var parameters :  ProfileProtocol?

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

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

// TrafficManagerUserMetricsKeys is the client for the TrafficManagerUserMetricsKeys methods of the
// TrafficManagerManagementClient service.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct TrafficManagerUserMetricsKeys {
    public static func CreateOrUpdate(subscriptionId: String) -> TrafficManagerUserMetricsKeysCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId)
    }
    public static func Delete(subscriptionId: String) -> TrafficManagerUserMetricsKeysDelete {
        return DeleteCommand(subscriptionId: subscriptionId)
    }
    public static func Get(subscriptionId: String) -> TrafficManagerUserMetricsKeysGet {
        return GetCommand(subscriptionId: subscriptionId)
    }
}
}


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

extension Commands.TrafficManagerUserMetricsKeys {
// CreateOrUpdate create or update a subscription-level key used for Real User Metrics collection.
    internal class CreateOrUpdateCommand : BaseCommand, TrafficManagerUserMetricsKeysCreateOrUpdate {
        public var subscriptionId : String
        public var apiVersion = "2017-09-01-preview"

        public init(subscriptionId: String) {
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys"
            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)
                let result = try decoder.decode(TrafficManagerUserMetricsKeyModelData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (TrafficManagerUserMetricsKeyModelProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: TrafficManagerUserMetricsKeyModelData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.TrafficManagerUserMetricsKeys {
// Delete delete a subscription-level key used for Real User Metrics collection.
    internal class DeleteCommand : BaseCommand, TrafficManagerUserMetricsKeysDelete {
        public var subscriptionId : String
        public var apiVersion = "2017-09-01-preview"

        public init(subscriptionId: String) {
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys"
            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)
                let result = try decoder.decode(DeleteOperationResultData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (DeleteOperationResultProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: DeleteOperationResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.TrafficManagerUserMetricsKeys {
// Get get the subscription-level key used for Real User Metrics collection.
    internal class GetCommand : BaseCommand, TrafficManagerUserMetricsKeysGet {
        public var subscriptionId : String
        public var apiVersion = "2017-09-01-preview"

        public init(subscriptionId: String) {
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.Network/trafficManagerUserMetricsKeys"
            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)
                let result = try decoder.decode(TrafficManagerUserMetricsKeyModelData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (TrafficManagerUserMetricsKeyModelProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: TrafficManagerUserMetricsKeyModelData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCheckTrafficManagerRelativeDnsNameAvailabilityParametersProtocol() -> CheckTrafficManagerRelativeDnsNameAvailabilityParametersProtocol {
    return CheckTrafficManagerRelativeDnsNameAvailabilityParametersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct CloudErrorBodyData : CloudErrorBodyProtocol {
    public var code: String?
    public var message: String?
    public var target: String?
    public var details: [CloudErrorBodyProtocol?]?

        enum CodingKeys: String, CodingKey {case code = "code"
        case message = "message"
        case target = "target"
        case details = "details"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCloudErrorBodyProtocol() -> CloudErrorBodyProtocol {
    return CloudErrorBodyData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCloudErrorProtocol() -> CloudErrorProtocol {
    return CloudErrorData()
  }
}


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

        enum CodingKeys: String, CodingKey {case operationResult = "boolean"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDeleteOperationResultProtocol() -> DeleteOperationResultProtocol {
    return DeleteOperationResultData()
  }
}


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

        enum CodingKeys: String, CodingKey {case relativeName = "relativeName"
        case fqdn = "fqdn"
        case ttl = "ttl"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDnsConfigProtocol() -> DnsConfigProtocol {
    return DnsConfigData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createEndpointProtocol() -> EndpointProtocol {
    return EndpointData()
  }
}


// EndpointMonitorStatus enumerates the values for endpoint monitor status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum EndpointMonitorStatusEnum: String, Codable
{
// CheckingEndpoint specifies the checking endpoint state for endpoint monitor status.
    case CheckingEndpoint = "CheckingEndpoint"
// Degraded specifies the degraded state for endpoint monitor status.
    case Degraded = "Degraded"
// Disabled specifies the disabled state for endpoint monitor status.
    case Disabled = "Disabled"
// Inactive specifies the inactive state for endpoint monitor status.
    case Inactive = "Inactive"
// Online specifies the online state for endpoint monitor status.
    case Online = "Online"
// Stopped specifies the stopped state for endpoint monitor status.
    case Stopped = "Stopped"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct EndpointPropertiesData : EndpointPropertiesProtocol {
    public var targetResourceId: String?
    public var target: String?
    public var endpointStatus: EndpointStatusEnum?
    public var weight: Int64?
    public var priority: Int64?
    public var endpointLocation: String?
    public var endpointMonitorStatus: EndpointMonitorStatusEnum?
    public var minChildEndpoints: Int64?
    public var geoMapping: [String]?

        enum CodingKeys: String, CodingKey {case targetResourceId = "targetResourceId"
        case target = "target"
        case endpointStatus = "endpointStatus"
        case weight = "weight"
        case priority = "priority"
        case endpointLocation = "endpointLocation"
        case endpointMonitorStatus = "endpointMonitorStatus"
        case minChildEndpoints = "minChildEndpoints"
        case geoMapping = "geoMapping"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.targetResourceId) {
        self.targetResourceId = try container.decode(String?.self, forKey: .targetResourceId)
    }
    if container.contains(.target) {
        self.target = try container.decode(String?.self, forKey: .target)
    }
    if container.contains(.endpointStatus) {
        self.endpointStatus = try container.decode(EndpointStatusEnum?.self, forKey: .endpointStatus)
    }
    if container.contains(.weight) {
        self.weight = try container.decode(Int64?.self, forKey: .weight)
    }
    if container.contains(.priority) {
        self.priority = try container.decode(Int64?.self, forKey: .priority)
    }
    if container.contains(.endpointLocation) {
        self.endpointLocation = try container.decode(String?.self, forKey: .endpointLocation)
    }
    if container.contains(.endpointMonitorStatus) {
        self.endpointMonitorStatus = try container.decode(EndpointMonitorStatusEnum?.self, forKey: .endpointMonitorStatus)
    }
    if container.contains(.minChildEndpoints) {
        self.minChildEndpoints = try container.decode(Int64?.self, forKey: .minChildEndpoints)
    }
    if container.contains(.geoMapping) {
        self.geoMapping = try container.decode([String]?.self, forKey: .geoMapping)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.targetResourceId != nil {try container.encode(self.targetResourceId, forKey: .targetResourceId)}
    if self.target != nil {try container.encode(self.target, forKey: .target)}
    if self.endpointStatus != nil {try container.encode(self.endpointStatus, forKey: .endpointStatus)}
    if self.weight != nil {try container.encode(self.weight, forKey: .weight)}
    if self.priority != nil {try container.encode(self.priority, forKey: .priority)}
    if self.endpointLocation != nil {try container.encode(self.endpointLocation, forKey: .endpointLocation)}
    if self.endpointMonitorStatus != nil {try container.encode(self.endpointMonitorStatus, forKey: .endpointMonitorStatus)}
    if self.minChildEndpoints != nil {try container.encode(self.minChildEndpoints, forKey: .minChildEndpoints)}
    if self.geoMapping != nil {try container.encode(self.geoMapping as! [String]?, forKey: .geoMapping)}
  }
}

extension DataFactory {
  public static func createEndpointPropertiesProtocol() -> EndpointPropertiesProtocol {
    return EndpointPropertiesData()
  }
}


// EndpointStatus enumerates the values for endpoint status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum EndpointStatusEnum: String, Codable
{
// EndpointStatusDisabled specifies the endpoint status disabled state for endpoint status.
    case EndpointStatusDisabled = "Disabled"
// EndpointStatusEnabled specifies the endpoint status enabled state for endpoint status.
    case EndpointStatusEnabled = "Enabled"
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createGeographicHierarchyPropertiesProtocol() -> GeographicHierarchyPropertiesProtocol {
    return GeographicHierarchyPropertiesData()
  }
}


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

        enum CodingKeys: String, CodingKey {case resourceId = "resourceId"
        case endpointId = "endpointId"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createHeatMapEndpointProtocol() -> HeatMapEndpointProtocol {
    return HeatMapEndpointData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createHeatMapModelProtocol() -> HeatMapModelProtocol {
    return HeatMapModelData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct HeatMapPropertiesData : HeatMapPropertiesProtocol {
    public var startTime: Date?
    public var endTime: Date?
    public var endpoints: [HeatMapEndpointProtocol?]?
    public var trafficFlows: [TrafficFlowProtocol?]?

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case endpoints = "endpoints"
        case trafficFlows = "trafficFlows"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.endpoints) {
        self.endpoints = try container.decode([HeatMapEndpointData?]?.self, forKey: .endpoints)
    }
    if container.contains(.trafficFlows) {
        self.trafficFlows = try container.decode([TrafficFlowData?]?.self, forKey: .trafficFlows)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.endpoints != nil {try container.encode(self.endpoints as! [HeatMapEndpointData?]?, forKey: .endpoints)}
    if self.trafficFlows != nil {try container.encode(self.trafficFlows as! [TrafficFlowData?]?, forKey: .trafficFlows)}
  }
}

extension DataFactory {
  public static func createHeatMapPropertiesProtocol() -> HeatMapPropertiesProtocol {
    return HeatMapPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct MonitorConfigData : MonitorConfigProtocol {
    public var profileMonitorStatus: ProfileMonitorStatusEnum?
    public var _protocol: MonitorProtocolEnum?
    public var port: Int64?
    public var path: String?
    public var intervalInSeconds: Int64?
    public var timeoutInSeconds: Int64?
    public var toleratedNumberOfFailures: Int64?

        enum CodingKeys: String, CodingKey {case profileMonitorStatus = "profileMonitorStatus"
        case _protocol = "protocol"
        case port = "port"
        case path = "path"
        case intervalInSeconds = "intervalInSeconds"
        case timeoutInSeconds = "timeoutInSeconds"
        case toleratedNumberOfFailures = "toleratedNumberOfFailures"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.profileMonitorStatus) {
        self.profileMonitorStatus = try container.decode(ProfileMonitorStatusEnum?.self, forKey: .profileMonitorStatus)
    }
    if container.contains(._protocol) {
        self._protocol = try container.decode(MonitorProtocolEnum?.self, forKey: ._protocol)
    }
    if container.contains(.port) {
        self.port = try container.decode(Int64?.self, forKey: .port)
    }
    if container.contains(.path) {
        self.path = try container.decode(String?.self, forKey: .path)
    }
    if container.contains(.intervalInSeconds) {
        self.intervalInSeconds = try container.decode(Int64?.self, forKey: .intervalInSeconds)
    }
    if container.contains(.timeoutInSeconds) {
        self.timeoutInSeconds = try container.decode(Int64?.self, forKey: .timeoutInSeconds)
    }
    if container.contains(.toleratedNumberOfFailures) {
        self.toleratedNumberOfFailures = try container.decode(Int64?.self, forKey: .toleratedNumberOfFailures)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.profileMonitorStatus != nil {try container.encode(self.profileMonitorStatus, forKey: .profileMonitorStatus)}
    if self._protocol != nil {try container.encode(self._protocol, forKey: ._protocol)}
    if self.port != nil {try container.encode(self.port, forKey: .port)}
    if self.path != nil {try container.encode(self.path, forKey: .path)}
    if self.intervalInSeconds != nil {try container.encode(self.intervalInSeconds, forKey: .intervalInSeconds)}
    if self.timeoutInSeconds != nil {try container.encode(self.timeoutInSeconds, forKey: .timeoutInSeconds)}
    if self.toleratedNumberOfFailures != nil {try container.encode(self.toleratedNumberOfFailures, forKey: .toleratedNumberOfFailures)}
  }
}

extension DataFactory {
  public static func createMonitorConfigProtocol() -> MonitorConfigProtocol {
    return MonitorConfigData()
  }
}


// MonitorProtocol enumerates the values for monitor protocol.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum MonitorProtocolEnum: String, Codable
{
// HTTP specifies the http state for monitor protocol.
    case HTTP = "HTTP"
// HTTPS specifies the https state for monitor protocol.
    case HTTPS = "HTTPS"
// TCP specifies the tcp state for monitor protocol.
    case TCP = "TCP"
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProfileProtocol() -> ProfileProtocol {
    return ProfileData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProfileListResultProtocol() -> ProfileListResultProtocol {
    return ProfileListResultData()
  }
}


// ProfileMonitorStatus enumerates the values for profile monitor status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ProfileMonitorStatusEnum: String, Codable
{
// ProfileMonitorStatusCheckingEndpoints specifies the profile monitor status checking endpoints state for profile
// monitor status.
    case ProfileMonitorStatusCheckingEndpoints = "CheckingEndpoints"
// ProfileMonitorStatusDegraded specifies the profile monitor status degraded state for profile monitor status.
    case ProfileMonitorStatusDegraded = "Degraded"
// ProfileMonitorStatusDisabled specifies the profile monitor status disabled state for profile monitor status.
    case ProfileMonitorStatusDisabled = "Disabled"
// ProfileMonitorStatusInactive specifies the profile monitor status inactive state for profile monitor status.
    case ProfileMonitorStatusInactive = "Inactive"
// ProfileMonitorStatusOnline specifies the profile monitor status online state for profile monitor status.
    case ProfileMonitorStatusOnline = "Online"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ProfilePropertiesData : ProfilePropertiesProtocol {
    public var profileStatus: ProfileStatusEnum?
    public var trafficRoutingMethod: TrafficRoutingMethodEnum?
    public var dnsConfig: DnsConfigProtocol?
    public var monitorConfig: MonitorConfigProtocol?
    public var endpoints: [EndpointProtocol?]?

        enum CodingKeys: String, CodingKey {case profileStatus = "profileStatus"
        case trafficRoutingMethod = "trafficRoutingMethod"
        case dnsConfig = "dnsConfig"
        case monitorConfig = "monitorConfig"
        case endpoints = "endpoints"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.profileStatus) {
        self.profileStatus = try container.decode(ProfileStatusEnum?.self, forKey: .profileStatus)
    }
    if container.contains(.trafficRoutingMethod) {
        self.trafficRoutingMethod = try container.decode(TrafficRoutingMethodEnum?.self, forKey: .trafficRoutingMethod)
    }
    if container.contains(.dnsConfig) {
        self.dnsConfig = try container.decode(DnsConfigData?.self, forKey: .dnsConfig)
    }
    if container.contains(.monitorConfig) {
        self.monitorConfig = try container.decode(MonitorConfigData?.self, forKey: .monitorConfig)
    }
    if container.contains(.endpoints) {
        self.endpoints = try container.decode([EndpointData?]?.self, forKey: .endpoints)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.profileStatus != nil {try container.encode(self.profileStatus, forKey: .profileStatus)}
    if self.trafficRoutingMethod != nil {try container.encode(self.trafficRoutingMethod, forKey: .trafficRoutingMethod)}
    if self.dnsConfig != nil {try container.encode(self.dnsConfig as! DnsConfigData?, forKey: .dnsConfig)}
    if self.monitorConfig != nil {try container.encode(self.monitorConfig as! MonitorConfigData?, forKey: .monitorConfig)}
    if self.endpoints != nil {try container.encode(self.endpoints as! [EndpointData?]?, forKey: .endpoints)}
  }
}

extension DataFactory {
  public static func createProfilePropertiesProtocol() -> ProfilePropertiesProtocol {
    return ProfilePropertiesData()
  }
}


// ProfileStatus enumerates the values for profile status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ProfileStatusEnum: String, Codable
{
// ProfileStatusDisabled specifies the profile status disabled state for profile status.
    case ProfileStatusDisabled = "Disabled"
// ProfileStatusEnabled specifies the profile status enabled state for profile status.
    case ProfileStatusEnabled = "Enabled"
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createProxyResourceProtocol() -> ProxyResourceProtocol {
    return ProxyResourceData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct QueryExperienceData : QueryExperienceProtocol {
    public var endpointId: Int32
    public var queryCount: Int32
    public var latency: Double?

        enum CodingKeys: String, CodingKey {case endpointId = "endpointId"
        case queryCount = "queryCount"
        case latency = "latency"
        }

  public init(endpointId: Int32, queryCount: Int32)  {
    self.endpointId = endpointId
    self.queryCount = queryCount
  }

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

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

extension DataFactory {
  public static func createQueryExperienceProtocol(endpointId: Int32, queryCount: Int32) -> QueryExperienceProtocol {
    return QueryExperienceData(endpointId: endpointId, queryCount: queryCount)
  }
}