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

extension Commands.AlertRules {
// Update updates an existing AlertRuleResource. To update other fields use the CreateOrUpdate method.
    internal class UpdateCommand : BaseCommand, AlertRulesUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var ruleName : String
        public var apiVersion = "2016-03-01"
    public var alertRulesResource :  AlertRuleResourcePatchProtocol?

        public init(subscriptionId: String, resourceGroupName: String, ruleName: String, alertRulesResource: AlertRuleResourcePatchProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.ruleName = ruleName
            self.alertRulesResource = alertRulesResource
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/alertrules/{ruleName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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

// AutoscaleSettings is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct AutoscaleSettings {
    public static func CreateOrUpdate(resourceGroupName: String, autoscaleSettingName: String, subscriptionId: String, parameters: AutoscaleSettingResourceProtocol) -> AutoscaleSettingsCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, autoscaleSettingName: autoscaleSettingName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, autoscaleSettingName: String, subscriptionId: String) -> AutoscaleSettingsDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, autoscaleSettingName: autoscaleSettingName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, autoscaleSettingName: String, subscriptionId: String) -> AutoscaleSettingsGet {
        return GetCommand(resourceGroupName: resourceGroupName, autoscaleSettingName: autoscaleSettingName, subscriptionId: subscriptionId)
    }
    public static func ListByResourceGroup(resourceGroupName: String, subscriptionId: String) -> AutoscaleSettingsListByResourceGroup {
        return ListByResourceGroupCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, autoscaleSettingName: String, autoscaleSettingResource: AutoscaleSettingResourcePatchProtocol) -> AutoscaleSettingsUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, autoscaleSettingName: autoscaleSettingName, autoscaleSettingResource: autoscaleSettingResource)
    }
}
}


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

extension Commands.AutoscaleSettings {
// CreateOrUpdate creates or updates an autoscale setting.
    internal class CreateOrUpdateCommand : BaseCommand, AutoscaleSettingsCreateOrUpdate {
        public var resourceGroupName : String
        public var autoscaleSettingName : String
        public var subscriptionId : String
        public var apiVersion = "2015-04-01"
    public var parameters :  AutoscaleSettingResourceProtocol?

        public init(resourceGroupName: String, autoscaleSettingName: String, subscriptionId: String, parameters: AutoscaleSettingResourceProtocol) {
            self.resourceGroupName = resourceGroupName
            self.autoscaleSettingName = autoscaleSettingName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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


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

extension Commands.AutoscaleSettings {
// Delete deletes and autoscale setting
    internal class DeleteCommand : BaseCommand, AutoscaleSettingsDelete {
        public var resourceGroupName : String
        public var autoscaleSettingName : String
        public var subscriptionId : String
        public var apiVersion = "2015-04-01"

        public init(resourceGroupName: String, autoscaleSettingName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.autoscaleSettingName = autoscaleSettingName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.AutoscaleSettings {
// Get gets an autoscale setting
    internal class GetCommand : BaseCommand, AutoscaleSettingsGet {
        public var resourceGroupName : String
        public var autoscaleSettingName : String
        public var subscriptionId : String
        public var apiVersion = "2015-04-01"

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

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

        }

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


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

extension Commands.AutoscaleSettings {
// ListByResourceGroup lists the autoscale settings for a resource group
    internal class ListByResourceGroupCommand : BaseCommand, AutoscaleSettingsListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2015-04-01"

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

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

        }

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


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

extension Commands.AutoscaleSettings {
// Update updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method.
    internal class UpdateCommand : BaseCommand, AutoscaleSettingsUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var autoscaleSettingName : String
        public var apiVersion = "2015-04-01"
    public var autoscaleSettingResource :  AutoscaleSettingResourcePatchProtocol?

        public init(subscriptionId: String, resourceGroupName: String, autoscaleSettingName: String, autoscaleSettingResource: AutoscaleSettingResourcePatchProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.autoscaleSettingName = autoscaleSettingName
            self.autoscaleSettingResource = autoscaleSettingResource
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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


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


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

// DiagnosticSettings is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct DiagnosticSettings {
    public static func CreateOrUpdate(resourceUri: String, name: String, parameters: DiagnosticSettingsResourceProtocol) -> DiagnosticSettingsCreateOrUpdate {
        return CreateOrUpdateCommand(resourceUri: resourceUri, name: name, parameters: parameters)
    }
    public static func Delete(resourceUri: String, name: String) -> DiagnosticSettingsDelete {
        return DeleteCommand(resourceUri: resourceUri, name: name)
    }
    public static func Get(resourceUri: String, name: String) -> DiagnosticSettingsGet {
        return GetCommand(resourceUri: resourceUri, name: name)
    }
    public static func List(resourceUri: String) -> DiagnosticSettingsList {
        return ListCommand(resourceUri: resourceUri)
    }
}
}


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

// DiagnosticSettingsCategory is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct DiagnosticSettingsCategory {
    public static func Get(resourceUri: String, name: String) -> DiagnosticSettingsCategoryGet {
        return GetCommand(resourceUri: resourceUri, name: name)
    }
    public static func List(resourceUri: String) -> DiagnosticSettingsCategoryList {
        return ListCommand(resourceUri: resourceUri)
    }
}
}


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

extension Commands.DiagnosticSettingsCategory {
// Get gets the diagnostic settings category for the specified resource.
    internal class GetCommand : BaseCommand, DiagnosticSettingsCategoryGet {
        public var resourceUri : String
        public var name : String
        public var apiVersion = "2017-05-01-preview"

        public init(resourceUri: String, name: String) {
            self.resourceUri = resourceUri
            self.name = name
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{resourceUri}/providers/microsoft.insights/diagnosticSettingsCategories/{name}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.DiagnosticSettingsCategory {
// List lists the diagnostic settings categories for the specified resource.
    internal class ListCommand : BaseCommand, DiagnosticSettingsCategoryList {
        public var resourceUri : String
        public var apiVersion = "2017-05-01-preview"

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

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


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

extension Commands.DiagnosticSettings {
// CreateOrUpdate creates or updates diagnostic settings for the specified resource.
    internal class CreateOrUpdateCommand : BaseCommand, DiagnosticSettingsCreateOrUpdate {
        public var resourceUri : String
        public var name : String
        public var apiVersion = "2017-05-01-preview"
    public var parameters :  DiagnosticSettingsResourceProtocol?

        public init(resourceUri: String, name: String, parameters: DiagnosticSettingsResourceProtocol) {
            self.resourceUri = resourceUri
            self.name = name
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.DiagnosticSettings {
// Delete deletes existing diagnostic settings for the specified resource.
    internal class DeleteCommand : BaseCommand, DiagnosticSettingsDelete {
        public var resourceUri : String
        public var name : String
        public var apiVersion = "2017-05-01-preview"

        public init(resourceUri: String, name: String) {
            self.resourceUri = resourceUri
            self.name = name
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

extension Commands.DiagnosticSettings {
// Get gets the active diagnostic settings for the specified resource.
    internal class GetCommand : BaseCommand, DiagnosticSettingsGet {
        public var resourceUri : String
        public var name : String
        public var apiVersion = "2017-05-01-preview"

        public init(resourceUri: String, name: String) {
            self.resourceUri = resourceUri
            self.name = name
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{resourceUri}/providers/microsoft.insights/diagnosticSettings/{name}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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


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

extension Commands.DiagnosticSettings {
// List gets the active diagnostic settings list for the specified resource.
    internal class ListCommand : BaseCommand, DiagnosticSettingsList {
        public var resourceUri : String
        public var apiVersion = "2017-05-01-preview"

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

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

// EventCategories is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct EventCategories {
    public static func List() -> EventCategoriesList {
        return ListCommand()
    }
}
}


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

extension Commands.EventCategories {
// List get the list of available event categories supported in the Activity Logs Service.<br>The current list includes
// the following: Administrative, Security, ServiceHealth, Alert, Recommendation, Policy.
    internal class ListCommand : BaseCommand, EventCategoriesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var apiVersion = "2015-04-01"

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

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

        }

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

// LogProfiles is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct LogProfiles {
    public static func CreateOrUpdate(logProfileName: String, subscriptionId: String, parameters: LogProfileResourceProtocol) -> LogProfilesCreateOrUpdate {
        return CreateOrUpdateCommand(logProfileName: logProfileName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(logProfileName: String, subscriptionId: String) -> LogProfilesDelete {
        return DeleteCommand(logProfileName: logProfileName, subscriptionId: subscriptionId)
    }
    public static func Get(logProfileName: String, subscriptionId: String) -> LogProfilesGet {
        return GetCommand(logProfileName: logProfileName, subscriptionId: subscriptionId)
    }
    public static func List(subscriptionId: String) -> LogProfilesList {
        return ListCommand(subscriptionId: subscriptionId)
    }
    public static func Update(subscriptionId: String, logProfileName: String, logProfilesResource: LogProfileResourcePatchProtocol) -> LogProfilesUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, logProfileName: logProfileName, logProfilesResource: logProfilesResource)
    }
}
}


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

extension Commands.LogProfiles {
// CreateOrUpdate create or update a log profile in Azure Monitoring REST API.
    internal class CreateOrUpdateCommand : BaseCommand, LogProfilesCreateOrUpdate {
        public var logProfileName : String
        public var subscriptionId : String
        public var apiVersion = "2016-03-01"
    public var parameters :  LogProfileResourceProtocol?

        public init(logProfileName: String, subscriptionId: String, parameters: LogProfileResourceProtocol) {
            self.logProfileName = logProfileName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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


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

extension Commands.LogProfiles {
// Delete deletes the log profile.
    internal class DeleteCommand : BaseCommand, LogProfilesDelete {
        public var logProfileName : String
        public var subscriptionId : String
        public var apiVersion = "2016-03-01"

        public init(logProfileName: String, subscriptionId: String) {
            self.logProfileName = logProfileName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.LogProfiles {
// Get gets the log profile.
    internal class GetCommand : BaseCommand, LogProfilesGet {
        public var logProfileName : String
        public var subscriptionId : String
        public var apiVersion = "2016-03-01"

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

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

        }

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


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

extension Commands.LogProfiles {
// List list the log profiles.
    internal class ListCommand : BaseCommand, LogProfilesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2016-03-01"

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

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

        }

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


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

extension Commands.LogProfiles {
// Update updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method.
    internal class UpdateCommand : BaseCommand, LogProfilesUpdate {
        public var subscriptionId : String
        public var logProfileName : String
        public var apiVersion = "2016-03-01"
    public var logProfilesResource :  LogProfileResourcePatchProtocol?

        public init(subscriptionId: String, logProfileName: String, logProfilesResource: LogProfileResourcePatchProtocol) {
            self.subscriptionId = subscriptionId
            self.logProfileName = logProfileName
            self.logProfilesResource = logProfilesResource
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/providers/microsoft.insights/logprofiles/{logProfileName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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

// MetricBaseline is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct MetricBaseline {
    public static func CalculateBaseline(resourceUri: String, timeSeriesInformation: TimeSeriesInformationProtocol) -> MetricBaselineCalculateBaseline {
        return CalculateBaselineCommand(resourceUri: resourceUri, timeSeriesInformation: timeSeriesInformation)
    }
    public static func Get(resourceUri: String, metricName: String) -> MetricBaselineGet {
        return GetCommand(resourceUri: resourceUri, metricName: metricName)
    }
}
}


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

extension Commands.MetricBaseline {
// CalculateBaseline **Lists the baseline values for a resource**.
    internal class CalculateBaselineCommand : BaseCommand, MetricBaselineCalculateBaseline {
        public var resourceUri : String
        public var apiVersion = "2017-11-01-preview"
    public var timeSeriesInformation :  TimeSeriesInformationProtocol?

        public init(resourceUri: String, timeSeriesInformation: TimeSeriesInformationProtocol) {
            self.resourceUri = resourceUri
            self.timeSeriesInformation = timeSeriesInformation
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/{resourceUri}/providers/microsoft.insights/calculatebaseline"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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


import Foundation
import azureSwiftRuntime
public protocol MetricBaselineGet  {
    var headerParameters: [String: String] { get set }
    var resourceUri : String { get set }
    var metricName : String { get set }
    var timespan : String? { get set }
    var interval : String? { get set }
    var aggregation : String? { get set }
    var sensitivities : String? { get set }
    var resultType : ResultTypeEnum? { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (BaselineResponseProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.MetricBaseline {
// Get **Gets the baseline values for a specific metric**.
    internal class GetCommand : BaseCommand, MetricBaselineGet {
        public var resourceUri : String
        public var metricName : String
        public var timespan : String?
        public var interval : String?
        public var aggregation : String?
        public var sensitivities : String?
        public var resultType : ResultTypeEnum?
        public var apiVersion = "2017-11-01-preview"

        public init(resourceUri: String, metricName: String) {
            self.resourceUri = resourceUri
            self.metricName = metricName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/{resourceUri}/providers/microsoft.insights/baseline/{metricName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{resourceUri}"] = String(describing: self.resourceUri)
            self.pathParameters["{metricName}"] = String(describing: self.metricName)
            if self.timespan != nil { queryParameters["timespan"] = String(describing: self.timespan!) }
            if self.interval != nil { queryParameters["interval"] = String(describing: self.interval!) }
            if self.aggregation != nil { queryParameters["aggregation"] = String(describing: self.aggregation!) }
            if self.sensitivities != nil { queryParameters["sensitivities"] = String(describing: self.sensitivities!) }
            if self.resultType != nil { queryParameters["resultType"] = String(describing: self.resultType!) }
            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(BaselineResponseData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (BaselineResponseProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: BaselineResponseData?, 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.

// MetricDefinitions is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct MetricDefinitions {
    public static func List(resourceUri: String) -> MetricDefinitionsList {
        return ListCommand(resourceUri: resourceUri)
    }
}
}


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

extension Commands.MetricDefinitions {
// List lists the metric definitions for the resource.
    internal class ListCommand : BaseCommand, MetricDefinitionsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceUri : String
        public var apiVersion = "2018-01-01"
        public var metricnamespace : String?

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

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

        }

        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(MetricDefinitionCollectionData?.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 (MetricDefinitionCollectionProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: MetricDefinitionCollectionData?, 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.

// Metrics is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Metrics {
    public static func List(resourceUri: String) -> MetricsList {
        return ListCommand(resourceUri: resourceUri)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol MetricsList  {
    var headerParameters: [String: String] { get set }
    var resourceUri : String { get set }
    var timespan : String? { get set }
    var interval : String? { get set }
    var metricnames : String? { get set }
    var aggregation : String? { get set }
    var top : Double? { get set }
    var orderby : String? { get set }
    var filter : String? { get set }
    var resultType : ResultTypeEnum? { get set }
    var apiVersion : String { get set }
    var metricnamespace : String? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ResponseProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Metrics {
// List **Lists the metric values for a resource**.
    internal class ListCommand : BaseCommand, MetricsList {
        public var resourceUri : String
        public var timespan : String?
        public var interval : String?
        public var metricnames : String?
        public var aggregation : String?
        public var top : Double?
        public var orderby : String?
        public var filter : String?
        public var resultType : ResultTypeEnum?
        public var apiVersion = "2018-01-01"
        public var metricnamespace : String?

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

        public override func preCall()  {
            self.pathParameters["{resourceUri}"] = String(describing: self.resourceUri)
            if self.timespan != nil { queryParameters["timespan"] = String(describing: self.timespan!) }
            if self.interval != nil { queryParameters["interval"] = String(describing: self.interval!) }
            if self.metricnames != nil { queryParameters["metricnames"] = String(describing: self.metricnames!) }
            if self.aggregation != nil { queryParameters["aggregation"] = String(describing: self.aggregation!) }
            if self.top != nil { queryParameters["top"] = String(describing: self.top!) }
            if self.orderby != nil { queryParameters["orderby"] = String(describing: self.orderby!) }
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.resultType != nil { queryParameters["resultType"] = String(describing: self.resultType!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.metricnamespace != nil { queryParameters["metricnamespace"] = String(describing: self.metricnamespace!) }

        }

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

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


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

extension Commands.Operations {
// List lists all of the available operations from Microsoft.Insights provider.
    internal class ListCommand : BaseCommand, OperationsList {
        public var apiVersion = "2015-04-01"

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

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

        }

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

// TenantActivityLogs is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct TenantActivityLogs {
    public static func List() -> TenantActivityLogsList {
        return ListCommand()
    }
}
}


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

extension Commands.TenantActivityLogs {
// List gets the Activity Logs for the Tenant.
Everything that is applicable to the API to get the Activity Logs for
// the subscription is applicable to this API (the parameters, $filter, etc.).
One thing to point out here is that
// this API does *not* retrieve the logs at the individual subscription of the tenant but only surfaces the logs that
// were generated at the tenant level.
    internal class ListCommand : BaseCommand, TenantActivityLogsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var apiVersion = "2015-04-01"
        public var filter : String?
        public var select : String?

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

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

        }

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ActionGroupData : ActionGroupProtocol {
    public var groupShortName: String
    public var enabled: Bool
    public var emailReceivers: [EmailReceiverProtocol?]?
    public var smsReceivers: [SmsReceiverProtocol?]?
    public var webhookReceivers: [WebhookReceiverProtocol?]?
    public var itsmReceivers: [ItsmReceiverProtocol?]?
    public var azureAppPushReceivers: [AzureAppPushReceiverProtocol?]?
    public var automationRunbookReceivers: [AutomationRunbookReceiverProtocol?]?

        enum CodingKeys: String, CodingKey {case groupShortName = "groupShortName"
        case enabled = "enabled"
        case emailReceivers = "emailReceivers"
        case smsReceivers = "smsReceivers"
        case webhookReceivers = "webhookReceivers"
        case itsmReceivers = "itsmReceivers"
        case azureAppPushReceivers = "azureAppPushReceivers"
        case automationRunbookReceivers = "automationRunbookReceivers"
        }

  public init(groupShortName: String, enabled: Bool)  {
    self.groupShortName = groupShortName
    self.enabled = enabled
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.groupShortName = try container.decode(String.self, forKey: .groupShortName)
    self.enabled = try container.decode(Bool.self, forKey: .enabled)
    if container.contains(.emailReceivers) {
        self.emailReceivers = try container.decode([EmailReceiverData?]?.self, forKey: .emailReceivers)
    }
    if container.contains(.smsReceivers) {
        self.smsReceivers = try container.decode([SmsReceiverData?]?.self, forKey: .smsReceivers)
    }
    if container.contains(.webhookReceivers) {
        self.webhookReceivers = try container.decode([WebhookReceiverData?]?.self, forKey: .webhookReceivers)
    }
    if container.contains(.itsmReceivers) {
        self.itsmReceivers = try container.decode([ItsmReceiverData?]?.self, forKey: .itsmReceivers)
    }
    if container.contains(.azureAppPushReceivers) {
        self.azureAppPushReceivers = try container.decode([AzureAppPushReceiverData?]?.self, forKey: .azureAppPushReceivers)
    }
    if container.contains(.automationRunbookReceivers) {
        self.automationRunbookReceivers = try container.decode([AutomationRunbookReceiverData?]?.self, forKey: .automationRunbookReceivers)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.groupShortName, forKey: .groupShortName)
    try container.encode(self.enabled, forKey: .enabled)
    if self.emailReceivers != nil {try container.encode(self.emailReceivers as! [EmailReceiverData?]?, forKey: .emailReceivers)}
    if self.smsReceivers != nil {try container.encode(self.smsReceivers as! [SmsReceiverData?]?, forKey: .smsReceivers)}
    if self.webhookReceivers != nil {try container.encode(self.webhookReceivers as! [WebhookReceiverData?]?, forKey: .webhookReceivers)}
    if self.itsmReceivers != nil {try container.encode(self.itsmReceivers as! [ItsmReceiverData?]?, forKey: .itsmReceivers)}
    if self.azureAppPushReceivers != nil {try container.encode(self.azureAppPushReceivers as! [AzureAppPushReceiverData?]?, forKey: .azureAppPushReceivers)}
    if self.automationRunbookReceivers != nil {try container.encode(self.automationRunbookReceivers as! [AutomationRunbookReceiverData?]?, forKey: .automationRunbookReceivers)}
  }
}

extension DataFactory {
  public static func createActionGroupProtocol(groupShortName: String, enabled: Bool) -> ActionGroupProtocol {
    return ActionGroupData(groupShortName: groupShortName, enabled: enabled)
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createActionGroupListProtocol() -> ActionGroupListProtocol {
    return ActionGroupListData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createActionGroupPatchBodyProtocol() -> ActionGroupPatchBodyProtocol {
    return ActionGroupPatchBodyData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createActionGroupPatchProtocol() -> ActionGroupPatchProtocol {
    return ActionGroupPatchData()
  }
}


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

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

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

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

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

extension DataFactory {
  public static func createActionGroupResourceProtocol(location: String) -> ActionGroupResourceProtocol {
    return ActionGroupResourceData(location: location)
  }
}


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

        enum CodingKeys: String, CodingKey {case actionGroupId = "actionGroupId"
        case webhookProperties = "webhookProperties"
        }

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

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

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

extension DataFactory {
  public static func createActivityLogAlertActionGroupProtocol(actionGroupId: String) -> ActivityLogAlertActionGroupProtocol {
    return ActivityLogAlertActionGroupData(actionGroupId: actionGroupId)
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createActivityLogAlertActionListProtocol() -> ActivityLogAlertActionListProtocol {
    return ActivityLogAlertActionListData()
  }
}


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

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

  public init(allOf: [ActivityLogAlertLeafConditionProtocol])  {
    self.allOf = allOf
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.allOf as! [ActivityLogAlertLeafConditionData], forKey: .allOf)
  }
}

extension DataFactory {
  public static func createActivityLogAlertAllOfConditionProtocol(allOf: [ActivityLogAlertLeafConditionProtocol]) -> ActivityLogAlertAllOfConditionProtocol {
    return ActivityLogAlertAllOfConditionData(allOf: allOf)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct ActivityLogAlertData : ActivityLogAlertProtocol {
    public var scopes: [String]
    public var enabled: Bool?
    public var condition: ActivityLogAlertAllOfConditionProtocol
    public var actions: ActivityLogAlertActionListProtocol
    public var description: String?

        enum CodingKeys: String, CodingKey {case scopes = "scopes"
        case enabled = "enabled"
        case condition = "condition"
        case actions = "actions"
        case description = "description"
        }

  public init(scopes: [String], condition: ActivityLogAlertAllOfConditionProtocol, actions: ActivityLogAlertActionListProtocol)  {
    self.scopes = scopes
    self.condition = condition
    self.actions = actions
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.scopes = try container.decode([String].self, forKey: .scopes)
    if container.contains(.enabled) {
        self.enabled = try container.decode(Bool?.self, forKey: .enabled)
    }
    self.condition = try container.decode(ActivityLogAlertAllOfConditionData.self, forKey: .condition)
    self.actions = try container.decode(ActivityLogAlertActionListData.self, forKey: .actions)
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.scopes as! [String], forKey: .scopes)
    if self.enabled != nil {try container.encode(self.enabled, forKey: .enabled)}
    try container.encode(self.condition as! ActivityLogAlertAllOfConditionData, forKey: .condition)
    try container.encode(self.actions as! ActivityLogAlertActionListData, forKey: .actions)
    if self.description != nil {try container.encode(self.description, forKey: .description)}
  }
}

extension DataFactory {
  public static func createActivityLogAlertProtocol(scopes: [String], condition: ActivityLogAlertAllOfConditionProtocol, actions: ActivityLogAlertActionListProtocol) -> ActivityLogAlertProtocol {
    return ActivityLogAlertData(scopes: scopes, condition: condition, actions: actions)
  }
}


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

        enum CodingKeys: String, CodingKey {case field = "field"
        case equals = "equals"
        }

  public init(field: String, equals: String)  {
    self.field = field
    self.equals = equals
  }

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

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

extension DataFactory {
  public static func createActivityLogAlertLeafConditionProtocol(field: String, equals: String) -> ActivityLogAlertLeafConditionProtocol {
    return ActivityLogAlertLeafConditionData(field: field, equals: equals)
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createActivityLogAlertListProtocol() -> ActivityLogAlertListProtocol {
    return ActivityLogAlertListData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createActivityLogAlertPatchBodyProtocol() -> ActivityLogAlertPatchBodyProtocol {
    return ActivityLogAlertPatchBodyData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createActivityLogAlertPatchProtocol() -> ActivityLogAlertPatchProtocol {
    return ActivityLogAlertPatchData()
  }
}