// 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: "graphrbac",
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "graphrbac",
            targets: ["graphrbac"]),
    ],
    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: "graphrbac",
            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.

// Applications is the the Graph RBAC Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Applications {
    public static func AddOwner(applicationObjectId: String, tenantID: String, parameters: ApplicationAddOwnerParametersProtocol) -> ApplicationsAddOwner {
        return AddOwnerCommand(applicationObjectId: applicationObjectId, tenantID: tenantID, parameters: parameters)
    }
    public static func Create(tenantID: String, parameters: ApplicationCreateParametersProtocol) -> ApplicationsCreate {
        return CreateCommand(tenantID: tenantID, parameters: parameters)
    }
    public static func Delete(applicationObjectId: String, tenantID: String) -> ApplicationsDelete {
        return DeleteCommand(applicationObjectId: applicationObjectId, tenantID: tenantID)
    }
    public static func Get(applicationObjectId: String, tenantID: String) -> ApplicationsGet {
        return GetCommand(applicationObjectId: applicationObjectId, tenantID: tenantID)
    }
    public static func List(tenantID: String) -> ApplicationsList {
        return ListCommand(tenantID: tenantID)
    }
    public static func ListKeyCredentials(applicationObjectId: String, tenantID: String) -> ApplicationsListKeyCredentials {
        return ListKeyCredentialsCommand(applicationObjectId: applicationObjectId, tenantID: tenantID)
    }
    public static func ListNext(_nextLink: String, tenantID: String) -> ApplicationsListNext {
        return ListNextCommand(_nextLink: _nextLink, tenantID: tenantID)
    }
    public static func ListOwners(applicationObjectId: String, tenantID: String) -> ApplicationsListOwners {
        return ListOwnersCommand(applicationObjectId: applicationObjectId, tenantID: tenantID)
    }
    public static func ListPasswordCredentials(applicationObjectId: String, tenantID: String) -> ApplicationsListPasswordCredentials {
        return ListPasswordCredentialsCommand(applicationObjectId: applicationObjectId, tenantID: tenantID)
    }
    public static func Patch(applicationObjectId: String, tenantID: String, parameters: ApplicationUpdateParametersProtocol) -> ApplicationsPatch {
        return PatchCommand(applicationObjectId: applicationObjectId, tenantID: tenantID, parameters: parameters)
    }
    public static func UpdateKeyCredentials(applicationObjectId: String, tenantID: String, parameters: KeyCredentialsUpdateParametersProtocol) -> ApplicationsUpdateKeyCredentials {
        return UpdateKeyCredentialsCommand(applicationObjectId: applicationObjectId, tenantID: tenantID, parameters: parameters)
    }
    public static func UpdatePasswordCredentials(applicationObjectId: String, tenantID: String, parameters: PasswordCredentialsUpdateParametersProtocol) -> ApplicationsUpdatePasswordCredentials {
        return UpdatePasswordCredentialsCommand(applicationObjectId: applicationObjectId, tenantID: tenantID, parameters: parameters)
    }
}
}


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

extension Commands.Applications {
// AddOwner add an owner to an application.
    internal class AddOwnerCommand : BaseCommand, ApplicationsAddOwner {
        public var applicationObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  ApplicationAddOwnerParametersProtocol?

        public init(applicationObjectId: String, tenantID: String, parameters: ApplicationAddOwnerParametersProtocol) {
            self.applicationObjectId = applicationObjectId
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications/{applicationObjectId}/$links/owners"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{applicationObjectId}"] = String(describing: self.applicationObjectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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? ApplicationAddOwnerParametersData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

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


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

extension Commands.Applications {
// Create create a new application.
    internal class CreateCommand : BaseCommand, ApplicationsCreate {
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  ApplicationCreateParametersProtocol?

        public init(tenantID: String, parameters: ApplicationCreateParametersProtocol) {
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.Applications {
// Delete delete an application.
    internal class DeleteCommand : BaseCommand, ApplicationsDelete {
        public var applicationObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(applicationObjectId: String, tenantID: String) {
            self.applicationObjectId = applicationObjectId
            self.tenantID = tenantID
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications/{applicationObjectId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{applicationObjectId}"] = String(describing: self.applicationObjectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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 ApplicationsGet  {
    var headerParameters: [String: String] { get set }
    var applicationObjectId : String { get set }
    var tenantID : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ApplicationProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Applications {
// Get get an application by object ID.
    internal class GetCommand : BaseCommand, ApplicationsGet {
        public var applicationObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(applicationObjectId: String, tenantID: String) {
            self.applicationObjectId = applicationObjectId
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications/{applicationObjectId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.Applications {
// List lists applications by filter parameters.
    internal class ListCommand : BaseCommand, ApplicationsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var tenantID : String
        public var filter : String?
        public var apiVersion = "1.6"

        public init(tenantID: String) {
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

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


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

extension Commands.Applications {
// ListKeyCredentials get the keyCredentials associated with an application.
    internal class ListKeyCredentialsCommand : BaseCommand, ApplicationsListKeyCredentials {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var applicationObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(applicationObjectId: String, tenantID: String) {
            self.applicationObjectId = applicationObjectId
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications/{applicationObjectId}/keyCredentials"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Applications {
// ListNext gets a list of applications from the current tenant.
    internal class ListNextCommand : BaseCommand, ApplicationsListNext {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var _nextLink : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(_nextLink: String, tenantID: String) {
            self._nextLink = _nextLink
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/{nextLink}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Applications {
// ListOwners the owners are a set of non-admin users who are allowed to modify this object.
    internal class ListOwnersCommand : BaseCommand, ApplicationsListOwners {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var applicationObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(applicationObjectId: String, tenantID: String) {
            self.applicationObjectId = applicationObjectId
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications/{applicationObjectId}/owners"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Applications {
// ListPasswordCredentials get the passwordCredentials associated with an application.
    internal class ListPasswordCredentialsCommand : BaseCommand, ApplicationsListPasswordCredentials {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var applicationObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(applicationObjectId: String, tenantID: String) {
            self.applicationObjectId = applicationObjectId
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications/{applicationObjectId}/passwordCredentials"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Applications {
// Patch update an existing application.
    internal class PatchCommand : BaseCommand, ApplicationsPatch {
        public var applicationObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  ApplicationUpdateParametersProtocol?

        public init(applicationObjectId: String, tenantID: String, parameters: ApplicationUpdateParametersProtocol) {
            self.applicationObjectId = applicationObjectId
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications/{applicationObjectId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{applicationObjectId}"] = String(describing: self.applicationObjectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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? ApplicationUpdateParametersData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

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


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

extension Commands.Applications {
// UpdateKeyCredentials update the keyCredentials associated with an application.
    internal class UpdateKeyCredentialsCommand : BaseCommand, ApplicationsUpdateKeyCredentials {
        public var applicationObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  KeyCredentialsUpdateParametersProtocol?

        public init(applicationObjectId: String, tenantID: String, parameters: KeyCredentialsUpdateParametersProtocol) {
            self.applicationObjectId = applicationObjectId
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications/{applicationObjectId}/keyCredentials"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{applicationObjectId}"] = String(describing: self.applicationObjectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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? KeyCredentialsUpdateParametersData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

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


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

extension Commands.Applications {
// UpdatePasswordCredentials update passwordCredentials associated with an application.
    internal class UpdatePasswordCredentialsCommand : BaseCommand, ApplicationsUpdatePasswordCredentials {
        public var applicationObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  PasswordCredentialsUpdateParametersProtocol?

        public init(applicationObjectId: String, tenantID: String, parameters: PasswordCredentialsUpdateParametersProtocol) {
            self.applicationObjectId = applicationObjectId
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/applications/{applicationObjectId}/passwordCredentials"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{applicationObjectId}"] = String(describing: self.applicationObjectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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? PasswordCredentialsUpdateParametersData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(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.

// Domains is the the Graph RBAC Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Domains {
    public static func Get(domainName: String, tenantID: String) -> DomainsGet {
        return GetCommand(domainName: domainName, tenantID: tenantID)
    }
    public static func List(tenantID: String) -> DomainsList {
        return ListCommand(tenantID: tenantID)
    }
}
}


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

extension Commands.Domains {
// Get gets a specific domain in the current tenant.
    internal class GetCommand : BaseCommand, DomainsGet {
        public var domainName : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(domainName: String, tenantID: String) {
            self.domainName = domainName
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/domains/{domainName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.Domains {
// List gets a list of domains for the current tenant.
    internal class ListCommand : BaseCommand, DomainsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var tenantID : String
        public var filter : String?
        public var apiVersion = "1.6"

        public init(tenantID: String) {
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/domains"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

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

// Groups is the the Graph RBAC Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Groups {
    public static func AddMember(groupObjectId: String, tenantID: String, parameters: GroupAddMemberParametersProtocol) -> GroupsAddMember {
        return AddMemberCommand(groupObjectId: groupObjectId, tenantID: tenantID, parameters: parameters)
    }
    public static func Create(tenantID: String, parameters: GroupCreateParametersProtocol) -> GroupsCreate {
        return CreateCommand(tenantID: tenantID, parameters: parameters)
    }
    public static func Delete(objectId: String, tenantID: String) -> GroupsDelete {
        return DeleteCommand(objectId: objectId, tenantID: tenantID)
    }
    public static func Get(objectId: String, tenantID: String) -> GroupsGet {
        return GetCommand(objectId: objectId, tenantID: tenantID)
    }
    public static func GetGroupMembers(objectId: String, tenantID: String) -> GroupsGetGroupMembers {
        return GetGroupMembersCommand(objectId: objectId, tenantID: tenantID)
    }
    public static func GetGroupMembersNext(_nextLink: String, tenantID: String) -> GroupsGetGroupMembersNext {
        return GetGroupMembersNextCommand(_nextLink: _nextLink, tenantID: tenantID)
    }
    public static func GetMemberGroups(objectId: String, tenantID: String, parameters: GroupGetMemberGroupsParametersProtocol) -> GroupsGetMemberGroups {
        return GetMemberGroupsCommand(objectId: objectId, tenantID: tenantID, parameters: parameters)
    }
    public static func IsMemberOf(tenantID: String, parameters: CheckGroupMembershipParametersProtocol) -> GroupsIsMemberOf {
        return IsMemberOfCommand(tenantID: tenantID, parameters: parameters)
    }
    public static func List(tenantID: String) -> GroupsList {
        return ListCommand(tenantID: tenantID)
    }
    public static func ListNext(_nextLink: String, tenantID: String) -> GroupsListNext {
        return ListNextCommand(_nextLink: _nextLink, tenantID: tenantID)
    }
    public static func RemoveMember(groupObjectId: String, memberObjectId: String, tenantID: String) -> GroupsRemoveMember {
        return RemoveMemberCommand(groupObjectId: groupObjectId, memberObjectId: memberObjectId, tenantID: tenantID)
    }
}
}


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

extension Commands.Groups {
// AddMember add a member to a group.
    internal class AddMemberCommand : BaseCommand, GroupsAddMember {
        public var groupObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  GroupAddMemberParametersProtocol?

        public init(groupObjectId: String, tenantID: String, parameters: GroupAddMemberParametersProtocol) {
            self.groupObjectId = groupObjectId
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/groups/{groupObjectId}/$links/members"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{groupObjectId}"] = String(describing: self.groupObjectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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? GroupAddMemberParametersData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

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


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

extension Commands.Groups {
// Create create a group in the directory.
    internal class CreateCommand : BaseCommand, GroupsCreate {
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  GroupCreateParametersProtocol?

        public init(tenantID: String, parameters: GroupCreateParametersProtocol) {
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/groups"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.Groups {
// Delete delete a group from the directory.
    internal class DeleteCommand : BaseCommand, GroupsDelete {
        public var objectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(objectId: String, tenantID: String) {
            self.objectId = objectId
            self.tenantID = tenantID
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/groups/{objectId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{objectId}"] = String(describing: self.objectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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 GroupsGet  {
    var headerParameters: [String: String] { get set }
    var objectId : String { get set }
    var tenantID : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ADGroupProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Groups {
// Get gets group information from the directory.
    internal class GetCommand : BaseCommand, GroupsGet {
        public var objectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(objectId: String, tenantID: String) {
            self.objectId = objectId
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/groups/{objectId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.Groups {
// GetGroupMembers gets the members of a group.
    internal class GetGroupMembersCommand : BaseCommand, GroupsGetGroupMembers {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var objectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(objectId: String, tenantID: String) {
            self.objectId = objectId
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/groups/{objectId}/members"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Groups {
// GetGroupMembersNext gets the members of a group.
    internal class GetGroupMembersNextCommand : BaseCommand, GroupsGetGroupMembersNext {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var _nextLink : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(_nextLink: String, tenantID: String) {
            self._nextLink = _nextLink
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/{nextLink}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


import Foundation
import azureSwiftRuntime
public protocol GroupsGetMemberGroups  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var objectId : String { get set }
    var tenantID : String { get set }
    var apiVersion : String { get set }
    var parameters :  GroupGetMemberGroupsParametersProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (GroupGetMemberGroupsResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Groups {
// GetMemberGroups gets a collection of object IDs of groups of which the specified group is a member.
    internal class GetMemberGroupsCommand : BaseCommand, GroupsGetMemberGroups {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var objectId : String
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  GroupGetMemberGroupsParametersProtocol?

        public init(objectId: String, tenantID: String, parameters: GroupGetMemberGroupsParametersProtocol) {
            self.objectId = objectId
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/groups/{objectId}/getMemberGroups"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{objectId}"] = String(describing: self.objectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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? GroupGetMemberGroupsParametersData)
                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)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "nil"
                }
                let result = try decoder.decode(GroupGetMemberGroupsResultData?.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 (GroupGetMemberGroupsResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: GroupGetMemberGroupsResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Groups {
// IsMemberOf checks whether the specified user, group, contact, or service principal is a direct or transitive member
// of the specified group.
    internal class IsMemberOfCommand : BaseCommand, GroupsIsMemberOf {
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  CheckGroupMembershipParametersProtocol?

        public init(tenantID: String, parameters: CheckGroupMembershipParametersProtocol) {
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/isMemberOf"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.Groups {
// List gets list of groups for the current tenant.
    internal class ListCommand : BaseCommand, GroupsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var tenantID : String
        public var filter : String?
        public var apiVersion = "1.6"

        public init(tenantID: String) {
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/groups"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

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


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

extension Commands.Groups {
// ListNext gets a list of groups for the current tenant.
    internal class ListNextCommand : BaseCommand, GroupsListNext {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var _nextLink : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(_nextLink: String, tenantID: String) {
            self._nextLink = _nextLink
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/{nextLink}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Groups {
// RemoveMember remove a member from a group.
    internal class RemoveMemberCommand : BaseCommand, GroupsRemoveMember {
        public var groupObjectId : String
        public var memberObjectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(groupObjectId: String, memberObjectId: String, tenantID: String) {
            self.groupObjectId = groupObjectId
            self.memberObjectId = memberObjectId
            self.tenantID = tenantID
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/groups/{groupObjectId}/$links/members/{memberObjectId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{groupObjectId}"] = String(describing: self.groupObjectId)
            self.pathParameters["{memberObjectId}"] = String(describing: self.memberObjectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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)
            }
        }
    }
}


// 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.

// Objects is the the Graph RBAC Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Objects {
    public static func GetCurrentUser(tenantID: String) -> ObjectsGetCurrentUser {
        return GetCurrentUserCommand(tenantID: tenantID)
    }
    public static func GetObjectsByObjectIds(tenantID: String, parameters: GetObjectsParametersProtocol) -> ObjectsGetObjectsByObjectIds {
        return GetObjectsByObjectIdsCommand(tenantID: tenantID, parameters: parameters)
    }
    public static func GetObjectsByObjectIdsNext(_nextLink: String, tenantID: String) -> ObjectsGetObjectsByObjectIdsNext {
        return GetObjectsByObjectIdsNextCommand(_nextLink: _nextLink, tenantID: tenantID)
    }
}
}


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

extension Commands.Objects {
// GetCurrentUser gets the details for the currently logged-in user.
    internal class GetCurrentUserCommand : BaseCommand, ObjectsGetCurrentUser {
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(tenantID: String) {
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/me"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


import Foundation
import azureSwiftRuntime
public protocol ObjectsGetObjectsByObjectIds  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var tenantID : String { get set }
    var apiVersion : String { get set }
    var parameters :  GetObjectsParametersProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (GetObjectsResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Objects {
// GetObjectsByObjectIds gets AD group membership for the specified AD object IDs.
    internal class GetObjectsByObjectIdsCommand : BaseCommand, ObjectsGetObjectsByObjectIds {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  GetObjectsParametersProtocol?

        public init(tenantID: String, parameters: GetObjectsParametersProtocol) {
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/getObjectsByObjectIds"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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? GetObjectsParametersData)
                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)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "OdatanextLink"
                }
                let result = try decoder.decode(GetObjectsResultData?.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 (GetObjectsResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: GetObjectsResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.Objects {
// GetObjectsByObjectIdsNext gets AD group membership for the specified AD object IDs.
    internal class GetObjectsByObjectIdsNextCommand : BaseCommand, ObjectsGetObjectsByObjectIdsNext {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var _nextLink : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(_nextLink: String, tenantID: String) {
            self._nextLink = _nextLink
            self.tenantID = tenantID
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/{nextLink}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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

// ServicePrincipals is the the Graph RBAC Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct ServicePrincipals {
    public static func Create(tenantID: String, parameters: ServicePrincipalCreateParametersProtocol) -> ServicePrincipalsCreate {
        return CreateCommand(tenantID: tenantID, parameters: parameters)
    }
    public static func Delete(objectId: String, tenantID: String) -> ServicePrincipalsDelete {
        return DeleteCommand(objectId: objectId, tenantID: tenantID)
    }
    public static func Get(objectId: String, tenantID: String) -> ServicePrincipalsGet {
        return GetCommand(objectId: objectId, tenantID: tenantID)
    }
    public static func List(tenantID: String) -> ServicePrincipalsList {
        return ListCommand(tenantID: tenantID)
    }
    public static func ListKeyCredentials(objectId: String, tenantID: String) -> ServicePrincipalsListKeyCredentials {
        return ListKeyCredentialsCommand(objectId: objectId, tenantID: tenantID)
    }
    public static func ListNext(_nextLink: String, tenantID: String) -> ServicePrincipalsListNext {
        return ListNextCommand(_nextLink: _nextLink, tenantID: tenantID)
    }
    public static func ListOwners(objectId: String, tenantID: String) -> ServicePrincipalsListOwners {
        return ListOwnersCommand(objectId: objectId, tenantID: tenantID)
    }
    public static func ListPasswordCredentials(objectId: String, tenantID: String) -> ServicePrincipalsListPasswordCredentials {
        return ListPasswordCredentialsCommand(objectId: objectId, tenantID: tenantID)
    }
    public static func UpdateKeyCredentials(objectId: String, tenantID: String, parameters: KeyCredentialsUpdateParametersProtocol) -> ServicePrincipalsUpdateKeyCredentials {
        return UpdateKeyCredentialsCommand(objectId: objectId, tenantID: tenantID, parameters: parameters)
    }
    public static func UpdatePasswordCredentials(objectId: String, tenantID: String, parameters: PasswordCredentialsUpdateParametersProtocol) -> ServicePrincipalsUpdatePasswordCredentials {
        return UpdatePasswordCredentialsCommand(objectId: objectId, tenantID: tenantID, parameters: parameters)
    }
}
}


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

extension Commands.ServicePrincipals {
// Create creates a service principal in the directory.
    internal class CreateCommand : BaseCommand, ServicePrincipalsCreate {
        public var tenantID : String
        public var apiVersion = "1.6"
    public var parameters :  ServicePrincipalCreateParametersProtocol?

        public init(tenantID: String, parameters: ServicePrincipalCreateParametersProtocol) {
            self.tenantID = tenantID
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/servicePrincipals"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.ServicePrincipals {
// Delete deletes a service principal from the directory.
    internal class DeleteCommand : BaseCommand, ServicePrincipalsDelete {
        public var objectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(objectId: String, tenantID: String) {
            self.objectId = objectId
            self.tenantID = tenantID
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/servicePrincipals/{objectId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{objectId}"] = String(describing: self.objectId)
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            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 ServicePrincipalsGet  {
    var headerParameters: [String: String] { get set }
    var objectId : String { get set }
    var tenantID : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ServicePrincipalProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.ServicePrincipals {
// Get gets service principal information from the directory.
    internal class GetCommand : BaseCommand, ServicePrincipalsGet {
        public var objectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(objectId: String, tenantID: String) {
            self.objectId = objectId
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/servicePrincipals/{objectId}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.ServicePrincipals {
// List gets a list of service principals from the current tenant.
    internal class ListCommand : BaseCommand, ServicePrincipalsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var tenantID : String
        public var filter : String?
        public var apiVersion = "1.6"

        public init(tenantID: String) {
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/servicePrincipals"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{tenantID}"] = String(describing: self.tenantID)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)

        }

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


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

extension Commands.ServicePrincipals {
// ListKeyCredentials get the keyCredentials associated with the specified service principal.
    internal class ListKeyCredentialsCommand : BaseCommand, ServicePrincipalsListKeyCredentials {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var objectId : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(objectId: String, tenantID: String) {
            self.objectId = objectId
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/servicePrincipals/{objectId}/keyCredentials"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.ServicePrincipals {
// ListNext gets a list of service principals from the current tenant.
    internal class ListNextCommand : BaseCommand, ServicePrincipalsListNext {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var _nextLink : String
        public var tenantID : String
        public var apiVersion = "1.6"

        public init(_nextLink: String, tenantID: String) {
            self._nextLink = _nextLink
            self.tenantID = tenantID
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{tenantID}/{nextLink}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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