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

        enum CodingKeys: String, CodingKey {case provisioningState = "provisioningState"
        case createdTime = "createdTime"
        case changedTime = "changedTime"
        case state = "state"
        case version = "version"
        case accessEndpoint = "accessEndpoint"
        case sku = "sku"
        case integrationAccount = "integrationAccount"
        case definition = "definition"
        case parameters = "parameters"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(WorkflowProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.createdTime) {
        self.createdTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdTime)), format: .dateTime)
    }
    if container.contains(.changedTime) {
        self.changedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .changedTime)), format: .dateTime)
    }
    if container.contains(.state) {
        self.state = try container.decode(WorkflowStateEnum?.self, forKey: .state)
    }
    if container.contains(.version) {
        self.version = try container.decode(String?.self, forKey: .version)
    }
    if container.contains(.accessEndpoint) {
        self.accessEndpoint = try container.decode(String?.self, forKey: .accessEndpoint)
    }
    if container.contains(.sku) {
        self.sku = try container.decode(SkuData?.self, forKey: .sku)
    }
    if container.contains(.integrationAccount) {
        self.integrationAccount = try container.decode(ResourceReferenceData?.self, forKey: .integrationAccount)
    }
    if container.contains(.definition) {
        self.definition = try container.decode([String: String?]?.self, forKey: .definition)
    }
    if container.contains(.parameters) {
        self.parameters = try container.decode([String:WorkflowParameterData?]?.self, forKey: .parameters)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.createdTime != nil {
        try container.encode(DateConverter.toString(date: self.createdTime!, format: .dateTime), forKey: .createdTime)
    }
    if self.changedTime != nil {
        try container.encode(DateConverter.toString(date: self.changedTime!, format: .dateTime), forKey: .changedTime)
    }
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.version != nil {try container.encode(self.version, forKey: .version)}
    if self.accessEndpoint != nil {try container.encode(self.accessEndpoint, forKey: .accessEndpoint)}
    if self.sku != nil {try container.encode(self.sku as! SkuData?, forKey: .sku)}
    if self.integrationAccount != nil {try container.encode(self.integrationAccount as! ResourceReferenceData?, forKey: .integrationAccount)}
    if self.definition != nil {try container.encode(self.definition, forKey: .definition)}
    if self.parameters != nil {try container.encode(self.parameters, forKey: .parameters)}
  }
}

extension DataFactory {
  public static func createWorkflowPropertiesProtocol() -> WorkflowPropertiesProtocol {
    return WorkflowPropertiesData()
  }
}


// WorkflowProvisioningState enumerates the values for workflow provisioning state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum WorkflowProvisioningStateEnum: String, Codable
{
// WorkflowProvisioningStateAccepted specifies the workflow provisioning state accepted state for workflow provisioning
// state.
    case WorkflowProvisioningStateAccepted = "Accepted"
// WorkflowProvisioningStateCanceled specifies the workflow provisioning state canceled state for workflow provisioning
// state.
    case WorkflowProvisioningStateCanceled = "Canceled"
// WorkflowProvisioningStateCompleted specifies the workflow provisioning state completed state for workflow
// provisioning state.
    case WorkflowProvisioningStateCompleted = "Completed"
// WorkflowProvisioningStateCreated specifies the workflow provisioning state created state for workflow provisioning
// state.
    case WorkflowProvisioningStateCreated = "Created"
// WorkflowProvisioningStateCreating specifies the workflow provisioning state creating state for workflow provisioning
// state.
    case WorkflowProvisioningStateCreating = "Creating"
// WorkflowProvisioningStateDeleted specifies the workflow provisioning state deleted state for workflow provisioning
// state.
    case WorkflowProvisioningStateDeleted = "Deleted"
// WorkflowProvisioningStateDeleting specifies the workflow provisioning state deleting state for workflow provisioning
// state.
    case WorkflowProvisioningStateDeleting = "Deleting"
// WorkflowProvisioningStateFailed specifies the workflow provisioning state failed state for workflow provisioning
// state.
    case WorkflowProvisioningStateFailed = "Failed"
// WorkflowProvisioningStateMoving specifies the workflow provisioning state moving state for workflow provisioning
// state.
    case WorkflowProvisioningStateMoving = "Moving"
// WorkflowProvisioningStateNotSpecified specifies the workflow provisioning state not specified state for workflow
// provisioning state.
    case WorkflowProvisioningStateNotSpecified = "NotSpecified"
// WorkflowProvisioningStateReady specifies the workflow provisioning state ready state for workflow provisioning
// state.
    case WorkflowProvisioningStateReady = "Ready"
// WorkflowProvisioningStateRegistered specifies the workflow provisioning state registered state for workflow
// provisioning state.
    case WorkflowProvisioningStateRegistered = "Registered"
// WorkflowProvisioningStateRegistering specifies the workflow provisioning state registering state for workflow
// provisioning state.
    case WorkflowProvisioningStateRegistering = "Registering"
// WorkflowProvisioningStateRunning specifies the workflow provisioning state running state for workflow provisioning
// state.
    case WorkflowProvisioningStateRunning = "Running"
// WorkflowProvisioningStateSucceeded specifies the workflow provisioning state succeeded state for workflow
// provisioning state.
    case WorkflowProvisioningStateSucceeded = "Succeeded"
// WorkflowProvisioningStateUnregistered specifies the workflow provisioning state unregistered state for workflow
// provisioning state.
    case WorkflowProvisioningStateUnregistered = "Unregistered"
// WorkflowProvisioningStateUnregistering specifies the workflow provisioning state unregistering state for workflow
// provisioning state.
    case WorkflowProvisioningStateUnregistering = "Unregistering"
// WorkflowProvisioningStateUpdating specifies the workflow provisioning state updating state for workflow provisioning
// state.
    case WorkflowProvisioningStateUpdating = "Updating"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct WorkflowRunActionData : WorkflowRunActionProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: WorkflowRunActionPropertiesProtocol?
    public var name: String?
    public var type: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowRunActionProtocol() -> WorkflowRunActionProtocol {
    return WorkflowRunActionData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowRunActionFilterProtocol() -> WorkflowRunActionFilterProtocol {
    return WorkflowRunActionFilterData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowRunActionListResultProtocol() -> WorkflowRunActionListResultProtocol {
    return WorkflowRunActionListResultData()
  }
}


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

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case status = "status"
        case code = "code"
        case error = "error"
        case trackingId = "trackingId"
        case correlation = "correlation"
        case inputsLink = "inputsLink"
        case outputsLink = "outputsLink"
        case trackedProperties = "trackedProperties"
        case retryHistory = "retryHistory"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.status) {
        self.status = try container.decode(WorkflowStatusEnum?.self, forKey: .status)
    }
    if container.contains(.code) {
        self.code = try container.decode(String?.self, forKey: .code)
    }
    if container.contains(.error) {
        self.error = try container.decode([String: String?]?.self, forKey: .error)
    }
    if container.contains(.trackingId) {
        self.trackingId = try container.decode(String?.self, forKey: .trackingId)
    }
    if container.contains(.correlation) {
        self.correlation = try container.decode(CorrelationData?.self, forKey: .correlation)
    }
    if container.contains(.inputsLink) {
        self.inputsLink = try container.decode(ContentLinkData?.self, forKey: .inputsLink)
    }
    if container.contains(.outputsLink) {
        self.outputsLink = try container.decode(ContentLinkData?.self, forKey: .outputsLink)
    }
    if container.contains(.trackedProperties) {
        self.trackedProperties = try container.decode([String: String?]?.self, forKey: .trackedProperties)
    }
    if container.contains(.retryHistory) {
        self.retryHistory = try container.decode([RetryHistoryData?]?.self, forKey: .retryHistory)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.code != nil {try container.encode(self.code, forKey: .code)}
    if self.error != nil {try container.encode(self.error, forKey: .error)}
    if self.trackingId != nil {try container.encode(self.trackingId, forKey: .trackingId)}
    if self.correlation != nil {try container.encode(self.correlation as! CorrelationData?, forKey: .correlation)}
    if self.inputsLink != nil {try container.encode(self.inputsLink as! ContentLinkData?, forKey: .inputsLink)}
    if self.outputsLink != nil {try container.encode(self.outputsLink as! ContentLinkData?, forKey: .outputsLink)}
    if self.trackedProperties != nil {try container.encode(self.trackedProperties, forKey: .trackedProperties)}
    if self.retryHistory != nil {try container.encode(self.retryHistory as! [RetryHistoryData?]?, forKey: .retryHistory)}
  }
}

extension DataFactory {
  public static func createWorkflowRunActionPropertiesProtocol() -> WorkflowRunActionPropertiesProtocol {
    return WorkflowRunActionPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct WorkflowRunData : WorkflowRunProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: WorkflowRunPropertiesProtocol?
    public var name: String?
    public var type: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowRunProtocol() -> WorkflowRunProtocol {
    return WorkflowRunData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowRunFilterProtocol() -> WorkflowRunFilterProtocol {
    return WorkflowRunFilterData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowRunListResultProtocol() -> WorkflowRunListResultProtocol {
    return WorkflowRunListResultData()
  }
}


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

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case status = "status"
        case code = "code"
        case error = "error"
        case correlationId = "correlationId"
        case correlation = "correlation"
        case workflow = "workflow"
        case trigger = "trigger"
        case outputs = "outputs"
        case response = "response"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.status) {
        self.status = try container.decode(WorkflowStatusEnum?.self, forKey: .status)
    }
    if container.contains(.code) {
        self.code = try container.decode(String?.self, forKey: .code)
    }
    if container.contains(.error) {
        self.error = try container.decode([String: String?]?.self, forKey: .error)
    }
    if container.contains(.correlationId) {
        self.correlationId = try container.decode(String?.self, forKey: .correlationId)
    }
    if container.contains(.correlation) {
        self.correlation = try container.decode(CorrelationData?.self, forKey: .correlation)
    }
    if container.contains(.workflow) {
        self.workflow = try container.decode(ResourceReferenceData?.self, forKey: .workflow)
    }
    if container.contains(.trigger) {
        self.trigger = try container.decode(WorkflowRunTriggerData?.self, forKey: .trigger)
    }
    if container.contains(.outputs) {
        self.outputs = try container.decode([String:WorkflowOutputParameterData?]?.self, forKey: .outputs)
    }
    if container.contains(.response) {
        self.response = try container.decode(WorkflowRunTriggerData?.self, forKey: .response)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.code != nil {try container.encode(self.code, forKey: .code)}
    if self.error != nil {try container.encode(self.error, forKey: .error)}
    if self.correlationId != nil {try container.encode(self.correlationId, forKey: .correlationId)}
    if self.correlation != nil {try container.encode(self.correlation as! CorrelationData?, forKey: .correlation)}
    if self.workflow != nil {try container.encode(self.workflow as! ResourceReferenceData?, forKey: .workflow)}
    if self.trigger != nil {try container.encode(self.trigger as! WorkflowRunTriggerData?, forKey: .trigger)}
    if self.outputs != nil {try container.encode(self.outputs, forKey: .outputs)}
    if self.response != nil {try container.encode(self.response as! WorkflowRunTriggerData?, forKey: .response)}
  }
}

extension DataFactory {
  public static func createWorkflowRunPropertiesProtocol() -> WorkflowRunPropertiesProtocol {
    return WorkflowRunPropertiesData()
  }
}


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

        enum CodingKeys: String, CodingKey {case name = "name"
        case inputs = "inputs"
        case inputsLink = "inputsLink"
        case outputs = "outputs"
        case outputsLink = "outputsLink"
        case startTime = "startTime"
        case endTime = "endTime"
        case trackingId = "trackingId"
        case correlation = "correlation"
        case code = "code"
        case status = "status"
        case error = "error"
        case trackedProperties = "trackedProperties"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.name) {
        self.name = try container.decode(String?.self, forKey: .name)
    }
    if container.contains(.inputs) {
        self.inputs = try container.decode([String: String?]?.self, forKey: .inputs)
    }
    if container.contains(.inputsLink) {
        self.inputsLink = try container.decode(ContentLinkData?.self, forKey: .inputsLink)
    }
    if container.contains(.outputs) {
        self.outputs = try container.decode([String: String?]?.self, forKey: .outputs)
    }
    if container.contains(.outputsLink) {
        self.outputsLink = try container.decode(ContentLinkData?.self, forKey: .outputsLink)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.trackingId) {
        self.trackingId = try container.decode(String?.self, forKey: .trackingId)
    }
    if container.contains(.correlation) {
        self.correlation = try container.decode(CorrelationData?.self, forKey: .correlation)
    }
    if container.contains(.code) {
        self.code = try container.decode(String?.self, forKey: .code)
    }
    if container.contains(.status) {
        self.status = try container.decode(WorkflowStatusEnum?.self, forKey: .status)
    }
    if container.contains(.error) {
        self.error = try container.decode([String: String?]?.self, forKey: .error)
    }
    if container.contains(.trackedProperties) {
        self.trackedProperties = try container.decode([String: String?]?.self, forKey: .trackedProperties)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.name != nil {try container.encode(self.name, forKey: .name)}
    if self.inputs != nil {try container.encode(self.inputs, forKey: .inputs)}
    if self.inputsLink != nil {try container.encode(self.inputsLink as! ContentLinkData?, forKey: .inputsLink)}
    if self.outputs != nil {try container.encode(self.outputs, forKey: .outputs)}
    if self.outputsLink != nil {try container.encode(self.outputsLink as! ContentLinkData?, forKey: .outputsLink)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.trackingId != nil {try container.encode(self.trackingId, forKey: .trackingId)}
    if self.correlation != nil {try container.encode(self.correlation as! CorrelationData?, forKey: .correlation)}
    if self.code != nil {try container.encode(self.code, forKey: .code)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.error != nil {try container.encode(self.error, forKey: .error)}
    if self.trackedProperties != nil {try container.encode(self.trackedProperties, forKey: .trackedProperties)}
  }
}

extension DataFactory {
  public static func createWorkflowRunTriggerProtocol() -> WorkflowRunTriggerProtocol {
    return WorkflowRunTriggerData()
  }
}


// WorkflowState enumerates the values for workflow state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum WorkflowStateEnum: String, Codable
{
// WorkflowStateCompleted specifies the workflow state completed state for workflow state.
    case WorkflowStateCompleted = "Completed"
// WorkflowStateDeleted specifies the workflow state deleted state for workflow state.
    case WorkflowStateDeleted = "Deleted"
// WorkflowStateDisabled specifies the workflow state disabled state for workflow state.
    case WorkflowStateDisabled = "Disabled"
// WorkflowStateEnabled specifies the workflow state enabled state for workflow state.
    case WorkflowStateEnabled = "Enabled"
// WorkflowStateNotSpecified specifies the workflow state not specified state for workflow state.
    case WorkflowStateNotSpecified = "NotSpecified"
// WorkflowStateSuspended specifies the workflow state suspended state for workflow state.
    case WorkflowStateSuspended = "Suspended"
}


// WorkflowStatus enumerates the values for workflow status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum WorkflowStatusEnum: String, Codable
{
// WorkflowStatusAborted specifies the workflow status aborted state for workflow status.
    case WorkflowStatusAborted = "Aborted"
// WorkflowStatusCancelled specifies the workflow status cancelled state for workflow status.
    case WorkflowStatusCancelled = "Cancelled"
// WorkflowStatusFailed specifies the workflow status failed state for workflow status.
    case WorkflowStatusFailed = "Failed"
// WorkflowStatusFaulted specifies the workflow status faulted state for workflow status.
    case WorkflowStatusFaulted = "Faulted"
// WorkflowStatusIgnored specifies the workflow status ignored state for workflow status.
    case WorkflowStatusIgnored = "Ignored"
// WorkflowStatusNotSpecified specifies the workflow status not specified state for workflow status.
    case WorkflowStatusNotSpecified = "NotSpecified"
// WorkflowStatusPaused specifies the workflow status paused state for workflow status.
    case WorkflowStatusPaused = "Paused"
// WorkflowStatusRunning specifies the workflow status running state for workflow status.
    case WorkflowStatusRunning = "Running"
// WorkflowStatusSkipped specifies the workflow status skipped state for workflow status.
    case WorkflowStatusSkipped = "Skipped"
// WorkflowStatusSucceeded specifies the workflow status succeeded state for workflow status.
    case WorkflowStatusSucceeded = "Succeeded"
// WorkflowStatusSuspended specifies the workflow status suspended state for workflow status.
    case WorkflowStatusSuspended = "Suspended"
// WorkflowStatusTimedOut specifies the workflow status timed out state for workflow status.
    case WorkflowStatusTimedOut = "TimedOut"
// WorkflowStatusWaiting specifies the workflow status waiting state for workflow status.
    case WorkflowStatusWaiting = "Waiting"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct WorkflowTriggerCallbackUrlData : WorkflowTriggerCallbackUrlProtocol {
    public var value: String?
    public var method: String?
    public var basePath: String?
    public var relativePath: String?
    public var relativePathParameters: [String]?
    public var queries: WorkflowTriggerListCallbackUrlQueriesProtocol?

        enum CodingKeys: String, CodingKey {case value = "value"
        case method = "method"
        case basePath = "basePath"
        case relativePath = "relativePath"
        case relativePathParameters = "relativePathParameters"
        case queries = "queries"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.value != nil {try container.encode(self.value, forKey: .value)}
    if self.method != nil {try container.encode(self.method, forKey: .method)}
    if self.basePath != nil {try container.encode(self.basePath, forKey: .basePath)}
    if self.relativePath != nil {try container.encode(self.relativePath, forKey: .relativePath)}
    if self.relativePathParameters != nil {try container.encode(self.relativePathParameters as! [String]?, forKey: .relativePathParameters)}
    if self.queries != nil {try container.encode(self.queries as! WorkflowTriggerListCallbackUrlQueriesData?, forKey: .queries)}
  }
}

extension DataFactory {
  public static func createWorkflowTriggerCallbackUrlProtocol() -> WorkflowTriggerCallbackUrlProtocol {
    return WorkflowTriggerCallbackUrlData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct WorkflowTriggerData : WorkflowTriggerProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: WorkflowTriggerPropertiesProtocol?
    public var name: String?
    public var type: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowTriggerProtocol() -> WorkflowTriggerProtocol {
    return WorkflowTriggerData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowTriggerFilterProtocol() -> WorkflowTriggerFilterProtocol {
    return WorkflowTriggerFilterData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct WorkflowTriggerHistoryData : WorkflowTriggerHistoryProtocol, SubResourceProtocol {
    public var id: String?
    public var properties: WorkflowTriggerHistoryPropertiesProtocol?
    public var name: String?
    public var type: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowTriggerHistoryProtocol() -> WorkflowTriggerHistoryProtocol {
    return WorkflowTriggerHistoryData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowTriggerHistoryFilterProtocol() -> WorkflowTriggerHistoryFilterProtocol {
    return WorkflowTriggerHistoryFilterData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowTriggerHistoryListResultProtocol() -> WorkflowTriggerHistoryListResultProtocol {
    return WorkflowTriggerHistoryListResultData()
  }
}


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

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case status = "status"
        case code = "code"
        case error = "error"
        case trackingId = "trackingId"
        case correlation = "correlation"
        case inputsLink = "inputsLink"
        case outputsLink = "outputsLink"
        case fired = "fired"
        case run = "run"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.status) {
        self.status = try container.decode(WorkflowStatusEnum?.self, forKey: .status)
    }
    if container.contains(.code) {
        self.code = try container.decode(String?.self, forKey: .code)
    }
    if container.contains(.error) {
        self.error = try container.decode([String: String?]?.self, forKey: .error)
    }
    if container.contains(.trackingId) {
        self.trackingId = try container.decode(String?.self, forKey: .trackingId)
    }
    if container.contains(.correlation) {
        self.correlation = try container.decode(CorrelationData?.self, forKey: .correlation)
    }
    if container.contains(.inputsLink) {
        self.inputsLink = try container.decode(ContentLinkData?.self, forKey: .inputsLink)
    }
    if container.contains(.outputsLink) {
        self.outputsLink = try container.decode(ContentLinkData?.self, forKey: .outputsLink)
    }
    if container.contains(.fired) {
        self.fired = try container.decode(Bool?.self, forKey: .fired)
    }
    if container.contains(.run) {
        self.run = try container.decode(ResourceReferenceData?.self, forKey: .run)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.code != nil {try container.encode(self.code, forKey: .code)}
    if self.error != nil {try container.encode(self.error, forKey: .error)}
    if self.trackingId != nil {try container.encode(self.trackingId, forKey: .trackingId)}
    if self.correlation != nil {try container.encode(self.correlation as! CorrelationData?, forKey: .correlation)}
    if self.inputsLink != nil {try container.encode(self.inputsLink as! ContentLinkData?, forKey: .inputsLink)}
    if self.outputsLink != nil {try container.encode(self.outputsLink as! ContentLinkData?, forKey: .outputsLink)}
    if self.fired != nil {try container.encode(self.fired, forKey: .fired)}
    if self.run != nil {try container.encode(self.run as! ResourceReferenceData?, forKey: .run)}
  }
}

extension DataFactory {
  public static func createWorkflowTriggerHistoryPropertiesProtocol() -> WorkflowTriggerHistoryPropertiesProtocol {
    return WorkflowTriggerHistoryPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct WorkflowTriggerListCallbackUrlQueriesData : WorkflowTriggerListCallbackUrlQueriesProtocol {
    public var apiVersion: String?
    public var sp: String?
    public var sv: String?
    public var sig: String?

        enum CodingKeys: String, CodingKey {case apiVersion = "api-version"
        case sp = "sp"
        case sv = "sv"
        case sig = "sig"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowTriggerListCallbackUrlQueriesProtocol() -> WorkflowTriggerListCallbackUrlQueriesProtocol {
    return WorkflowTriggerListCallbackUrlQueriesData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowTriggerListResultProtocol() -> WorkflowTriggerListResultProtocol {
    return WorkflowTriggerListResultData()
  }
}


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

        enum CodingKeys: String, CodingKey {case provisioningState = "provisioningState"
        case createdTime = "createdTime"
        case changedTime = "changedTime"
        case state = "state"
        case status = "status"
        case lastExecutionTime = "lastExecutionTime"
        case nextExecutionTime = "nextExecutionTime"
        case recurrence = "recurrence"
        case workflow = "workflow"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(WorkflowTriggerProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.createdTime) {
        self.createdTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdTime)), format: .dateTime)
    }
    if container.contains(.changedTime) {
        self.changedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .changedTime)), format: .dateTime)
    }
    if container.contains(.state) {
        self.state = try container.decode(WorkflowStateEnum?.self, forKey: .state)
    }
    if container.contains(.status) {
        self.status = try container.decode(WorkflowStatusEnum?.self, forKey: .status)
    }
    if container.contains(.lastExecutionTime) {
        self.lastExecutionTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastExecutionTime)), format: .dateTime)
    }
    if container.contains(.nextExecutionTime) {
        self.nextExecutionTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .nextExecutionTime)), format: .dateTime)
    }
    if container.contains(.recurrence) {
        self.recurrence = try container.decode(WorkflowTriggerRecurrenceData?.self, forKey: .recurrence)
    }
    if container.contains(.workflow) {
        self.workflow = try container.decode(ResourceReferenceData?.self, forKey: .workflow)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.createdTime != nil {
        try container.encode(DateConverter.toString(date: self.createdTime!, format: .dateTime), forKey: .createdTime)
    }
    if self.changedTime != nil {
        try container.encode(DateConverter.toString(date: self.changedTime!, format: .dateTime), forKey: .changedTime)
    }
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.lastExecutionTime != nil {
        try container.encode(DateConverter.toString(date: self.lastExecutionTime!, format: .dateTime), forKey: .lastExecutionTime)
    }
    if self.nextExecutionTime != nil {
        try container.encode(DateConverter.toString(date: self.nextExecutionTime!, format: .dateTime), forKey: .nextExecutionTime)
    }
    if self.recurrence != nil {try container.encode(self.recurrence as! WorkflowTriggerRecurrenceData?, forKey: .recurrence)}
    if self.workflow != nil {try container.encode(self.workflow as! ResourceReferenceData?, forKey: .workflow)}
  }
}

extension DataFactory {
  public static func createWorkflowTriggerPropertiesProtocol() -> WorkflowTriggerPropertiesProtocol {
    return WorkflowTriggerPropertiesData()
  }
}


// WorkflowTriggerProvisioningState enumerates the values for workflow trigger provisioning state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum WorkflowTriggerProvisioningStateEnum: String, Codable
{
// WorkflowTriggerProvisioningStateAccepted specifies the workflow trigger provisioning state accepted state for
// workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateAccepted = "Accepted"
// WorkflowTriggerProvisioningStateCanceled specifies the workflow trigger provisioning state canceled state for
// workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateCanceled = "Canceled"
// WorkflowTriggerProvisioningStateCompleted specifies the workflow trigger provisioning state completed state for
// workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateCompleted = "Completed"
// WorkflowTriggerProvisioningStateCreated specifies the workflow trigger provisioning state created state for workflow
// trigger provisioning state.
    case WorkflowTriggerProvisioningStateCreated = "Created"
// WorkflowTriggerProvisioningStateCreating specifies the workflow trigger provisioning state creating state for
// workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateCreating = "Creating"
// WorkflowTriggerProvisioningStateDeleted specifies the workflow trigger provisioning state deleted state for workflow
// trigger provisioning state.
    case WorkflowTriggerProvisioningStateDeleted = "Deleted"
// WorkflowTriggerProvisioningStateDeleting specifies the workflow trigger provisioning state deleting state for
// workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateDeleting = "Deleting"
// WorkflowTriggerProvisioningStateFailed specifies the workflow trigger provisioning state failed state for workflow
// trigger provisioning state.
    case WorkflowTriggerProvisioningStateFailed = "Failed"
// WorkflowTriggerProvisioningStateMoving specifies the workflow trigger provisioning state moving state for workflow
// trigger provisioning state.
    case WorkflowTriggerProvisioningStateMoving = "Moving"
// WorkflowTriggerProvisioningStateNotSpecified specifies the workflow trigger provisioning state not specified state
// for workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateNotSpecified = "NotSpecified"
// WorkflowTriggerProvisioningStateReady specifies the workflow trigger provisioning state ready state for workflow
// trigger provisioning state.
    case WorkflowTriggerProvisioningStateReady = "Ready"
// WorkflowTriggerProvisioningStateRegistered specifies the workflow trigger provisioning state registered state for
// workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateRegistered = "Registered"
// WorkflowTriggerProvisioningStateRegistering specifies the workflow trigger provisioning state registering state for
// workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateRegistering = "Registering"
// WorkflowTriggerProvisioningStateRunning specifies the workflow trigger provisioning state running state for workflow
// trigger provisioning state.
    case WorkflowTriggerProvisioningStateRunning = "Running"
// WorkflowTriggerProvisioningStateSucceeded specifies the workflow trigger provisioning state succeeded state for
// workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateSucceeded = "Succeeded"
// WorkflowTriggerProvisioningStateUnregistered specifies the workflow trigger provisioning state unregistered state
// for workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateUnregistered = "Unregistered"
// WorkflowTriggerProvisioningStateUnregistering specifies the workflow trigger provisioning state unregistering state
// for workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateUnregistering = "Unregistering"
// WorkflowTriggerProvisioningStateUpdating specifies the workflow trigger provisioning state updating state for
// workflow trigger provisioning state.
    case WorkflowTriggerProvisioningStateUpdating = "Updating"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct WorkflowTriggerRecurrenceData : WorkflowTriggerRecurrenceProtocol {
    public var frequency: RecurrenceFrequencyEnum?
    public var interval: Int32?
    public var startTime: Date?
    public var endTime: Date?
    public var timeZone: String?
    public var schedule: RecurrenceScheduleProtocol?

        enum CodingKeys: String, CodingKey {case frequency = "frequency"
        case interval = "interval"
        case startTime = "startTime"
        case endTime = "endTime"
        case timeZone = "timeZone"
        case schedule = "schedule"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.frequency) {
        self.frequency = try container.decode(RecurrenceFrequencyEnum?.self, forKey: .frequency)
    }
    if container.contains(.interval) {
        self.interval = try container.decode(Int32?.self, forKey: .interval)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.timeZone) {
        self.timeZone = try container.decode(String?.self, forKey: .timeZone)
    }
    if container.contains(.schedule) {
        self.schedule = try container.decode(RecurrenceScheduleData?.self, forKey: .schedule)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.frequency != nil {try container.encode(self.frequency, forKey: .frequency)}
    if self.interval != nil {try container.encode(self.interval, forKey: .interval)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.timeZone != nil {try container.encode(self.timeZone, forKey: .timeZone)}
    if self.schedule != nil {try container.encode(self.schedule as! RecurrenceScheduleData?, forKey: .schedule)}
  }
}

extension DataFactory {
  public static func createWorkflowTriggerRecurrenceProtocol() -> WorkflowTriggerRecurrenceProtocol {
    return WorkflowTriggerRecurrenceData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowVersionProtocol() -> WorkflowVersionProtocol {
    return WorkflowVersionData()
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createWorkflowVersionListResultProtocol() -> WorkflowVersionListResultProtocol {
    return WorkflowVersionListResultData()
  }
}


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

        enum CodingKeys: String, CodingKey {case createdTime = "createdTime"
        case changedTime = "changedTime"
        case state = "state"
        case version = "version"
        case accessEndpoint = "accessEndpoint"
        case sku = "sku"
        case integrationAccount = "integrationAccount"
        case definition = "definition"
        case parameters = "parameters"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.createdTime) {
        self.createdTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdTime)), format: .dateTime)
    }
    if container.contains(.changedTime) {
        self.changedTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .changedTime)), format: .dateTime)
    }
    if container.contains(.state) {
        self.state = try container.decode(WorkflowStateEnum?.self, forKey: .state)
    }
    if container.contains(.version) {
        self.version = try container.decode(String?.self, forKey: .version)
    }
    if container.contains(.accessEndpoint) {
        self.accessEndpoint = try container.decode(String?.self, forKey: .accessEndpoint)
    }
    if container.contains(.sku) {
        self.sku = try container.decode(SkuData?.self, forKey: .sku)
    }
    if container.contains(.integrationAccount) {
        self.integrationAccount = try container.decode(ResourceReferenceData?.self, forKey: .integrationAccount)
    }
    if container.contains(.definition) {
        self.definition = try container.decode([String: String?]?.self, forKey: .definition)
    }
    if container.contains(.parameters) {
        self.parameters = try container.decode([String:WorkflowParameterData?]?.self, forKey: .parameters)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.createdTime != nil {
        try container.encode(DateConverter.toString(date: self.createdTime!, format: .dateTime), forKey: .createdTime)
    }
    if self.changedTime != nil {
        try container.encode(DateConverter.toString(date: self.changedTime!, format: .dateTime), forKey: .changedTime)
    }
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.version != nil {try container.encode(self.version, forKey: .version)}
    if self.accessEndpoint != nil {try container.encode(self.accessEndpoint, forKey: .accessEndpoint)}
    if self.sku != nil {try container.encode(self.sku as! SkuData?, forKey: .sku)}
    if self.integrationAccount != nil {try container.encode(self.integrationAccount as! ResourceReferenceData?, forKey: .integrationAccount)}
    if self.definition != nil {try container.encode(self.definition, forKey: .definition)}
    if self.parameters != nil {try container.encode(self.parameters, forKey: .parameters)}
  }
}

extension DataFactory {
  public static func createWorkflowVersionPropertiesProtocol() -> WorkflowVersionPropertiesProtocol {
    return WorkflowVersionPropertiesData()
  }
}


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

        enum CodingKeys: String, CodingKey {case needTechnicalAcknowledgement = "needTechnicalAcknowledgement"
        case batchTechnicalAcknowledgements = "batchTechnicalAcknowledgements"
        case needFunctionalAcknowledgement = "needFunctionalAcknowledgement"
        case functionalAcknowledgementVersion = "functionalAcknowledgementVersion"
        case batchFunctionalAcknowledgements = "batchFunctionalAcknowledgements"
        case needImplementationAcknowledgement = "needImplementationAcknowledgement"
        case implementationAcknowledgementVersion = "implementationAcknowledgementVersion"
        case batchImplementationAcknowledgements = "batchImplementationAcknowledgements"
        case needLoopForValidMessages = "needLoopForValidMessages"
        case sendSynchronousAcknowledgement = "sendSynchronousAcknowledgement"
        case acknowledgementControlNumberPrefix = "acknowledgementControlNumberPrefix"
        case acknowledgementControlNumberSuffix = "acknowledgementControlNumberSuffix"
        case acknowledgementControlNumberLowerBound = "acknowledgementControlNumberLowerBound"
        case acknowledgementControlNumberUpperBound = "acknowledgementControlNumberUpperBound"
        case rolloverAcknowledgementControlNumber = "rolloverAcknowledgementControlNumber"
        }

  public init(needTechnicalAcknowledgement: Bool, batchTechnicalAcknowledgements: Bool, needFunctionalAcknowledgement: Bool, batchFunctionalAcknowledgements: Bool, needImplementationAcknowledgement: Bool, batchImplementationAcknowledgements: Bool, needLoopForValidMessages: Bool, sendSynchronousAcknowledgement: Bool, acknowledgementControlNumberLowerBound: Int32, acknowledgementControlNumberUpperBound: Int32, rolloverAcknowledgementControlNumber: Bool)  {
    self.needTechnicalAcknowledgement = needTechnicalAcknowledgement
    self.batchTechnicalAcknowledgements = batchTechnicalAcknowledgements
    self.needFunctionalAcknowledgement = needFunctionalAcknowledgement
    self.batchFunctionalAcknowledgements = batchFunctionalAcknowledgements
    self.needImplementationAcknowledgement = needImplementationAcknowledgement
    self.batchImplementationAcknowledgements = batchImplementationAcknowledgements
    self.needLoopForValidMessages = needLoopForValidMessages
    self.sendSynchronousAcknowledgement = sendSynchronousAcknowledgement
    self.acknowledgementControlNumberLowerBound = acknowledgementControlNumberLowerBound
    self.acknowledgementControlNumberUpperBound = acknowledgementControlNumberUpperBound
    self.rolloverAcknowledgementControlNumber = rolloverAcknowledgementControlNumber
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.needTechnicalAcknowledgement = try container.decode(Bool.self, forKey: .needTechnicalAcknowledgement)
    self.batchTechnicalAcknowledgements = try container.decode(Bool.self, forKey: .batchTechnicalAcknowledgements)
    self.needFunctionalAcknowledgement = try container.decode(Bool.self, forKey: .needFunctionalAcknowledgement)
    if container.contains(.functionalAcknowledgementVersion) {
        self.functionalAcknowledgementVersion = try container.decode(String?.self, forKey: .functionalAcknowledgementVersion)
    }
    self.batchFunctionalAcknowledgements = try container.decode(Bool.self, forKey: .batchFunctionalAcknowledgements)
    self.needImplementationAcknowledgement = try container.decode(Bool.self, forKey: .needImplementationAcknowledgement)
    if container.contains(.implementationAcknowledgementVersion) {
        self.implementationAcknowledgementVersion = try container.decode(String?.self, forKey: .implementationAcknowledgementVersion)
    }
    self.batchImplementationAcknowledgements = try container.decode(Bool.self, forKey: .batchImplementationAcknowledgements)
    self.needLoopForValidMessages = try container.decode(Bool.self, forKey: .needLoopForValidMessages)
    self.sendSynchronousAcknowledgement = try container.decode(Bool.self, forKey: .sendSynchronousAcknowledgement)
    if container.contains(.acknowledgementControlNumberPrefix) {
        self.acknowledgementControlNumberPrefix = try container.decode(String?.self, forKey: .acknowledgementControlNumberPrefix)
    }
    if container.contains(.acknowledgementControlNumberSuffix) {
        self.acknowledgementControlNumberSuffix = try container.decode(String?.self, forKey: .acknowledgementControlNumberSuffix)
    }
    self.acknowledgementControlNumberLowerBound = try container.decode(Int32.self, forKey: .acknowledgementControlNumberLowerBound)
    self.acknowledgementControlNumberUpperBound = try container.decode(Int32.self, forKey: .acknowledgementControlNumberUpperBound)
    self.rolloverAcknowledgementControlNumber = try container.decode(Bool.self, forKey: .rolloverAcknowledgementControlNumber)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.needTechnicalAcknowledgement, forKey: .needTechnicalAcknowledgement)
    try container.encode(self.batchTechnicalAcknowledgements, forKey: .batchTechnicalAcknowledgements)
    try container.encode(self.needFunctionalAcknowledgement, forKey: .needFunctionalAcknowledgement)
    if self.functionalAcknowledgementVersion != nil {try container.encode(self.functionalAcknowledgementVersion, forKey: .functionalAcknowledgementVersion)}
    try container.encode(self.batchFunctionalAcknowledgements, forKey: .batchFunctionalAcknowledgements)
    try container.encode(self.needImplementationAcknowledgement, forKey: .needImplementationAcknowledgement)
    if self.implementationAcknowledgementVersion != nil {try container.encode(self.implementationAcknowledgementVersion, forKey: .implementationAcknowledgementVersion)}
    try container.encode(self.batchImplementationAcknowledgements, forKey: .batchImplementationAcknowledgements)
    try container.encode(self.needLoopForValidMessages, forKey: .needLoopForValidMessages)
    try container.encode(self.sendSynchronousAcknowledgement, forKey: .sendSynchronousAcknowledgement)
    if self.acknowledgementControlNumberPrefix != nil {try container.encode(self.acknowledgementControlNumberPrefix, forKey: .acknowledgementControlNumberPrefix)}
    if self.acknowledgementControlNumberSuffix != nil {try container.encode(self.acknowledgementControlNumberSuffix, forKey: .acknowledgementControlNumberSuffix)}
    try container.encode(self.acknowledgementControlNumberLowerBound, forKey: .acknowledgementControlNumberLowerBound)
    try container.encode(self.acknowledgementControlNumberUpperBound, forKey: .acknowledgementControlNumberUpperBound)
    try container.encode(self.rolloverAcknowledgementControlNumber, forKey: .rolloverAcknowledgementControlNumber)
  }
}

extension DataFactory {
  public static func createX12AcknowledgementSettingsProtocol(needTechnicalAcknowledgement: Bool, batchTechnicalAcknowledgements: Bool, needFunctionalAcknowledgement: Bool, batchFunctionalAcknowledgements: Bool, needImplementationAcknowledgement: Bool, batchImplementationAcknowledgements: Bool, needLoopForValidMessages: Bool, sendSynchronousAcknowledgement: Bool, acknowledgementControlNumberLowerBound: Int32, acknowledgementControlNumberUpperBound: Int32, rolloverAcknowledgementControlNumber: Bool) -> X12AcknowledgementSettingsProtocol {
    return X12AcknowledgementSettingsData(needTechnicalAcknowledgement: needTechnicalAcknowledgement, batchTechnicalAcknowledgements: batchTechnicalAcknowledgements, needFunctionalAcknowledgement: needFunctionalAcknowledgement, batchFunctionalAcknowledgements: batchFunctionalAcknowledgements, needImplementationAcknowledgement: needImplementationAcknowledgement, batchImplementationAcknowledgements: batchImplementationAcknowledgements, needLoopForValidMessages: needLoopForValidMessages, sendSynchronousAcknowledgement: sendSynchronousAcknowledgement, acknowledgementControlNumberLowerBound: acknowledgementControlNumberLowerBound, acknowledgementControlNumberUpperBound: acknowledgementControlNumberUpperBound, rolloverAcknowledgementControlNumber: rolloverAcknowledgementControlNumber)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct X12AgreementContentData : X12AgreementContentProtocol {
    public var receiveAgreement: X12OneWayAgreementProtocol
    public var sendAgreement: X12OneWayAgreementProtocol

        enum CodingKeys: String, CodingKey {case receiveAgreement = "receiveAgreement"
        case sendAgreement = "sendAgreement"
        }

  public init(receiveAgreement: X12OneWayAgreementProtocol, sendAgreement: X12OneWayAgreementProtocol)  {
    self.receiveAgreement = receiveAgreement
    self.sendAgreement = sendAgreement
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.receiveAgreement as! X12OneWayAgreementData, forKey: .receiveAgreement)
    try container.encode(self.sendAgreement as! X12OneWayAgreementData, forKey: .sendAgreement)
  }
}

extension DataFactory {
  public static func createX12AgreementContentProtocol(receiveAgreement: X12OneWayAgreementProtocol, sendAgreement: X12OneWayAgreementProtocol) -> X12AgreementContentProtocol {
    return X12AgreementContentData(receiveAgreement: receiveAgreement, sendAgreement: sendAgreement)
  }
}


// X12CharacterSet enumerates the values for x12 character 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.
public enum X12CharacterSetEnum: String, Codable
{
// X12CharacterSetBasic specifies the x12 character set basic state for x12 character set.
    case X12CharacterSetBasic = "Basic"
// X12CharacterSetExtended specifies the x12 character set extended state for x12 character set.
    case X12CharacterSetExtended = "Extended"
// X12CharacterSetNotSpecified specifies the x12 character set not specified state for x12 character set.
    case X12CharacterSetNotSpecified = "NotSpecified"
// X12CharacterSetUTF8 specifies the x12 character set utf8 state for x12 character set.
    case X12CharacterSetUTF8 = "UTF8"
}


// X12DateFormat enumerates the values for x12 date format.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum X12DateFormatEnum: String, Codable
{
// X12DateFormatCCYYMMDD specifies the x12 date format ccyymmdd state for x12 date format.
    case X12DateFormatCCYYMMDD = "CCYYMMDD"
// X12DateFormatNotSpecified specifies the x12 date format not specified state for x12 date format.
    case X12DateFormatNotSpecified = "NotSpecified"
// X12DateFormatYYMMDD specifies the x12 date format yymmdd state for x12 date format.
    case X12DateFormatYYMMDD = "YYMMDD"
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct X12DelimiterOverridesData : X12DelimiterOverridesProtocol {
    public var protocolVersion: String?
    public var messageId: String?
    public var dataElementSeparator: Int32
    public var componentSeparator: Int32
    public var segmentTerminator: Int32
    public var segmentTerminatorSuffix: SegmentTerminatorSuffixEnum
    public var replaceCharacter: Int32
    public var replaceSeparatorsInPayload: Bool
    public var targetNamespace: String?

        enum CodingKeys: String, CodingKey {case protocolVersion = "protocolVersion"
        case messageId = "messageId"
        case dataElementSeparator = "dataElementSeparator"
        case componentSeparator = "componentSeparator"
        case segmentTerminator = "segmentTerminator"
        case segmentTerminatorSuffix = "segmentTerminatorSuffix"
        case replaceCharacter = "replaceCharacter"
        case replaceSeparatorsInPayload = "replaceSeparatorsInPayload"
        case targetNamespace = "targetNamespace"
        }

  public init(dataElementSeparator: Int32, componentSeparator: Int32, segmentTerminator: Int32, segmentTerminatorSuffix: SegmentTerminatorSuffixEnum, replaceCharacter: Int32, replaceSeparatorsInPayload: Bool)  {
    self.dataElementSeparator = dataElementSeparator
    self.componentSeparator = componentSeparator
    self.segmentTerminator = segmentTerminator
    self.segmentTerminatorSuffix = segmentTerminatorSuffix
    self.replaceCharacter = replaceCharacter
    self.replaceSeparatorsInPayload = replaceSeparatorsInPayload
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.protocolVersion) {
        self.protocolVersion = try container.decode(String?.self, forKey: .protocolVersion)
    }
    if container.contains(.messageId) {
        self.messageId = try container.decode(String?.self, forKey: .messageId)
    }
    self.dataElementSeparator = try container.decode(Int32.self, forKey: .dataElementSeparator)
    self.componentSeparator = try container.decode(Int32.self, forKey: .componentSeparator)
    self.segmentTerminator = try container.decode(Int32.self, forKey: .segmentTerminator)
    self.segmentTerminatorSuffix = try container.decode(SegmentTerminatorSuffixEnum.self, forKey: .segmentTerminatorSuffix)
    self.replaceCharacter = try container.decode(Int32.self, forKey: .replaceCharacter)
    self.replaceSeparatorsInPayload = try container.decode(Bool.self, forKey: .replaceSeparatorsInPayload)
    if container.contains(.targetNamespace) {
        self.targetNamespace = try container.decode(String?.self, forKey: .targetNamespace)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.protocolVersion != nil {try container.encode(self.protocolVersion, forKey: .protocolVersion)}
    if self.messageId != nil {try container.encode(self.messageId, forKey: .messageId)}
    try container.encode(self.dataElementSeparator, forKey: .dataElementSeparator)
    try container.encode(self.componentSeparator, forKey: .componentSeparator)
    try container.encode(self.segmentTerminator, forKey: .segmentTerminator)
    try container.encode(self.segmentTerminatorSuffix, forKey: .segmentTerminatorSuffix)
    try container.encode(self.replaceCharacter, forKey: .replaceCharacter)
    try container.encode(self.replaceSeparatorsInPayload, forKey: .replaceSeparatorsInPayload)
    if self.targetNamespace != nil {try container.encode(self.targetNamespace, forKey: .targetNamespace)}
  }
}

extension DataFactory {
  public static func createX12DelimiterOverridesProtocol(dataElementSeparator: Int32, componentSeparator: Int32, segmentTerminator: Int32, segmentTerminatorSuffix: SegmentTerminatorSuffixEnum, replaceCharacter: Int32, replaceSeparatorsInPayload: Bool) -> X12DelimiterOverridesProtocol {
    return X12DelimiterOverridesData(dataElementSeparator: dataElementSeparator, componentSeparator: componentSeparator, segmentTerminator: segmentTerminator, segmentTerminatorSuffix: segmentTerminatorSuffix, replaceCharacter: replaceCharacter, replaceSeparatorsInPayload: replaceSeparatorsInPayload)
  }
}