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 (Error?) -> Void) -> Void;
}

extension Commands.Profiles {
// Delete deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion
// of all of the sub-resources including endpoints, origins and custom domains. This method may poll for completion.
// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any
// outstanding HTTP requests.
    internal class DeleteCommand : BaseCommand, ProfilesDelete {
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-02"

        public init(resourceGroupName: String, profileName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.profileName = profileName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{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 func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsyncLRO(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


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

extension Commands.Profiles {
// GenerateSsoUri generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemnetal portal is
// used to configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports
// in a standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The
// SSO URI changes approximately every 10 minutes.
    internal class GenerateSsoUriCommand : BaseCommand, ProfilesGenerateSsoUri {
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-02"

        public init(resourceGroupName: String, profileName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.profileName = profileName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri"
            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(SsoUriData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (SsoUriProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: SsoUriData?, 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 CDN profile with the specified profile name under the specified subscription and resource group.
    internal class GetCommand : BaseCommand, ProfilesGet {
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-02"

        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.Cdn/profiles/{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 ProfilesList  {
    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 {
// List lists all of the CDN profiles within an Azure subscription.
    internal class ListCommand : BaseCommand, ProfilesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2017-04-02"

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

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(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 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 of the CDN 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-04-02"

        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.Cdn/profiles"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(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 ProfilesListResourceUsage  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    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 (ResourceUsageListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Profiles {
// ListResourceUsage checks the quota and actual usage of endpoints under the given CDN profile.
    internal class ListResourceUsageCommand : BaseCommand, ProfilesListResourceUsage {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-02"

        public init(resourceGroupName: String, profileName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.profileName = profileName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkResourceUsage"
            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)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(ResourceUsageListResultData?.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 (ResourceUsageListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ResourceUsageListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Profiles {
// ListSupportedOptimizationTypes gets the supported optimization types for the current profile. A user can create an
// endpoint with an optimization type from the listed values.
    internal class ListSupportedOptimizationTypesCommand : BaseCommand, ProfilesListSupportedOptimizationTypes {
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-02"

        public init(resourceGroupName: String, profileName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.profileName = profileName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getSupportedOptimizationTypes"
            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(SupportedOptimizationTypesListResultData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (SupportedOptimizationTypesListResultProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: SupportedOptimizationTypesListResultData?, 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 profileUpdateParameters :  ProfileUpdateParametersProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ProfileProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Profiles {
// Update updates an existing CDN profile with the specified profile name under the specified subscription and resource
// group. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. The
// channel will be used to cancel polling and any outstanding HTTP requests.
    internal class UpdateCommand : BaseCommand, ProfilesUpdate {
        public var resourceGroupName : String
        public var profileName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-02"
    public var profileUpdateParameters :  ProfileUpdateParametersProtocol?

        public init(resourceGroupName: String, profileName: String, subscriptionId: String, profileUpdateParameters: ProfileUpdateParametersProtocol) {
            self.resourceGroupName = resourceGroupName
            self.profileName = profileName
            self.subscriptionId = subscriptionId
            self.profileUpdateParameters = profileUpdateParameters
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = true
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{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 = profileUpdateParameters

        }
        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(profileUpdateParameters as? ProfileUpdateParametersData)
                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.executeAsyncLRO(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.

// ResourceUsage is the use these APIs to manage Azure CDN resources through the Azure Resource Manager. You must make
// sure that requests made to these resources are secure.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct ResourceUsage {
    public static func List(subscriptionId: String) -> ResourceUsageList {
        return ListCommand(subscriptionId: subscriptionId)
    }
}
}


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

extension Commands.ResourceUsage {
// List check the quota and actual usage of the CDN profiles under the given subscription.
    internal class ListCommand : BaseCommand, ResourceUsageList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2017-04-02"

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

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

        }

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

// ManagementClient is the use these APIs to manage Azure CDN resources through the Azure Resource Manager. You must
// make sure that requests made to these resources are secure.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Service {
    public static func CheckNameAvailability(checkNameAvailabilityInput: CheckNameAvailabilityInputProtocol) -> ServiceCheckNameAvailability {
        return CheckNameAvailabilityCommand(checkNameAvailabilityInput: checkNameAvailabilityInput)
    }
    public static func ValidateProbe(subscriptionId: String, validateProbeInput: ValidateProbeInputProtocol) -> ServiceValidateProbe {
        return ValidateProbeCommand(subscriptionId: subscriptionId, validateProbeInput: validateProbeInput)
    }
}
}


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

extension Commands.Service {
// CheckNameAvailability check the availability of a resource name. This is needed for resources where name is globally
// unique, such as a CDN endpoint.
    internal class CheckNameAvailabilityCommand : BaseCommand, ServiceCheckNameAvailability {
        public var apiVersion = "2017-04-02"
    public var checkNameAvailabilityInput :  CheckNameAvailabilityInputProtocol?

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

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

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


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

extension Commands.Service {
// ValidateProbe check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file
// hosted on the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is
// relative to the origin path specified in the endpoint configuration.
    internal class ValidateProbeCommand : BaseCommand, ServiceValidateProbe {
        public var subscriptionId : String
        public var apiVersion = "2017-04-02"
    public var validateProbeInput :  ValidateProbeInputProtocol?

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

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

        }
        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(validateProbeInput as? ValidateProbeInputData)
                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(ValidateProbeOutputData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (ValidateProbeOutputProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: ValidateProbeOutputData?, 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 CheckNameAvailabilityInputData : CheckNameAvailabilityInputProtocol {
    public var name: String
    public var type: String

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

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

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

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

extension DataFactory {
  public static func createCheckNameAvailabilityInputProtocol(name: String, type: String) -> CheckNameAvailabilityInputProtocol {
    return CheckNameAvailabilityInputData(name: name, type: type)
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCheckNameAvailabilityOutputProtocol() -> CheckNameAvailabilityOutputProtocol {
    return CheckNameAvailabilityOutputData()
  }
}


// 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 CidrIpAddressData : CidrIpAddressProtocol {
    public var baseIpAddress: String?
    public var prefixLength: Int32?

        enum CodingKeys: String, CodingKey {case baseIpAddress = "baseIpAddress"
        case prefixLength = "prefixLength"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createCidrIpAddressProtocol() -> CidrIpAddressProtocol {
    return CidrIpAddressData()
  }
}


// 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 CustomDomainData : CustomDomainProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: CustomDomainPropertiesProtocol?

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

extension DataFactory {
  public static func createCustomDomainProtocol() -> CustomDomainProtocol {
    return CustomDomainData()
  }
}


// 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 CustomDomainListResultData : CustomDomainListResultProtocol {
    public var value: [CustomDomainProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCustomDomainListResultProtocol() -> CustomDomainListResultProtocol {
    return CustomDomainListResultData()
  }
}


// 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 CustomDomainParametersData : CustomDomainParametersProtocol {
    public var properties: CustomDomainPropertiesParametersProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCustomDomainParametersProtocol() -> CustomDomainParametersProtocol {
    return CustomDomainParametersData()
  }
}


// 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 CustomDomainPropertiesData : CustomDomainPropertiesProtocol {
    public var hostName: String
    public var resourceState: CustomDomainResourceStateEnum?
    public var customHttpsProvisioningState: CustomHttpsProvisioningStateEnum?
    public var customHttpsProvisioningSubstate: CustomHttpsProvisioningSubstateEnum?
    public var validationData: String?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case hostName = "hostName"
        case resourceState = "resourceState"
        case customHttpsProvisioningState = "customHttpsProvisioningState"
        case customHttpsProvisioningSubstate = "customHttpsProvisioningSubstate"
        case validationData = "validationData"
        case provisioningState = "provisioningState"
        }

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.hostName = try container.decode(String.self, forKey: .hostName)
    if container.contains(.resourceState) {
        self.resourceState = try container.decode(CustomDomainResourceStateEnum?.self, forKey: .resourceState)
    }
    if container.contains(.customHttpsProvisioningState) {
        self.customHttpsProvisioningState = try container.decode(CustomHttpsProvisioningStateEnum?.self, forKey: .customHttpsProvisioningState)
    }
    if container.contains(.customHttpsProvisioningSubstate) {
        self.customHttpsProvisioningSubstate = try container.decode(CustomHttpsProvisioningSubstateEnum?.self, forKey: .customHttpsProvisioningSubstate)
    }
    if container.contains(.validationData) {
        self.validationData = try container.decode(String?.self, forKey: .validationData)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    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.hostName, forKey: .hostName)
    if self.resourceState != nil {try container.encode(self.resourceState, forKey: .resourceState)}
    if self.customHttpsProvisioningState != nil {try container.encode(self.customHttpsProvisioningState, forKey: .customHttpsProvisioningState)}
    if self.customHttpsProvisioningSubstate != nil {try container.encode(self.customHttpsProvisioningSubstate, forKey: .customHttpsProvisioningSubstate)}
    if self.validationData != nil {try container.encode(self.validationData, forKey: .validationData)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createCustomDomainPropertiesProtocol(hostName: String) -> CustomDomainPropertiesProtocol {
    return CustomDomainPropertiesData(hostName: hostName)
  }
}


// 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 CustomDomainPropertiesParametersData : CustomDomainPropertiesParametersProtocol {
    public var hostName: String

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

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.hostName = try container.decode(String.self, forKey: .hostName)
    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.hostName, forKey: .hostName)
  }
}

extension DataFactory {
  public static func createCustomDomainPropertiesParametersProtocol(hostName: String) -> CustomDomainPropertiesParametersProtocol {
    return CustomDomainPropertiesParametersData(hostName: hostName)
  }
}


// CustomDomainResourceState enumerates the values for custom domain resource state.

// 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 CustomDomainResourceStateEnum: String, Codable
{
// Active specifies the active state for custom domain resource state.
    case Active = "Active"
// Creating specifies the creating state for custom domain resource state.
    case Creating = "Creating"
// Deleting specifies the deleting state for custom domain resource state.
    case Deleting = "Deleting"
}


// CustomHttpsProvisioningState enumerates the values for custom https provisioning state.

// 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 CustomHttpsProvisioningStateEnum: String, Codable
{
// Disabled specifies the disabled state for custom https provisioning state.
    case Disabled = "Disabled"
// Disabling specifies the disabling state for custom https provisioning state.
    case Disabling = "Disabling"
// Enabled specifies the enabled state for custom https provisioning state.
    case Enabled = "Enabled"
// Enabling specifies the enabling state for custom https provisioning state.
    case Enabling = "Enabling"
// Failed specifies the failed state for custom https provisioning state.
    case Failed = "Failed"
}


// CustomHttpsProvisioningSubstate enumerates the values for custom https provisioning substate.

// 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 CustomHttpsProvisioningSubstateEnum: String, Codable
{
// CertificateDeleted specifies the certificate deleted state for custom https provisioning substate.
    case CertificateDeleted = "CertificateDeleted"
// CertificateDeployed specifies the certificate deployed state for custom https provisioning substate.
    case CertificateDeployed = "CertificateDeployed"
// DeletingCertificate specifies the deleting certificate state for custom https provisioning substate.
    case DeletingCertificate = "DeletingCertificate"
// DeployingCertificate specifies the deploying certificate state for custom https provisioning substate.
    case DeployingCertificate = "DeployingCertificate"
// DomainControlValidationRequestApproved specifies the domain control validation request approved state for custom
// https provisioning substate.
    case DomainControlValidationRequestApproved = "DomainControlValidationRequestApproved"
// DomainControlValidationRequestRejected specifies the domain control validation request rejected state for custom
// https provisioning substate.
    case DomainControlValidationRequestRejected = "DomainControlValidationRequestRejected"
// DomainControlValidationRequestTimedOut specifies the domain control validation request timed out state for custom
// https provisioning substate.
    case DomainControlValidationRequestTimedOut = "DomainControlValidationRequestTimedOut"
// IssuingCertificate specifies the issuing certificate state for custom https provisioning substate.
    case IssuingCertificate = "IssuingCertificate"
// PendingDomainControlValidationREquestApproval specifies the pending domain control validation r equest approval
// state for custom https provisioning substate.
    case PendingDomainControlValidationREquestApproval = "PendingDomainControlValidationREquestApproval"
// SubmittingDomainControlValidationRequest specifies the submitting domain control validation request state for custom
// https provisioning substate.
    case SubmittingDomainControlValidationRequest = "SubmittingDomainControlValidationRequest"
}


// 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 DeepCreatedOriginData : DeepCreatedOriginProtocol {
    public var name: String
    public var properties: DeepCreatedOriginPropertiesProtocol?

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

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

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

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

extension DataFactory {
  public static func createDeepCreatedOriginProtocol(name: String) -> DeepCreatedOriginProtocol {
    return DeepCreatedOriginData(name: name)
  }
}


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

        enum CodingKeys: String, CodingKey {case hostName = "hostName"
        case httpPort = "httpPort"
        case httpsPort = "httpsPort"
        }

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

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

extension DataFactory {
  public static func createDeepCreatedOriginPropertiesProtocol(hostName: String) -> DeepCreatedOriginPropertiesProtocol {
    return DeepCreatedOriginPropertiesData(hostName: hostName)
  }
}


// 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 EdgeNodeData : EdgeNodeProtocol, ProxyResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: EdgeNodePropertiesProtocol?

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

extension DataFactory {
  public static func createEdgeNodeProtocol() -> EdgeNodeProtocol {
    return EdgeNodeData()
  }
}


// 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 EdgeNodePropertiesData : EdgeNodePropertiesProtocol {
    public var ipAddressGroups: [IpAddressGroupProtocol]

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

  public init(ipAddressGroups: [IpAddressGroupProtocol])  {
    self.ipAddressGroups = ipAddressGroups
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.ipAddressGroups = try container.decode([IpAddressGroupData].self, forKey: .ipAddressGroups)
    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.ipAddressGroups as! [IpAddressGroupData], forKey: .ipAddressGroups)
  }
}

extension DataFactory {
  public static func createEdgeNodePropertiesProtocol(ipAddressGroups: [IpAddressGroupProtocol]) -> EdgeNodePropertiesProtocol {
    return EdgeNodePropertiesData(ipAddressGroups: ipAddressGroups)
  }
}


// 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 EdgenodeResultData : EdgenodeResultProtocol {
    public var value: [EdgeNodeProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createEdgenodeResultProtocol() -> EdgenodeResultProtocol {
    return EdgenodeResultData()
  }
}


// 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, TrackedResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var tags: [String:String]?
    public var properties: EndpointPropertiesProtocol?

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

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

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

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


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createEndpointListResultProtocol() -> EndpointListResultProtocol {
    return EndpointListResultData()
  }
}


// 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, EndpointPropertiesUpdateParametersProtocol {
    public var originHostHeader: String?
    public var originPath: String?
    public var contentTypesToCompress: [String]?
    public var isCompressionEnabled: Bool?
    public var isHttpAllowed: Bool?
    public var isHttpsAllowed: Bool?
    public var queryStringCachingBehavior: QueryStringCachingBehaviorEnum?
    public var optimizationType: OptimizationTypeEnum?
    public var probePath: String?
    public var geoFilters: [GeoFilterProtocol?]?
    public var hostName: String?
    public var origins: [DeepCreatedOriginProtocol]
    public var resourceState: EndpointResourceStateEnum?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case originHostHeader = "originHostHeader"
        case originPath = "originPath"
        case contentTypesToCompress = "contentTypesToCompress"
        case isCompressionEnabled = "isCompressionEnabled"
        case isHttpAllowed = "isHttpAllowed"
        case isHttpsAllowed = "isHttpsAllowed"
        case queryStringCachingBehavior = "queryStringCachingBehavior"
        case optimizationType = "optimizationType"
        case probePath = "probePath"
        case geoFilters = "geoFilters"
        case hostName = "hostName"
        case origins = "origins"
        case resourceState = "resourceState"
        case provisioningState = "provisioningState"
        }

  public init(origins: [DeepCreatedOriginProtocol])  {
    self.origins = origins
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.originHostHeader) {
        self.originHostHeader = try container.decode(String?.self, forKey: .originHostHeader)
    }
    if container.contains(.originPath) {
        self.originPath = try container.decode(String?.self, forKey: .originPath)
    }
    if container.contains(.contentTypesToCompress) {
        self.contentTypesToCompress = try container.decode([String]?.self, forKey: .contentTypesToCompress)
    }
    if container.contains(.isCompressionEnabled) {
        self.isCompressionEnabled = try container.decode(Bool?.self, forKey: .isCompressionEnabled)
    }
    if container.contains(.isHttpAllowed) {
        self.isHttpAllowed = try container.decode(Bool?.self, forKey: .isHttpAllowed)
    }
    if container.contains(.isHttpsAllowed) {
        self.isHttpsAllowed = try container.decode(Bool?.self, forKey: .isHttpsAllowed)
    }
    if container.contains(.queryStringCachingBehavior) {
        self.queryStringCachingBehavior = try container.decode(QueryStringCachingBehaviorEnum?.self, forKey: .queryStringCachingBehavior)
    }
    if container.contains(.optimizationType) {
        self.optimizationType = try container.decode(OptimizationTypeEnum?.self, forKey: .optimizationType)
    }
    if container.contains(.probePath) {
        self.probePath = try container.decode(String?.self, forKey: .probePath)
    }
    if container.contains(.geoFilters) {
        self.geoFilters = try container.decode([GeoFilterData?]?.self, forKey: .geoFilters)
    }
    if container.contains(.hostName) {
        self.hostName = try container.decode(String?.self, forKey: .hostName)
    }
    self.origins = try container.decode([DeepCreatedOriginData].self, forKey: .origins)
    if container.contains(.resourceState) {
        self.resourceState = try container.decode(EndpointResourceStateEnum?.self, forKey: .resourceState)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    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.originHostHeader != nil {try container.encode(self.originHostHeader, forKey: .originHostHeader)}
    if self.originPath != nil {try container.encode(self.originPath, forKey: .originPath)}
    if self.contentTypesToCompress != nil {try container.encode(self.contentTypesToCompress as! [String]?, forKey: .contentTypesToCompress)}
    if self.isCompressionEnabled != nil {try container.encode(self.isCompressionEnabled, forKey: .isCompressionEnabled)}
    if self.isHttpAllowed != nil {try container.encode(self.isHttpAllowed, forKey: .isHttpAllowed)}
    if self.isHttpsAllowed != nil {try container.encode(self.isHttpsAllowed, forKey: .isHttpsAllowed)}
    if self.queryStringCachingBehavior != nil {try container.encode(self.queryStringCachingBehavior, forKey: .queryStringCachingBehavior)}
    if self.optimizationType != nil {try container.encode(self.optimizationType, forKey: .optimizationType)}
    if self.probePath != nil {try container.encode(self.probePath, forKey: .probePath)}
    if self.geoFilters != nil {try container.encode(self.geoFilters as! [GeoFilterData?]?, forKey: .geoFilters)}
    if self.hostName != nil {try container.encode(self.hostName, forKey: .hostName)}
    try container.encode(self.origins as! [DeepCreatedOriginData], forKey: .origins)
    if self.resourceState != nil {try container.encode(self.resourceState, forKey: .resourceState)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
  }
}

extension DataFactory {
  public static func createEndpointPropertiesProtocol(origins: [DeepCreatedOriginProtocol]) -> EndpointPropertiesProtocol {
    return EndpointPropertiesData(origins: origins)
  }
}


// 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 EndpointPropertiesUpdateParametersData : EndpointPropertiesUpdateParametersProtocol {
    public var originHostHeader: String?
    public var originPath: String?
    public var contentTypesToCompress: [String]?
    public var isCompressionEnabled: Bool?
    public var isHttpAllowed: Bool?
    public var isHttpsAllowed: Bool?
    public var queryStringCachingBehavior: QueryStringCachingBehaviorEnum?
    public var optimizationType: OptimizationTypeEnum?
    public var probePath: String?
    public var geoFilters: [GeoFilterProtocol?]?

        enum CodingKeys: String, CodingKey {case originHostHeader = "originHostHeader"
        case originPath = "originPath"
        case contentTypesToCompress = "contentTypesToCompress"
        case isCompressionEnabled = "isCompressionEnabled"
        case isHttpAllowed = "isHttpAllowed"
        case isHttpsAllowed = "isHttpsAllowed"
        case queryStringCachingBehavior = "queryStringCachingBehavior"
        case optimizationType = "optimizationType"
        case probePath = "probePath"
        case geoFilters = "geoFilters"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.originHostHeader) {
        self.originHostHeader = try container.decode(String?.self, forKey: .originHostHeader)
    }
    if container.contains(.originPath) {
        self.originPath = try container.decode(String?.self, forKey: .originPath)
    }
    if container.contains(.contentTypesToCompress) {
        self.contentTypesToCompress = try container.decode([String]?.self, forKey: .contentTypesToCompress)
    }
    if container.contains(.isCompressionEnabled) {
        self.isCompressionEnabled = try container.decode(Bool?.self, forKey: .isCompressionEnabled)
    }
    if container.contains(.isHttpAllowed) {
        self.isHttpAllowed = try container.decode(Bool?.self, forKey: .isHttpAllowed)
    }
    if container.contains(.isHttpsAllowed) {
        self.isHttpsAllowed = try container.decode(Bool?.self, forKey: .isHttpsAllowed)
    }
    if container.contains(.queryStringCachingBehavior) {
        self.queryStringCachingBehavior = try container.decode(QueryStringCachingBehaviorEnum?.self, forKey: .queryStringCachingBehavior)
    }
    if container.contains(.optimizationType) {
        self.optimizationType = try container.decode(OptimizationTypeEnum?.self, forKey: .optimizationType)
    }
    if container.contains(.probePath) {
        self.probePath = try container.decode(String?.self, forKey: .probePath)
    }
    if container.contains(.geoFilters) {
        self.geoFilters = try container.decode([GeoFilterData?]?.self, forKey: .geoFilters)
    }
    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.originHostHeader != nil {try container.encode(self.originHostHeader, forKey: .originHostHeader)}
    if self.originPath != nil {try container.encode(self.originPath, forKey: .originPath)}
    if self.contentTypesToCompress != nil {try container.encode(self.contentTypesToCompress as! [String]?, forKey: .contentTypesToCompress)}
    if self.isCompressionEnabled != nil {try container.encode(self.isCompressionEnabled, forKey: .isCompressionEnabled)}
    if self.isHttpAllowed != nil {try container.encode(self.isHttpAllowed, forKey: .isHttpAllowed)}
    if self.isHttpsAllowed != nil {try container.encode(self.isHttpsAllowed, forKey: .isHttpsAllowed)}
    if self.queryStringCachingBehavior != nil {try container.encode(self.queryStringCachingBehavior, forKey: .queryStringCachingBehavior)}
    if self.optimizationType != nil {try container.encode(self.optimizationType, forKey: .optimizationType)}
    if self.probePath != nil {try container.encode(self.probePath, forKey: .probePath)}
    if self.geoFilters != nil {try container.encode(self.geoFilters as! [GeoFilterData?]?, forKey: .geoFilters)}
  }
}

extension DataFactory {
  public static func createEndpointPropertiesUpdateParametersProtocol() -> EndpointPropertiesUpdateParametersProtocol {
    return EndpointPropertiesUpdateParametersData()
  }
}


// EndpointResourceState enumerates the values for endpoint resource state.

// 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 EndpointResourceStateEnum: String, Codable
{
// EndpointResourceStateCreating specifies the endpoint resource state creating state for endpoint resource state.
    case EndpointResourceStateCreating = "Creating"
// EndpointResourceStateDeleting specifies the endpoint resource state deleting state for endpoint resource state.
    case EndpointResourceStateDeleting = "Deleting"
// EndpointResourceStateRunning specifies the endpoint resource state running state for endpoint resource state.
    case EndpointResourceStateRunning = "Running"
// EndpointResourceStateStarting specifies the endpoint resource state starting state for endpoint resource state.
    case EndpointResourceStateStarting = "Starting"
// EndpointResourceStateStopped specifies the endpoint resource state stopped state for endpoint resource state.
    case EndpointResourceStateStopped = "Stopped"
// EndpointResourceStateStopping specifies the endpoint resource state stopping state for endpoint resource state.
    case EndpointResourceStateStopping = "Stopping"
}


// 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 EndpointUpdateParametersData : EndpointUpdateParametersProtocol {
    public var tags: [String:String]?
    public var properties: EndpointPropertiesUpdateParametersProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createEndpointUpdateParametersProtocol() -> EndpointUpdateParametersProtocol {
    return EndpointUpdateParametersData()
  }
}


// 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 ErrorResponseData : ErrorResponseProtocol {
    public var code: String?
    public var message: String?

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

  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 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)}
  }
}

extension DataFactory {
  public static func createErrorResponseProtocol() -> ErrorResponseProtocol {
    return ErrorResponseData()
  }
}


// GeoFilterActions enumerates the values for geo filter actions.

// 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 GeoFilterActionsEnum: String, Codable
{
// Allow specifies the allow state for geo filter actions.
    case Allow = "Allow"
// Block specifies the block state for geo filter actions.
    case Block = "Block"
}


// 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 GeoFilterData : GeoFilterProtocol {
    public var relativePath: String
    public var action: GeoFilterActionsEnum
    public var countryCodes: [String]

        enum CodingKeys: String, CodingKey {case relativePath = "relativePath"
        case action = "action"
        case countryCodes = "countryCodes"
        }

  public init(relativePath: String, action: GeoFilterActionsEnum, countryCodes: [String])  {
    self.relativePath = relativePath
    self.action = action
    self.countryCodes = countryCodes
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.relativePath = try container.decode(String.self, forKey: .relativePath)
    self.action = try container.decode(GeoFilterActionsEnum.self, forKey: .action)
    self.countryCodes = try container.decode([String].self, forKey: .countryCodes)
    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.relativePath, forKey: .relativePath)
    try container.encode(self.action, forKey: .action)
    try container.encode(self.countryCodes as! [String], forKey: .countryCodes)
  }
}

extension DataFactory {
  public static func createGeoFilterProtocol(relativePath: String, action: GeoFilterActionsEnum, countryCodes: [String]) -> GeoFilterProtocol {
    return GeoFilterData(relativePath: relativePath, action: action, countryCodes: countryCodes)
  }
}


// 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 IpAddressGroupData : IpAddressGroupProtocol {
    public var deliveryRegion: String?
    public var ipv4Addresses: [CidrIpAddressProtocol?]?
    public var ipv6Addresses: [CidrIpAddressProtocol?]?

        enum CodingKeys: String, CodingKey {case deliveryRegion = "deliveryRegion"
        case ipv4Addresses = "ipv4Addresses"
        case ipv6Addresses = "ipv6Addresses"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createIpAddressGroupProtocol() -> IpAddressGroupProtocol {
    return IpAddressGroupData()
  }
}


// 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 LoadParametersData : LoadParametersProtocol {
    public var contentPaths: [String]

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

  public init(contentPaths: [String])  {
    self.contentPaths = contentPaths
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.contentPaths = try container.decode([String].self, forKey: .contentPaths)
    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.contentPaths as! [String], forKey: .contentPaths)
  }
}

extension DataFactory {
  public static func createLoadParametersProtocol(contentPaths: [String]) -> LoadParametersProtocol {
    return LoadParametersData(contentPaths: contentPaths)
  }
}


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

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

  public init()  {
  }

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

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

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


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationDisplayProtocol() -> OperationDisplayProtocol {
    return OperationDisplayData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationsListResultProtocol() -> OperationsListResultProtocol {
    return OperationsListResultData()
  }
}


// OptimizationType enumerates the values for optimization type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum OptimizationTypeEnum: String, Codable
{
// DynamicSiteAcceleration specifies the dynamic site acceleration state for optimization type.
    case DynamicSiteAcceleration = "DynamicSiteAcceleration"
// GeneralMediaStreaming specifies the general media streaming state for optimization type.
    case GeneralMediaStreaming = "GeneralMediaStreaming"
// GeneralWebDelivery specifies the general web delivery state for optimization type.
    case GeneralWebDelivery = "GeneralWebDelivery"
// LargeFileDownload specifies the large file download state for optimization type.
    case LargeFileDownload = "LargeFileDownload"
// VideoOnDemandMediaStreaming specifies the video on demand media streaming state for optimization type.
    case VideoOnDemandMediaStreaming = "VideoOnDemandMediaStreaming"
}


// 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 OriginData : OriginProtocol, TrackedResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var tags: [String:String]?
    public var properties: OriginPropertiesProtocol?

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

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

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

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

extension DataFactory {
  public static func createOriginProtocol(location: String) -> OriginProtocol {
    return OriginData(location: location)
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOriginListResultProtocol() -> OriginListResultProtocol {
    return OriginListResultData()
  }
}