// 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 VaultListResultData : VaultListResultProtocol {
    public var value: [VaultProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createVaultListResultProtocol() -> VaultListResultProtocol {
    return VaultListResultData()
  }
}


// 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 VaultPatchParametersData : VaultPatchParametersProtocol {
    public var tags: [String:String]?
    public var properties: VaultPatchPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createVaultPatchParametersProtocol() -> VaultPatchParametersProtocol {
    return VaultPatchParametersData()
  }
}


// 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 VaultPatchPropertiesData : VaultPatchPropertiesProtocol {
    public var tenantId: String?
    public var sku: SkuProtocol?
    public var accessPolicies: [AccessPolicyEntryProtocol?]?
    public var enabledForDeployment: Bool?
    public var enabledForDiskEncryption: Bool?
    public var enabledForTemplateDeployment: Bool?
    public var enableSoftDelete: Bool?
    public var createMode: CreateModeEnum?
    public var enablePurgeProtection: Bool?

        enum CodingKeys: String, CodingKey {case tenantId = "tenantId"
        case sku = "sku"
        case accessPolicies = "accessPolicies"
        case enabledForDeployment = "enabledForDeployment"
        case enabledForDiskEncryption = "enabledForDiskEncryption"
        case enabledForTemplateDeployment = "enabledForTemplateDeployment"
        case enableSoftDelete = "enableSoftDelete"
        case createMode = "createMode"
        case enablePurgeProtection = "enablePurgeProtection"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.tenantId) {
        self.tenantId = try container.decode(String?.self, forKey: .tenantId)
    }
    if container.contains(.sku) {
        self.sku = try container.decode(SkuData?.self, forKey: .sku)
    }
    if container.contains(.accessPolicies) {
        self.accessPolicies = try container.decode([AccessPolicyEntryData?]?.self, forKey: .accessPolicies)
    }
    if container.contains(.enabledForDeployment) {
        self.enabledForDeployment = try container.decode(Bool?.self, forKey: .enabledForDeployment)
    }
    if container.contains(.enabledForDiskEncryption) {
        self.enabledForDiskEncryption = try container.decode(Bool?.self, forKey: .enabledForDiskEncryption)
    }
    if container.contains(.enabledForTemplateDeployment) {
        self.enabledForTemplateDeployment = try container.decode(Bool?.self, forKey: .enabledForTemplateDeployment)
    }
    if container.contains(.enableSoftDelete) {
        self.enableSoftDelete = try container.decode(Bool?.self, forKey: .enableSoftDelete)
    }
    if container.contains(.createMode) {
        self.createMode = try container.decode(CreateModeEnum?.self, forKey: .createMode)
    }
    if container.contains(.enablePurgeProtection) {
        self.enablePurgeProtection = try container.decode(Bool?.self, forKey: .enablePurgeProtection)
    }
    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.tenantId != nil {try container.encode(self.tenantId, forKey: .tenantId)}
    if self.sku != nil {try container.encode(self.sku as! SkuData?, forKey: .sku)}
    if self.accessPolicies != nil {try container.encode(self.accessPolicies as! [AccessPolicyEntryData?]?, forKey: .accessPolicies)}
    if self.enabledForDeployment != nil {try container.encode(self.enabledForDeployment, forKey: .enabledForDeployment)}
    if self.enabledForDiskEncryption != nil {try container.encode(self.enabledForDiskEncryption, forKey: .enabledForDiskEncryption)}
    if self.enabledForTemplateDeployment != nil {try container.encode(self.enabledForTemplateDeployment, forKey: .enabledForTemplateDeployment)}
    if self.enableSoftDelete != nil {try container.encode(self.enableSoftDelete, forKey: .enableSoftDelete)}
    if self.createMode != nil {try container.encode(self.createMode, forKey: .createMode)}
    if self.enablePurgeProtection != nil {try container.encode(self.enablePurgeProtection, forKey: .enablePurgeProtection)}
  }
}

extension DataFactory {
  public static func createVaultPatchPropertiesProtocol() -> VaultPatchPropertiesProtocol {
    return VaultPatchPropertiesData()
  }
}


// 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 VaultPropertiesData : VaultPropertiesProtocol {
    public var tenantId: String
    public var sku: SkuProtocol
    public var accessPolicies: [AccessPolicyEntryProtocol?]?
    public var vaultUri: String?
    public var enabledForDeployment: Bool?
    public var enabledForDiskEncryption: Bool?
    public var enabledForTemplateDeployment: Bool?
    public var enableSoftDelete: Bool?
    public var createMode: CreateModeEnum?
    public var enablePurgeProtection: Bool?

        enum CodingKeys: String, CodingKey {case tenantId = "tenantId"
        case sku = "sku"
        case accessPolicies = "accessPolicies"
        case vaultUri = "vaultUri"
        case enabledForDeployment = "enabledForDeployment"
        case enabledForDiskEncryption = "enabledForDiskEncryption"
        case enabledForTemplateDeployment = "enabledForTemplateDeployment"
        case enableSoftDelete = "enableSoftDelete"
        case createMode = "createMode"
        case enablePurgeProtection = "enablePurgeProtection"
        }

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.tenantId = try container.decode(String.self, forKey: .tenantId)
    self.sku = try container.decode(SkuData.self, forKey: .sku)
    if container.contains(.accessPolicies) {
        self.accessPolicies = try container.decode([AccessPolicyEntryData?]?.self, forKey: .accessPolicies)
    }
    if container.contains(.vaultUri) {
        self.vaultUri = try container.decode(String?.self, forKey: .vaultUri)
    }
    if container.contains(.enabledForDeployment) {
        self.enabledForDeployment = try container.decode(Bool?.self, forKey: .enabledForDeployment)
    }
    if container.contains(.enabledForDiskEncryption) {
        self.enabledForDiskEncryption = try container.decode(Bool?.self, forKey: .enabledForDiskEncryption)
    }
    if container.contains(.enabledForTemplateDeployment) {
        self.enabledForTemplateDeployment = try container.decode(Bool?.self, forKey: .enabledForTemplateDeployment)
    }
    if container.contains(.enableSoftDelete) {
        self.enableSoftDelete = try container.decode(Bool?.self, forKey: .enableSoftDelete)
    }
    if container.contains(.createMode) {
        self.createMode = try container.decode(CreateModeEnum?.self, forKey: .createMode)
    }
    if container.contains(.enablePurgeProtection) {
        self.enablePurgeProtection = try container.decode(Bool?.self, forKey: .enablePurgeProtection)
    }
    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.tenantId, forKey: .tenantId)
    try container.encode(self.sku as! SkuData, forKey: .sku)
    if self.accessPolicies != nil {try container.encode(self.accessPolicies as! [AccessPolicyEntryData?]?, forKey: .accessPolicies)}
    if self.vaultUri != nil {try container.encode(self.vaultUri, forKey: .vaultUri)}
    if self.enabledForDeployment != nil {try container.encode(self.enabledForDeployment, forKey: .enabledForDeployment)}
    if self.enabledForDiskEncryption != nil {try container.encode(self.enabledForDiskEncryption, forKey: .enabledForDiskEncryption)}
    if self.enabledForTemplateDeployment != nil {try container.encode(self.enabledForTemplateDeployment, forKey: .enabledForTemplateDeployment)}
    if self.enableSoftDelete != nil {try container.encode(self.enableSoftDelete, forKey: .enableSoftDelete)}
    if self.createMode != nil {try container.encode(self.createMode, forKey: .createMode)}
    if self.enablePurgeProtection != nil {try container.encode(self.enablePurgeProtection, forKey: .enablePurgeProtection)}
  }
}

extension DataFactory {
  public static func createVaultPropertiesProtocol(tenantId: String, sku: SkuProtocol) -> VaultPropertiesProtocol {
    return VaultPropertiesData(tenantId: tenantId, sku: sku)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AccessPolicyEntryProtocol is an identity that have access to the key vault. All identities in the array must use the
// same tenant ID as the key vault's tenant ID.
public protocol AccessPolicyEntryProtocol : Codable {
     var tenantId: String { get set }
     var objectId: String { get set }
     var applicationId: String? { get set }
     var permissions: PermissionsProtocol { 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
// CheckNameAvailabilityResultProtocol is the CheckNameAvailability operation response.
public protocol CheckNameAvailabilityResultProtocol : Codable {
     var nameAvailable: Bool? { get set }
     var reason: ReasonEnum? { 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
// DeletedVaultListResultProtocol is list of vaults
public protocol DeletedVaultListResultProtocol : Codable {
     var value: [DeletedVaultProtocol?]? { 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
// DeletedVaultPropertiesProtocol is properties of the deleted vault.
public protocol DeletedVaultPropertiesProtocol : Codable {
     var vaultId: String? { get set }
     var location: String? { get set }
     var deletionDate: Date? { get set }
     var scheduledPurgeDate: Date? { get set }
     var tags: [String:String]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// DeletedVaultProtocol is deleted vault information with extended details.
public protocol DeletedVaultProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var properties: DeletedVaultPropertiesProtocol? { 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
// LogSpecificationProtocol is log specification of operation.
public protocol LogSpecificationProtocol : Codable {
     var name: String? { get set }
     var displayName: String? { get set }
     var blobDuration: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationDisplayProtocol is display metadata associated with the operation.
public protocol OperationDisplayProtocol : Codable {
     var provider: String? { get set }
     var resource: String? { get set }
     var operation: String? { get set }
     var description: 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
// OperationListResultProtocol is result of the request to list Storage operations. It contains a list of operations
// and a URL link to get the next set of results.
public protocol OperationListResultProtocol : Codable {
     var value: [OperationProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationPropertiesProtocol is properties of operation, include metric specifications.
public protocol OperationPropertiesProtocol : Codable {
     var serviceSpecification: ServiceSpecificationProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationProtocol is key Vault REST API operation definition.
public protocol OperationProtocol : Codable {
     var name: String? { get set }
     var display: OperationDisplayProtocol? { get set }
     var origin: String? { get set }
     var operationProperties: OperationPropertiesProtocol? { 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
// PermissionsProtocol is permissions the identity has for keys, secrets, certificates and storage.
public protocol PermissionsProtocol : Codable {
     var keys: [KeyPermissionsEnum?]? { get set }
     var secrets: [SecretPermissionsEnum?]? { get set }
     var certificates: [CertificatePermissionsEnum?]? { get set }
     var storage: [StoragePermissionsEnum?]? { 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
// ResourceListResultProtocol is list of vault resources.
public protocol ResourceListResultProtocol : Codable {
     var value: [ResourceProtocol?]? { 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
// ResourceProtocol is key Vault resource
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 }
}


// 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
// ServiceSpecificationProtocol is one property of operation, include log specifications.
public protocol ServiceSpecificationProtocol : Codable {
     var logSpecifications: [LogSpecificationProtocol?]? { 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 SKU details
public protocol SkuProtocol : Codable {
     var family: String { get set }
     var name: SkuNameEnum { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// VaultAccessPolicyParametersProtocol is parameters for updating the access policy in a vault
public protocol VaultAccessPolicyParametersProtocol : Codable {
     var id: String? { get set }
     var name: String? { get set }
     var type: String? { get set }
     var location: String? { get set }
     var properties: VaultAccessPolicyPropertiesProtocol { 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
// VaultAccessPolicyPropertiesProtocol is properties of the vault access policy
public protocol VaultAccessPolicyPropertiesProtocol : Codable {
     var accessPolicies: [AccessPolicyEntryProtocol] { 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
// VaultCheckNameAvailabilityParametersProtocol is the parameters used to check the availabity of the vault name.
public protocol VaultCheckNameAvailabilityParametersProtocol : 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
// VaultCreateOrUpdateParametersProtocol is parameters for creating or updating a vault
public protocol VaultCreateOrUpdateParametersProtocol : Codable {
     var location: String { get set }
     var tags: [String:String]? { get set }
     var properties: VaultPropertiesProtocol { 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
// VaultListResultProtocol is list of vaults
public protocol VaultListResultProtocol : Codable {
     var value: [VaultProtocol?]? { 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
// VaultPatchParametersProtocol is parameters for creating or updating a vault
public protocol VaultPatchParametersProtocol : Codable {
     var tags: [String:String]? { get set }
     var properties: VaultPatchPropertiesProtocol? { 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
// VaultPatchPropertiesProtocol is properties of the vault
public protocol VaultPatchPropertiesProtocol : Codable {
     var tenantId: String? { get set }
     var sku: SkuProtocol? { get set }
     var accessPolicies: [AccessPolicyEntryProtocol?]? { get set }
     var enabledForDeployment: Bool? { get set }
     var enabledForDiskEncryption: Bool? { get set }
     var enabledForTemplateDeployment: Bool? { get set }
     var enableSoftDelete: Bool? { get set }
     var createMode: CreateModeEnum? { get set }
     var enablePurgeProtection: 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
// VaultPropertiesProtocol is properties of the vault
public protocol VaultPropertiesProtocol : Codable {
     var tenantId: String { get set }
     var sku: SkuProtocol { get set }
     var accessPolicies: [AccessPolicyEntryProtocol?]? { get set }
     var vaultUri: String? { get set }
     var enabledForDeployment: Bool? { get set }
     var enabledForDiskEncryption: Bool? { get set }
     var enabledForTemplateDeployment: Bool? { get set }
     var enableSoftDelete: Bool? { get set }
     var createMode: CreateModeEnum? { get set }
     var enablePurgeProtection: 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
// VaultProtocol is resource information with extended details.
public protocol VaultProtocol : ResourceProtocol {
     var properties: VaultPropertiesProtocol { 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: "logic",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "logic",
            targets: ["logic"]),
    ],
    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: "logic",
            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.

// Agreements is the REST API for Azure Logic Apps.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Agreements {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, agreementName: String, agreement: IntegrationAccountAgreementProtocol) -> AgreementsCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, agreementName: agreementName, agreement: agreement)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, agreementName: String) -> AgreementsDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, agreementName: agreementName)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, agreementName: String) -> AgreementsGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, agreementName: agreementName)
    }
    public static func ListByIntegrationAccounts(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) -> AgreementsListByIntegrationAccounts {
        return ListByIntegrationAccountsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName)
    }
}
}


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

extension Commands.Agreements {
// CreateOrUpdate creates or updates an integration account agreement.
    internal class CreateOrUpdateCommand : BaseCommand, AgreementsCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var agreementName : String
        public var apiVersion = "2016-06-01"
    public var agreement :  IntegrationAccountAgreementProtocol?

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, agreementName: String, agreement: IntegrationAccountAgreementProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.agreementName = agreementName
            self.agreement = agreement
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.pathParameters["{agreementName}"] = String(describing: self.agreementName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = agreement

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


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

extension Commands.Agreements {
// Delete deletes an integration account agreement.
    internal class DeleteCommand : BaseCommand, AgreementsDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var agreementName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, agreementName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.agreementName = agreementName
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.pathParameters["{agreementName}"] = String(describing: self.agreementName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

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


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

extension Commands.Agreements {
// Get gets an integration account agreement.
    internal class GetCommand : BaseCommand, AgreementsGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var agreementName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, agreementName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.agreementName = agreementName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements/{agreementName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.pathParameters["{agreementName}"] = String(describing: self.agreementName)
            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(IntegrationAccountAgreementData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (IntegrationAccountAgreementProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: IntegrationAccountAgreementData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol AgreementsListByIntegrationAccounts  {
    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 integrationAccountName : String { get set }
    var apiVersion : String { get set }
    var top : Int32? { get set }
    var filter : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (IntegrationAccountAgreementListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Agreements {
// ListByIntegrationAccounts gets a list of integration account agreements.
    internal class ListByIntegrationAccountsCommand : BaseCommand, AgreementsListByIntegrationAccounts {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var apiVersion = "2016-06-01"
        public var top : Int32?
        public var filter : String?

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/agreements"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }

        }

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

// Certificates is the REST API for Azure Logic Apps.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Certificates {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, certificateName: String, certificate: IntegrationAccountCertificateProtocol) -> CertificatesCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, certificateName: certificateName, certificate: certificate)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, certificateName: String) -> CertificatesDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, certificateName: certificateName)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, certificateName: String) -> CertificatesGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, certificateName: certificateName)
    }
    public static func ListByIntegrationAccounts(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) -> CertificatesListByIntegrationAccounts {
        return ListByIntegrationAccountsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName)
    }
}
}


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

extension Commands.Certificates {
// CreateOrUpdate creates or updates an integration account certificate.
    internal class CreateOrUpdateCommand : BaseCommand, CertificatesCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var certificateName : String
        public var apiVersion = "2016-06-01"
    public var certificate :  IntegrationAccountCertificateProtocol?

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, certificateName: String, certificate: IntegrationAccountCertificateProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.certificateName = certificateName
            self.certificate = certificate
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.pathParameters["{certificateName}"] = String(describing: self.certificateName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = certificate

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


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

extension Commands.Certificates {
// Delete deletes an integration account certificate.
    internal class DeleteCommand : BaseCommand, CertificatesDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var certificateName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, certificateName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.certificateName = certificateName
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.pathParameters["{certificateName}"] = String(describing: self.certificateName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

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


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

extension Commands.Certificates {
// Get gets an integration account certificate.
    internal class GetCommand : BaseCommand, CertificatesGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var certificateName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, certificateName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.certificateName = certificateName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates/{certificateName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.pathParameters["{certificateName}"] = String(describing: self.certificateName)
            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(IntegrationAccountCertificateData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (IntegrationAccountCertificateProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: IntegrationAccountCertificateData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol CertificatesListByIntegrationAccounts  {
    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 integrationAccountName : String { get set }
    var apiVersion : String { get set }
    var top : Int32? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (IntegrationAccountCertificateListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Certificates {
// ListByIntegrationAccounts gets a list of integration account certificates.
    internal class ListByIntegrationAccountsCommand : BaseCommand, CertificatesListByIntegrationAccounts {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var apiVersion = "2016-06-01"
        public var top : Int32?

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/certificates"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }

        }

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


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


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

// IntegrationAccounts is the REST API for Azure Logic Apps.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct IntegrationAccounts {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, integrationAccount: IntegrationAccountProtocol) -> IntegrationAccountsCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, integrationAccount: integrationAccount)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) -> IntegrationAccountsDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) -> IntegrationAccountsGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName)
    }
    public static func GetCallbackUrl(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, parameters: GetCallbackUrlParametersProtocol) -> IntegrationAccountsGetCallbackUrl {
        return GetCallbackUrlCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, parameters: parameters)
    }
    public static func ListByResourceGroup(subscriptionId: String, resourceGroupName: String) -> IntegrationAccountsListByResourceGroup {
        return ListByResourceGroupCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName)
    }
    public static func ListBySubscription(subscriptionId: String) -> IntegrationAccountsListBySubscription {
        return ListBySubscriptionCommand(subscriptionId: subscriptionId)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, integrationAccount: IntegrationAccountProtocol) -> IntegrationAccountsUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, integrationAccount: integrationAccount)
    }
}
}


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

extension Commands.IntegrationAccounts {
// CreateOrUpdate creates or updates an integration account.
    internal class CreateOrUpdateCommand : BaseCommand, IntegrationAccountsCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var apiVersion = "2016-06-01"
    public var integrationAccount :  IntegrationAccountProtocol?

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, integrationAccount: IntegrationAccountProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.integrationAccount = integrationAccount
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = integrationAccount

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


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

extension Commands.IntegrationAccounts {
// Delete deletes an integration account.
    internal class DeleteCommand : BaseCommand, IntegrationAccountsDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

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


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

extension Commands.IntegrationAccounts {
// Get gets an integration account.
    internal class GetCommand : BaseCommand, IntegrationAccountsGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            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(IntegrationAccountData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (IntegrationAccountProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: IntegrationAccountData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.IntegrationAccounts {
// GetCallbackUrl gets the integration account callback URL.
    internal class GetCallbackUrlCommand : BaseCommand, IntegrationAccountsGetCallbackUrl {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var apiVersion = "2016-06-01"
    public var parameters :  GetCallbackUrlParametersProtocol?

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, parameters: GetCallbackUrlParametersProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/listCallbackUrl"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = parameters

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


import Foundation
import azureSwiftRuntime
public protocol IntegrationAccountsListByResourceGroup  {
    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 }
    var top : Int32? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (IntegrationAccountListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.IntegrationAccounts {
// ListByResourceGroup gets a list of integration accounts by resource group.
    internal class ListByResourceGroupCommand : BaseCommand, IntegrationAccountsListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var apiVersion = "2016-06-01"
        public var top : Int32?

        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.Logic/integrationAccounts"
            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)
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }

        }

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


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

extension Commands.IntegrationAccounts {
// ListBySubscription gets a list of integration accounts by subscription.
    internal class ListBySubscriptionCommand : BaseCommand, IntegrationAccountsListBySubscription {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2016-06-01"
        public var top : Int32?

        public init(subscriptionId: String) {
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/Microsoft.Logic/integrationAccounts"
            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)
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }

        }

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


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

extension Commands.IntegrationAccounts {
// Update updates an integration account.
    internal class UpdateCommand : BaseCommand, IntegrationAccountsUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var apiVersion = "2016-06-01"
    public var integrationAccount :  IntegrationAccountProtocol?

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, integrationAccount: IntegrationAccountProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.integrationAccount = integrationAccount
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = integrationAccount

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

// Maps is the REST API for Azure Logic Apps.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Maps {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, mapName: String, map: IntegrationAccountMapProtocol) -> MapsCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, mapName: mapName, map: map)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, mapName: String) -> MapsDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, mapName: mapName)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, mapName: String) -> MapsGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, mapName: mapName)
    }
    public static func ListByIntegrationAccounts(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) -> MapsListByIntegrationAccounts {
        return ListByIntegrationAccountsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName)
    }
}
}


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

extension Commands.Maps {
// CreateOrUpdate creates or updates an integration account map.
    internal class CreateOrUpdateCommand : BaseCommand, MapsCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var mapName : String
        public var apiVersion = "2016-06-01"
    public var map :  IntegrationAccountMapProtocol?

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, mapName: String, map: IntegrationAccountMapProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.mapName = mapName
            self.map = map
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.pathParameters["{mapName}"] = String(describing: self.mapName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = map

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


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

extension Commands.Maps {
// Delete deletes an integration account map.
    internal class DeleteCommand : BaseCommand, MapsDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var mapName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, mapName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.mapName = mapName
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.pathParameters["{mapName}"] = String(describing: self.mapName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

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


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

extension Commands.Maps {
// Get gets an integration account map.
    internal class GetCommand : BaseCommand, MapsGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var mapName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, mapName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            self.mapName = mapName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps/{mapName}"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.pathParameters["{mapName}"] = String(describing: self.mapName)
            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(IntegrationAccountMapData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (IntegrationAccountMapProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: IntegrationAccountMapData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol MapsListByIntegrationAccounts  {
    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 integrationAccountName : String { get set }
    var apiVersion : String { get set }
    var top : Int32? { get set }
    var filter : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (IntegrationAccountMapListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Maps {
// ListByIntegrationAccounts gets a list of integration account maps.
    internal class ListByIntegrationAccountsCommand : BaseCommand, MapsListByIntegrationAccounts {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var integrationAccountName : String
        public var apiVersion = "2016-06-01"
        public var top : Int32?
        public var filter : String?

        public init(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.integrationAccountName = integrationAccountName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/integrationAccounts/{integrationAccountName}/maps"
            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["{integrationAccountName}"] = String(describing: self.integrationAccountName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.top != nil { queryParameters["$top"] = String(describing: self.top!) }
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }

        }

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

// Partners is the REST API for Azure Logic Apps.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Partners {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, partnerName: String, partner: IntegrationAccountPartnerProtocol) -> PartnersCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, partnerName: partnerName, partner: partner)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, partnerName: String) -> PartnersDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, partnerName: partnerName)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, integrationAccountName: String, partnerName: String) -> PartnersGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName, partnerName: partnerName)
    }
    public static func ListByIntegrationAccounts(subscriptionId: String, resourceGroupName: String, integrationAccountName: String) -> PartnersListByIntegrationAccounts {
        return ListByIntegrationAccountsCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, integrationAccountName: integrationAccountName)
    }
}
}