// 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
// RecurrenceScheduleProtocol is the recurrence schedule.
public protocol RecurrenceScheduleProtocol : Codable {
     var minutes: [Int32]? { get set }
     var hours: [Int32]? { get set }
     var weekDays: [DaysOfWeekEnum?]? { get set }
     var monthDays: [Int32]? { get set }
     var monthlyOccurrences: [RecurrenceScheduleOccurrenceProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// RegenerateActionParameterProtocol is the access key regenerate action content.
public protocol RegenerateActionParameterProtocol : Codable {
     var keyType: KeyTypeEnum? { get set }
}


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


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// RetryHistoryProtocol is the retry history.
public protocol RetryHistoryProtocol : Codable {
     var startTime: Date? { get set }
     var endTime: Date? { get set }
     var code: String? { get set }
     var clientRequestId: String? { get set }
     var serviceRequestId: String? { get set }
     var error: ErrorResponseProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SkuProtocol is the sku type.
public protocol SkuProtocol : Codable {
     var name: SkuNameEnum { get set }
     var plan: ResourceReferenceProtocol? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowFilterProtocol is the workflow filter.
public protocol WorkflowFilterProtocol : Codable {
     var state: WorkflowStateEnum? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowOutputParameterProtocol is the workflow output parameter.
public protocol WorkflowOutputParameterProtocol : WorkflowParameterProtocol {
     var error: [String: String?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowParameterProtocol is the workflow parameters.
public protocol WorkflowParameterProtocol : Codable {
     var type: ParameterTypeEnum? { get set }
     var value: [String: String?]? { get set }
     var metadata: [String: String?]? { get set }
     var description: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowPropertiesProtocol is the workflow properties.
public protocol WorkflowPropertiesProtocol : Codable {
     var provisioningState: WorkflowProvisioningStateEnum? { get set }
     var createdTime: Date? { get set }
     var changedTime: Date? { get set }
     var state: WorkflowStateEnum? { get set }
     var version: String? { get set }
     var accessEndpoint: String? { get set }
     var sku: SkuProtocol? { get set }
     var integrationAccount: ResourceReferenceProtocol? { get set }
     var definition: [String: String?]? { get set }
     var parameters: [String:WorkflowParameterProtocol?]? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowRunActionFilterProtocol is the workflow run action filter.
public protocol WorkflowRunActionFilterProtocol : Codable {
     var status: WorkflowStatusEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowRunActionListResultProtocol is the list of workflow run actions.
public protocol WorkflowRunActionListResultProtocol : Codable {
     var value: [WorkflowRunActionProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowRunActionPropertiesProtocol is the workflow run action properties.
public protocol WorkflowRunActionPropertiesProtocol : Codable {
     var startTime: Date? { get set }
     var endTime: Date? { get set }
     var status: WorkflowStatusEnum? { get set }
     var code: String? { get set }
     var error: [String: String?]? { get set }
     var trackingId: String? { get set }
     var correlation: CorrelationProtocol? { get set }
     var inputsLink: ContentLinkProtocol? { get set }
     var outputsLink: ContentLinkProtocol? { get set }
     var trackedProperties: [String: String?]? { get set }
     var retryHistory: [RetryHistoryProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowRunActionProtocol is the workflow run action.
public protocol WorkflowRunActionProtocol : SubResourceProtocol {
     var properties: WorkflowRunActionPropertiesProtocol? { get set }
     var name: String? { get set }
     var type: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowRunFilterProtocol is the workflow run filter.
public protocol WorkflowRunFilterProtocol : Codable {
     var status: WorkflowStatusEnum? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowRunPropertiesProtocol is the workflow run properties.
public protocol WorkflowRunPropertiesProtocol : Codable {
     var startTime: Date? { get set }
     var endTime: Date? { get set }
     var status: WorkflowStatusEnum? { get set }
     var code: String? { get set }
     var error: [String: String?]? { get set }
     var correlationId: String? { get set }
     var correlation: CorrelationProtocol? { get set }
     var workflow: ResourceReferenceProtocol? { get set }
     var trigger: WorkflowRunTriggerProtocol? { get set }
     var outputs: [String:WorkflowOutputParameterProtocol?]? { get set }
     var response: WorkflowRunTriggerProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowRunProtocol is the workflow run.
public protocol WorkflowRunProtocol : SubResourceProtocol {
     var properties: WorkflowRunPropertiesProtocol? { get set }
     var name: String? { get set }
     var type: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowRunTriggerProtocol is the workflow run trigger.
public protocol WorkflowRunTriggerProtocol : Codable {
     var name: String? { get set }
     var inputs: [String: String?]? { get set }
     var inputsLink: ContentLinkProtocol? { get set }
     var outputs: [String: String?]? { get set }
     var outputsLink: ContentLinkProtocol? { get set }
     var startTime: Date? { get set }
     var endTime: Date? { get set }
     var trackingId: String? { get set }
     var correlation: CorrelationProtocol? { get set }
     var code: String? { get set }
     var status: WorkflowStatusEnum? { get set }
     var error: [String: String?]? { get set }
     var trackedProperties: [String: String?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerCallbackUrlProtocol is the workflow trigger callback URL.
public protocol WorkflowTriggerCallbackUrlProtocol : Codable {
     var value: String? { get set }
     var method: String? { get set }
     var basePath: String? { get set }
     var relativePath: String? { get set }
     var relativePathParameters: [String]? { get set }
     var queries: WorkflowTriggerListCallbackUrlQueriesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerFilterProtocol is the workflow trigger filter.
public protocol WorkflowTriggerFilterProtocol : Codable {
     var state: WorkflowStateEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerHistoryFilterProtocol is the workflow trigger history filter.
public protocol WorkflowTriggerHistoryFilterProtocol : Codable {
     var status: WorkflowStatusEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerHistoryListResultProtocol is the list of workflow trigger histories.
public protocol WorkflowTriggerHistoryListResultProtocol : Codable {
     var value: [WorkflowTriggerHistoryProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerHistoryPropertiesProtocol is the workflow trigger history properties.
public protocol WorkflowTriggerHistoryPropertiesProtocol : Codable {
     var startTime: Date? { get set }
     var endTime: Date? { get set }
     var status: WorkflowStatusEnum? { get set }
     var code: String? { get set }
     var error: [String: String?]? { get set }
     var trackingId: String? { get set }
     var correlation: CorrelationProtocol? { get set }
     var inputsLink: ContentLinkProtocol? { get set }
     var outputsLink: ContentLinkProtocol? { get set }
     var fired: Bool? { get set }
     var run: ResourceReferenceProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerHistoryProtocol is the workflow trigger history.
public protocol WorkflowTriggerHistoryProtocol : SubResourceProtocol {
     var properties: WorkflowTriggerHistoryPropertiesProtocol? { get set }
     var name: String? { get set }
     var type: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerListCallbackUrlQueriesProtocol is gets the workflow trigger callback URL query parameters.
public protocol WorkflowTriggerListCallbackUrlQueriesProtocol : Codable {
     var apiVersion: String? { get set }
     var sp: String? { get set }
     var sv: String? { get set }
     var sig: String? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerPropertiesProtocol is the workflow trigger properties.
public protocol WorkflowTriggerPropertiesProtocol : Codable {
     var provisioningState: WorkflowTriggerProvisioningStateEnum? { get set }
     var createdTime: Date? { get set }
     var changedTime: Date? { get set }
     var state: WorkflowStateEnum? { get set }
     var status: WorkflowStatusEnum? { get set }
     var lastExecutionTime: Date? { get set }
     var nextExecutionTime: Date? { get set }
     var recurrence: WorkflowTriggerRecurrenceProtocol? { get set }
     var workflow: ResourceReferenceProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerProtocol is the workflow trigger.
public protocol WorkflowTriggerProtocol : SubResourceProtocol {
     var properties: WorkflowTriggerPropertiesProtocol? { get set }
     var name: String? { get set }
     var type: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowTriggerRecurrenceProtocol is the workflow trigger recurrence.
public protocol WorkflowTriggerRecurrenceProtocol : Codable {
     var frequency: RecurrenceFrequencyEnum? { get set }
     var interval: Int32? { get set }
     var startTime: Date? { get set }
     var endTime: Date? { get set }
     var timeZone: String? { get set }
     var schedule: RecurrenceScheduleProtocol? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowVersionPropertiesProtocol is the workflow version properties.
public protocol WorkflowVersionPropertiesProtocol : Codable {
     var createdTime: Date? { get set }
     var changedTime: Date? { get set }
     var state: WorkflowStateEnum? { get set }
     var version: String? { get set }
     var accessEndpoint: String? { get set }
     var sku: SkuProtocol? { get set }
     var integrationAccount: ResourceReferenceProtocol? { get set }
     var definition: [String: String?]? { get set }
     var parameters: [String:WorkflowParameterProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// WorkflowVersionProtocol is the workflow version.
public protocol WorkflowVersionProtocol : ResourceProtocol {
     var properties: WorkflowVersionPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12AcknowledgementSettingsProtocol is the X12 agreement acknowledgement settings.
public protocol X12AcknowledgementSettingsProtocol : Codable {
     var needTechnicalAcknowledgement: Bool { get set }
     var batchTechnicalAcknowledgements: Bool { get set }
     var needFunctionalAcknowledgement: Bool { get set }
     var functionalAcknowledgementVersion: String? { get set }
     var batchFunctionalAcknowledgements: Bool { get set }
     var needImplementationAcknowledgement: Bool { get set }
     var implementationAcknowledgementVersion: String? { get set }
     var batchImplementationAcknowledgements: Bool { get set }
     var needLoopForValidMessages: Bool { get set }
     var sendSynchronousAcknowledgement: Bool { get set }
     var acknowledgementControlNumberPrefix: String? { get set }
     var acknowledgementControlNumberSuffix: String? { get set }
     var acknowledgementControlNumberLowerBound: Int32 { get set }
     var acknowledgementControlNumberUpperBound: Int32 { get set }
     var rolloverAcknowledgementControlNumber: Bool { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12AgreementContentProtocol is the X12 agreement content.
public protocol X12AgreementContentProtocol : Codable {
     var receiveAgreement: X12OneWayAgreementProtocol { get set }
     var sendAgreement: X12OneWayAgreementProtocol { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12DelimiterOverridesProtocol is the X12 delimiter override settings.
public protocol X12DelimiterOverridesProtocol : Codable {
     var protocolVersion: String? { get set }
     var messageId: String? { get set }
     var dataElementSeparator: Int32 { get set }
     var componentSeparator: Int32 { get set }
     var segmentTerminator: Int32 { get set }
     var segmentTerminatorSuffix: SegmentTerminatorSuffixEnum { get set }
     var replaceCharacter: Int32 { get set }
     var replaceSeparatorsInPayload: Bool { get set }
     var targetNamespace: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12EnvelopeOverrideProtocol is the X12 envelope override settings.
public protocol X12EnvelopeOverrideProtocol : Codable {
     var targetNamespace: String { get set }
     var protocolVersion: String { get set }
     var messageId: String { get set }
     var responsibleAgencyCode: String { get set }
     var headerVersion: String { get set }
     var senderApplicationId: String { get set }
     var receiverApplicationId: String { get set }
     var functionalIdentifierCode: String? { get set }
     var dateFormat: X12DateFormatEnum { get set }
     var timeFormat: X12TimeFormatEnum { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12EnvelopeSettingsProtocol is the X12 agreement envelope settings.
public protocol X12EnvelopeSettingsProtocol : Codable {
     var controlStandardsId: Int32 { get set }
     var useControlStandardsIdAsRepetitionCharacter: Bool { get set }
     var senderApplicationId: String { get set }
     var receiverApplicationId: String { get set }
     var controlVersionNumber: String { get set }
     var interchangeControlNumberLowerBound: Int32 { get set }
     var interchangeControlNumberUpperBound: Int32 { get set }
     var rolloverInterchangeControlNumber: Bool { get set }
     var enableDefaultGroupHeaders: Bool { get set }
     var functionalGroupId: String? { get set }
     var groupControlNumberLowerBound: Int32 { get set }
     var groupControlNumberUpperBound: Int32 { get set }
     var rolloverGroupControlNumber: Bool { get set }
     var groupHeaderAgencyCode: String { get set }
     var groupHeaderVersion: String { get set }
     var transactionSetControlNumberLowerBound: Int32 { get set }
     var transactionSetControlNumberUpperBound: Int32 { get set }
     var rolloverTransactionSetControlNumber: Bool { get set }
     var transactionSetControlNumberPrefix: String? { get set }
     var transactionSetControlNumberSuffix: String? { get set }
     var overwriteExistingTransactionSetControlNumber: Bool { get set }
     var groupHeaderDateFormat: X12DateFormatEnum { get set }
     var groupHeaderTimeFormat: X12TimeFormatEnum { get set }
     var usageIndicator: UsageIndicatorEnum { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12FramingSettingsProtocol is the X12 agreement framing settings.
public protocol X12FramingSettingsProtocol : Codable {
     var dataElementSeparator: Int32 { get set }
     var componentSeparator: Int32 { get set }
     var replaceSeparatorsInPayload: Bool { get set }
     var replaceCharacter: Int32 { get set }
     var segmentTerminator: Int32 { get set }
     var characterSet: X12CharacterSetEnum { get set }
     var segmentTerminatorSuffix: SegmentTerminatorSuffixEnum { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12MessageFilterProtocol is the X12 message filter for odata query.
public protocol X12MessageFilterProtocol : Codable {
     var messageFilterType: MessageFilterTypeEnum { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12MessageIdentifierProtocol is the X12 message identifier.
public protocol X12MessageIdentifierProtocol : Codable {
     var messageId: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12OneWayAgreementProtocol is the X12 oneway agreement.
public protocol X12OneWayAgreementProtocol : Codable {
     var senderBusinessIdentity: BusinessIdentityProtocol { get set }
     var receiverBusinessIdentity: BusinessIdentityProtocol { get set }
     var protocolSettings: X12ProtocolSettingsProtocol { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12ProcessingSettingsProtocol is the X12 processing settings.
public protocol X12ProcessingSettingsProtocol : Codable {
     var maskSecurityInfo: Bool { get set }
     var convertImpliedDecimal: Bool { get set }
     var preserveInterchange: Bool { get set }
     var suspendInterchangeOnError: Bool { get set }
     var createEmptyXmlTagsForTrailingSeparators: Bool { get set }
     var useDotAsDecimalSeparator: Bool { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12ProtocolSettingsProtocol is the X12 agreement protocol settings.
public protocol X12ProtocolSettingsProtocol : Codable {
     var validationSettings: X12ValidationSettingsProtocol { get set }
     var framingSettings: X12FramingSettingsProtocol { get set }
     var envelopeSettings: X12EnvelopeSettingsProtocol { get set }
     var acknowledgementSettings: X12AcknowledgementSettingsProtocol { get set }
     var messageFilter: X12MessageFilterProtocol { get set }
     var securitySettings: X12SecuritySettingsProtocol { get set }
     var processingSettings: X12ProcessingSettingsProtocol { get set }
     var envelopeOverrides: [X12EnvelopeOverrideProtocol?]? { get set }
     var validationOverrides: [X12ValidationOverrideProtocol?]? { get set }
     var messageFilterList: [X12MessageIdentifierProtocol?]? { get set }
     var schemaReferences: [X12SchemaReferenceProtocol] { get set }
     var x12DelimiterOverrides: [X12DelimiterOverridesProtocol?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12SchemaReferenceProtocol is the X12 schema reference.
public protocol X12SchemaReferenceProtocol : Codable {
     var messageId: String { get set }
     var senderApplicationId: String? { get set }
     var schemaVersion: String { get set }
     var schemaName: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12SecuritySettingsProtocol is the X12 agreement security settings.
public protocol X12SecuritySettingsProtocol : Codable {
     var authorizationQualifier: String { get set }
     var authorizationValue: String? { get set }
     var securityQualifier: String { get set }
     var passwordValue: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12ValidationOverrideProtocol is the X12 validation override settings.
public protocol X12ValidationOverrideProtocol : Codable {
     var messageId: String { get set }
     var validateEdiTypes: Bool { get set }
     var validateXsdTypes: Bool { get set }
     var allowLeadingAndTrailingSpacesAndZeroes: Bool { get set }
     var validateCharacterSet: Bool { get set }
     var trimLeadingAndTrailingSpacesAndZeroes: Bool { get set }
     var trailingSeparatorPolicy: TrailingSeparatorPolicyEnum { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// X12ValidationSettingsProtocol is the X12 agreement validation settings.
public protocol X12ValidationSettingsProtocol : Codable {
     var validateCharacterSet: Bool { get set }
     var checkDuplicateInterchangeControlNumber: Bool { get set }
     var interchangeControlNumberValidityDays: Int32 { get set }
     var checkDuplicateGroupControlNumber: Bool { get set }
     var checkDuplicateTransactionSetControlNumber: Bool { get set }
     var validateEdiTypes: Bool { get set }
     var validateXsdTypes: Bool { get set }
     var allowLeadingAndTrailingSpacesAndZeroes: Bool { get set }
     var trimLeadingAndTrailingSpacesAndZeroes: Bool { get set }
     var trailingSeparatorPolicy: TrailingSeparatorPolicyEnum { get set }
}


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


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

// ActionGroups is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct ActionGroups {
    public static func CreateOrUpdate(resourceGroupName: String, actionGroupName: String, subscriptionId: String, actionGroup: ActionGroupResourceProtocol) -> ActionGroupsCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, actionGroupName: actionGroupName, subscriptionId: subscriptionId, actionGroup: actionGroup)
    }
    public static func Delete(resourceGroupName: String, actionGroupName: String, subscriptionId: String) -> ActionGroupsDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, actionGroupName: actionGroupName, subscriptionId: subscriptionId)
    }
    public static func EnableReceiver(resourceGroupName: String, actionGroupName: String, subscriptionId: String, enableRequest: EnableRequestProtocol) -> ActionGroupsEnableReceiver {
        return EnableReceiverCommand(resourceGroupName: resourceGroupName, actionGroupName: actionGroupName, subscriptionId: subscriptionId, enableRequest: enableRequest)
    }
    public static func Get(resourceGroupName: String, actionGroupName: String, subscriptionId: String) -> ActionGroupsGet {
        return GetCommand(resourceGroupName: resourceGroupName, actionGroupName: actionGroupName, subscriptionId: subscriptionId)
    }
    public static func ListByResourceGroup(resourceGroupName: String, subscriptionId: String) -> ActionGroupsListByResourceGroup {
        return ListByResourceGroupCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func ListBySubscriptionId(subscriptionId: String) -> ActionGroupsListBySubscriptionId {
        return ListBySubscriptionIdCommand(subscriptionId: subscriptionId)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, actionGroupName: String, actionGroupPatch: ActionGroupPatchBodyProtocol) -> ActionGroupsUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, actionGroupName: actionGroupName, actionGroupPatch: actionGroupPatch)
    }
}
}


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

extension Commands.ActionGroups {
// CreateOrUpdate create a new action group or update an existing one.
    internal class CreateOrUpdateCommand : BaseCommand, ActionGroupsCreateOrUpdate {
        public var resourceGroupName : String
        public var actionGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var actionGroup :  ActionGroupResourceProtocol?

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

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

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


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

extension Commands.ActionGroups {
// Delete delete an action group.
    internal class DeleteCommand : BaseCommand, ActionGroupsDelete {
        public var resourceGroupName : String
        public var actionGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

extension Commands.ActionGroups {
// EnableReceiver enable a receiver in an action group. This changes the receiver's status from Disabled to Enabled.
    internal class EnableReceiverCommand : BaseCommand, ActionGroupsEnableReceiver {
        public var resourceGroupName : String
        public var actionGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var enableRequest :  EnableRequestProtocol?

        public init(resourceGroupName: String, actionGroupName: String, subscriptionId: String, enableRequest: EnableRequestProtocol) {
            self.resourceGroupName = resourceGroupName
            self.actionGroupName = actionGroupName
            self.subscriptionId = subscriptionId
            self.enableRequest = enableRequest
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}/subscribe"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

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

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


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

extension Commands.ActionGroups {
// Get get an action group.
    internal class GetCommand : BaseCommand, ActionGroupsGet {
        public var resourceGroupName : String
        public var actionGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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


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

extension Commands.ActionGroups {
// ListByResourceGroup get a list of all action groups in a resource group.
    internal class ListByResourceGroupCommand : BaseCommand, ActionGroupsListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2017-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/actionGroups"
            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 = "nil"
                }
                let result = try decoder.decode(ActionGroupListData?.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 (ActionGroupListProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: ActionGroupListData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.ActionGroups {
// ListBySubscriptionId get a list of all action groups in a subscription.
    internal class ListBySubscriptionIdCommand : BaseCommand, ActionGroupsListBySubscriptionId {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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


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

extension Commands.ActionGroups {
// Update updates an existing action group's tags. To update other fields use the CreateOrUpdate method.
    internal class UpdateCommand : BaseCommand, ActionGroupsUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var actionGroupName : String
        public var apiVersion = "2017-04-01"
    public var actionGroupPatch :  ActionGroupPatchBodyProtocol?

        public init(subscriptionId: String, resourceGroupName: String, actionGroupName: String, actionGroupPatch: ActionGroupPatchBodyProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.actionGroupName = actionGroupName
            self.actionGroupPatch = actionGroupPatch
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/actionGroups/{actionGroupName}"
            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["{actionGroupName}"] = String(describing: self.actionGroupName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = actionGroupPatch

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

// ActivityLogAlerts is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct ActivityLogAlerts {
    public static func CreateOrUpdate(subscriptionId: String, resourceGroupName: String, activityLogAlertName: String, activityLogAlert: ActivityLogAlertResourceProtocol) -> ActivityLogAlertsCreateOrUpdate {
        return CreateOrUpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, activityLogAlertName: activityLogAlertName, activityLogAlert: activityLogAlert)
    }
    public static func Delete(subscriptionId: String, resourceGroupName: String, activityLogAlertName: String) -> ActivityLogAlertsDelete {
        return DeleteCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, activityLogAlertName: activityLogAlertName)
    }
    public static func Get(subscriptionId: String, resourceGroupName: String, activityLogAlertName: String) -> ActivityLogAlertsGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, activityLogAlertName: activityLogAlertName)
    }
    public static func ListByResourceGroup(subscriptionId: String, resourceGroupName: String) -> ActivityLogAlertsListByResourceGroup {
        return ListByResourceGroupCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName)
    }
    public static func ListBySubscriptionId(subscriptionId: String) -> ActivityLogAlertsListBySubscriptionId {
        return ListBySubscriptionIdCommand(subscriptionId: subscriptionId)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, activityLogAlertName: String, activityLogAlertPatch: ActivityLogAlertPatchBodyProtocol) -> ActivityLogAlertsUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, activityLogAlertName: activityLogAlertName, activityLogAlertPatch: activityLogAlertPatch)
    }
}
}


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

extension Commands.ActivityLogAlerts {
// CreateOrUpdate create a new activity log alert or update an existing one.
    internal class CreateOrUpdateCommand : BaseCommand, ActivityLogAlertsCreateOrUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var activityLogAlertName : String
        public var apiVersion = "2017-04-01"
    public var activityLogAlert :  ActivityLogAlertResourceProtocol?

        public init(subscriptionId: String, resourceGroupName: String, activityLogAlertName: String, activityLogAlert: ActivityLogAlertResourceProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.activityLogAlertName = activityLogAlertName
            self.activityLogAlert = activityLogAlert
            super.init()
            self.method = "Put"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}"
            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["{activityLogAlertName}"] = String(describing: self.activityLogAlertName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = activityLogAlert

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


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

extension Commands.ActivityLogAlerts {
// Delete delete an activity log alert.
    internal class DeleteCommand : BaseCommand, ActivityLogAlertsDelete {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var activityLogAlertName : String
        public var apiVersion = "2017-04-01"

        public init(subscriptionId: String, resourceGroupName: String, activityLogAlertName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.activityLogAlertName = activityLogAlertName
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}"
            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["{activityLogAlertName}"] = String(describing: self.activityLogAlertName)
            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 ActivityLogAlertsGet  {
    var headerParameters: [String: String] { get set }
    var subscriptionId : String { get set }
    var resourceGroupName : String { get set }
    var activityLogAlertName : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (ActivityLogAlertResourceProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.ActivityLogAlerts {
// Get get an activity log alert.
    internal class GetCommand : BaseCommand, ActivityLogAlertsGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var activityLogAlertName : String
        public var apiVersion = "2017-04-01"

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


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

extension Commands.ActivityLogAlerts {
// ListByResourceGroup get a list of all activity log alerts in a resource group.
    internal class ListByResourceGroupCommand : BaseCommand, ActivityLogAlertsListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.ActivityLogAlerts {
// ListBySubscriptionId get a list of all activity log alerts in a subscription.
    internal class ListBySubscriptionIdCommand : BaseCommand, ActivityLogAlertsListBySubscriptionId {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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


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

extension Commands.ActivityLogAlerts {
// Update updates an existing ActivityLogAlertResource's tags. To update other fields use the CreateOrUpdate method.
    internal class UpdateCommand : BaseCommand, ActivityLogAlertsUpdate {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var activityLogAlertName : String
        public var apiVersion = "2017-04-01"
    public var activityLogAlertPatch :  ActivityLogAlertPatchBodyProtocol?

        public init(subscriptionId: String, resourceGroupName: String, activityLogAlertName: String, activityLogAlertPatch: ActivityLogAlertPatchBodyProtocol) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.activityLogAlertName = activityLogAlertName
            self.activityLogAlertPatch = activityLogAlertPatch
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.insights/activityLogAlerts/{activityLogAlertName}"
            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["{activityLogAlertName}"] = String(describing: self.activityLogAlertName)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            self.body = activityLogAlertPatch

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

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


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

extension Commands.ActivityLogs {
// List provides the list of records from the activity logs.
    internal class ListCommand : BaseCommand, ActivityLogsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var apiVersion = "2015-04-01"
        public var filter : String?
        public var select : String?

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.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.

// AlertRuleIncidents is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct AlertRuleIncidents {
    public static func Get(resourceGroupName: String, ruleName: String, incidentName: String, subscriptionId: String) -> AlertRuleIncidentsGet {
        return GetCommand(resourceGroupName: resourceGroupName, ruleName: ruleName, incidentName: incidentName, subscriptionId: subscriptionId)
    }
    public static func ListByAlertRule(resourceGroupName: String, ruleName: String, subscriptionId: String) -> AlertRuleIncidentsListByAlertRule {
        return ListByAlertRuleCommand(resourceGroupName: resourceGroupName, ruleName: ruleName, subscriptionId: subscriptionId)
    }
}
}


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

extension Commands.AlertRuleIncidents {
// Get gets an incident associated to an alert rule
    internal class GetCommand : BaseCommand, AlertRuleIncidentsGet {
        public var resourceGroupName : String
        public var ruleName : String
        public var incidentName : String
        public var subscriptionId : String
        public var apiVersion = "2016-03-01"

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

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


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

extension Commands.AlertRuleIncidents {
// ListByAlertRule gets a list of incidents associated to an alert rule
    internal class ListByAlertRuleCommand : BaseCommand, AlertRuleIncidentsListByAlertRule {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var ruleName : String
        public var subscriptionId : String
        public var apiVersion = "2016-03-01"

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

        public override func preCall()  {
            self.pathParameters["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{ruleName}"] = String(describing: self.ruleName)
            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(IncidentListResultData?.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 (IncidentListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: IncidentListResultData?, 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.

// AlertRules is the monitor Management Client
import Foundation
import azureSwiftRuntime
extension Commands {
public struct AlertRules {
    public static func CreateOrUpdate(resourceGroupName: String, ruleName: String, subscriptionId: String, parameters: AlertRuleResourceProtocol) -> AlertRulesCreateOrUpdate {
        return CreateOrUpdateCommand(resourceGroupName: resourceGroupName, ruleName: ruleName, subscriptionId: subscriptionId, parameters: parameters)
    }
    public static func Delete(resourceGroupName: String, ruleName: String, subscriptionId: String) -> AlertRulesDelete {
        return DeleteCommand(resourceGroupName: resourceGroupName, ruleName: ruleName, subscriptionId: subscriptionId)
    }
    public static func Get(resourceGroupName: String, ruleName: String, subscriptionId: String) -> AlertRulesGet {
        return GetCommand(resourceGroupName: resourceGroupName, ruleName: ruleName, subscriptionId: subscriptionId)
    }
    public static func ListByResourceGroup(resourceGroupName: String, subscriptionId: String) -> AlertRulesListByResourceGroup {
        return ListByResourceGroupCommand(resourceGroupName: resourceGroupName, subscriptionId: subscriptionId)
    }
    public static func Update(subscriptionId: String, resourceGroupName: String, ruleName: String, alertRulesResource: AlertRuleResourcePatchProtocol) -> AlertRulesUpdate {
        return UpdateCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, ruleName: ruleName, alertRulesResource: alertRulesResource)
    }
}
}


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

extension Commands.AlertRules {
// CreateOrUpdate creates or updates an alert rule.
    internal class CreateOrUpdateCommand : BaseCommand, AlertRulesCreateOrUpdate {
        public var resourceGroupName : String
        public var ruleName : String
        public var subscriptionId : String
        public var apiVersion = "2016-03-01"
    public var parameters :  AlertRuleResourceProtocol?

        public init(resourceGroupName: String, ruleName: String, subscriptionId: String, parameters: AlertRuleResourceProtocol) {
            self.resourceGroupName = resourceGroupName
            self.ruleName = ruleName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Put"
            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["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{ruleName}"] = String(describing: self.ruleName)
            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? AlertRuleResourceData)
                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)
            }
        }
    }
}


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

extension Commands.AlertRules {
// Delete deletes an alert rule
    internal class DeleteCommand : BaseCommand, AlertRulesDelete {
        public var resourceGroupName : String
        public var ruleName : String
        public var subscriptionId : String
        public var apiVersion = "2016-03-01"

        public init(resourceGroupName: String, ruleName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.ruleName = ruleName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            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["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{ruleName}"] = String(describing: self.ruleName)
            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 AlertRulesGet  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var ruleName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (AlertRuleResourceProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.AlertRules {
// Get gets an alert rule
    internal class GetCommand : BaseCommand, AlertRulesGet {
        public var resourceGroupName : String
        public var ruleName : String
        public var subscriptionId : String
        public var apiVersion = "2016-03-01"

        public init(resourceGroupName: String, ruleName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.ruleName = ruleName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            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["{resourceGroupName}"] = String(describing: self.resourceGroupName)
            self.pathParameters["{ruleName}"] = String(describing: self.ruleName)
            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(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)
            }
        }
    }
}


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

extension Commands.AlertRules {
// ListByResourceGroup list the alert rules within a resource group.
    internal class ListByResourceGroupCommand : BaseCommand, AlertRulesListByResourceGroup {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var subscriptionId : String
        public var apiVersion = "2016-03-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/alertrules"
            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 = "nil"
                }
                let result = try decoder.decode(AlertRuleResourceCollectionData?.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 (AlertRuleResourceCollectionProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: AlertRuleResourceCollectionData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}