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

extension Commands.Regions {
// ListBySku gets the available Regions for a given sku
    internal class ListBySkuCommand : BaseCommand, RegionsListBySku {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var subscriptionId : String
        public var sku : String
        public var apiVersion = "2017-04-01"

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

        public override func preCall()  {
            self.pathParameters["{subscriptionId}"] = String(describing: self.subscriptionId)
            self.pathParameters["{sku}"] = String(describing: self.sku)
            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(MessagingRegionsListResultData?.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 (MessagingRegionsListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: MessagingRegionsListResultData?, 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 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 AuthorizationRuleData : AuthorizationRuleProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: AuthorizationRulePropertiesProtocol?

        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(AuthorizationRulePropertiesData?.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! AuthorizationRulePropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createAuthorizationRuleProtocol() -> AuthorizationRuleProtocol {
    return AuthorizationRuleData()
  }
}


// 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 AuthorizationRuleListResultData : AuthorizationRuleListResultProtocol {
    public var value: [AuthorizationRuleProtocol?]?
    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([AuthorizationRuleData?]?.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! [AuthorizationRuleData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createAuthorizationRuleListResultProtocol() -> AuthorizationRuleListResultProtocol {
    return AuthorizationRuleListResultData()
  }
}


// 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()  {
  }

  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 createAuthorizationRulePropertiesProtocol() -> AuthorizationRulePropertiesProtocol {
    return AuthorizationRulePropertiesData()
  }
}


// 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 CheckNameAvailabilityParameterData : CheckNameAvailabilityParameterProtocol {
    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 createCheckNameAvailabilityParameterProtocol(name: String) -> CheckNameAvailabilityParameterProtocol {
    return CheckNameAvailabilityParameterData(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 ConsumerGroupData : ConsumerGroupProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var properties: ConsumerGroupPropertiesProtocol?

        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(ConsumerGroupPropertiesData?.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! ConsumerGroupPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createConsumerGroupProtocol() -> ConsumerGroupProtocol {
    return ConsumerGroupData()
  }
}


// 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 ConsumerGroupListResultData : ConsumerGroupListResultProtocol {
    public var value: [ConsumerGroupProtocol?]?
    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([ConsumerGroupData?]?.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! [ConsumerGroupData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createConsumerGroupListResultProtocol() -> ConsumerGroupListResultProtocol {
    return ConsumerGroupListResultData()
  }
}


// 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 ConsumerGroupPropertiesData : ConsumerGroupPropertiesProtocol {
    public var createdAt: Date?
    public var updatedAt: Date?
    public var userMetadata: String?

        enum CodingKeys: String, CodingKey {case createdAt = "createdAt"
        case updatedAt = "updatedAt"
        case userMetadata = "userMetadata"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createConsumerGroupPropertiesProtocol() -> ConsumerGroupPropertiesProtocol {
    return ConsumerGroupPropertiesData()
  }
}


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


// 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 EHNamespaceData : EHNamespaceProtocol, TrackedResourceProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var sku: SkuProtocol?
    public var properties: EHNamespacePropertiesProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case name = "name"
        case type = "type"
        case location = "location"
        case tags = "tags"
        case sku = "sku"
        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(.sku) {
        self.sku = try container.decode(SkuData?.self, forKey: .sku)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(EHNamespacePropertiesData?.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.sku != nil {try container.encode(self.sku as! SkuData?, forKey: .sku)}
    if self.properties != nil {try container.encode(self.properties as! EHNamespacePropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createEHNamespaceProtocol() -> EHNamespaceProtocol {
    return EHNamespaceData()
  }
}


// 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 EHNamespaceListResultData : EHNamespaceListResultProtocol {
    public var value: [EHNamespaceProtocol?]?
    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([EHNamespaceData?]?.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! [EHNamespaceData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createEHNamespaceListResultProtocol() -> EHNamespaceListResultProtocol {
    return EHNamespaceListResultData()
  }
}


// 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 EHNamespacePropertiesData : EHNamespacePropertiesProtocol {
    public var provisioningState: String?
    public var createdAt: Date?
    public var updatedAt: Date?
    public var serviceBusEndpoint: String?
    public var metricId: String?
    public var isAutoInflateEnabled: Bool?
    public var maximumThroughputUnits: Int32?

        enum CodingKeys: String, CodingKey {case provisioningState = "provisioningState"
        case createdAt = "createdAt"
        case updatedAt = "updatedAt"
        case serviceBusEndpoint = "serviceBusEndpoint"
        case metricId = "metricId"
        case isAutoInflateEnabled = "isAutoInflateEnabled"
        case maximumThroughputUnits = "maximumThroughputUnits"
        }

  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(String?.self, forKey: .provisioningState)
    }
    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(.serviceBusEndpoint) {
        self.serviceBusEndpoint = try container.decode(String?.self, forKey: .serviceBusEndpoint)
    }
    if container.contains(.metricId) {
        self.metricId = try container.decode(String?.self, forKey: .metricId)
    }
    if container.contains(.isAutoInflateEnabled) {
        self.isAutoInflateEnabled = try container.decode(Bool?.self, forKey: .isAutoInflateEnabled)
    }
    if container.contains(.maximumThroughputUnits) {
        self.maximumThroughputUnits = try container.decode(Int32?.self, forKey: .maximumThroughputUnits)
    }
    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.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.serviceBusEndpoint != nil {try container.encode(self.serviceBusEndpoint, forKey: .serviceBusEndpoint)}
    if self.metricId != nil {try container.encode(self.metricId, forKey: .metricId)}
    if self.isAutoInflateEnabled != nil {try container.encode(self.isAutoInflateEnabled, forKey: .isAutoInflateEnabled)}
    if self.maximumThroughputUnits != nil {try container.encode(self.maximumThroughputUnits, forKey: .maximumThroughputUnits)}
  }
}

extension DataFactory {
  public static func createEHNamespacePropertiesProtocol() -> EHNamespacePropertiesProtocol {
    return EHNamespacePropertiesData()
  }
}


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


// 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 MessagingPlanData : MessagingPlanProtocol, TrackedResourceProtocol, 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: MessagingPlanpropertiesProtocol?

        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(MessagingPlanpropertiesData?.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! MessagingPlanpropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createMessagingPlanProtocol() -> MessagingPlanProtocol {
    return MessagingPlanData()
  }
}


// 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 MessagingPlanpropertiesData : MessagingPlanpropertiesProtocol {
    public var sku: Int32?
    public var selectedEventHubUnit: Int32?
    public var updatedAt: Date?
    public var revision: Int64?

        enum CodingKeys: String, CodingKey {case sku = "sku"
        case selectedEventHubUnit = "selectedEventHubUnit"
        case updatedAt = "updatedAt"
        case revision = "revision"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.sku) {
        self.sku = try container.decode(Int32?.self, forKey: .sku)
    }
    if container.contains(.selectedEventHubUnit) {
        self.selectedEventHubUnit = try container.decode(Int32?.self, forKey: .selectedEventHubUnit)
    }
    if container.contains(.updatedAt) {
        self.updatedAt = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .updatedAt)), format: .dateTime)
    }
    if container.contains(.revision) {
        self.revision = try container.decode(Int64?.self, forKey: .revision)
    }
    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.sku != nil {try container.encode(self.sku, forKey: .sku)}
    if self.selectedEventHubUnit != nil {try container.encode(self.selectedEventHubUnit, forKey: .selectedEventHubUnit)}
    if self.updatedAt != nil {
        try container.encode(DateConverter.toString(date: self.updatedAt!, format: .dateTime), forKey: .updatedAt)
    }
    if self.revision != nil {try container.encode(self.revision, forKey: .revision)}
  }
}

extension DataFactory {
  public static func createMessagingPlanpropertiesProtocol() -> MessagingPlanpropertiesProtocol {
    return MessagingPlanpropertiesData()
  }
}


// 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 MessagingRegionsData : MessagingRegionsProtocol, TrackedResourceProtocol, 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: MessagingRegionsPropertiesProtocol?

        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(MessagingRegionsPropertiesData?.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! MessagingRegionsPropertiesData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createMessagingRegionsProtocol() -> MessagingRegionsProtocol {
    return MessagingRegionsData()
  }
}


// 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 MessagingRegionsListResultData : MessagingRegionsListResultProtocol {
    public var value: [MessagingRegionsProtocol?]?
    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([MessagingRegionsData?]?.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! [MessagingRegionsData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createMessagingRegionsListResultProtocol() -> MessagingRegionsListResultProtocol {
    return MessagingRegionsListResultData()
  }
}


// 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 MessagingRegionsPropertiesData : MessagingRegionsPropertiesProtocol {
    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 createMessagingRegionsPropertiesProtocol() -> MessagingRegionsPropertiesProtocol {
    return MessagingRegionsPropertiesData()
  }
}


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


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


// 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 SkuData : SkuProtocol {
    public var name: SkuNameEnum
    public var tier: SkuTierEnum?
    public var capacity: Int32?

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

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

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

extension DataFactory {
  public static func createSkuProtocol(name: SkuNameEnum) -> SkuProtocol {
    return SkuData(name: name)
  }
}


// SkuName enumerates the values for sku 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.
public enum SkuNameEnum: String, Codable
{
// Basic specifies the basic state for sku name.
    case Basic = "Basic"
// Standard specifies the standard state for sku name.
    case Standard = "Standard"
}


// SkuTier enumerates the values for sku tier.

// 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 SkuTierEnum: String, Codable
{
// SkuTierBasic specifies the sku tier basic state for sku tier.
    case SkuTierBasic = "Basic"
// SkuTierStandard specifies the sku tier standard state for sku tier.
    case SkuTierStandard = "Standard"
}


// 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 TrackedResourceData : TrackedResourceProtocol, 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 createTrackedResourceProtocol() -> TrackedResourceProtocol {
    return TrackedResourceData()
  }
}


// UnavailableReason enumerates the values for unavailable reason.

// 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 UnavailableReasonEnum: String, Codable
{
// InvalidName specifies the invalid name state for unavailable reason.
    case InvalidName = "InvalidName"
// NameInLockdown specifies the name in lockdown state for unavailable reason.
    case NameInLockdown = "NameInLockdown"
// NameInUse specifies the name in use state for unavailable reason.
    case NameInUse = "NameInUse"
// None specifies the none state for unavailable reason.
    case None = "None"
// SubscriptionIsDisabled specifies the subscription is disabled state for unavailable reason.
    case SubscriptionIsDisabled = "SubscriptionIsDisabled"
// TooManyNamespaceInCurrentSubscription specifies the too many namespace in current subscription state for unavailable
// reason.
    case TooManyNamespaceInCurrentSubscription = "TooManyNamespaceInCurrentSubscription"
}


// 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
// AccessKeysProtocol is namespace/EventHub Connection String
public protocol AccessKeysProtocol : Codable {
     var primaryConnectionString: String? { get set }
     var secondaryConnectionString: String? { get set }
     var aliasPrimaryConnectionString: String? { get set }
     var aliasSecondaryConnectionString: String? { get set }
     var primaryKey: String? { get set }
     var secondaryKey: String? { get set }
     var keyName: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ArmDisasterRecoveryListResultProtocol is the result of the List Alias(Disaster Recovery configuration) operation.
public protocol ArmDisasterRecoveryListResultProtocol : Codable {
     var value: [ArmDisasterRecoveryProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ArmDisasterRecoveryPropertiesProtocol is properties required to the Create Or Update Alias(Disaster Recovery
// configurations)
public protocol ArmDisasterRecoveryPropertiesProtocol : Codable {
     var provisioningState: ProvisioningStateDREnum? { get set }
     var partnerNamespace: String? { get set }
     var alternateName: String? { get set }
     var role: RoleDisasterRecoveryEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ArmDisasterRecoveryProtocol is single item in List or Get Alias(Disaster Recovery configuration) operation
public protocol ArmDisasterRecoveryProtocol : ResourceProtocol {
     var properties: ArmDisasterRecoveryPropertiesProtocol? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AuthorizationRulePropertiesProtocol is properties supplied to create or update AuthorizationRule
public protocol AuthorizationRulePropertiesProtocol : Codable {
     var rights: [AccessRightsEnum?]? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// AuthorizationRuleProtocol is single item in a List or Get AuthorizationRule operation
public protocol AuthorizationRuleProtocol : ResourceProtocol {
     var properties: AuthorizationRulePropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CaptureDescriptionProtocol is properties to configure capture description for eventhub
public protocol CaptureDescriptionProtocol : Codable {
     var enabled: Bool? { get set }
     var encoding: EncodingCaptureDescriptionEnum? { get set }
     var intervalInSeconds: Int32? { get set }
     var sizeLimitInBytes: Int32? { get set }
     var destination: DestinationProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CheckNameAvailabilityParameterProtocol is parameter supplied to check Namespace name availability operation
public protocol CheckNameAvailabilityParameterProtocol : Codable {
     var name: String { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// CheckNameAvailabilityResultProtocol is the Result of the CheckNameAvailability operation
public protocol CheckNameAvailabilityResultProtocol : Codable {
     var message: String? { get set }
     var nameAvailable: Bool? { get set }
     var reason: UnavailableReasonEnum? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ConsumerGroupListResultProtocol is the result to the List Consumer Group operation.
public protocol ConsumerGroupListResultProtocol : Codable {
     var value: [ConsumerGroupProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ConsumerGroupPropertiesProtocol is single item in List or Get Consumer group operation
public protocol ConsumerGroupPropertiesProtocol : Codable {
     var createdAt: Date? { get set }
     var updatedAt: Date? { get set }
     var userMetadata: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ConsumerGroupProtocol is single item in List or Get Consumer group operation
public protocol ConsumerGroupProtocol : ResourceProtocol {
     var properties: ConsumerGroupPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// DestinationPropertiesProtocol is properties describing the storage account, blob container and acrchive anme format
// for capture destination
public protocol DestinationPropertiesProtocol : Codable {
     var storageAccountResourceId: String? { get set }
     var blobContainer: String? { get set }
     var archiveNameFormat: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// DestinationProtocol is capture storage details for capture description
public protocol DestinationProtocol : Codable {
     var name: String? { get set }
     var properties: DestinationPropertiesProtocol? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EHNamespacePropertiesProtocol is namespace properties supplied for create namespace operation.
public protocol EHNamespacePropertiesProtocol : Codable {
     var provisioningState: String? { get set }
     var createdAt: Date? { get set }
     var updatedAt: Date? { get set }
     var serviceBusEndpoint: String? { get set }
     var metricId: String? { get set }
     var isAutoInflateEnabled: Bool? { get set }
     var maximumThroughputUnits: Int32? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EHNamespaceProtocol is single Namespace item in List or Get Operation
public protocol EHNamespaceProtocol : TrackedResourceProtocol {
     var sku: SkuProtocol? { get set }
     var properties: EHNamespacePropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// ErrorResponseProtocol is error reponse indicates EventHub service is not able to process the incoming request. The
// reason is provided in the error message.
public protocol ErrorResponseProtocol : Codable {
     var code: String? { get set }
     var message: String? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EventhubPropertiesProtocol is properties supplied to the Create Or Update Event Hub operation.
public protocol EventhubPropertiesProtocol : Codable {
     var partitionIds: [String]? { get set }
     var createdAt: Date? { get set }
     var updatedAt: Date? { get set }
     var messageRetentionInDays: Int64? { get set }
     var partitionCount: Int64? { get set }
     var status: EntityStatusEnum? { get set }
     var captureDescription: CaptureDescriptionProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// EventhubProtocol is single item in List or Get Event Hub operation
public protocol EventhubProtocol : ResourceProtocol {
     var properties: EventhubPropertiesProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// MessagingPlanpropertiesProtocol is messaging Region
public protocol MessagingPlanpropertiesProtocol : Codable {
     var sku: Int32? { get set }
     var selectedEventHubUnit: Int32? { get set }
     var updatedAt: Date? { get set }
     var revision: Int64? { get set }
}


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


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


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


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


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationListResultProtocol is result of the request to list Event Hub operations. It contains a list of operations
// and a URL link to get the next set of results.
public protocol OperationListResultProtocol : Codable {
     var value: [OperationProtocol?]? { get set }
     var _nextLink: String? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// OperationProtocol is a Event Hub REST API operation
public protocol OperationProtocol : Codable {
     var name: String? { get set }
     var display: OperationDisplayProtocol? { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// RegenerateAccessKeyParametersProtocol is parameters supplied to the Regenerate Authorization Rule operation,
// specifies which key neeeds to be reset.
public protocol RegenerateAccessKeyParametersProtocol : Codable {
     var keyType: KeyTypeEnum { get set }
     var key: String? { get set }
}


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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// SkuProtocol is SKU parameters supplied to the create namespace operation
public protocol SkuProtocol : Codable {
     var name: SkuNameEnum { get set }
     var tier: SkuTierEnum? { get set }
     var capacity: Int32? { get set }
}


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