// 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 OriginPropertiesData : OriginPropertiesProtocol {
    public var hostName: String
    public var httpPort: Int32?
    public var httpsPort: Int32?
    public var resourceState: OriginResourceStateEnum?
    public var provisioningState: String?

        enum CodingKeys: String, CodingKey {case hostName = "hostName"
        case httpPort = "httpPort"
        case httpsPort = "httpsPort"
        case resourceState = "resourceState"
        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(.httpPort) {
        self.httpPort = try container.decode(Int32?.self, forKey: .httpPort)
    }
    if container.contains(.httpsPort) {
        self.httpsPort = try container.decode(Int32?.self, forKey: .httpsPort)
    }
    if container.contains(.resourceState) {
        self.resourceState = try container.decode(OriginResourceStateEnum?.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)
    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)}
    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 createOriginPropertiesProtocol(hostName: String) -> OriginPropertiesProtocol {
    return OriginPropertiesData(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 OriginPropertiesParametersData : OriginPropertiesParametersProtocol {
    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()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.hostName) {
        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)
    if self.hostName != nil {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 createOriginPropertiesParametersProtocol() -> OriginPropertiesParametersProtocol {
    return OriginPropertiesParametersData()
  }
}


// OriginResourceState enumerates the values for origin 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 OriginResourceStateEnum: String, Codable
{
// OriginResourceStateActive specifies the origin resource state active state for origin resource state.
    case OriginResourceStateActive = "Active"
// OriginResourceStateCreating specifies the origin resource state creating state for origin resource state.
    case OriginResourceStateCreating = "Creating"
// OriginResourceStateDeleting specifies the origin resource state deleting state for origin resource state.
    case OriginResourceStateDeleting = "Deleting"
}


// 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 OriginUpdateParametersData : OriginUpdateParametersProtocol {
    public var properties: OriginPropertiesParametersProtocol?

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

extension DataFactory {
  public static func createOriginUpdateParametersProtocol() -> OriginUpdateParametersProtocol {
    return OriginUpdateParametersData()
  }
}


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

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

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

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

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

extension DataFactory {
  public static func createProfileProtocol(location: String, sku: SkuProtocol) -> ProfileProtocol {
    return ProfileData(location: location, sku: sku)
  }
}


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

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


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

        enum CodingKeys: String, CodingKey {case resourceState = "resourceState"
        case provisioningState = "provisioningState"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.resourceState) {
        self.resourceState = try container.decode(ProfileResourceStateEnum?.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.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 createProfilePropertiesProtocol() -> ProfilePropertiesProtocol {
    return ProfilePropertiesData()
  }
}


// ProfileResourceState enumerates the values for profile 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 ProfileResourceStateEnum: String, Codable
{
// ProfileResourceStateActive specifies the profile resource state active state for profile resource state.
    case ProfileResourceStateActive = "Active"
// ProfileResourceStateCreating specifies the profile resource state creating state for profile resource state.
    case ProfileResourceStateCreating = "Creating"
// ProfileResourceStateDeleting specifies the profile resource state deleting state for profile resource state.
    case ProfileResourceStateDeleting = "Deleting"
// ProfileResourceStateDisabled specifies the profile resource state disabled state for profile resource state.
    case ProfileResourceStateDisabled = "Disabled"
}


// 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 ProfileUpdateParametersData : ProfileUpdateParametersProtocol {
    public var tags: [String:String]?

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

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

extension DataFactory {
  public static func createProfileUpdateParametersProtocol() -> ProfileUpdateParametersProtocol {
    return ProfileUpdateParametersData()
  }
}


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

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

  public init()  {
  }

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

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

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct PurgeParametersData : PurgeParametersProtocol {
    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 createPurgeParametersProtocol(contentPaths: [String]) -> PurgeParametersProtocol {
    return PurgeParametersData(contentPaths: contentPaths)
  }
}


// QueryStringCachingBehavior enumerates the values for query string caching behavior.

// 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 QueryStringCachingBehaviorEnum: String, Codable
{
// BypassCaching specifies the bypass caching state for query string caching behavior.
    case BypassCaching = "BypassCaching"
// IgnoreQueryString specifies the ignore query string state for query string caching behavior.
    case IgnoreQueryString = "IgnoreQueryString"
// NotSet specifies the not set state for query string caching behavior.
    case NotSet = "NotSet"
// UseQueryString specifies the use query string state for query string caching behavior.
    case UseQueryString = "UseQueryString"
}


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

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

  public init()  {
  }

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

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

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


// ResourceType enumerates the values for resource 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 ResourceTypeEnum: String, Codable
{
// MicrosoftCdnProfilesEndpoints specifies the microsoft cdn profiles endpoints state for resource type.
    case MicrosoftCdnProfilesEndpoints = "Microsoft.Cdn/Profiles/Endpoints"
}


// 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 ResourceUsageData : ResourceUsageProtocol {
    public var resourceType: String?
    public var unit: String?
    public var currentValue: Int32?
    public var limit: Int32?

        enum CodingKeys: String, CodingKey {case resourceType = "resourceType"
        case unit = "unit"
        case currentValue = "currentValue"
        case limit = "limit"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createResourceUsageProtocol() -> ResourceUsageProtocol {
    return ResourceUsageData()
  }
}


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

extension DataFactory {
  public static func createResourceUsageListResultProtocol() -> ResourceUsageListResultProtocol {
    return ResourceUsageListResultData()
  }
}


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

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

  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(SkuNameEnum?.self, forKey: .name)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createSkuProtocol() -> SkuProtocol {
    return SkuData()
  }
}


// SkuName enumerates the values for sku name.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SkuNameEnum: String, Codable
{
// CustomVerizon specifies the custom verizon state for sku name.
    case CustomVerizon = "Custom_Verizon"
// PremiumVerizon specifies the premium verizon state for sku name.
    case PremiumVerizon = "Premium_Verizon"
// StandardAkamai specifies the standard akamai state for sku name.
    case StandardAkamai = "Standard_Akamai"
// StandardChinaCdn specifies the standard china cdn state for sku name.
    case StandardChinaCdn = "Standard_ChinaCdn"
// StandardVerizon specifies the standard verizon state for sku name.
    case StandardVerizon = "Standard_Verizon"
}


// 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 SsoUriData : SsoUriProtocol {
    public var ssoUriValue: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createSsoUriProtocol() -> SsoUriProtocol {
    return SsoUriData()
  }
}


// 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 SupportedOptimizationTypesListResultData : SupportedOptimizationTypesListResultProtocol {
    public var supportedOptimizationTypes: [OptimizationTypeEnum?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createSupportedOptimizationTypesListResultProtocol() -> SupportedOptimizationTypesListResultProtocol {
    return SupportedOptimizationTypesListResultData()
  }
}


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

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

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

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

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

extension DataFactory {
  public static func createTrackedResourceProtocol(location: String) -> TrackedResourceProtocol {
    return TrackedResourceData(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 ValidateCustomDomainInputData : ValidateCustomDomainInputProtocol {
    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 createValidateCustomDomainInputProtocol(hostName: String) -> ValidateCustomDomainInputProtocol {
    return ValidateCustomDomainInputData(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 ValidateCustomDomainOutputData : ValidateCustomDomainOutputProtocol {
    public var customDomainValidated: Bool?
    public var reason: String?
    public var message: String?

        enum CodingKeys: String, CodingKey {case customDomainValidated = "customDomainValidated"
        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(.customDomainValidated) {
        self.customDomainValidated = try container.decode(Bool?.self, forKey: .customDomainValidated)
    }
    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.customDomainValidated != nil {try container.encode(self.customDomainValidated, forKey: .customDomainValidated)}
    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 createValidateCustomDomainOutputProtocol() -> ValidateCustomDomainOutputProtocol {
    return ValidateCustomDomainOutputData()
  }
}


// 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 ValidateProbeInputData : ValidateProbeInputProtocol {
    public var probeURL: String

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

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

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

extension DataFactory {
  public static func createValidateProbeInputProtocol(probeURL: String) -> ValidateProbeInputProtocol {
    return ValidateProbeInputData(probeURL: probeURL)
  }
}


// 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 ValidateProbeOutputData : ValidateProbeOutputProtocol {
    public var isValid: Bool?
    public var errorCode: String?
    public var message: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createValidateProbeOutputProtocol() -> ValidateProbeOutputProtocol {
    return ValidateProbeOutputData()
  }
}


// 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
// CheckNameAvailabilityInputProtocol is input of CheckNameAvailability API.
public protocol CheckNameAvailabilityInputProtocol : Codable {
     var name: String { get set }
     var type: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CheckNameAvailabilityOutputProtocol is output of check name availability API.
public protocol CheckNameAvailabilityOutputProtocol : Codable {
     var nameAvailable: Bool? { get set }
     var reason: String? { get set }
     var message: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CidrIpAddressProtocol is CIDR Ip address
public protocol CidrIpAddressProtocol : Codable {
     var baseIpAddress: String? { get set }
     var prefixLength: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CustomDomainListResultProtocol is result of the request to list custom domains. It contains a list of custom domain
// objects and a URL link to get the next set of results.
public protocol CustomDomainListResultProtocol : Codable {
     var value: [CustomDomainProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CustomDomainParametersProtocol is the customDomain JSON object required for custom domain creation or update.
public protocol CustomDomainParametersProtocol : Codable {
     var properties: CustomDomainPropertiesParametersProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CustomDomainPropertiesParametersProtocol is the JSON object that contains the properties of the custom domain to
// create.
public protocol CustomDomainPropertiesParametersProtocol : Codable {
     var hostName: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CustomDomainPropertiesProtocol is the JSON object that contains the properties of the custom domain to create.
public protocol CustomDomainPropertiesProtocol : Codable {
     var hostName: String { get set }
     var resourceState: CustomDomainResourceStateEnum? { get set }
     var customHttpsProvisioningState: CustomHttpsProvisioningStateEnum? { get set }
     var customHttpsProvisioningSubstate: CustomHttpsProvisioningSubstateEnum? { get set }
     var validationData: String? { get set }
     var provisioningState: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CustomDomainProtocol is friendly domain name mapping to the endpoint hostname that the customer provides for
// branding purposes, e.g. www.consoto.com.
public protocol CustomDomainProtocol : ProxyResourceProtocol {
     var properties: CustomDomainPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// DeepCreatedOriginPropertiesProtocol is properties of the origin created on the CDN endpoint.
public protocol DeepCreatedOriginPropertiesProtocol : Codable {
     var hostName: String { get set }
     var httpPort: Int32? { get set }
     var httpsPort: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// DeepCreatedOriginProtocol is the main origin of CDN content which is added when creating a CDN endpoint.
public protocol DeepCreatedOriginProtocol : Codable {
     var name: String { get set }
     var properties: DeepCreatedOriginPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EdgeNodePropertiesProtocol is the JSON object that contains the properties required to create an edgenode.
public protocol EdgeNodePropertiesProtocol : Codable {
     var ipAddressGroups: [IpAddressGroupProtocol] { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EdgeNodeProtocol is edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users.
public protocol EdgeNodeProtocol : ProxyResourceProtocol {
     var properties: EdgeNodePropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EdgenodeResultProtocol is result of the request to list CDN edgenodes. It contains a list of ip address group and a
// URL link to get the next set of results.
public protocol EdgenodeResultProtocol : Codable {
     var value: [EdgeNodeProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EndpointListResultProtocol is result of the request to list endpoints. It contains a list of endpoint objects and a
// URL link to get the the next set of results.
public protocol EndpointListResultProtocol : Codable {
     var value: [EndpointProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EndpointPropertiesProtocol is the JSON object that contains the properties required to create an endpoint.
public protocol EndpointPropertiesProtocol : EndpointPropertiesUpdateParametersProtocol {
     var hostName: String? { get set }
     var origins: [DeepCreatedOriginProtocol] { get set }
     var resourceState: EndpointResourceStateEnum? { get set }
     var provisioningState: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EndpointPropertiesUpdateParametersProtocol is the JSON object containing endpoint update parameters.
public protocol EndpointPropertiesUpdateParametersProtocol : Codable {
     var originHostHeader: String? { get set }
     var originPath: String? { get set }
     var contentTypesToCompress: [String]? { get set }
     var isCompressionEnabled: Bool? { get set }
     var isHttpAllowed: Bool? { get set }
     var isHttpsAllowed: Bool? { get set }
     var queryStringCachingBehavior: QueryStringCachingBehaviorEnum? { get set }
     var optimizationType: OptimizationTypeEnum? { get set }
     var probePath: String? { get set }
     var geoFilters: [GeoFilterProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EndpointProtocol is CDN endpoint is the entity within a CDN profile containing configuration information such as
// origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format
// <endpointname>.azureedge.net.
public protocol EndpointProtocol : TrackedResourceProtocol {
     var properties: EndpointPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EndpointUpdateParametersProtocol is properties required to create or update an endpoint.
public protocol EndpointUpdateParametersProtocol : Codable {
     var tags: [String:String]? { get set }
     var properties: EndpointPropertiesUpdateParametersProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ErrorResponseProtocol is error reponse indicates CDN service is not able to process the incoming request. The reason
// is provided in the error message.
public protocol ErrorResponseProtocol : Codable {
     var code: String? { get set }
     var message: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// GeoFilterProtocol is rules defining user's geo access within a CDN endpoint.
public protocol GeoFilterProtocol : Codable {
     var relativePath: String { get set }
     var action: GeoFilterActionsEnum { get set }
     var countryCodes: [String] { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// IpAddressGroupProtocol is CDN Ip address group
public protocol IpAddressGroupProtocol : Codable {
     var deliveryRegion: String? { get set }
     var ipv4Addresses: [CidrIpAddressProtocol?]? { get set }
     var ipv6Addresses: [CidrIpAddressProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// LoadParametersProtocol is parameters required for content load.
public protocol LoadParametersProtocol : Codable {
     var contentPaths: [String] { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationDisplayProtocol is the object that represents the operation.
public protocol OperationDisplayProtocol : Codable {
     var provider: String? { get set }
     var resource: String? { get set }
     var operation: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationProtocol is CDN REST API operation
public protocol OperationProtocol : Codable {
     var name: String? { get set }
     var display: OperationDisplayProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationsListResultProtocol is result of the request to list CDN operations. It contains a list of operations and a
// URL link to get the next set of results.
public protocol OperationsListResultProtocol : Codable {
     var value: [OperationProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OriginListResultProtocol is result of the request to list origins. It contains a list of origin objects and a URL
// link to get the next set of results.
public protocol OriginListResultProtocol : Codable {
     var value: [OriginProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OriginPropertiesParametersProtocol is the JSON object that contains the properties of the origin.
public protocol OriginPropertiesParametersProtocol : Codable {
     var hostName: String? { get set }
     var httpPort: Int32? { get set }
     var httpsPort: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OriginPropertiesProtocol is the JSON object that contains the properties of the origin.
public protocol OriginPropertiesProtocol : Codable {
     var hostName: String { get set }
     var httpPort: Int32? { get set }
     var httpsPort: Int32? { get set }
     var resourceState: OriginResourceStateEnum? { get set }
     var provisioningState: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OriginProtocol is CDN origin is the source of the content being delivered via CDN. When the edge nodes represented
// by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of the configured
// origins.
public protocol OriginProtocol : TrackedResourceProtocol {
     var properties: OriginPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OriginUpdateParametersProtocol is origin properties needed for origin creation or update.
public protocol OriginUpdateParametersProtocol : Codable {
     var properties: OriginPropertiesParametersProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ProfileListResultProtocol is result of the request to list profiles. It contains a list of profile objects and a URL
// link to get the the next set of results.
public protocol ProfileListResultProtocol : Codable {
     var value: [ProfileProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ProfilePropertiesProtocol is the JSON object that contains the properties required to create a profile.
public protocol ProfilePropertiesProtocol : Codable {
     var resourceState: ProfileResourceStateEnum? { get set }
     var provisioningState: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ProfileProtocol is CDN profile is a logical grouping of endpoints that share the same settings, such as CDN provider
// and pricing tier.
public protocol ProfileProtocol : TrackedResourceProtocol {
     var sku: SkuProtocol { get set }
     var properties: ProfilePropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ProfileUpdateParametersProtocol is properties required to update a profile.
public protocol ProfileUpdateParametersProtocol : Codable {
     var tags: [String:String]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ProxyResourceProtocol is the resource model definition for a ARM proxy resource. It will have everything other than
// required location and tags
public protocol ProxyResourceProtocol : ResourceProtocol {
}


// 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
// PurgeParametersProtocol is parameters required for content purge.
public protocol PurgeParametersProtocol : Codable {
     var contentPaths: [String] { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ResourceProtocol is the core properties of ARM resources
public protocol ResourceProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ResourceUsageListResultProtocol is output of check resource usage API.
public protocol ResourceUsageListResultProtocol : Codable {
     var value: [ResourceUsageProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ResourceUsageProtocol is output of check resource usage API.
public protocol ResourceUsageProtocol : Codable {
     var resourceType: String? { get set }
     var unit: String? { get set }
     var currentValue: Int32? { get set }
     var limit: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SkuProtocol is the pricing tier (defines a CDN provider, feature list and rate) of the CDN profile.
public protocol SkuProtocol : Codable {
     var name: SkuNameEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SsoUriProtocol is the URI required to login to the supplemental portal from the Azure portal.
public protocol SsoUriProtocol : Codable {
     var ssoUriValue: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SupportedOptimizationTypesListResultProtocol is the result of the GetSupportedOptimizationTypes API
public protocol SupportedOptimizationTypesListResultProtocol : Codable {
     var supportedOptimizationTypes: [OptimizationTypeEnum?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// TrackedResourceProtocol is the resource model definition for a ARM tracked top level resource.
public protocol TrackedResourceProtocol : ResourceProtocol {
     var location: String { get set }
     var tags: [String:String]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ValidateCustomDomainInputProtocol is input of the custom domain to be validated for DNS mapping.
public protocol ValidateCustomDomainInputProtocol : Codable {
     var hostName: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ValidateCustomDomainOutputProtocol is output of custom domain validation.
public protocol ValidateCustomDomainOutputProtocol : Codable {
     var customDomainValidated: Bool? { get set }
     var reason: String? { get set }
     var message: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ValidateProbeInputProtocol is input of the validate probe API.
public protocol ValidateProbeInputProtocol : Codable {
     var probeURL: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ValidateProbeOutputProtocol is output of the validate probe API.
public protocol ValidateProbeOutputProtocol : Codable {
     var isValid: Bool? { get set }
     var errorCode: String? { get set }
     var message: String? { get set }
}


// swift-tools-version:4.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
    name: "cognitiveservices",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "cognitiveservices",
            targets: ["cognitiveservices"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(url: "https://github.com/Alamofire/Alamofire.git", from: "4.0.10"),
        .package(url: "https://github.com/ReactiveX/RxSwift.git", from: "3.4.2"),
        .package(url: "https://github.com/SwiftyJSON/SwiftyJSON.git", from: "3.1.4"),
        .package(url: "git@github.com:alvadb/autorest-clientruntime-for-swift.git", .branch("master"))
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages which this package depends on.
        .target(
            name: "cognitiveservices",
            dependencies: ["Alamofire", "RxSwift", "SwiftyJSON", "azureSwiftRuntime"])
    ]
)


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

// Accounts is the cognitive Services Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Accounts {
    public static func Create(resourceGroupName: String, accountName: String, subscriptionId: String, parameters: CognitiveServicesAccountCreateParametersProtocol) -> AccountsCreate {
        return CreateCommand(resourceGroupName: resourceGroupName, accountName: accountName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, accountName: String, subscriptionId: String) -> AccountsDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, accountName: accountName, subscriptionId: subscriptionId)
    }
    public static func GetProperties(resourceGroupName: String, accountName: String, subscriptionId: String) -> AccountsGetProperties {
        return GetPropertiesCommand(resourceGroupName: resourceGroupName, accountName: accountName, subscriptionId: subscriptionId)
    }
    public static func List(subscriptionId: String) -> AccountsList {
        return ListCommand(subscriptionId: subscriptionId)
    }
    public static func ListByResourceGroup(resourceGroupName: String, subscriptionId: String) -> AccountsListByResourceGroup {
        return ListByResourceGroupCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func ListKeys(resourceGroupName: String, accountName: String, subscriptionId: String) -> AccountsListKeys {
        return ListKeysCommand(resourceGroupName: resourceGroupName, accountName: accountName, subscriptionId: subscriptionId)
    }
    public static func ListSkus(resourceGroupName: String, accountName: String, subscriptionId: String) -> AccountsListSkus {
        return ListSkusCommand(resourceGroupName: resourceGroupName, accountName: accountName, subscriptionId: subscriptionId)
    }
    public static func RegenerateKey(resourceGroupName: String, accountName: String, subscriptionId: String, parameters: RegenerateKeyParametersProtocol) -> AccountsRegenerateKey {
        return RegenerateKeyCommand(resourceGroupName: resourceGroupName, accountName: accountName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Update(resourceGroupName: String, accountName: String, subscriptionId: String, parameters: CognitiveServicesAccountUpdateParametersProtocol) -> AccountsUpdate {
        return UpdateCommand(resourceGroupName: resourceGroupName, accountName: accountName, subscriptionId: subscriptionId, parameters: parameters)
    }
}
}


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

extension Commands.Accounts {
// Create create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for
// developer to access intelligent APIs. It's also the resource type for billing.
    internal class CreateCommand : BaseCommand, AccountsCreate {
        public var resourceGroupName : String
        public var accountName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-18"
    public var parameters :  CognitiveServicesAccountCreateParametersProtocol?

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

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

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


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

extension Commands.Accounts {
// Delete deletes a Cognitive Services account from the resource group.
    internal class DeleteCommand : BaseCommand, AccountsDelete {
        public var resourceGroupName : String
        public var accountName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-18"

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

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

        }

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


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

extension Commands.Accounts {
// GetProperties returns a Cognitive Services account specified by the parameters.
    internal class GetPropertiesCommand : BaseCommand, AccountsGetProperties {
        public var resourceGroupName : String
        public var accountName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-18"

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

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


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

extension Commands.Accounts {
// List returns all the resources of a particular type belonging to a subscription.
    internal class ListCommand : BaseCommand, AccountsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2017-04-18"

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


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

extension Commands.Accounts {
// ListByResourceGroup returns all the resources of a particular type belonging to a resource group
    internal class ListByResourceGroupCommand : BaseCommand, AccountsListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-18"

        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.CognitiveServices/accounts"
            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(CognitiveServicesAccountListResultData?.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 (CognitiveServicesAccountListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: CognitiveServicesAccountListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Accounts {
// ListKeys lists the account keys for the specified Cognitive Services account.
    internal class ListKeysCommand : BaseCommand, AccountsListKeys {
        public var resourceGroupName : String
        public var accountName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-18"

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

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


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

extension Commands.Accounts {
// ListSkus list available SKUs for the requested Cognitive Services account
    internal class ListSkusCommand : BaseCommand, AccountsListSkus {
        public var resourceGroupName : String
        public var accountName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-18"

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

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


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

extension Commands.Accounts {
// RegenerateKey regenerates the specified account key for the specified Cognitive Services account.
    internal class RegenerateKeyCommand : BaseCommand, AccountsRegenerateKey {
        public var resourceGroupName : String
        public var accountName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-18"
    public var parameters :  RegenerateKeyParametersProtocol?

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

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

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


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

extension Commands.Accounts {
// Update updates a Cognitive Services account
    internal class UpdateCommand : BaseCommand, AccountsUpdate {
        public var resourceGroupName : String
        public var accountName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-18"
    public var parameters :  CognitiveServicesAccountUpdateParametersProtocol?

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

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

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

// CheckSkuAvailability is the cognitive Services Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct CheckSkuAvailability {
    public static func List(subscriptionId: String, location: String, parameters: CheckSkuAvailabilityParameterProtocol) -> CheckSkuAvailabilityList {
        return ListCommand(subscriptionId: subscriptionId, location: location, parameters: parameters)
    }
}
}


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

extension Commands.CheckSkuAvailability {
// List check available SKUs.
    internal class ListCommand : BaseCommand, CheckSkuAvailabilityList {
        public var subscriptionId : String
        public var location : String
        public var apiVersion = "2017-04-18"
    public var parameters :  CheckSkuAvailabilityParameterProtocol?

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

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

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


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

// Operations is the cognitive Services Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Operations {
    public static func List() -> OperationsList {
        return ListCommand()
    }
}
}