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

// WorkflowTriggerHistories is the REST API for Azure Logic Apps.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct WorkflowTriggerHistories {
    public static func Get(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String, historyName: String) -> WorkflowTriggerHistoriesGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName, triggerName: triggerName, historyName: historyName)
    }
    public static func List(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String) -> WorkflowTriggerHistoriesList {
        return ListCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName, triggerName: triggerName)
    }
    public static func Resubmit(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String, historyName: String) -> WorkflowTriggerHistoriesResubmit {
        return ResubmitCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName, triggerName: triggerName, historyName: historyName)
    }
}
}


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

extension Commands.WorkflowTriggerHistories {
// Get gets a workflow trigger history.
    internal class GetCommand : BaseCommand, WorkflowTriggerHistoriesGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var triggerName : String
        public var historyName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String, historyName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.workflowName = workflowName
            self.triggerName = triggerName
            self.historyName = historyName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.WorkflowTriggerHistories {
// List gets a list of workflow trigger histories.
    internal class ListCommand : BaseCommand, WorkflowTriggerHistoriesList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var triggerName : String
        public var apiVersion = "2016-06-01"
        public var top : Int32?
        public var filter : String?

        public init(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.workflowName = workflowName
            self.triggerName = triggerName
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(WorkflowTriggerHistoryListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (WorkflowTriggerHistoryListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: WorkflowTriggerHistoryListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.WorkflowTriggerHistories {
// Resubmit resubmits a workflow run based on the trigger history.
    internal class ResubmitCommand : BaseCommand, WorkflowTriggerHistoriesResubmit {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var triggerName : String
        public var historyName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String, historyName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.workflowName = workflowName
            self.triggerName = triggerName
            self.historyName = historyName
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/histories/{historyName}/resubmit"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

// WorkflowTriggers is the REST API for Azure Logic Apps.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct WorkflowTriggers {
    public static func Get(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String) -> WorkflowTriggersGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName, triggerName: triggerName)
    }
    public static func List(subscriptionId: String, resourceGroupName: String, workflowName: String) -> WorkflowTriggersList {
        return ListCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName)
    }
    public static func ListCallbackUrl(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String) -> WorkflowTriggersListCallbackUrl {
        return ListCallbackUrlCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName, triggerName: triggerName)
    }
    public static func Run(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String) -> WorkflowTriggersRun {
        return RunCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName, triggerName: triggerName)
    }
}
}


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

extension Commands.WorkflowTriggers {
// Get gets a workflow trigger.
    internal class GetCommand : BaseCommand, WorkflowTriggersGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var triggerName : String
        public var apiVersion = "2016-06-01"

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

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

        }

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


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

extension Commands.WorkflowTriggers {
// List gets a list of workflow triggers.
    internal class ListCommand : BaseCommand, WorkflowTriggersList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var apiVersion = "2016-06-01"
        public var top : Int32?
        public var filter : String?

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

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(WorkflowTriggerListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (WorkflowTriggerListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: WorkflowTriggerListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.WorkflowTriggers {
// ListCallbackUrl gets the callback URL for a workflow trigger.
    internal class ListCallbackUrlCommand : BaseCommand, WorkflowTriggersListCallbackUrl {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var triggerName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.workflowName = workflowName
            self.triggerName = triggerName
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/listCallbackUrl"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.WorkflowTriggers {
// Run runs a workflow trigger.
    internal class RunCommand : BaseCommand, WorkflowTriggersRun {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var triggerName : String
        public var apiVersion = "2016-06-01"

        public init(subscriptionId: String, resourceGroupName: String, workflowName: String, triggerName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.workflowName = workflowName
            self.triggerName = triggerName
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/triggers/{triggerName}/run"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

// WorkflowVersions is the REST API for Azure Logic Apps.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct WorkflowVersions {
    public static func Get(subscriptionId: String, resourceGroupName: String, workflowName: String, versionId: String) -> WorkflowVersionsGet {
        return GetCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName, versionId: versionId)
    }
    public static func List(subscriptionId: String, resourceGroupName: String, workflowName: String) -> WorkflowVersionsList {
        return ListCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName)
    }
    public static func ListCallbackUrl(subscriptionId: String, resourceGroupName: String, workflowName: String, versionId: String, triggerName: String) -> WorkflowVersionsListCallbackUrl {
        return ListCallbackUrlCommand(subscriptionId: subscriptionId, resourceGroupName: resourceGroupName, workflowName: workflowName, versionId: versionId, triggerName: triggerName)
    }
}
}


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

extension Commands.WorkflowVersions {
// Get gets a workflow version.
    internal class GetCommand : BaseCommand, WorkflowVersionsGet {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var versionId : String
        public var apiVersion = "2016-06-01"

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

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

        }

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


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

extension Commands.WorkflowVersions {
// List gets a list of workflow versions.
    internal class ListCommand : BaseCommand, WorkflowVersionsList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var apiVersion = "2016-06-01"
        public var top : Int32?

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

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

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "NextLink"
                }
                let result = try decoder.decode(WorkflowVersionListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (WorkflowVersionListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: WorkflowVersionListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


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

extension Commands.WorkflowVersions {
// ListCallbackUrl lists the callback URL for a trigger of a workflow version.
    internal class ListCallbackUrlCommand : BaseCommand, WorkflowVersionsListCallbackUrl {
        public var subscriptionId : String
        public var resourceGroupName : String
        public var workflowName : String
        public var versionId : String
        public var triggerName : String
        public var apiVersion = "2016-06-01"
    public var parameters :  GetCallbackUrlParametersProtocol?

        public init(subscriptionId: String, resourceGroupName: String, workflowName: String, versionId: String, triggerName: String) {
            self.subscriptionId = subscriptionId
            self.resourceGroupName = resourceGroupName
            self.workflowName = workflowName
            self.versionId = versionId
            self.triggerName = triggerName
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/versions/{versionId}/triggers/{triggerName}/listCallbackUrl"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? GetCallbackUrlParametersData?)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct AgreementContentData : AgreementContentProtocol {
    public var aS2: AS2AgreementContentProtocol?
    public var x12: X12AgreementContentProtocol?
    public var edifact: EdifactAgreementContentProtocol?

        enum CodingKeys: String, CodingKey {case aS2 = "aS2"
        case x12 = "x12"
        case edifact = "edifact"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.aS2) {
        self.aS2 = try container.decode(AS2AgreementContentData?.self, forKey: .aS2)
    }
    if container.contains(.x12) {
        self.x12 = try container.decode(X12AgreementContentData?.self, forKey: .x12)
    }
    if container.contains(.edifact) {
        self.edifact = try container.decode(EdifactAgreementContentData?.self, forKey: .edifact)
    }
    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.aS2 != nil {try container.encode(self.aS2 as! AS2AgreementContentData?, forKey: .aS2)}
    if self.x12 != nil {try container.encode(self.x12 as! X12AgreementContentData?, forKey: .x12)}
    if self.edifact != nil {try container.encode(self.edifact as! EdifactAgreementContentData?, forKey: .edifact)}
  }
}

extension DataFactory {
  public static func createAgreementContentProtocol() -> AgreementContentProtocol {
    return AgreementContentData()
  }
}


// AgreementType enumerates the values for agreement type.

// 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 AgreementTypeEnum: String, Codable
{
// AS2 specifies the as2 state for agreement type.
    case AS2 = "AS2"
// Edifact specifies the edifact state for agreement type.
    case Edifact = "Edifact"
// NotSpecified specifies the not specified state for agreement type.
    case NotSpecified = "NotSpecified"
// X12 specifies the x12 state for agreement type.
    case X12 = "X12"
}


// 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 AS2AcknowledgementConnectionSettingsData : AS2AcknowledgementConnectionSettingsProtocol {
    public var ignoreCertificateNameMismatch: Bool
    public var supportHttpStatusCodeContinue: Bool
    public var keepHttpConnectionAlive: Bool
    public var unfoldHttpHeaders: Bool

        enum CodingKeys: String, CodingKey {case ignoreCertificateNameMismatch = "ignoreCertificateNameMismatch"
        case supportHttpStatusCodeContinue = "supportHttpStatusCodeContinue"
        case keepHttpConnectionAlive = "keepHttpConnectionAlive"
        case unfoldHttpHeaders = "unfoldHttpHeaders"
        }

  public init(ignoreCertificateNameMismatch: Bool, supportHttpStatusCodeContinue: Bool, keepHttpConnectionAlive: Bool, unfoldHttpHeaders: Bool)  {
    self.ignoreCertificateNameMismatch = ignoreCertificateNameMismatch
    self.supportHttpStatusCodeContinue = supportHttpStatusCodeContinue
    self.keepHttpConnectionAlive = keepHttpConnectionAlive
    self.unfoldHttpHeaders = unfoldHttpHeaders
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.ignoreCertificateNameMismatch = try container.decode(Bool.self, forKey: .ignoreCertificateNameMismatch)
    self.supportHttpStatusCodeContinue = try container.decode(Bool.self, forKey: .supportHttpStatusCodeContinue)
    self.keepHttpConnectionAlive = try container.decode(Bool.self, forKey: .keepHttpConnectionAlive)
    self.unfoldHttpHeaders = try container.decode(Bool.self, forKey: .unfoldHttpHeaders)
    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.ignoreCertificateNameMismatch, forKey: .ignoreCertificateNameMismatch)
    try container.encode(self.supportHttpStatusCodeContinue, forKey: .supportHttpStatusCodeContinue)
    try container.encode(self.keepHttpConnectionAlive, forKey: .keepHttpConnectionAlive)
    try container.encode(self.unfoldHttpHeaders, forKey: .unfoldHttpHeaders)
  }
}

extension DataFactory {
  public static func createAS2AcknowledgementConnectionSettingsProtocol(ignoreCertificateNameMismatch: Bool, supportHttpStatusCodeContinue: Bool, keepHttpConnectionAlive: Bool, unfoldHttpHeaders: Bool) -> AS2AcknowledgementConnectionSettingsProtocol {
    return AS2AcknowledgementConnectionSettingsData(ignoreCertificateNameMismatch: ignoreCertificateNameMismatch, supportHttpStatusCodeContinue: supportHttpStatusCodeContinue, keepHttpConnectionAlive: keepHttpConnectionAlive, unfoldHttpHeaders: unfoldHttpHeaders)
  }
}


// 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 AS2AgreementContentData : AS2AgreementContentProtocol {
    public var receiveAgreement: AS2OneWayAgreementProtocol
    public var sendAgreement: AS2OneWayAgreementProtocol

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

  public init(receiveAgreement: AS2OneWayAgreementProtocol, sendAgreement: AS2OneWayAgreementProtocol)  {
    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(AS2OneWayAgreementData.self, forKey: .receiveAgreement)
    self.sendAgreement = try container.decode(AS2OneWayAgreementData.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! AS2OneWayAgreementData, forKey: .receiveAgreement)
    try container.encode(self.sendAgreement as! AS2OneWayAgreementData, forKey: .sendAgreement)
  }
}

extension DataFactory {
  public static func createAS2AgreementContentProtocol(receiveAgreement: AS2OneWayAgreementProtocol, sendAgreement: AS2OneWayAgreementProtocol) -> AS2AgreementContentProtocol {
    return AS2AgreementContentData(receiveAgreement: receiveAgreement, sendAgreement: sendAgreement)
  }
}


// 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 AS2EnvelopeSettingsData : AS2EnvelopeSettingsProtocol {
    public var messageContentType: String
    public var transmitFileNameInMimeHeader: Bool
    public var fileNameTemplate: String
    public var suspendMessageOnFileNameGenerationError: Bool
    public var autogenerateFileName: Bool

        enum CodingKeys: String, CodingKey {case messageContentType = "messageContentType"
        case transmitFileNameInMimeHeader = "transmitFileNameInMimeHeader"
        case fileNameTemplate = "fileNameTemplate"
        case suspendMessageOnFileNameGenerationError = "suspendMessageOnFileNameGenerationError"
        case autogenerateFileName = "autogenerateFileName"
        }

  public init(messageContentType: String, transmitFileNameInMimeHeader: Bool, fileNameTemplate: String, suspendMessageOnFileNameGenerationError: Bool, autogenerateFileName: Bool)  {
    self.messageContentType = messageContentType
    self.transmitFileNameInMimeHeader = transmitFileNameInMimeHeader
    self.fileNameTemplate = fileNameTemplate
    self.suspendMessageOnFileNameGenerationError = suspendMessageOnFileNameGenerationError
    self.autogenerateFileName = autogenerateFileName
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.messageContentType = try container.decode(String.self, forKey: .messageContentType)
    self.transmitFileNameInMimeHeader = try container.decode(Bool.self, forKey: .transmitFileNameInMimeHeader)
    self.fileNameTemplate = try container.decode(String.self, forKey: .fileNameTemplate)
    self.suspendMessageOnFileNameGenerationError = try container.decode(Bool.self, forKey: .suspendMessageOnFileNameGenerationError)
    self.autogenerateFileName = try container.decode(Bool.self, forKey: .autogenerateFileName)
    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.messageContentType, forKey: .messageContentType)
    try container.encode(self.transmitFileNameInMimeHeader, forKey: .transmitFileNameInMimeHeader)
    try container.encode(self.fileNameTemplate, forKey: .fileNameTemplate)
    try container.encode(self.suspendMessageOnFileNameGenerationError, forKey: .suspendMessageOnFileNameGenerationError)
    try container.encode(self.autogenerateFileName, forKey: .autogenerateFileName)
  }
}

extension DataFactory {
  public static func createAS2EnvelopeSettingsProtocol(messageContentType: String, transmitFileNameInMimeHeader: Bool, fileNameTemplate: String, suspendMessageOnFileNameGenerationError: Bool, autogenerateFileName: Bool) -> AS2EnvelopeSettingsProtocol {
    return AS2EnvelopeSettingsData(messageContentType: messageContentType, transmitFileNameInMimeHeader: transmitFileNameInMimeHeader, fileNameTemplate: fileNameTemplate, suspendMessageOnFileNameGenerationError: suspendMessageOnFileNameGenerationError, autogenerateFileName: autogenerateFileName)
  }
}


// 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 AS2ErrorSettingsData : AS2ErrorSettingsProtocol {
    public var suspendDuplicateMessage: Bool
    public var resendIfMdnNotReceived: Bool

        enum CodingKeys: String, CodingKey {case suspendDuplicateMessage = "suspendDuplicateMessage"
        case resendIfMdnNotReceived = "resendIfMdnNotReceived"
        }

  public init(suspendDuplicateMessage: Bool, resendIfMdnNotReceived: Bool)  {
    self.suspendDuplicateMessage = suspendDuplicateMessage
    self.resendIfMdnNotReceived = resendIfMdnNotReceived
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.suspendDuplicateMessage = try container.decode(Bool.self, forKey: .suspendDuplicateMessage)
    self.resendIfMdnNotReceived = try container.decode(Bool.self, forKey: .resendIfMdnNotReceived)
    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.suspendDuplicateMessage, forKey: .suspendDuplicateMessage)
    try container.encode(self.resendIfMdnNotReceived, forKey: .resendIfMdnNotReceived)
  }
}

extension DataFactory {
  public static func createAS2ErrorSettingsProtocol(suspendDuplicateMessage: Bool, resendIfMdnNotReceived: Bool) -> AS2ErrorSettingsProtocol {
    return AS2ErrorSettingsData(suspendDuplicateMessage: suspendDuplicateMessage, resendIfMdnNotReceived: resendIfMdnNotReceived)
  }
}


// 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 AS2MdnSettingsData : AS2MdnSettingsProtocol {
    public var needMdn: Bool
    public var signMdn: Bool
    public var sendMdnAsynchronously: Bool
    public var receiptDeliveryUrl: String?
    public var dispositionNotificationTo: String?
    public var signOutboundMdnIfOptional: Bool
    public var mdnText: String?
    public var sendInboundMdnToMessageBox: Bool
    public var micHashingAlgorithm: HashingAlgorithmEnum

        enum CodingKeys: String, CodingKey {case needMdn = "needMdn"
        case signMdn = "signMdn"
        case sendMdnAsynchronously = "sendMdnAsynchronously"
        case receiptDeliveryUrl = "receiptDeliveryUrl"
        case dispositionNotificationTo = "dispositionNotificationTo"
        case signOutboundMdnIfOptional = "signOutboundMdnIfOptional"
        case mdnText = "mdnText"
        case sendInboundMdnToMessageBox = "sendInboundMdnToMessageBox"
        case micHashingAlgorithm = "micHashingAlgorithm"
        }

  public init(needMdn: Bool, signMdn: Bool, sendMdnAsynchronously: Bool, signOutboundMdnIfOptional: Bool, sendInboundMdnToMessageBox: Bool, micHashingAlgorithm: HashingAlgorithmEnum)  {
    self.needMdn = needMdn
    self.signMdn = signMdn
    self.sendMdnAsynchronously = sendMdnAsynchronously
    self.signOutboundMdnIfOptional = signOutboundMdnIfOptional
    self.sendInboundMdnToMessageBox = sendInboundMdnToMessageBox
    self.micHashingAlgorithm = micHashingAlgorithm
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.needMdn = try container.decode(Bool.self, forKey: .needMdn)
    self.signMdn = try container.decode(Bool.self, forKey: .signMdn)
    self.sendMdnAsynchronously = try container.decode(Bool.self, forKey: .sendMdnAsynchronously)
    if container.contains(.receiptDeliveryUrl) {
        self.receiptDeliveryUrl = try container.decode(String?.self, forKey: .receiptDeliveryUrl)
    }
    if container.contains(.dispositionNotificationTo) {
        self.dispositionNotificationTo = try container.decode(String?.self, forKey: .dispositionNotificationTo)
    }
    self.signOutboundMdnIfOptional = try container.decode(Bool.self, forKey: .signOutboundMdnIfOptional)
    if container.contains(.mdnText) {
        self.mdnText = try container.decode(String?.self, forKey: .mdnText)
    }
    self.sendInboundMdnToMessageBox = try container.decode(Bool.self, forKey: .sendInboundMdnToMessageBox)
    self.micHashingAlgorithm = try container.decode(HashingAlgorithmEnum.self, forKey: .micHashingAlgorithm)
    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.needMdn, forKey: .needMdn)
    try container.encode(self.signMdn, forKey: .signMdn)
    try container.encode(self.sendMdnAsynchronously, forKey: .sendMdnAsynchronously)
    if self.receiptDeliveryUrl != nil {try container.encode(self.receiptDeliveryUrl, forKey: .receiptDeliveryUrl)}
    if self.dispositionNotificationTo != nil {try container.encode(self.dispositionNotificationTo, forKey: .dispositionNotificationTo)}
    try container.encode(self.signOutboundMdnIfOptional, forKey: .signOutboundMdnIfOptional)
    if self.mdnText != nil {try container.encode(self.mdnText, forKey: .mdnText)}
    try container.encode(self.sendInboundMdnToMessageBox, forKey: .sendInboundMdnToMessageBox)
    try container.encode(self.micHashingAlgorithm, forKey: .micHashingAlgorithm)
  }
}

extension DataFactory {
  public static func createAS2MdnSettingsProtocol(needMdn: Bool, signMdn: Bool, sendMdnAsynchronously: Bool, signOutboundMdnIfOptional: Bool, sendInboundMdnToMessageBox: Bool, micHashingAlgorithm: HashingAlgorithmEnum) -> AS2MdnSettingsProtocol {
    return AS2MdnSettingsData(needMdn: needMdn, signMdn: signMdn, sendMdnAsynchronously: sendMdnAsynchronously, signOutboundMdnIfOptional: signOutboundMdnIfOptional, sendInboundMdnToMessageBox: sendInboundMdnToMessageBox, micHashingAlgorithm: micHashingAlgorithm)
  }
}


// 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 AS2MessageConnectionSettingsData : AS2MessageConnectionSettingsProtocol {
    public var ignoreCertificateNameMismatch: Bool
    public var supportHttpStatusCodeContinue: Bool
    public var keepHttpConnectionAlive: Bool
    public var unfoldHttpHeaders: Bool

        enum CodingKeys: String, CodingKey {case ignoreCertificateNameMismatch = "ignoreCertificateNameMismatch"
        case supportHttpStatusCodeContinue = "supportHttpStatusCodeContinue"
        case keepHttpConnectionAlive = "keepHttpConnectionAlive"
        case unfoldHttpHeaders = "unfoldHttpHeaders"
        }

  public init(ignoreCertificateNameMismatch: Bool, supportHttpStatusCodeContinue: Bool, keepHttpConnectionAlive: Bool, unfoldHttpHeaders: Bool)  {
    self.ignoreCertificateNameMismatch = ignoreCertificateNameMismatch
    self.supportHttpStatusCodeContinue = supportHttpStatusCodeContinue
    self.keepHttpConnectionAlive = keepHttpConnectionAlive
    self.unfoldHttpHeaders = unfoldHttpHeaders
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.ignoreCertificateNameMismatch = try container.decode(Bool.self, forKey: .ignoreCertificateNameMismatch)
    self.supportHttpStatusCodeContinue = try container.decode(Bool.self, forKey: .supportHttpStatusCodeContinue)
    self.keepHttpConnectionAlive = try container.decode(Bool.self, forKey: .keepHttpConnectionAlive)
    self.unfoldHttpHeaders = try container.decode(Bool.self, forKey: .unfoldHttpHeaders)
    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.ignoreCertificateNameMismatch, forKey: .ignoreCertificateNameMismatch)
    try container.encode(self.supportHttpStatusCodeContinue, forKey: .supportHttpStatusCodeContinue)
    try container.encode(self.keepHttpConnectionAlive, forKey: .keepHttpConnectionAlive)
    try container.encode(self.unfoldHttpHeaders, forKey: .unfoldHttpHeaders)
  }
}

extension DataFactory {
  public static func createAS2MessageConnectionSettingsProtocol(ignoreCertificateNameMismatch: Bool, supportHttpStatusCodeContinue: Bool, keepHttpConnectionAlive: Bool, unfoldHttpHeaders: Bool) -> AS2MessageConnectionSettingsProtocol {
    return AS2MessageConnectionSettingsData(ignoreCertificateNameMismatch: ignoreCertificateNameMismatch, supportHttpStatusCodeContinue: supportHttpStatusCodeContinue, keepHttpConnectionAlive: keepHttpConnectionAlive, unfoldHttpHeaders: unfoldHttpHeaders)
  }
}


// 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 AS2OneWayAgreementData : AS2OneWayAgreementProtocol {
    public var senderBusinessIdentity: BusinessIdentityProtocol
    public var receiverBusinessIdentity: BusinessIdentityProtocol
    public var protocolSettings: AS2ProtocolSettingsProtocol

        enum CodingKeys: String, CodingKey {case senderBusinessIdentity = "senderBusinessIdentity"
        case receiverBusinessIdentity = "receiverBusinessIdentity"
        case protocolSettings = "protocolSettings"
        }

  public init(senderBusinessIdentity: BusinessIdentityProtocol, receiverBusinessIdentity: BusinessIdentityProtocol, protocolSettings: AS2ProtocolSettingsProtocol)  {
    self.senderBusinessIdentity = senderBusinessIdentity
    self.receiverBusinessIdentity = receiverBusinessIdentity
    self.protocolSettings = protocolSettings
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.senderBusinessIdentity = try container.decode(BusinessIdentityData.self, forKey: .senderBusinessIdentity)
    self.receiverBusinessIdentity = try container.decode(BusinessIdentityData.self, forKey: .receiverBusinessIdentity)
    self.protocolSettings = try container.decode(AS2ProtocolSettingsData.self, forKey: .protocolSettings)
    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.senderBusinessIdentity as! BusinessIdentityData, forKey: .senderBusinessIdentity)
    try container.encode(self.receiverBusinessIdentity as! BusinessIdentityData, forKey: .receiverBusinessIdentity)
    try container.encode(self.protocolSettings as! AS2ProtocolSettingsData, forKey: .protocolSettings)
  }
}

extension DataFactory {
  public static func createAS2OneWayAgreementProtocol(senderBusinessIdentity: BusinessIdentityProtocol, receiverBusinessIdentity: BusinessIdentityProtocol, protocolSettings: AS2ProtocolSettingsProtocol) -> AS2OneWayAgreementProtocol {
    return AS2OneWayAgreementData(senderBusinessIdentity: senderBusinessIdentity, receiverBusinessIdentity: receiverBusinessIdentity, protocolSettings: protocolSettings)
  }
}


// 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 AS2ProtocolSettingsData : AS2ProtocolSettingsProtocol {
    public var messageConnectionSettings: AS2MessageConnectionSettingsProtocol
    public var acknowledgementConnectionSettings: AS2AcknowledgementConnectionSettingsProtocol
    public var mdnSettings: AS2MdnSettingsProtocol
    public var securitySettings: AS2SecuritySettingsProtocol
    public var validationSettings: AS2ValidationSettingsProtocol
    public var envelopeSettings: AS2EnvelopeSettingsProtocol
    public var errorSettings: AS2ErrorSettingsProtocol

        enum CodingKeys: String, CodingKey {case messageConnectionSettings = "messageConnectionSettings"
        case acknowledgementConnectionSettings = "acknowledgementConnectionSettings"
        case mdnSettings = "mdnSettings"
        case securitySettings = "securitySettings"
        case validationSettings = "validationSettings"
        case envelopeSettings = "envelopeSettings"
        case errorSettings = "errorSettings"
        }

  public init(messageConnectionSettings: AS2MessageConnectionSettingsProtocol, acknowledgementConnectionSettings: AS2AcknowledgementConnectionSettingsProtocol, mdnSettings: AS2MdnSettingsProtocol, securitySettings: AS2SecuritySettingsProtocol, validationSettings: AS2ValidationSettingsProtocol, envelopeSettings: AS2EnvelopeSettingsProtocol, errorSettings: AS2ErrorSettingsProtocol)  {
    self.messageConnectionSettings = messageConnectionSettings
    self.acknowledgementConnectionSettings = acknowledgementConnectionSettings
    self.mdnSettings = mdnSettings
    self.securitySettings = securitySettings
    self.validationSettings = validationSettings
    self.envelopeSettings = envelopeSettings
    self.errorSettings = errorSettings
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.messageConnectionSettings = try container.decode(AS2MessageConnectionSettingsData.self, forKey: .messageConnectionSettings)
    self.acknowledgementConnectionSettings = try container.decode(AS2AcknowledgementConnectionSettingsData.self, forKey: .acknowledgementConnectionSettings)
    self.mdnSettings = try container.decode(AS2MdnSettingsData.self, forKey: .mdnSettings)
    self.securitySettings = try container.decode(AS2SecuritySettingsData.self, forKey: .securitySettings)
    self.validationSettings = try container.decode(AS2ValidationSettingsData.self, forKey: .validationSettings)
    self.envelopeSettings = try container.decode(AS2EnvelopeSettingsData.self, forKey: .envelopeSettings)
    self.errorSettings = try container.decode(AS2ErrorSettingsData.self, forKey: .errorSettings)
    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.messageConnectionSettings as! AS2MessageConnectionSettingsData, forKey: .messageConnectionSettings)
    try container.encode(self.acknowledgementConnectionSettings as! AS2AcknowledgementConnectionSettingsData, forKey: .acknowledgementConnectionSettings)
    try container.encode(self.mdnSettings as! AS2MdnSettingsData, forKey: .mdnSettings)
    try container.encode(self.securitySettings as! AS2SecuritySettingsData, forKey: .securitySettings)
    try container.encode(self.validationSettings as! AS2ValidationSettingsData, forKey: .validationSettings)
    try container.encode(self.envelopeSettings as! AS2EnvelopeSettingsData, forKey: .envelopeSettings)
    try container.encode(self.errorSettings as! AS2ErrorSettingsData, forKey: .errorSettings)
  }
}

extension DataFactory {
  public static func createAS2ProtocolSettingsProtocol(messageConnectionSettings: AS2MessageConnectionSettingsProtocol, acknowledgementConnectionSettings: AS2AcknowledgementConnectionSettingsProtocol, mdnSettings: AS2MdnSettingsProtocol, securitySettings: AS2SecuritySettingsProtocol, validationSettings: AS2ValidationSettingsProtocol, envelopeSettings: AS2EnvelopeSettingsProtocol, errorSettings: AS2ErrorSettingsProtocol) -> AS2ProtocolSettingsProtocol {
    return AS2ProtocolSettingsData(messageConnectionSettings: messageConnectionSettings, acknowledgementConnectionSettings: acknowledgementConnectionSettings, mdnSettings: mdnSettings, securitySettings: securitySettings, validationSettings: validationSettings, envelopeSettings: envelopeSettings, errorSettings: errorSettings)
  }
}


// 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 AS2SecuritySettingsData : AS2SecuritySettingsProtocol {
    public var overrideGroupSigningCertificate: Bool
    public var signingCertificateName: String?
    public var encryptionCertificateName: String?
    public var enableNrrForInboundEncodedMessages: Bool
    public var enableNrrForInboundDecodedMessages: Bool
    public var enableNrrForOutboundMdn: Bool
    public var enableNrrForOutboundEncodedMessages: Bool
    public var enableNrrForOutboundDecodedMessages: Bool
    public var enableNrrForInboundMdn: Bool
    public var sha2AlgorithmFormat: String?

        enum CodingKeys: String, CodingKey {case overrideGroupSigningCertificate = "overrideGroupSigningCertificate"
        case signingCertificateName = "signingCertificateName"
        case encryptionCertificateName = "encryptionCertificateName"
        case enableNrrForInboundEncodedMessages = "enableNrrForInboundEncodedMessages"
        case enableNrrForInboundDecodedMessages = "enableNrrForInboundDecodedMessages"
        case enableNrrForOutboundMdn = "enableNrrForOutboundMdn"
        case enableNrrForOutboundEncodedMessages = "enableNrrForOutboundEncodedMessages"
        case enableNrrForOutboundDecodedMessages = "enableNrrForOutboundDecodedMessages"
        case enableNrrForInboundMdn = "enableNrrForInboundMdn"
        case sha2AlgorithmFormat = "sha2AlgorithmFormat"
        }

  public init(overrideGroupSigningCertificate: Bool, enableNrrForInboundEncodedMessages: Bool, enableNrrForInboundDecodedMessages: Bool, enableNrrForOutboundMdn: Bool, enableNrrForOutboundEncodedMessages: Bool, enableNrrForOutboundDecodedMessages: Bool, enableNrrForInboundMdn: Bool)  {
    self.overrideGroupSigningCertificate = overrideGroupSigningCertificate
    self.enableNrrForInboundEncodedMessages = enableNrrForInboundEncodedMessages
    self.enableNrrForInboundDecodedMessages = enableNrrForInboundDecodedMessages
    self.enableNrrForOutboundMdn = enableNrrForOutboundMdn
    self.enableNrrForOutboundEncodedMessages = enableNrrForOutboundEncodedMessages
    self.enableNrrForOutboundDecodedMessages = enableNrrForOutboundDecodedMessages
    self.enableNrrForInboundMdn = enableNrrForInboundMdn
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.overrideGroupSigningCertificate = try container.decode(Bool.self, forKey: .overrideGroupSigningCertificate)
    if container.contains(.signingCertificateName) {
        self.signingCertificateName = try container.decode(String?.self, forKey: .signingCertificateName)
    }
    if container.contains(.encryptionCertificateName) {
        self.encryptionCertificateName = try container.decode(String?.self, forKey: .encryptionCertificateName)
    }
    self.enableNrrForInboundEncodedMessages = try container.decode(Bool.self, forKey: .enableNrrForInboundEncodedMessages)
    self.enableNrrForInboundDecodedMessages = try container.decode(Bool.self, forKey: .enableNrrForInboundDecodedMessages)
    self.enableNrrForOutboundMdn = try container.decode(Bool.self, forKey: .enableNrrForOutboundMdn)
    self.enableNrrForOutboundEncodedMessages = try container.decode(Bool.self, forKey: .enableNrrForOutboundEncodedMessages)
    self.enableNrrForOutboundDecodedMessages = try container.decode(Bool.self, forKey: .enableNrrForOutboundDecodedMessages)
    self.enableNrrForInboundMdn = try container.decode(Bool.self, forKey: .enableNrrForInboundMdn)
    if container.contains(.sha2AlgorithmFormat) {
        self.sha2AlgorithmFormat = try container.decode(String?.self, forKey: .sha2AlgorithmFormat)
    }
    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.overrideGroupSigningCertificate, forKey: .overrideGroupSigningCertificate)
    if self.signingCertificateName != nil {try container.encode(self.signingCertificateName, forKey: .signingCertificateName)}
    if self.encryptionCertificateName != nil {try container.encode(self.encryptionCertificateName, forKey: .encryptionCertificateName)}
    try container.encode(self.enableNrrForInboundEncodedMessages, forKey: .enableNrrForInboundEncodedMessages)
    try container.encode(self.enableNrrForInboundDecodedMessages, forKey: .enableNrrForInboundDecodedMessages)
    try container.encode(self.enableNrrForOutboundMdn, forKey: .enableNrrForOutboundMdn)
    try container.encode(self.enableNrrForOutboundEncodedMessages, forKey: .enableNrrForOutboundEncodedMessages)
    try container.encode(self.enableNrrForOutboundDecodedMessages, forKey: .enableNrrForOutboundDecodedMessages)
    try container.encode(self.enableNrrForInboundMdn, forKey: .enableNrrForInboundMdn)
    if self.sha2AlgorithmFormat != nil {try container.encode(self.sha2AlgorithmFormat, forKey: .sha2AlgorithmFormat)}
  }
}

extension DataFactory {
  public static func createAS2SecuritySettingsProtocol(overrideGroupSigningCertificate: Bool, enableNrrForInboundEncodedMessages: Bool, enableNrrForInboundDecodedMessages: Bool, enableNrrForOutboundMdn: Bool, enableNrrForOutboundEncodedMessages: Bool, enableNrrForOutboundDecodedMessages: Bool, enableNrrForInboundMdn: Bool) -> AS2SecuritySettingsProtocol {
    return AS2SecuritySettingsData(overrideGroupSigningCertificate: overrideGroupSigningCertificate, enableNrrForInboundEncodedMessages: enableNrrForInboundEncodedMessages, enableNrrForInboundDecodedMessages: enableNrrForInboundDecodedMessages, enableNrrForOutboundMdn: enableNrrForOutboundMdn, enableNrrForOutboundEncodedMessages: enableNrrForOutboundEncodedMessages, enableNrrForOutboundDecodedMessages: enableNrrForOutboundDecodedMessages, enableNrrForInboundMdn: enableNrrForInboundMdn)
  }
}


// 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 AS2ValidationSettingsData : AS2ValidationSettingsProtocol {
    public var overrideMessageProperties: Bool
    public var encryptMessage: Bool
    public var signMessage: Bool
    public var compressMessage: Bool
    public var checkDuplicateMessage: Bool
    public var interchangeDuplicatesValidityDays: Int32
    public var checkCertificateRevocationListOnSend: Bool
    public var checkCertificateRevocationListOnReceive: Bool
    public var encryptionAlgorithm: EncryptionAlgorithmEnum
    public var signingAlgorithm: SigningAlgorithmEnum?

        enum CodingKeys: String, CodingKey {case overrideMessageProperties = "overrideMessageProperties"
        case encryptMessage = "encryptMessage"
        case signMessage = "signMessage"
        case compressMessage = "compressMessage"
        case checkDuplicateMessage = "checkDuplicateMessage"
        case interchangeDuplicatesValidityDays = "interchangeDuplicatesValidityDays"
        case checkCertificateRevocationListOnSend = "checkCertificateRevocationListOnSend"
        case checkCertificateRevocationListOnReceive = "checkCertificateRevocationListOnReceive"
        case encryptionAlgorithm = "encryptionAlgorithm"
        case signingAlgorithm = "signingAlgorithm"
        }

  public init(overrideMessageProperties: Bool, encryptMessage: Bool, signMessage: Bool, compressMessage: Bool, checkDuplicateMessage: Bool, interchangeDuplicatesValidityDays: Int32, checkCertificateRevocationListOnSend: Bool, checkCertificateRevocationListOnReceive: Bool, encryptionAlgorithm: EncryptionAlgorithmEnum)  {
    self.overrideMessageProperties = overrideMessageProperties
    self.encryptMessage = encryptMessage
    self.signMessage = signMessage
    self.compressMessage = compressMessage
    self.checkDuplicateMessage = checkDuplicateMessage
    self.interchangeDuplicatesValidityDays = interchangeDuplicatesValidityDays
    self.checkCertificateRevocationListOnSend = checkCertificateRevocationListOnSend
    self.checkCertificateRevocationListOnReceive = checkCertificateRevocationListOnReceive
    self.encryptionAlgorithm = encryptionAlgorithm
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.overrideMessageProperties = try container.decode(Bool.self, forKey: .overrideMessageProperties)
    self.encryptMessage = try container.decode(Bool.self, forKey: .encryptMessage)
    self.signMessage = try container.decode(Bool.self, forKey: .signMessage)
    self.compressMessage = try container.decode(Bool.self, forKey: .compressMessage)
    self.checkDuplicateMessage = try container.decode(Bool.self, forKey: .checkDuplicateMessage)
    self.interchangeDuplicatesValidityDays = try container.decode(Int32.self, forKey: .interchangeDuplicatesValidityDays)
    self.checkCertificateRevocationListOnSend = try container.decode(Bool.self, forKey: .checkCertificateRevocationListOnSend)
    self.checkCertificateRevocationListOnReceive = try container.decode(Bool.self, forKey: .checkCertificateRevocationListOnReceive)
    self.encryptionAlgorithm = try container.decode(EncryptionAlgorithmEnum.self, forKey: .encryptionAlgorithm)
    if container.contains(.signingAlgorithm) {
        self.signingAlgorithm = try container.decode(SigningAlgorithmEnum?.self, forKey: .signingAlgorithm)
    }
    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.overrideMessageProperties, forKey: .overrideMessageProperties)
    try container.encode(self.encryptMessage, forKey: .encryptMessage)
    try container.encode(self.signMessage, forKey: .signMessage)
    try container.encode(self.compressMessage, forKey: .compressMessage)
    try container.encode(self.checkDuplicateMessage, forKey: .checkDuplicateMessage)
    try container.encode(self.interchangeDuplicatesValidityDays, forKey: .interchangeDuplicatesValidityDays)
    try container.encode(self.checkCertificateRevocationListOnSend, forKey: .checkCertificateRevocationListOnSend)
    try container.encode(self.checkCertificateRevocationListOnReceive, forKey: .checkCertificateRevocationListOnReceive)
    try container.encode(self.encryptionAlgorithm, forKey: .encryptionAlgorithm)
    if self.signingAlgorithm != nil {try container.encode(self.signingAlgorithm, forKey: .signingAlgorithm)}
  }
}

extension DataFactory {
  public static func createAS2ValidationSettingsProtocol(overrideMessageProperties: Bool, encryptMessage: Bool, signMessage: Bool, compressMessage: Bool, checkDuplicateMessage: Bool, interchangeDuplicatesValidityDays: Int32, checkCertificateRevocationListOnSend: Bool, checkCertificateRevocationListOnReceive: Bool, encryptionAlgorithm: EncryptionAlgorithmEnum) -> AS2ValidationSettingsProtocol {
    return AS2ValidationSettingsData(overrideMessageProperties: overrideMessageProperties, encryptMessage: encryptMessage, signMessage: signMessage, compressMessage: compressMessage, checkDuplicateMessage: checkDuplicateMessage, interchangeDuplicatesValidityDays: interchangeDuplicatesValidityDays, checkCertificateRevocationListOnSend: checkCertificateRevocationListOnSend, checkCertificateRevocationListOnReceive: checkCertificateRevocationListOnReceive, encryptionAlgorithm: encryptionAlgorithm)
  }
}


// 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 B2BPartnerContentData : B2BPartnerContentProtocol {
    public var businessIdentities: [BusinessIdentityProtocol?]?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.businessIdentities) {
        self.businessIdentities = try container.decode([BusinessIdentityData?]?.self, forKey: .businessIdentities)
    }
    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.businessIdentities != nil {try container.encode(self.businessIdentities as! [BusinessIdentityData?]?, forKey: .businessIdentities)}
  }
}

extension DataFactory {
  public static func createB2BPartnerContentProtocol() -> B2BPartnerContentProtocol {
    return B2BPartnerContentData()
  }
}


// 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 BusinessIdentityData : BusinessIdentityProtocol {
    public var qualifier: String
    public var value: String

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

  public init(qualifier: String, value: String)  {
    self.qualifier = qualifier
    self.value = value
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.qualifier = try container.decode(String.self, forKey: .qualifier)
    self.value = try container.decode(String.self, forKey: .value)
    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.qualifier, forKey: .qualifier)
    try container.encode(self.value, forKey: .value)
  }
}

extension DataFactory {
  public static func createBusinessIdentityProtocol(qualifier: String, value: String) -> BusinessIdentityProtocol {
    return BusinessIdentityData(qualifier: qualifier, value: value)
  }
}


// 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 CallbackUrlData : CallbackUrlProtocol {
    public var value: String?

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

  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 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)}
  }
}

extension DataFactory {
  public static func createCallbackUrlProtocol() -> CallbackUrlProtocol {
    return CallbackUrlData()
  }
}


// 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 ContentHashData : ContentHashProtocol {
    public var algorithm: String?
    public var value: String?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.algorithm) {
        self.algorithm = try container.decode(String?.self, forKey: .algorithm)
    }
    if container.contains(.value) {
        self.value = try container.decode(String?.self, forKey: .value)
    }
    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.algorithm != nil {try container.encode(self.algorithm, forKey: .algorithm)}
    if self.value != nil {try container.encode(self.value, forKey: .value)}
  }
}

extension DataFactory {
  public static func createContentHashProtocol() -> ContentHashProtocol {
    return ContentHashData()
  }
}


// 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 ContentLinkData : ContentLinkProtocol {
    public var uri: String?
    public var contentVersion: String?
    public var contentSize: Int64?
    public var contentHash: ContentHashProtocol?
    public var metadata: [String: String?]?

        enum CodingKeys: String, CodingKey {case uri = "uri"
        case contentVersion = "contentVersion"
        case contentSize = "contentSize"
        case contentHash = "contentHash"
        case metadata = "metadata"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.uri) {
        self.uri = try container.decode(String?.self, forKey: .uri)
    }
    if container.contains(.contentVersion) {
        self.contentVersion = try container.decode(String?.self, forKey: .contentVersion)
    }
    if container.contains(.contentSize) {
        self.contentSize = try container.decode(Int64?.self, forKey: .contentSize)
    }
    if container.contains(.contentHash) {
        self.contentHash = try container.decode(ContentHashData?.self, forKey: .contentHash)
    }
    if container.contains(.metadata) {
        self.metadata = try container.decode([String: String?]?.self, forKey: .metadata)
    }
    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.uri != nil {try container.encode(self.uri, forKey: .uri)}
    if self.contentVersion != nil {try container.encode(self.contentVersion, forKey: .contentVersion)}
    if self.contentSize != nil {try container.encode(self.contentSize, forKey: .contentSize)}
    if self.contentHash != nil {try container.encode(self.contentHash as! ContentHashData?, forKey: .contentHash)}
    if self.metadata != nil {try container.encode(self.metadata, forKey: .metadata)}
  }
}

extension DataFactory {
  public static func createContentLinkProtocol() -> ContentLinkProtocol {
    return ContentLinkData()
  }
}


// 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 CorrelationData : CorrelationProtocol {
    public var clientTrackingId: String?

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

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.clientTrackingId) {
        self.clientTrackingId = try container.decode(String?.self, forKey: .clientTrackingId)
    }
    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.clientTrackingId != nil {try container.encode(self.clientTrackingId, forKey: .clientTrackingId)}
  }
}

extension DataFactory {
  public static func createCorrelationProtocol() -> CorrelationProtocol {
    return CorrelationData()
  }
}


// DayOfWeek enumerates the values for day of week.

// 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 DayOfWeekEnum: String, Codable
{
// Friday specifies the friday state for day of week.
    case Friday = "Friday"
// Monday specifies the monday state for day of week.
    case Monday = "Monday"
// Saturday specifies the saturday state for day of week.
    case Saturday = "Saturday"
// Sunday specifies the sunday state for day of week.
    case Sunday = "Sunday"
// Thursday specifies the thursday state for day of week.
    case Thursday = "Thursday"
// Tuesday specifies the tuesday state for day of week.
    case Tuesday = "Tuesday"
// Wednesday specifies the wednesday state for day of week.
    case Wednesday = "Wednesday"
}


// DaysOfWeek enumerates the values for days of week.

// 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 DaysOfWeekEnum: String, Codable
{
// DaysOfWeekFriday specifies the days of week friday state for days of week.
    case DaysOfWeekFriday = "Friday"
// DaysOfWeekMonday specifies the days of week monday state for days of week.
    case DaysOfWeekMonday = "Monday"
// DaysOfWeekSaturday specifies the days of week saturday state for days of week.
    case DaysOfWeekSaturday = "Saturday"
// DaysOfWeekSunday specifies the days of week sunday state for days of week.
    case DaysOfWeekSunday = "Sunday"
// DaysOfWeekThursday specifies the days of week thursday state for days of week.
    case DaysOfWeekThursday = "Thursday"
// DaysOfWeekTuesday specifies the days of week tuesday state for days of week.
    case DaysOfWeekTuesday = "Tuesday"
// DaysOfWeekWednesday specifies the days of week wednesday state for days of week.
    case DaysOfWeekWednesday = "Wednesday"
}


// 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 EdifactAcknowledgementSettingsData : EdifactAcknowledgementSettingsProtocol {
    public var needTechnicalAcknowledgement: Bool
    public var batchTechnicalAcknowledgements: Bool
    public var needFunctionalAcknowledgement: Bool
    public var batchFunctionalAcknowledgements: 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 batchFunctionalAcknowledgements = "batchFunctionalAcknowledgements"
        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, needLoopForValidMessages: Bool, sendSynchronousAcknowledgement: Bool, acknowledgementControlNumberLowerBound: Int32, acknowledgementControlNumberUpperBound: Int32, rolloverAcknowledgementControlNumber: Bool)  {
    self.needTechnicalAcknowledgement = needTechnicalAcknowledgement
    self.batchTechnicalAcknowledgements = batchTechnicalAcknowledgements
    self.needFunctionalAcknowledgement = needFunctionalAcknowledgement
    self.batchFunctionalAcknowledgements = batchFunctionalAcknowledgements
    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)
    self.batchFunctionalAcknowledgements = try container.decode(Bool.self, forKey: .batchFunctionalAcknowledgements)
    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)
    try container.encode(self.batchFunctionalAcknowledgements, forKey: .batchFunctionalAcknowledgements)
    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 createEdifactAcknowledgementSettingsProtocol(needTechnicalAcknowledgement: Bool, batchTechnicalAcknowledgements: Bool, needFunctionalAcknowledgement: Bool, batchFunctionalAcknowledgements: Bool, needLoopForValidMessages: Bool, sendSynchronousAcknowledgement: Bool, acknowledgementControlNumberLowerBound: Int32, acknowledgementControlNumberUpperBound: Int32, rolloverAcknowledgementControlNumber: Bool) -> EdifactAcknowledgementSettingsProtocol {
    return EdifactAcknowledgementSettingsData(needTechnicalAcknowledgement: needTechnicalAcknowledgement, batchTechnicalAcknowledgements: batchTechnicalAcknowledgements, needFunctionalAcknowledgement: needFunctionalAcknowledgement, batchFunctionalAcknowledgements: batchFunctionalAcknowledgements, 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 EdifactAgreementContentData : EdifactAgreementContentProtocol {
    public var receiveAgreement: EdifactOneWayAgreementProtocol
    public var sendAgreement: EdifactOneWayAgreementProtocol

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

  public init(receiveAgreement: EdifactOneWayAgreementProtocol, sendAgreement: EdifactOneWayAgreementProtocol)  {
    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(EdifactOneWayAgreementData.self, forKey: .receiveAgreement)
    self.sendAgreement = try container.decode(EdifactOneWayAgreementData.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! EdifactOneWayAgreementData, forKey: .receiveAgreement)
    try container.encode(self.sendAgreement as! EdifactOneWayAgreementData, forKey: .sendAgreement)
  }
}

extension DataFactory {
  public static func createEdifactAgreementContentProtocol(receiveAgreement: EdifactOneWayAgreementProtocol, sendAgreement: EdifactOneWayAgreementProtocol) -> EdifactAgreementContentProtocol {
    return EdifactAgreementContentData(receiveAgreement: receiveAgreement, sendAgreement: sendAgreement)
  }
}