// 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
    public var tier: String?
    public var size: String?
    public var family: String?
    public var capacity: Int32?

        enum CodingKeys: String, CodingKey {case name = "name"
        case tier = "tier"
        case size = "size"
        case family = "family"
        case capacity = "capacity"
        }

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

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

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

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


// 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
{
// Basic specifies the basic state for sku name.
    case Basic = "Basic"
// Free specifies the free state for sku name.
    case Free = "Free"
// Standard specifies the standard state for sku name.
    case Standard = "Standard"
}


// 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 SubResourceData : SubResourceProtocol {
    public var id: String?

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

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

extension DataFactory {
  public static func createSubResourceProtocol() -> SubResourceProtocol {
    return SubResourceData()
  }
}


// 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 WnsCredentialData : WnsCredentialProtocol {
    public var properties: WnsCredentialPropertiesProtocol?

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

extension DataFactory {
  public static func createWnsCredentialProtocol() -> WnsCredentialProtocol {
    return WnsCredentialData()
  }
}


// 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 WnsCredentialPropertiesData : WnsCredentialPropertiesProtocol {
    public var packageSid: String?
    public var secretKey: String?
    public var windowsLiveEndpoint: String?

        enum CodingKeys: String, CodingKey {case packageSid = "packageSid"
        case secretKey = "secretKey"
        case windowsLiveEndpoint = "windowsLiveEndpoint"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createWnsCredentialPropertiesProtocol() -> WnsCredentialPropertiesProtocol {
    return WnsCredentialPropertiesData()
  }
}


// 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
// AdmCredentialPropertiesProtocol is description of a NotificationHub AdmCredential.
public protocol AdmCredentialPropertiesProtocol : Codable {
     var clientId: String? { get set }
     var clientSecret: String? { get set }
     var authTokenUrl: 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
// AdmCredentialProtocol is description of a NotificationHub AdmCredential.
public protocol AdmCredentialProtocol : Codable {
     var properties: AdmCredentialPropertiesProtocol? { 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
// ApnsCredentialPropertiesProtocol is description of a NotificationHub ApnsCredential.
public protocol ApnsCredentialPropertiesProtocol : Codable {
     var apnsCertificate: String? { get set }
     var certificateKey: String? { get set }
     var endpoint: String? { get set }
     var thumbprint: String? { get set }
     var keyId: String? { get set }
     var appName: String? { get set }
     var appId: String? { get set }
     var token: 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
// ApnsCredentialProtocol is description of a NotificationHub ApnsCredential.
public protocol ApnsCredentialProtocol : Codable {
     var properties: ApnsCredentialPropertiesProtocol? { 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
// BaiduCredentialPropertiesProtocol is description of a NotificationHub BaiduCredential.
public protocol BaiduCredentialPropertiesProtocol : Codable {
     var baiduApiKey: String? { get set }
     var baiduEndPoint: String? { get set }
     var baiduSecretKey: 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
// BaiduCredentialProtocol is description of a NotificationHub BaiduCredential.
public protocol BaiduCredentialProtocol : Codable {
     var properties: BaiduCredentialPropertiesProtocol? { 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
// CheckAvailabilityParametersProtocol is parameters supplied to the Check Name Availability for Namespace and
// NotificationHubs.
public protocol CheckAvailabilityParametersProtocol : Codable {
     var id: String? { get set }
     var name: String { get set }
     var type: String? { get set }
     var location: String { get set }
     var tags: [String:String]? { get set }
     var sku: SkuProtocol? { get set }
     var isAvailiable: Bool? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CheckAvailabilityResultProtocol is description of a CheckAvailibility resource.
public protocol CheckAvailabilityResultProtocol : ResourceProtocol {
     var isAvailiable: Bool? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CheckNameAvailabilityRequestParametersProtocol is parameters supplied to the Check Name Availability for Namespace
// and NotificationHubs.
public protocol CheckNameAvailabilityRequestParametersProtocol : 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
// CheckNameAvailabilityResponseProtocol is
public protocol CheckNameAvailabilityResponseProtocol : 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
// GcmCredentialPropertiesProtocol is description of a NotificationHub GcmCredential.
public protocol GcmCredentialPropertiesProtocol : Codable {
     var gcmEndpoint: String? { get set }
     var googleApiKey: 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
// GcmCredentialProtocol is description of a NotificationHub GcmCredential.
public protocol GcmCredentialProtocol : Codable {
     var properties: GcmCredentialPropertiesProtocol? { 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
// MpnsCredentialPropertiesProtocol is description of a NotificationHub MpnsCredential.
public protocol MpnsCredentialPropertiesProtocol : Codable {
     var mpnsCertificate: String? { get set }
     var certificateKey: String? { get set }
     var thumbprint: 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
// MpnsCredentialProtocol is description of a NotificationHub MpnsCredential.
public protocol MpnsCredentialProtocol : Codable {
     var properties: MpnsCredentialPropertiesProtocol? { 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
// NamespaceCreateOrUpdateParametersProtocol is parameters supplied to the CreateOrUpdate Namespace operation.
public protocol NamespaceCreateOrUpdateParametersProtocol : ResourceProtocol {
     var properties: NamespacePropertiesProtocol? { 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
// NamespaceListResultProtocol is the response of the List Namespace operation.
public protocol NamespaceListResultProtocol : Codable {
     var value: [NamespaceResourceProtocol?]? { 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
// NamespacePatchParametersProtocol is parameters supplied to the Patch Namespace operation.
public protocol NamespacePatchParametersProtocol : Codable {
     var tags: [String:String]? { get set }
     var sku: SkuProtocol? { 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
// NamespacePropertiesProtocol is namespace properties.
public protocol NamespacePropertiesProtocol : Codable {
     var name: String? { get set }
     var provisioningState: String? { get set }
     var region: String? { get set }
     var status: String? { get set }
     var createdAt: Date? { get set }
     var serviceBusEndpoint: String? { get set }
     var subscriptionId: String? { get set }
     var scaleUnit: String? { get set }
     var enabled: Bool? { get set }
     var critical: Bool? { get set }
     var namespaceType: NamespaceTypeEnum? { 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
// NamespaceResourceProtocol is description of a Namespace resource.
public protocol NamespaceResourceProtocol : ResourceProtocol {
     var properties: NamespacePropertiesProtocol? { 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
// NotificationHubCreateOrUpdateParametersProtocol is parameters supplied to the CreateOrUpdate NotificationHub
// operation.
public protocol NotificationHubCreateOrUpdateParametersProtocol : ResourceProtocol {
     var properties: NotificationHubPropertiesProtocol { 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
// NotificationHubListResultProtocol is the response of the List NotificationHub operation.
public protocol NotificationHubListResultProtocol : Codable {
     var value: [NotificationHubResourceProtocol?]? { 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
// NotificationHubPropertiesProtocol is notificationHub properties.
public protocol NotificationHubPropertiesProtocol : Codable {
     var name: String? { get set }
     var registrationTtl: String? { get set }
     var authorizationRules: [SharedAccessAuthorizationRulePropertiesProtocol?]? { get set }
     var apnsCredential: ApnsCredentialProtocol? { get set }
     var wnsCredential: WnsCredentialProtocol? { get set }
     var gcmCredential: GcmCredentialProtocol? { get set }
     var mpnsCredential: MpnsCredentialProtocol? { get set }
     var admCredential: AdmCredentialProtocol? { get set }
     var baiduCredential: BaiduCredentialProtocol? { 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
// NotificationHubResourceProtocol is description of a NotificationHub Resource.
public protocol NotificationHubResourceProtocol : ResourceProtocol {
     var properties: NotificationHubPropertiesProtocol? { 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
// PnsCredentialsPropertiesProtocol is description of a NotificationHub PNS Credentials.
public protocol PnsCredentialsPropertiesProtocol : Codable {
     var apnsCredential: ApnsCredentialProtocol? { get set }
     var wnsCredential: WnsCredentialProtocol? { get set }
     var gcmCredential: GcmCredentialProtocol? { get set }
     var mpnsCredential: MpnsCredentialProtocol? { get set }
     var admCredential: AdmCredentialProtocol? { get set }
     var baiduCredential: BaiduCredentialProtocol? { 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
// PnsCredentialsResourceProtocol is description of a NotificationHub PNS Credentials.
public protocol PnsCredentialsResourceProtocol : ResourceProtocol {
     var properties: PnsCredentialsPropertiesProtocol? { 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
// PolicykeyResourceProtocol is namespace/NotificationHub Regenerate Keys
public protocol PolicykeyResourceProtocol : Codable {
     var policyKey: 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
// ResourceListKeysProtocol is namespace/NotificationHub Connection String
public protocol ResourceListKeysProtocol : Codable {
     var primaryConnectionString: String? { get set }
     var secondaryConnectionString: String? { get set }
     var primaryKey: String? { get set }
     var secondaryKey: String? { get set }
     var keyName: 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
public protocol ResourceProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var location: String { get set }
     var tags: [String:String]? { get set }
     var sku: SkuProtocol? { 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
// SharedAccessAuthorizationRuleCreateOrUpdateParametersProtocol is parameters supplied to the CreateOrUpdate Namespace
// AuthorizationRules.
public protocol SharedAccessAuthorizationRuleCreateOrUpdateParametersProtocol : ResourceProtocol {
     var properties: SharedAccessAuthorizationRulePropertiesProtocol { 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
// SharedAccessAuthorizationRuleListResultProtocol is the response of the List Namespace operation.
public protocol SharedAccessAuthorizationRuleListResultProtocol : Codable {
     var value: [SharedAccessAuthorizationRuleResourceProtocol?]? { 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
// SharedAccessAuthorizationRulePropertiesProtocol is sharedAccessAuthorizationRule properties.
public protocol SharedAccessAuthorizationRulePropertiesProtocol : Codable {
     var rights: [AccessRightsEnum?]? { 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
// SharedAccessAuthorizationRuleResourceProtocol is description of a Namespace AuthorizationRules.
public protocol SharedAccessAuthorizationRuleResourceProtocol : ResourceProtocol {
     var properties: SharedAccessAuthorizationRulePropertiesProtocol? { 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 Sku description for a namespace
public protocol SkuProtocol : Codable {
     var name: SkuNameEnum { get set }
     var tier: String? { get set }
     var size: String? { get set }
     var family: String? { get set }
     var capacity: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SubResourceProtocol is
public protocol SubResourceProtocol : Codable {
     var id: 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
// WnsCredentialPropertiesProtocol is description of a NotificationHub WnsCredential.
public protocol WnsCredentialPropertiesProtocol : Codable {
     var packageSid: String? { get set }
     var secretKey: String? { get set }
     var windowsLiveEndpoint: 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
// WnsCredentialProtocol is description of a NotificationHub WnsCredential.
public protocol WnsCredentialProtocol : Codable {
     var properties: WnsCredentialPropertiesProtocol? { 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: "powerbi",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "powerbi",
            targets: ["powerbi"]),
    ],
    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: "powerbi",
            dependencies: ["Alamofire", "RxSwift", "SwiftyJSON", "azureSwiftRuntime"])
    ]
)


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


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

// ManagementClient is the client to manage your Power BI Embedded workspace collections and retrieve workspaces.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Service {
    public static func GetAvailableOperations() -> ServiceGetAvailableOperations {
        return GetAvailableOperationsCommand()
    }
}
}


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

extension Commands.Service {
// GetAvailableOperations indicates which operations can be performed by the Power BI Resource Provider.
    internal class GetAvailableOperationsCommand : BaseCommand, ServiceGetAvailableOperations {
        public var apiVersion = "2016-01-29"

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

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

        }

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

// WorkspaceCollections is the client to manage your Power BI Embedded workspace collections and retrieve workspaces.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct WorkspaceCollections {
    public static func CheckNameAvailability(subscriptionId: String, location: String, _body: CheckNameRequestProtocol) -> WorkspaceCollectionsCheckNameAvailability {
        return CheckNameAvailabilityCommand(subscriptionId: subscriptionId, location: location, _body: _body)
    }
    public static func Create(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String, _body: CreateWorkspaceCollectionRequestProtocol) -> WorkspaceCollectionsCreate {
        return CreateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workspaceCollectionName: workspaceCollectionName, _body: _body)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String) -> WorkspaceCollectionsDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workspaceCollectionName: workspaceCollectionName)
    }
    public static func GetAccessKeys(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String) -> WorkspaceCollectionsGetAccessKeys {
        return GetAccessKeysCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workspaceCollectionName: workspaceCollectionName)
    }
    public static func GetByName(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String) -> WorkspaceCollectionsGetByName {
        return GetByNameCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workspaceCollectionName: workspaceCollectionName)
    }
    public static func ListByResourceGroup(subscriptionId: String, resourceGroupName: String) -> WorkspaceCollectionsListByResourceGroup {
        return ListByResourceGroupCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName)
    }
    public static func ListBySubscription(subscriptionId: String) -> WorkspaceCollectionsListBySubscription {
        return ListBySubscriptionCommand(subscriptionId: subscriptionId)
    }
    public static func Migrate(subscriptionId: String, resourceGroupName: String, _body: MigrateWorkspaceCollectionRequestProtocol) -> WorkspaceCollectionsMigrate {
        return MigrateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, _body: _body)
    }
    public static func RegenerateKey(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String, _body: WorkspaceCollectionAccessKeyProtocol) -> WorkspaceCollectionsRegenerateKey {
        return RegenerateKeyCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workspaceCollectionName: workspaceCollectionName, _body: _body)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String, _body: UpdateWorkspaceCollectionRequestProtocol) -> WorkspaceCollectionsUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workspaceCollectionName: workspaceCollectionName, _body: _body)
    }
}
}


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

extension Commands.WorkspaceCollections {
// CheckNameAvailability verify the specified Power BI Workspace Collection name is valid and not already in use.
    internal class CheckNameAvailabilityCommand : BaseCommand, WorkspaceCollectionsCheckNameAvailability {
        public var subscriptionId : String
        public var location : String
        public var apiVersion = "2016-01-29"
    public var _body :  CheckNameRequestProtocol?

        public init(subscriptionId: String, location: String, _body: CheckNameRequestProtocol) {
            self.subscriptionId = subscriptionId
            self.location = location
            self._body = _body
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.PowerBI/locations/{location}/checkNameAvailability"
            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 = _body

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


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

extension Commands.WorkspaceCollections {
// Create creates a new Power BI Workspace Collection with the specified properties. A Power BI Workspace Collection
// contains one or more workspaces, and can be used to provision keys that provide API access to those workspaces.
    internal class CreateCommand : BaseCommand, WorkspaceCollectionsCreate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workspaceCollectionName : String
        public var apiVersion = "2016-01-29"
    public var _body :  CreateWorkspaceCollectionRequestProtocol?

        public init(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String, _body: CreateWorkspaceCollectionRequestProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.workspaceCollectionName = workspaceCollectionName
            self._body = _body
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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


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

extension Commands.WorkspaceCollections {
// Delete delete a Power BI Workspace Collection. This method may poll for completion. Polling can be canceled by
// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
    internal class DeleteCommand : BaseCommand, WorkspaceCollectionsDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workspaceCollectionName : String
        public var apiVersion = "2016-01-29"

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

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

        }

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


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

extension Commands.WorkspaceCollections {
// GetAccessKeys retrieves the primary and secondary access keys for the specified Power BI Workspace Collection.
    internal class GetAccessKeysCommand : BaseCommand, WorkspaceCollectionsGetAccessKeys {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workspaceCollectionName : String
        public var apiVersion = "2016-01-29"

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

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


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

extension Commands.WorkspaceCollections {
// GetByName retrieves an existing Power BI Workspace Collection.
    internal class GetByNameCommand : BaseCommand, WorkspaceCollectionsGetByName {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workspaceCollectionName : String
        public var apiVersion = "2016-01-29"

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

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


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

extension Commands.WorkspaceCollections {
// ListByResourceGroup retrieves all existing Power BI workspace collections in the specified resource group.
    internal class ListByResourceGroupCommand : BaseCommand, WorkspaceCollectionsListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var apiVersion = "2016-01-29"

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

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

        }

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


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

extension Commands.WorkspaceCollections {
// ListBySubscription retrieves all existing Power BI workspace collections in the specified subscription.
    internal class ListBySubscriptionCommand : BaseCommand, WorkspaceCollectionsListBySubscription {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2016-01-29"

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

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

        }

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


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

extension Commands.WorkspaceCollections {
// Migrate migrates an existing Power BI Workspace Collection to a different resource group and/or subscription.
    internal class MigrateCommand : BaseCommand, WorkspaceCollectionsMigrate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var apiVersion = "2016-01-29"
    public var _body :  MigrateWorkspaceCollectionRequestProtocol?

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

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

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

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


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

extension Commands.WorkspaceCollections {
// RegenerateKey regenerates the primary or secondary access key for the specified Power BI Workspace Collection.
    internal class RegenerateKeyCommand : BaseCommand, WorkspaceCollectionsRegenerateKey {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workspaceCollectionName : String
        public var apiVersion = "2016-01-29"
    public var _body :  WorkspaceCollectionAccessKeyProtocol?

        public init(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String, _body: WorkspaceCollectionAccessKeyProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.workspaceCollectionName = workspaceCollectionName
            self._body = _body
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}/regenerateKey"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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


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

extension Commands.WorkspaceCollections {
// Update update an existing Power BI Workspace Collection with the specified properties.
    internal class UpdateCommand : BaseCommand, WorkspaceCollectionsUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workspaceCollectionName : String
        public var apiVersion = "2016-01-29"
    public var _body :  UpdateWorkspaceCollectionRequestProtocol?

        public init(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String, _body: UpdateWorkspaceCollectionRequestProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.workspaceCollectionName = workspaceCollectionName
            self._body = _body
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PowerBI/workspaceCollections/{workspaceCollectionName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        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(_body as? UpdateWorkspaceCollectionRequestData)
                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(WorkspaceCollectionData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (WorkspaceCollectionProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: WorkspaceCollectionData?, 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.

// Workspaces is the client to manage your Power BI Embedded workspace collections and retrieve workspaces.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Workspaces {
    public static func List(subscriptionId: String, resourceGroupName: String, workspaceCollectionName: String) -> WorkspacesList {
        return ListCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workspaceCollectionName: workspaceCollectionName)
    }
}
}


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

extension Commands.Workspaces {
// List retrieves all existing Power BI workspaces in the specified workspace collection.
    internal class ListCommand : BaseCommand, WorkspacesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workspaceCollectionName : String
        public var apiVersion = "2016-01-29"

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

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

        }

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


// AccessKeyName enumerates the values for access key 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 AccessKeyNameEnum: String, Codable
{
// Key1 specifies the key 1 state for access key name.
    case Key1 = "key1"
// Key2 specifies the key 2 state for access key name.
    case Key2 = "key2"
}


// 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 AzureSkuData : AzureSkuProtocol {
    public var name: String
    public var tier: String

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

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

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

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

extension DataFactory {
  public static func createAzureSkuProtocol(name: String, tier: String) -> AzureSkuProtocol {
    return AzureSkuData(name: name, tier: tier)
  }
}


// CheckNameReason enumerates the values for check name reason.

// 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 CheckNameReasonEnum: String, Codable
{
// Invalid specifies the invalid state for check name reason.
    case Invalid = "Invalid"
// Unavailable specifies the unavailable state for check name reason.
    case Unavailable = "Unavailable"
}


// 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 CheckNameRequestData : CheckNameRequestProtocol {
    public var name: String?
    public var type: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCheckNameRequestProtocol() -> CheckNameRequestProtocol {
    return CheckNameRequestData()
  }
}


// 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 CheckNameResponseData : CheckNameResponseProtocol {
    public var nameAvailable: Bool?
    public var reason: CheckNameReasonEnum?
    public var message: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createCheckNameResponseProtocol() -> CheckNameResponseProtocol {
    return CheckNameResponseData()
  }
}


// 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 CreateWorkspaceCollectionRequestData : CreateWorkspaceCollectionRequestProtocol {
    public var location: String?
    public var tags: [String:String]?
    public var sku: AzureSkuProtocol?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createCreateWorkspaceCollectionRequestProtocol() -> CreateWorkspaceCollectionRequestProtocol {
    return CreateWorkspaceCollectionRequestData()
  }
}


// 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 DisplayData : DisplayProtocol {
    public var provider: String?
    public var resource: String?
    public var operation: String?
    public var description: String?
    public var origin: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDisplayProtocol() -> DisplayProtocol {
    return DisplayData()
  }
}


// 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 ErrorData : ErrorProtocol {
    public var code: String?
    public var message: String?
    public var target: String?
    public var details: [ErrorDetailProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createErrorProtocol() -> ErrorProtocol {
    return ErrorData()
  }
}


// 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 ErrorDetailData : ErrorDetailProtocol {
    public var code: String?
    public var message: String?
    public var target: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createErrorDetailProtocol() -> ErrorDetailProtocol {
    return ErrorDetailData()
  }
}


// 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 MigrateWorkspaceCollectionRequestData : MigrateWorkspaceCollectionRequestProtocol {
    public var targetResourceGroup: String?
    public var resources: [String]?

        enum CodingKeys: String, CodingKey {case targetResourceGroup = "targetResourceGroup"
        case resources = "resources"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createMigrateWorkspaceCollectionRequestProtocol() -> MigrateWorkspaceCollectionRequestProtocol {
    return MigrateWorkspaceCollectionRequestData()
  }
}


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

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

  public init()  {
  }

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

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

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


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationListProtocol() -> OperationListProtocol {
    return OperationListData()
  }
}


// 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 UpdateWorkspaceCollectionRequestData : UpdateWorkspaceCollectionRequestProtocol {
    public var tags: [String:String]?
    public var sku: AzureSkuProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createUpdateWorkspaceCollectionRequestProtocol() -> UpdateWorkspaceCollectionRequestProtocol {
    return UpdateWorkspaceCollectionRequestData()
  }
}


// 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 WorkspaceCollectionAccessKeyData : WorkspaceCollectionAccessKeyProtocol {
    public var keyName: AccessKeyNameEnum?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createWorkspaceCollectionAccessKeyProtocol() -> WorkspaceCollectionAccessKeyProtocol {
    return WorkspaceCollectionAccessKeyData()
  }
}


// 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 WorkspaceCollectionAccessKeysData : WorkspaceCollectionAccessKeysProtocol {
    public var key1: String?
    public var key2: String?

        enum CodingKeys: String, CodingKey {case key1 = "key1"
        case key2 = "key2"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createWorkspaceCollectionAccessKeysProtocol() -> WorkspaceCollectionAccessKeysProtocol {
    return WorkspaceCollectionAccessKeysData()
  }
}


// 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 WorkspaceCollectionData : WorkspaceCollectionProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var sku: AzureSkuProtocol?
    public var properties: [String: String?]?

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

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

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

extension DataFactory {
  public static func createWorkspaceCollectionProtocol() -> WorkspaceCollectionProtocol {
    return WorkspaceCollectionData()
  }
}


// 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 WorkspaceCollectionListData : WorkspaceCollectionListProtocol {
    public var value: [WorkspaceCollectionProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkspaceCollectionListProtocol() -> WorkspaceCollectionListProtocol {
    return WorkspaceCollectionListData()
  }
}


// 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 WorkspaceData : WorkspaceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: [String: String?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkspaceProtocol() -> WorkspaceProtocol {
    return WorkspaceData()
  }
}


// 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 WorkspaceListData : WorkspaceListProtocol {
    public var value: [WorkspaceProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkspaceListProtocol() -> WorkspaceListProtocol {
    return WorkspaceListData()
  }
}


// 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
// AzureSkuProtocol is
public protocol AzureSkuProtocol : Codable {
     var name: String { get set }
     var tier: String { get set }
}