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

extension Commands.Topics {
// Delete deletes a topic from the specified namespace and resource group.
    internal class DeleteCommand : BaseCommand, TopicsDelete {
        public var resourceGroupName : String
        public var namespaceName : String
        public var topicName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, topicName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.topicName = topicName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Topics {
// DeleteAuthorizationRule deletes a topic authorization rule.
    internal class DeleteAuthorizationRuleCommand : BaseCommand, TopicsDeleteAuthorizationRule {
        public var resourceGroupName : String
        public var namespaceName : String
        public var topicName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, topicName: String, authorizationRuleName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.topicName = topicName
            self.authorizationRuleName = authorizationRuleName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Topics {
// Get returns a description for the specified topic.
    internal class GetCommand : BaseCommand, TopicsGet {
        public var resourceGroupName : String
        public var namespaceName : String
        public var topicName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.Topics {
// GetAuthorizationRule returns the specified authorization rule.
    internal class GetAuthorizationRuleCommand : BaseCommand, TopicsGetAuthorizationRule {
        public var resourceGroupName : String
        public var namespaceName : String
        public var topicName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, topicName: String, authorizationRuleName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.topicName = topicName
            self.authorizationRuleName = authorizationRuleName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Topics {
// ListAuthorizationRules gets authorization rules for a topic.
    internal class ListAuthorizationRulesCommand : BaseCommand, TopicsListAuthorizationRules {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var namespaceName : String
        public var topicName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, topicName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.topicName = topicName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


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

extension Commands.Topics {
// ListByNamespace gets all the topics in a namespace.
    internal class ListByNamespaceCommand : BaseCommand, TopicsListByNamespace {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var resourceGroupName : String
        public var namespaceName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

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

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

        }

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


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

extension Commands.Topics {
// ListKeys gets the primary and secondary connection strings for the topic.
    internal class ListKeysCommand : BaseCommand, TopicsListKeys {
        public var resourceGroupName : String
        public var namespaceName : String
        public var topicName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"

        public init(resourceGroupName: String, namespaceName: String, topicName: String, authorizationRuleName: String, subscriptionId: String) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.topicName = topicName
            self.authorizationRuleName = authorizationRuleName
            self.subscriptionId = subscriptionId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/ListKeys"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }

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


import Foundation
import azureSwiftRuntime
public protocol TopicsRegenerateKeys  {
    var headerParameters: [String: String] { get set }
    var resourceGroupName : String { get set }
    var namespaceName : String { get set }
    var topicName : String { get set }
    var authorizationRuleName : String { get set }
    var subscriptionId : String { get set }
    var apiVersion : String { get set }
    var parameters :  RegenerateAccessKeyParametersProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (AccessKeysProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Topics {
// RegenerateKeys regenerates primary or secondary connection strings for the topic.
    internal class RegenerateKeysCommand : BaseCommand, TopicsRegenerateKeys {
        public var resourceGroupName : String
        public var namespaceName : String
        public var topicName : String
        public var authorizationRuleName : String
        public var subscriptionId : String
        public var apiVersion = "2017-04-01"
    public var parameters :  RegenerateAccessKeyParametersProtocol?

        public init(resourceGroupName: String, namespaceName: String, topicName: String, authorizationRuleName: String, subscriptionId: String, parameters: RegenerateAccessKeyParametersProtocol) {
            self.resourceGroupName = resourceGroupName
            self.namespaceName = namespaceName
            self.topicName = topicName
            self.authorizationRuleName = authorizationRuleName
            self.subscriptionId = subscriptionId
            self.parameters = parameters
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/topics/{topicName}/authorizationRules/{authorizationRuleName}/regenerateKeys"
            self.headerParameters = ["Content-Type":"application/json; charset=utf-8"]
        }

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

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(parameters as? RegenerateAccessKeyParametersData)
                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(AccessKeysData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (AccessKeysProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: AccessKeysData?, 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 AccessKeysData : AccessKeysProtocol {
    public var primaryConnectionString: String?
    public var secondaryConnectionString: String?
    public var aliasPrimaryConnectionString: String?
    public var aliasSecondaryConnectionString: String?
    public var primaryKey: String?
    public var secondaryKey: String?
    public var keyName: String?

        enum CodingKeys: String, CodingKey {case primaryConnectionString = "primaryConnectionString"
        case secondaryConnectionString = "secondaryConnectionString"
        case aliasPrimaryConnectionString = "aliasPrimaryConnectionString"
        case aliasSecondaryConnectionString = "aliasSecondaryConnectionString"
        case primaryKey = "primaryKey"
        case secondaryKey = "secondaryKey"
        case keyName = "keyName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createAccessKeysProtocol() -> AccessKeysProtocol {
    return AccessKeysData()
  }
}


// AccessRights enumerates the values for access rights.

// 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 AccessRightsEnum: String, Codable
{
// Listen specifies the listen state for access rights.
    case Listen = "Listen"
// Manage specifies the manage state for access rights.
    case Manage = "Manage"
// Send specifies the send state for access rights.
    case Send = "Send"
}


// 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 ActionData : ActionProtocol {
    public var sqlExpression: String?
    public var compatibilityLevel: Int32?
    public var requiresPreprocessing: Bool?

        enum CodingKeys: String, CodingKey {case sqlExpression = "sqlExpression"
        case compatibilityLevel = "compatibilityLevel"
        case requiresPreprocessing = "requiresPreprocessing"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createActionProtocol() -> ActionProtocol {
    return ActionData()
  }
}


// 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 ArmDisasterRecoveryData : ArmDisasterRecoveryProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: ArmDisasterRecoveryPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createArmDisasterRecoveryProtocol() -> ArmDisasterRecoveryProtocol {
    return ArmDisasterRecoveryData()
  }
}


// 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 ArmDisasterRecoveryListResultData : ArmDisasterRecoveryListResultProtocol {
    public var value: [ArmDisasterRecoveryProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createArmDisasterRecoveryListResultProtocol() -> ArmDisasterRecoveryListResultProtocol {
    return ArmDisasterRecoveryListResultData()
  }
}


// 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 ArmDisasterRecoveryPropertiesData : ArmDisasterRecoveryPropertiesProtocol {
    public var provisioningState: ProvisioningStateDREnum?
    public var partnerNamespace: String?
    public var alternateName: String?
    public var role: RoleDisasterRecoveryEnum?

        enum CodingKeys: String, CodingKey {case provisioningState = "provisioningState"
        case partnerNamespace = "partnerNamespace"
        case alternateName = "alternateName"
        case role = "role"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStateDREnum?.self, forKey: .provisioningState)
    }
    if container.contains(.partnerNamespace) {
        self.partnerNamespace = try container.decode(String?.self, forKey: .partnerNamespace)
    }
    if container.contains(.alternateName) {
        self.alternateName = try container.decode(String?.self, forKey: .alternateName)
    }
    if container.contains(.role) {
        self.role = try container.decode(RoleDisasterRecoveryEnum?.self, forKey: .role)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createArmDisasterRecoveryPropertiesProtocol() -> ArmDisasterRecoveryPropertiesProtocol {
    return ArmDisasterRecoveryPropertiesData()
  }
}


// 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 AuthorizationRulePropertiesData : AuthorizationRulePropertiesProtocol {
    public var rights: [AccessRightsEnum]

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

  public init(rights: [AccessRightsEnum])  {
    self.rights = rights
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.rights = try container.decode([AccessRightsEnum].self, forKey: .rights)
    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.rights as! [AccessRightsEnum], forKey: .rights)
  }
}

extension DataFactory {
  public static func createAuthorizationRulePropertiesProtocol(rights: [AccessRightsEnum]) -> AuthorizationRulePropertiesProtocol {
    return AuthorizationRulePropertiesData(rights: rights)
  }
}


// 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 CaptureDescriptionData : CaptureDescriptionProtocol {
    public var enabled: Bool?
    public var encoding: EncodingCaptureDescriptionEnum?
    public var intervalInSeconds: Int32?
    public var sizeLimitInBytes: Int32?
    public var destination: DestinationProtocol?

        enum CodingKeys: String, CodingKey {case enabled = "enabled"
        case encoding = "encoding"
        case intervalInSeconds = "intervalInSeconds"
        case sizeLimitInBytes = "sizeLimitInBytes"
        case destination = "destination"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.enabled != nil {try container.encode(self.enabled, forKey: .enabled)}
    if self.encoding != nil {try container.encode(self.encoding, forKey: .encoding)}
    if self.intervalInSeconds != nil {try container.encode(self.intervalInSeconds, forKey: .intervalInSeconds)}
    if self.sizeLimitInBytes != nil {try container.encode(self.sizeLimitInBytes, forKey: .sizeLimitInBytes)}
    if self.destination != nil {try container.encode(self.destination as! DestinationData?, forKey: .destination)}
  }
}

extension DataFactory {
  public static func createCaptureDescriptionProtocol() -> CaptureDescriptionProtocol {
    return CaptureDescriptionData()
  }
}


// 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 CheckNameAvailabilityData : CheckNameAvailabilityProtocol {
    public var name: String

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

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

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

extension DataFactory {
  public static func createCheckNameAvailabilityProtocol(name: String) -> CheckNameAvailabilityProtocol {
    return CheckNameAvailabilityData(name: name)
  }
}


// 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 CheckNameAvailabilityResultData : CheckNameAvailabilityResultProtocol {
    public var message: String?
    public var nameAvailable: Bool?
    public var reason: UnavailableReasonEnum?

        enum CodingKeys: String, CodingKey {case message = "message"
        case nameAvailable = "nameAvailable"
        case reason = "reason"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createCheckNameAvailabilityResultProtocol() -> CheckNameAvailabilityResultProtocol {
    return CheckNameAvailabilityResultData()
  }
}


// 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 CorrelationFilterData : CorrelationFilterProtocol {
    public var correlationId: String?
    public var messageId: String?
    public var to: String?
    public var replyTo: String?
    public var label: String?
    public var sessionId: String?
    public var replyToSessionId: String?
    public var contentType: String?
    public var requiresPreprocessing: Bool?

        enum CodingKeys: String, CodingKey {case correlationId = "correlationId"
        case messageId = "messageId"
        case to = "to"
        case replyTo = "replyTo"
        case label = "label"
        case sessionId = "sessionId"
        case replyToSessionId = "replyToSessionId"
        case contentType = "contentType"
        case requiresPreprocessing = "requiresPreprocessing"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.correlationId) {
        self.correlationId = try container.decode(String?.self, forKey: .correlationId)
    }
    if container.contains(.messageId) {
        self.messageId = try container.decode(String?.self, forKey: .messageId)
    }
    if container.contains(.to) {
        self.to = try container.decode(String?.self, forKey: .to)
    }
    if container.contains(.replyTo) {
        self.replyTo = try container.decode(String?.self, forKey: .replyTo)
    }
    if container.contains(.label) {
        self.label = try container.decode(String?.self, forKey: .label)
    }
    if container.contains(.sessionId) {
        self.sessionId = try container.decode(String?.self, forKey: .sessionId)
    }
    if container.contains(.replyToSessionId) {
        self.replyToSessionId = try container.decode(String?.self, forKey: .replyToSessionId)
    }
    if container.contains(.contentType) {
        self.contentType = try container.decode(String?.self, forKey: .contentType)
    }
    if container.contains(.requiresPreprocessing) {
        self.requiresPreprocessing = try container.decode(Bool?.self, forKey: .requiresPreprocessing)
    }
    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.correlationId != nil {try container.encode(self.correlationId, forKey: .correlationId)}
    if self.messageId != nil {try container.encode(self.messageId, forKey: .messageId)}
    if self.to != nil {try container.encode(self.to, forKey: .to)}
    if self.replyTo != nil {try container.encode(self.replyTo, forKey: .replyTo)}
    if self.label != nil {try container.encode(self.label, forKey: .label)}
    if self.sessionId != nil {try container.encode(self.sessionId, forKey: .sessionId)}
    if self.replyToSessionId != nil {try container.encode(self.replyToSessionId, forKey: .replyToSessionId)}
    if self.contentType != nil {try container.encode(self.contentType, forKey: .contentType)}
    if self.requiresPreprocessing != nil {try container.encode(self.requiresPreprocessing, forKey: .requiresPreprocessing)}
  }
}

extension DataFactory {
  public static func createCorrelationFilterProtocol() -> CorrelationFilterProtocol {
    return CorrelationFilterData()
  }
}


// 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 DestinationData : DestinationProtocol {
    public var name: String?
    public var properties: DestinationPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createDestinationProtocol() -> DestinationProtocol {
    return DestinationData()
  }
}


// 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 DestinationPropertiesData : DestinationPropertiesProtocol {
    public var storageAccountResourceId: String?
    public var blobContainer: String?
    public var archiveNameFormat: String?

        enum CodingKeys: String, CodingKey {case storageAccountResourceId = "storageAccountResourceId"
        case blobContainer = "blobContainer"
        case archiveNameFormat = "archiveNameFormat"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDestinationPropertiesProtocol() -> DestinationPropertiesProtocol {
    return DestinationPropertiesData()
  }
}


// EncodingCaptureDescription enumerates the values for encoding capture description.

// 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 EncodingCaptureDescriptionEnum: String, Codable
{
// Avro specifies the avro state for encoding capture description.
    case Avro = "Avro"
// AvroDeflate specifies the avro deflate state for encoding capture description.
    case AvroDeflate = "AvroDeflate"
}


// EntityStatus enumerates the values for entity status.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum EntityStatusEnum: String, Codable
{
// Active specifies the active state for entity status.
    case Active = "Active"
// Creating specifies the creating state for entity status.
    case Creating = "Creating"
// Deleting specifies the deleting state for entity status.
    case Deleting = "Deleting"
// Disabled specifies the disabled state for entity status.
    case Disabled = "Disabled"
// ReceiveDisabled specifies the receive disabled state for entity status.
    case ReceiveDisabled = "ReceiveDisabled"
// Renaming specifies the renaming state for entity status.
    case Renaming = "Renaming"
// Restoring specifies the restoring state for entity status.
    case Restoring = "Restoring"
// SendDisabled specifies the send disabled state for entity status.
    case SendDisabled = "SendDisabled"
// Unknown specifies the unknown state for entity status.
    case Unknown = "Unknown"
}


// 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 ErrorResponseData : ErrorResponseProtocol {
    public var code: String?
    public var message: String?

        enum CodingKeys: String, CodingKey {case code = "code"
        case message = "message"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createErrorResponseProtocol() -> ErrorResponseProtocol {
    return ErrorResponseData()
  }
}


// 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 EventhubData : EventhubProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: EventhubPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createEventhubProtocol() -> EventhubProtocol {
    return EventhubData()
  }
}


// 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 EventHubListResultData : EventHubListResultProtocol {
    public var value: [EventhubProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createEventHubListResultProtocol() -> EventHubListResultProtocol {
    return EventHubListResultData()
  }
}


// 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 EventhubPropertiesData : EventhubPropertiesProtocol {
    public var partitionIds: [String]?
    public var createdAt: Date?
    public var updatedAt: Date?
    public var messageRetentionInDays: Int64?
    public var partitionCount: Int64?
    public var status: EntityStatusEnum?
    public var captureDescription: CaptureDescriptionProtocol?

        enum CodingKeys: String, CodingKey {case partitionIds = "partitionIds"
        case createdAt = "createdAt"
        case updatedAt = "updatedAt"
        case messageRetentionInDays = "messageRetentionInDays"
        case partitionCount = "partitionCount"
        case status = "status"
        case captureDescription = "captureDescription"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.partitionIds) {
        self.partitionIds = try container.decode([String]?.self, forKey: .partitionIds)
    }
    if container.contains(.createdAt) {
        self.createdAt = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdAt)), format: .dateTime)
    }
    if container.contains(.updatedAt) {
        self.updatedAt = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .updatedAt)), format: .dateTime)
    }
    if container.contains(.messageRetentionInDays) {
        self.messageRetentionInDays = try container.decode(Int64?.self, forKey: .messageRetentionInDays)
    }
    if container.contains(.partitionCount) {
        self.partitionCount = try container.decode(Int64?.self, forKey: .partitionCount)
    }
    if container.contains(.status) {
        self.status = try container.decode(EntityStatusEnum?.self, forKey: .status)
    }
    if container.contains(.captureDescription) {
        self.captureDescription = try container.decode(CaptureDescriptionData?.self, forKey: .captureDescription)
    }
    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.partitionIds != nil {try container.encode(self.partitionIds as! [String]?, forKey: .partitionIds)}
    if self.createdAt != nil {
        try container.encode(DateConverter.toString(date: self.createdAt!, format: .dateTime), forKey: .createdAt)
    }
    if self.updatedAt != nil {
        try container.encode(DateConverter.toString(date: self.updatedAt!, format: .dateTime), forKey: .updatedAt)
    }
    if self.messageRetentionInDays != nil {try container.encode(self.messageRetentionInDays, forKey: .messageRetentionInDays)}
    if self.partitionCount != nil {try container.encode(self.partitionCount, forKey: .partitionCount)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.captureDescription != nil {try container.encode(self.captureDescription as! CaptureDescriptionData?, forKey: .captureDescription)}
  }
}

extension DataFactory {
  public static func createEventhubPropertiesProtocol() -> EventhubPropertiesProtocol {
    return EventhubPropertiesData()
  }
}


// FilterType enumerates the values for filter 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 FilterTypeEnum: String, Codable
{
// FilterTypeCorrelationFilter specifies the filter type correlation filter state for filter type.
    case FilterTypeCorrelationFilter = "CorrelationFilter"
// FilterTypeSqlFilter specifies the filter type sql filter state for filter type.
    case FilterTypeSqlFilter = "SqlFilter"
}


// KeyType enumerates the values for key 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 KeyTypeEnum: String, Codable
{
// PrimaryKey specifies the primary key state for key type.
    case PrimaryKey = "PrimaryKey"
// SecondaryKey specifies the secondary key state for key type.
    case SecondaryKey = "SecondaryKey"
}


// 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 MessageCountDetailsData : MessageCountDetailsProtocol {
    public var activeMessageCount: Int64?
    public var deadLetterMessageCount: Int64?
    public var scheduledMessageCount: Int64?
    public var transferMessageCount: Int64?
    public var transferDeadLetterMessageCount: Int64?

        enum CodingKeys: String, CodingKey {case activeMessageCount = "activeMessageCount"
        case deadLetterMessageCount = "deadLetterMessageCount"
        case scheduledMessageCount = "scheduledMessageCount"
        case transferMessageCount = "transferMessageCount"
        case transferDeadLetterMessageCount = "transferDeadLetterMessageCount"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createMessageCountDetailsProtocol() -> MessageCountDetailsProtocol {
    return MessageCountDetailsData()
  }
}


// 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 OperationData : OperationProtocol {
    public var name: String?
    public var display: OperationDisplayProtocol?

        enum CodingKeys: String, CodingKey {case name = "name"
        case display = "display"
        }

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationProtocol() -> OperationProtocol {
    return OperationData()
  }
}


// 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 OperationDisplayData : OperationDisplayProtocol {
    public var provider: String?
    public var resource: String?
    public var operation: String?

        enum CodingKeys: String, CodingKey {case provider = "provider"
        case resource = "resource"
        case operation = "operation"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationDisplayProtocol() -> OperationDisplayProtocol {
    return OperationDisplayData()
  }
}


// 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 OperationListResultData : OperationListResultProtocol {
    public var value: [OperationProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createOperationListResultProtocol() -> OperationListResultProtocol {
    return OperationListResultData()
  }
}


// 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 PremiumMessagingRegionsData : PremiumMessagingRegionsProtocol, ResourceNamespacePatchProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: PremiumMessagingRegionsPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createPremiumMessagingRegionsProtocol() -> PremiumMessagingRegionsProtocol {
    return PremiumMessagingRegionsData()
  }
}


// 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 PremiumMessagingRegionsListResultData : PremiumMessagingRegionsListResultProtocol {
    public var value: [PremiumMessagingRegionsProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createPremiumMessagingRegionsListResultProtocol() -> PremiumMessagingRegionsListResultProtocol {
    return PremiumMessagingRegionsListResultData()
  }
}


// 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 PremiumMessagingRegionsPropertiesData : PremiumMessagingRegionsPropertiesProtocol {
    public var code: String?
    public var fullName: String?

        enum CodingKeys: String, CodingKey {case code = "code"
        case fullName = "fullName"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPremiumMessagingRegionsPropertiesProtocol() -> PremiumMessagingRegionsPropertiesProtocol {
    return PremiumMessagingRegionsPropertiesData()
  }
}


// ProvisioningStateDR enumerates the values for provisioning state dr.

// 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 ProvisioningStateDREnum: String, Codable
{
// Accepted specifies the accepted state for provisioning state dr.
    case Accepted = "Accepted"
// Failed specifies the failed state for provisioning state dr.
    case Failed = "Failed"
// Succeeded specifies the succeeded state for provisioning state dr.
    case Succeeded = "Succeeded"
}


// 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 RegenerateAccessKeyParametersData : RegenerateAccessKeyParametersProtocol {
    public var keyType: KeyTypeEnum
    public var key: String?

        enum CodingKeys: String, CodingKey {case keyType = "keyType"
        case key = "key"
        }

  public init(keyType: KeyTypeEnum)  {
    self.keyType = keyType
  }

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

extension DataFactory {
  public static func createRegenerateAccessKeyParametersProtocol(keyType: KeyTypeEnum) -> RegenerateAccessKeyParametersProtocol {
    return RegenerateAccessKeyParametersData(keyType: keyType)
  }
}


// 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 ResourceData : ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createResourceProtocol() -> ResourceProtocol {
    return ResourceData()
  }
}


// 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 ResourceNamespacePatchData : ResourceNamespacePatchProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createResourceNamespacePatchProtocol() -> ResourceNamespacePatchProtocol {
    return ResourceNamespacePatchData()
  }
}


// RoleDisasterRecovery enumerates the values for role disaster recovery.

// 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 RoleDisasterRecoveryEnum: String, Codable
{
// Primary specifies the primary state for role disaster recovery.
    case Primary = "Primary"
// PrimaryNotReplicating specifies the primary not replicating state for role disaster recovery.
    case PrimaryNotReplicating = "PrimaryNotReplicating"
// Secondary specifies the secondary state for role disaster recovery.
    case Secondary = "Secondary"
}


// 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 RuleData : RuleProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: RulepropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRuleProtocol() -> RuleProtocol {
    return RuleData()
  }
}


// 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 RuleListResultData : RuleListResultProtocol {
    public var value: [RuleProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createRuleListResultProtocol() -> RuleListResultProtocol {
    return RuleListResultData()
  }
}


// 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 RulepropertiesData : RulepropertiesProtocol {
    public var action: ActionProtocol?
    public var filterType: FilterTypeEnum?
    public var sqlFilter: SqlFilterProtocol?
    public var correlationFilter: CorrelationFilterProtocol?

        enum CodingKeys: String, CodingKey {case action = "action"
        case filterType = "filterType"
        case sqlFilter = "sqlFilter"
        case correlationFilter = "correlationFilter"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.action) {
        self.action = try container.decode(ActionData?.self, forKey: .action)
    }
    if container.contains(.filterType) {
        self.filterType = try container.decode(FilterTypeEnum?.self, forKey: .filterType)
    }
    if container.contains(.sqlFilter) {
        self.sqlFilter = try container.decode(SqlFilterData?.self, forKey: .sqlFilter)
    }
    if container.contains(.correlationFilter) {
        self.correlationFilter = try container.decode(CorrelationFilterData?.self, forKey: .correlationFilter)
    }
    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.action != nil {try container.encode(self.action as! ActionData?, forKey: .action)}
    if self.filterType != nil {try container.encode(self.filterType, forKey: .filterType)}
    if self.sqlFilter != nil {try container.encode(self.sqlFilter as! SqlFilterData?, forKey: .sqlFilter)}
    if self.correlationFilter != nil {try container.encode(self.correlationFilter as! CorrelationFilterData?, forKey: .correlationFilter)}
  }
}

extension DataFactory {
  public static func createRulepropertiesProtocol() -> RulepropertiesProtocol {
    return RulepropertiesData()
  }
}


// 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 SBAuthorizationRuleData : SBAuthorizationRuleProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: SBAuthorizationRulePropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createSBAuthorizationRuleProtocol() -> SBAuthorizationRuleProtocol {
    return SBAuthorizationRuleData()
  }
}


// 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 SBAuthorizationRuleListResultData : SBAuthorizationRuleListResultProtocol {
    public var value: [SBAuthorizationRuleProtocol?]?
    public var _nextLink: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createSBAuthorizationRuleListResultProtocol() -> SBAuthorizationRuleListResultProtocol {
    return SBAuthorizationRuleListResultData()
  }
}


// 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 SBAuthorizationRulePropertiesData : SBAuthorizationRulePropertiesProtocol {
    public var rights: [AccessRightsEnum?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createSBAuthorizationRulePropertiesProtocol() -> SBAuthorizationRulePropertiesProtocol {
    return SBAuthorizationRulePropertiesData()
  }
}