// 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 IotHubCapacityData : IotHubCapacityProtocol {
    public var minimum: Int64?
    public var maximum: Int64?
    public var _default: Int64?
    public var scaleType: IotHubScaleTypeEnum?

        enum CodingKeys: String, CodingKey {case minimum = "minimum"
        case maximum = "maximum"
        case _default = "default"
        case scaleType = "scaleType"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createIotHubCapacityProtocol() -> IotHubCapacityProtocol {
    return IotHubCapacityData()
  }
}


// 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 IotHubDescriptionData : IotHubDescriptionProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String
    public var tags: [String:String]?
    public var subscriptionid: String
    public var resourcegroup: String
    public var etag: String?
    public var properties: IotHubPropertiesProtocol?
    public var sku: IotHubSkuInfoProtocol

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

  public init(location: String, subscriptionid: String, resourcegroup: String, sku: IotHubSkuInfoProtocol)  {
    self.location = location
    self.subscriptionid = subscriptionid
    self.resourcegroup = resourcegroup
    self.sku = sku
  }

  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)
    }
    self.location = try container.decode(String.self, forKey: .location)
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    self.subscriptionid = try container.decode(String.self, forKey: .subscriptionid)
    self.resourcegroup = try container.decode(String.self, forKey: .resourcegroup)
    if container.contains(.etag) {
        self.etag = try container.decode(String?.self, forKey: .etag)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(IotHubPropertiesData?.self, forKey: .properties)
    }
    self.sku = try container.decode(IotHubSkuInfoData.self, forKey: .sku)
    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)}
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    try container.encode(self.subscriptionid, forKey: .subscriptionid)
    try container.encode(self.resourcegroup, forKey: .resourcegroup)
    if self.etag != nil {try container.encode(self.etag, forKey: .etag)}
    if self.properties != nil {try container.encode(self.properties as! IotHubPropertiesData?, forKey: .properties)}
    try container.encode(self.sku as! IotHubSkuInfoData, forKey: .sku)
  }
}

extension DataFactory {
  public static func createIotHubDescriptionProtocol(location: String, subscriptionid: String, resourcegroup: String, sku: IotHubSkuInfoProtocol) -> IotHubDescriptionProtocol {
    return IotHubDescriptionData(location: location, subscriptionid: subscriptionid, resourcegroup: resourcegroup, sku: sku)
  }
}


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

extension DataFactory {
  public static func createIotHubDescriptionListResultProtocol() -> IotHubDescriptionListResultProtocol {
    return IotHubDescriptionListResultData()
  }
}


// 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 IotHubNameAvailabilityInfoData : IotHubNameAvailabilityInfoProtocol {
    public var nameAvailable: Bool?
    public var reason: IotHubNameUnavailabilityReasonEnum?
    public var message: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createIotHubNameAvailabilityInfoProtocol() -> IotHubNameAvailabilityInfoProtocol {
    return IotHubNameAvailabilityInfoData()
  }
}


// IotHubNameUnavailabilityReason enumerates the values for iot hub name unavailability 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 IotHubNameUnavailabilityReasonEnum: String, Codable
{
// AlreadyExists specifies the already exists state for iot hub name unavailability reason.
    case AlreadyExists = "AlreadyExists"
// Invalid specifies the invalid state for iot hub name unavailability reason.
    case Invalid = "Invalid"
}


// 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 IotHubPropertiesData : IotHubPropertiesProtocol {
    public var authorizationPolicies: [SharedAccessSignatureAuthorizationRuleProtocol?]?
    public var ipFilterRules: [IpFilterRuleProtocol?]?
    public var provisioningState: String?
    public var hostName: String?
    public var eventHubEndpoints: [String:EventHubPropertiesProtocol?]?
    public var routing: RoutingPropertiesProtocol?
    public var storageEndpoints: [String:StorageEndpointPropertiesProtocol?]?
    public var messagingEndpoints: [String:MessagingEndpointPropertiesProtocol?]?
    public var enableFileUploadNotifications: Bool?
    public var cloudToDevice: CloudToDevicePropertiesProtocol?
    public var comments: String?
    public var operationsMonitoringProperties: OperationsMonitoringPropertiesProtocol?
    public var features: CapabilitiesEnum?

        enum CodingKeys: String, CodingKey {case authorizationPolicies = "authorizationPolicies"
        case ipFilterRules = "ipFilterRules"
        case provisioningState = "provisioningState"
        case hostName = "hostName"
        case eventHubEndpoints = "eventHubEndpoints"
        case routing = "routing"
        case storageEndpoints = "storageEndpoints"
        case messagingEndpoints = "messagingEndpoints"
        case enableFileUploadNotifications = "enableFileUploadNotifications"
        case cloudToDevice = "cloudToDevice"
        case comments = "comments"
        case operationsMonitoringProperties = "operationsMonitoringProperties"
        case features = "features"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.authorizationPolicies) {
        self.authorizationPolicies = try container.decode([SharedAccessSignatureAuthorizationRuleData?]?.self, forKey: .authorizationPolicies)
    }
    if container.contains(.ipFilterRules) {
        self.ipFilterRules = try container.decode([IpFilterRuleData?]?.self, forKey: .ipFilterRules)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.hostName) {
        self.hostName = try container.decode(String?.self, forKey: .hostName)
    }
    if container.contains(.eventHubEndpoints) {
        self.eventHubEndpoints = try container.decode([String:EventHubPropertiesData?]?.self, forKey: .eventHubEndpoints)
    }
    if container.contains(.routing) {
        self.routing = try container.decode(RoutingPropertiesData?.self, forKey: .routing)
    }
    if container.contains(.storageEndpoints) {
        self.storageEndpoints = try container.decode([String:StorageEndpointPropertiesData?]?.self, forKey: .storageEndpoints)
    }
    if container.contains(.messagingEndpoints) {
        self.messagingEndpoints = try container.decode([String:MessagingEndpointPropertiesData?]?.self, forKey: .messagingEndpoints)
    }
    if container.contains(.enableFileUploadNotifications) {
        self.enableFileUploadNotifications = try container.decode(Bool?.self, forKey: .enableFileUploadNotifications)
    }
    if container.contains(.cloudToDevice) {
        self.cloudToDevice = try container.decode(CloudToDevicePropertiesData?.self, forKey: .cloudToDevice)
    }
    if container.contains(.comments) {
        self.comments = try container.decode(String?.self, forKey: .comments)
    }
    if container.contains(.operationsMonitoringProperties) {
        self.operationsMonitoringProperties = try container.decode(OperationsMonitoringPropertiesData?.self, forKey: .operationsMonitoringProperties)
    }
    if container.contains(.features) {
        self.features = try container.decode(CapabilitiesEnum?.self, forKey: .features)
    }
    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.authorizationPolicies != nil {try container.encode(self.authorizationPolicies as! [SharedAccessSignatureAuthorizationRuleData?]?, forKey: .authorizationPolicies)}
    if self.ipFilterRules != nil {try container.encode(self.ipFilterRules as! [IpFilterRuleData?]?, forKey: .ipFilterRules)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.hostName != nil {try container.encode(self.hostName, forKey: .hostName)}
    if self.eventHubEndpoints != nil {try container.encode(self.eventHubEndpoints, forKey: .eventHubEndpoints)}
    if self.routing != nil {try container.encode(self.routing as! RoutingPropertiesData?, forKey: .routing)}
    if self.storageEndpoints != nil {try container.encode(self.storageEndpoints, forKey: .storageEndpoints)}
    if self.messagingEndpoints != nil {try container.encode(self.messagingEndpoints, forKey: .messagingEndpoints)}
    if self.enableFileUploadNotifications != nil {try container.encode(self.enableFileUploadNotifications, forKey: .enableFileUploadNotifications)}
    if self.cloudToDevice != nil {try container.encode(self.cloudToDevice as! CloudToDevicePropertiesData?, forKey: .cloudToDevice)}
    if self.comments != nil {try container.encode(self.comments, forKey: .comments)}
    if self.operationsMonitoringProperties != nil {try container.encode(self.operationsMonitoringProperties as! OperationsMonitoringPropertiesData?, forKey: .operationsMonitoringProperties)}
    if self.features != nil {try container.encode(self.features, forKey: .features)}
  }
}

extension DataFactory {
  public static func createIotHubPropertiesProtocol() -> IotHubPropertiesProtocol {
    return IotHubPropertiesData()
  }
}


// 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 IotHubQuotaMetricInfoData : IotHubQuotaMetricInfoProtocol {
    public var name: String?
    public var currentValue: Int64?
    public var maxValue: Int64?

        enum CodingKeys: String, CodingKey {case name = "Name"
        case currentValue = "CurrentValue"
        case maxValue = "MaxValue"
        }

  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(.currentValue) {
        self.currentValue = try container.decode(Int64?.self, forKey: .currentValue)
    }
    if container.contains(.maxValue) {
        self.maxValue = try container.decode(Int64?.self, forKey: .maxValue)
    }
    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.currentValue != nil {try container.encode(self.currentValue, forKey: .currentValue)}
    if self.maxValue != nil {try container.encode(self.maxValue, forKey: .maxValue)}
  }
}

extension DataFactory {
  public static func createIotHubQuotaMetricInfoProtocol() -> IotHubQuotaMetricInfoProtocol {
    return IotHubQuotaMetricInfoData()
  }
}


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

extension DataFactory {
  public static func createIotHubQuotaMetricInfoListResultProtocol() -> IotHubQuotaMetricInfoListResultProtocol {
    return IotHubQuotaMetricInfoListResultData()
  }
}


// IotHubScaleType enumerates the values for iot hub scale 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 IotHubScaleTypeEnum: String, Codable
{
// IotHubScaleTypeAutomatic specifies the iot hub scale type automatic state for iot hub scale type.
    case IotHubScaleTypeAutomatic = "Automatic"
// IotHubScaleTypeManual specifies the iot hub scale type manual state for iot hub scale type.
    case IotHubScaleTypeManual = "Manual"
// IotHubScaleTypeNone specifies the iot hub scale type none state for iot hub scale type.
    case IotHubScaleTypeNone = "None"
}


// 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 IotHubSkuDescriptionData : IotHubSkuDescriptionProtocol {
    public var resourceType: String?
    public var sku: IotHubSkuInfoProtocol
    public var capacity: IotHubCapacityProtocol

        enum CodingKeys: String, CodingKey {case resourceType = "resourceType"
        case sku = "sku"
        case capacity = "capacity"
        }

  public init(sku: IotHubSkuInfoProtocol, capacity: IotHubCapacityProtocol)  {
    self.sku = sku
    self.capacity = capacity
  }

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

extension DataFactory {
  public static func createIotHubSkuDescriptionProtocol(sku: IotHubSkuInfoProtocol, capacity: IotHubCapacityProtocol) -> IotHubSkuDescriptionProtocol {
    return IotHubSkuDescriptionData(sku: sku, capacity: capacity)
  }
}


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

extension DataFactory {
  public static func createIotHubSkuDescriptionListResultProtocol() -> IotHubSkuDescriptionListResultProtocol {
    return IotHubSkuDescriptionListResultData()
  }
}


// IotHubSku enumerates the values for iot hub sku.

// 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 IotHubSkuEnum: String, Codable
{
// F1 specifies the f1 state for iot hub sku.
    case F1 = "F1"
// S1 specifies the s1 state for iot hub sku.
    case S1 = "S1"
// S2 specifies the s2 state for iot hub sku.
    case S2 = "S2"
// S3 specifies the s3 state for iot hub sku.
    case S3 = "S3"
}


// 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 IotHubSkuInfoData : IotHubSkuInfoProtocol {
    public var name: IotHubSkuEnum
    public var tier: IotHubSkuTierEnum?
    public var capacity: Int64

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

  public init(name: IotHubSkuEnum, capacity: Int64)  {
    self.name = name
    self.capacity = capacity
  }

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

extension DataFactory {
  public static func createIotHubSkuInfoProtocol(name: IotHubSkuEnum, capacity: Int64) -> IotHubSkuInfoProtocol {
    return IotHubSkuInfoData(name: name, capacity: capacity)
  }
}


// IotHubSkuTier enumerates the values for iot hub 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 IotHubSkuTierEnum: String, Codable
{
// Free specifies the free state for iot hub sku tier.
    case Free = "Free"
// Standard specifies the standard state for iot hub sku tier.
    case Standard = "Standard"
}


// IpFilterActionType enumerates the values for ip filter action 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 IpFilterActionTypeEnum: String, Codable
{
// Accept specifies the accept state for ip filter action type.
    case Accept = "Accept"
// Reject specifies the reject state for ip filter action type.
    case Reject = "Reject"
}


// 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 IpFilterRuleData : IpFilterRuleProtocol {
    public var filterName: String
    public var action: IpFilterActionTypeEnum
    public var ipMask: String

        enum CodingKeys: String, CodingKey {case filterName = "filterName"
        case action = "action"
        case ipMask = "ipMask"
        }

  public init(filterName: String, action: IpFilterActionTypeEnum, ipMask: String)  {
    self.filterName = filterName
    self.action = action
    self.ipMask = ipMask
  }

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

extension DataFactory {
  public static func createIpFilterRuleProtocol(filterName: String, action: IpFilterActionTypeEnum, ipMask: String) -> IpFilterRuleProtocol {
    return IpFilterRuleData(filterName: filterName, action: action, ipMask: ipMask)
  }
}


// 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 JobResponseData : JobResponseProtocol {
    public var jobId: String?
    public var startTimeUtc: Date?
    public var endTimeUtc: Date?
    public var type: JobTypeEnum?
    public var status: JobStatusEnum?
    public var failureReason: String?
    public var statusMessage: String?
    public var parentJobId: String?

        enum CodingKeys: String, CodingKey {case jobId = "jobId"
        case startTimeUtc = "startTimeUtc"
        case endTimeUtc = "endTimeUtc"
        case type = "type"
        case status = "status"
        case failureReason = "failureReason"
        case statusMessage = "statusMessage"
        case parentJobId = "parentJobId"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.jobId) {
        self.jobId = try container.decode(String?.self, forKey: .jobId)
    }
    if container.contains(.startTimeUtc) {
        self.startTimeUtc = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTimeUtc)), format: .dateTimeRfc1123)
    }
    if container.contains(.endTimeUtc) {
        self.endTimeUtc = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTimeUtc)), format: .dateTimeRfc1123)
    }
    if container.contains(.type) {
        self.type = try container.decode(JobTypeEnum?.self, forKey: .type)
    }
    if container.contains(.status) {
        self.status = try container.decode(JobStatusEnum?.self, forKey: .status)
    }
    if container.contains(.failureReason) {
        self.failureReason = try container.decode(String?.self, forKey: .failureReason)
    }
    if container.contains(.statusMessage) {
        self.statusMessage = try container.decode(String?.self, forKey: .statusMessage)
    }
    if container.contains(.parentJobId) {
        self.parentJobId = try container.decode(String?.self, forKey: .parentJobId)
    }
    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.jobId != nil {try container.encode(self.jobId, forKey: .jobId)}
    if self.startTimeUtc != nil {
        try container.encode(DateConverter.toString(date: self.startTimeUtc!, format: .dateTimeRfc1123), forKey: .startTimeUtc)
    }
    if self.endTimeUtc != nil {
        try container.encode(DateConverter.toString(date: self.endTimeUtc!, format: .dateTimeRfc1123), forKey: .endTimeUtc)
    }
    if self.type != nil {try container.encode(self.type, forKey: .type)}
    if self.status != nil {try container.encode(self.status, forKey: .status)}
    if self.failureReason != nil {try container.encode(self.failureReason, forKey: .failureReason)}
    if self.statusMessage != nil {try container.encode(self.statusMessage, forKey: .statusMessage)}
    if self.parentJobId != nil {try container.encode(self.parentJobId, forKey: .parentJobId)}
  }
}

extension DataFactory {
  public static func createJobResponseProtocol() -> JobResponseProtocol {
    return JobResponseData()
  }
}


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

extension DataFactory {
  public static func createJobResponseListResultProtocol() -> JobResponseListResultProtocol {
    return JobResponseListResultData()
  }
}


// JobStatus enumerates the values for job 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 JobStatusEnum: String, Codable
{
// Cancelled specifies the cancelled state for job status.
    case Cancelled = "cancelled"
// Completed specifies the completed state for job status.
    case Completed = "completed"
// Enqueued specifies the enqueued state for job status.
    case Enqueued = "enqueued"
// Failed specifies the failed state for job status.
    case Failed = "failed"
// Running specifies the running state for job status.
    case Running = "running"
// Unknown specifies the unknown state for job status.
    case Unknown = "unknown"
}


// JobType enumerates the values for job 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 JobTypeEnum: String, Codable
{
// JobTypeBackup specifies the job type backup state for job type.
    case JobTypeBackup = "backup"
// JobTypeExport specifies the job type export state for job type.
    case JobTypeExport = "export"
// JobTypeFactoryResetDevice specifies the job type factory reset device state for job type.
    case JobTypeFactoryResetDevice = "factoryResetDevice"
// JobTypeFirmwareUpdate specifies the job type firmware update state for job type.
    case JobTypeFirmwareUpdate = "firmwareUpdate"
// JobTypeImport specifies the job type import state for job type.
    case JobTypeImport = "import"
// JobTypeReadDeviceProperties specifies the job type read device properties state for job type.
    case JobTypeReadDeviceProperties = "readDeviceProperties"
// JobTypeRebootDevice specifies the job type reboot device state for job type.
    case JobTypeRebootDevice = "rebootDevice"
// JobTypeUnknown specifies the job type unknown state for job type.
    case JobTypeUnknown = "unknown"
// JobTypeUpdateDeviceConfiguration specifies the job type update device configuration state for job type.
    case JobTypeUpdateDeviceConfiguration = "updateDeviceConfiguration"
// JobTypeWriteDeviceProperties specifies the job type write device properties state for job type.
    case JobTypeWriteDeviceProperties = "writeDeviceProperties"
}


// 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 MessagingEndpointPropertiesData : MessagingEndpointPropertiesProtocol {
    public var lockDurationAsIso8601: String?
    public var ttlAsIso8601: String?
    public var maxDeliveryCount: Int32?

        enum CodingKeys: String, CodingKey {case lockDurationAsIso8601 = "lockDurationAsIso8601"
        case ttlAsIso8601 = "ttlAsIso8601"
        case maxDeliveryCount = "maxDeliveryCount"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createMessagingEndpointPropertiesProtocol() -> MessagingEndpointPropertiesProtocol {
    return MessagingEndpointPropertiesData()
  }
}


// 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 OperationInputsData : OperationInputsProtocol {
    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 createOperationInputsProtocol(name: String) -> OperationInputsProtocol {
    return OperationInputsData(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 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()
  }
}


// OperationMonitoringLevel enumerates the values for operation monitoring level.

// 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 OperationMonitoringLevelEnum: String, Codable
{
// OperationMonitoringLevelError specifies the operation monitoring level error state for operation monitoring level.
    case OperationMonitoringLevelError = "Error"
// OperationMonitoringLevelErrorInformation specifies the operation monitoring level error information state for
// operation monitoring level.
    case OperationMonitoringLevelErrorInformation = "Error, Information"
// OperationMonitoringLevelInformation specifies the operation monitoring level information state for operation
// monitoring level.
    case OperationMonitoringLevelInformation = "Information"
// OperationMonitoringLevelNone specifies the operation monitoring level none state for operation monitoring level.
    case OperationMonitoringLevelNone = "None"
}


// 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 OperationsMonitoringPropertiesData : OperationsMonitoringPropertiesProtocol {
    public var events: [String:OperationMonitoringLevelEnum?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationsMonitoringPropertiesProtocol() -> OperationsMonitoringPropertiesProtocol {
    return OperationsMonitoringPropertiesData()
  }
}


// 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 RegistryStatisticsData : RegistryStatisticsProtocol {
    public var totalDeviceCount: Int64?
    public var enabledDeviceCount: Int64?
    public var disabledDeviceCount: Int64?

        enum CodingKeys: String, CodingKey {case totalDeviceCount = "totalDeviceCount"
        case enabledDeviceCount = "enabledDeviceCount"
        case disabledDeviceCount = "disabledDeviceCount"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRegistryStatisticsProtocol() -> RegistryStatisticsProtocol {
    return RegistryStatisticsData()
  }
}


// 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?
    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(location: String)  {
    self.location = location
  }

  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)
    }
    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)}
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
  }
}

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


// 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 RoutePropertiesData : RoutePropertiesProtocol {
    public var name: String
    public var source: RoutingSourceEnum
    public var condition: String?
    public var endpointNames: [String]
    public var isEnabled: Bool

        enum CodingKeys: String, CodingKey {case name = "name"
        case source = "source"
        case condition = "condition"
        case endpointNames = "endpointNames"
        case isEnabled = "isEnabled"
        }

  public init(name: String, source: RoutingSourceEnum, endpointNames: [String], isEnabled: Bool)  {
    self.name = name
    self.source = source
    self.endpointNames = endpointNames
    self.isEnabled = isEnabled
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.name = try container.decode(String.self, forKey: .name)
    self.source = try container.decode(RoutingSourceEnum.self, forKey: .source)
    if container.contains(.condition) {
        self.condition = try container.decode(String?.self, forKey: .condition)
    }
    self.endpointNames = try container.decode([String].self, forKey: .endpointNames)
    self.isEnabled = try container.decode(Bool.self, forKey: .isEnabled)
    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)
    try container.encode(self.source, forKey: .source)
    if self.condition != nil {try container.encode(self.condition, forKey: .condition)}
    try container.encode(self.endpointNames as! [String], forKey: .endpointNames)
    try container.encode(self.isEnabled, forKey: .isEnabled)
  }
}

extension DataFactory {
  public static func createRoutePropertiesProtocol(name: String, source: RoutingSourceEnum, endpointNames: [String], isEnabled: Bool) -> RoutePropertiesProtocol {
    return RoutePropertiesData(name: name, source: source, endpointNames: endpointNames, isEnabled: isEnabled)
  }
}


// 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 RoutingEndpointsData : RoutingEndpointsProtocol {
    public var serviceBusQueues: [RoutingServiceBusQueueEndpointPropertiesProtocol?]?
    public var serviceBusTopics: [RoutingServiceBusTopicEndpointPropertiesProtocol?]?
    public var eventHubs: [RoutingEventHubPropertiesProtocol?]?
    public var storageContainers: [RoutingStorageContainerPropertiesProtocol?]?

        enum CodingKeys: String, CodingKey {case serviceBusQueues = "serviceBusQueues"
        case serviceBusTopics = "serviceBusTopics"
        case eventHubs = "eventHubs"
        case storageContainers = "storageContainers"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.serviceBusQueues) {
        self.serviceBusQueues = try container.decode([RoutingServiceBusQueueEndpointPropertiesData?]?.self, forKey: .serviceBusQueues)
    }
    if container.contains(.serviceBusTopics) {
        self.serviceBusTopics = try container.decode([RoutingServiceBusTopicEndpointPropertiesData?]?.self, forKey: .serviceBusTopics)
    }
    if container.contains(.eventHubs) {
        self.eventHubs = try container.decode([RoutingEventHubPropertiesData?]?.self, forKey: .eventHubs)
    }
    if container.contains(.storageContainers) {
        self.storageContainers = try container.decode([RoutingStorageContainerPropertiesData?]?.self, forKey: .storageContainers)
    }
    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.serviceBusQueues != nil {try container.encode(self.serviceBusQueues as! [RoutingServiceBusQueueEndpointPropertiesData?]?, forKey: .serviceBusQueues)}
    if self.serviceBusTopics != nil {try container.encode(self.serviceBusTopics as! [RoutingServiceBusTopicEndpointPropertiesData?]?, forKey: .serviceBusTopics)}
    if self.eventHubs != nil {try container.encode(self.eventHubs as! [RoutingEventHubPropertiesData?]?, forKey: .eventHubs)}
    if self.storageContainers != nil {try container.encode(self.storageContainers as! [RoutingStorageContainerPropertiesData?]?, forKey: .storageContainers)}
  }
}

extension DataFactory {
  public static func createRoutingEndpointsProtocol() -> RoutingEndpointsProtocol {
    return RoutingEndpointsData()
  }
}


// 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 RoutingEventHubPropertiesData : RoutingEventHubPropertiesProtocol {
    public var connectionString: String
    public var name: String
    public var subscriptionId: String?
    public var resourceGroup: String?

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

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

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

extension DataFactory {
  public static func createRoutingEventHubPropertiesProtocol(connectionString: String, name: String) -> RoutingEventHubPropertiesProtocol {
    return RoutingEventHubPropertiesData(connectionString: connectionString, 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 RoutingPropertiesData : RoutingPropertiesProtocol {
    public var endpoints: RoutingEndpointsProtocol?
    public var routes: [RoutePropertiesProtocol?]?
    public var fallbackRoute: FallbackRoutePropertiesProtocol?

        enum CodingKeys: String, CodingKey {case endpoints = "endpoints"
        case routes = "routes"
        case fallbackRoute = "fallbackRoute"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRoutingPropertiesProtocol() -> RoutingPropertiesProtocol {
    return RoutingPropertiesData()
  }
}


// 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 RoutingServiceBusQueueEndpointPropertiesData : RoutingServiceBusQueueEndpointPropertiesProtocol {
    public var connectionString: String
    public var name: String
    public var subscriptionId: String?
    public var resourceGroup: String?

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

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

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

extension DataFactory {
  public static func createRoutingServiceBusQueueEndpointPropertiesProtocol(connectionString: String, name: String) -> RoutingServiceBusQueueEndpointPropertiesProtocol {
    return RoutingServiceBusQueueEndpointPropertiesData(connectionString: connectionString, 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 RoutingServiceBusTopicEndpointPropertiesData : RoutingServiceBusTopicEndpointPropertiesProtocol {
    public var connectionString: String
    public var name: String
    public var subscriptionId: String?
    public var resourceGroup: String?

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

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

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

extension DataFactory {
  public static func createRoutingServiceBusTopicEndpointPropertiesProtocol(connectionString: String, name: String) -> RoutingServiceBusTopicEndpointPropertiesProtocol {
    return RoutingServiceBusTopicEndpointPropertiesData(connectionString: connectionString, name: name)
  }
}


// RoutingSource enumerates the values for routing source.

// 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 RoutingSourceEnum: String, Codable
{
// DeviceJobLifecycleEvents specifies the device job lifecycle events state for routing source.
    case DeviceJobLifecycleEvents = "DeviceJobLifecycleEvents"
// DeviceLifecycleEvents specifies the device lifecycle events state for routing source.
    case DeviceLifecycleEvents = "DeviceLifecycleEvents"
// DeviceMessages specifies the device messages state for routing source.
    case DeviceMessages = "DeviceMessages"
// TwinChangeEvents specifies the twin change events state for routing source.
    case TwinChangeEvents = "TwinChangeEvents"
}


// 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 RoutingStorageContainerPropertiesData : RoutingStorageContainerPropertiesProtocol {
    public var connectionString: String
    public var name: String
    public var subscriptionId: String?
    public var resourceGroup: String?
    public var containerName: String
    public var fileNameFormat: String?
    public var batchFrequencyInSeconds: Int32?
    public var maxChunkSizeInBytes: Int32?
    public var encoding: String?

        enum CodingKeys: String, CodingKey {case connectionString = "connectionString"
        case name = "name"
        case subscriptionId = "subscriptionId"
        case resourceGroup = "resourceGroup"
        case containerName = "containerName"
        case fileNameFormat = "fileNameFormat"
        case batchFrequencyInSeconds = "batchFrequencyInSeconds"
        case maxChunkSizeInBytes = "maxChunkSizeInBytes"
        case encoding = "encoding"
        }

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.connectionString = try container.decode(String.self, forKey: .connectionString)
    self.name = try container.decode(String.self, forKey: .name)
    if container.contains(.subscriptionId) {
        self.subscriptionId = try container.decode(String?.self, forKey: .subscriptionId)
    }
    if container.contains(.resourceGroup) {
        self.resourceGroup = try container.decode(String?.self, forKey: .resourceGroup)
    }
    self.containerName = try container.decode(String.self, forKey: .containerName)
    if container.contains(.fileNameFormat) {
        self.fileNameFormat = try container.decode(String?.self, forKey: .fileNameFormat)
    }
    if container.contains(.batchFrequencyInSeconds) {
        self.batchFrequencyInSeconds = try container.decode(Int32?.self, forKey: .batchFrequencyInSeconds)
    }
    if container.contains(.maxChunkSizeInBytes) {
        self.maxChunkSizeInBytes = try container.decode(Int32?.self, forKey: .maxChunkSizeInBytes)
    }
    if container.contains(.encoding) {
        self.encoding = try container.decode(String?.self, forKey: .encoding)
    }
    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.connectionString, forKey: .connectionString)
    try container.encode(self.name, forKey: .name)
    if self.subscriptionId != nil {try container.encode(self.subscriptionId, forKey: .subscriptionId)}
    if self.resourceGroup != nil {try container.encode(self.resourceGroup, forKey: .resourceGroup)}
    try container.encode(self.containerName, forKey: .containerName)
    if self.fileNameFormat != nil {try container.encode(self.fileNameFormat, forKey: .fileNameFormat)}
    if self.batchFrequencyInSeconds != nil {try container.encode(self.batchFrequencyInSeconds, forKey: .batchFrequencyInSeconds)}
    if self.maxChunkSizeInBytes != nil {try container.encode(self.maxChunkSizeInBytes, forKey: .maxChunkSizeInBytes)}
    if self.encoding != nil {try container.encode(self.encoding, forKey: .encoding)}
  }
}

extension DataFactory {
  public static func createRoutingStorageContainerPropertiesProtocol(connectionString: String, name: String, containerName: String) -> RoutingStorageContainerPropertiesProtocol {
    return RoutingStorageContainerPropertiesData(connectionString: connectionString, name: name, containerName: containerName)
  }
}


// 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 SharedAccessSignatureAuthorizationRuleData : SharedAccessSignatureAuthorizationRuleProtocol {
    public var keyName: String
    public var primaryKey: String?
    public var secondaryKey: String?
    public var rights: AccessRightsEnum

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

  public init(keyName: String, rights: AccessRightsEnum)  {
    self.keyName = keyName
    self.rights = rights
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.keyName = try container.decode(String.self, forKey: .keyName)
    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)
    }
    self.rights = try container.decode(AccessRightsEnum.self, forKey: .rights)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createSharedAccessSignatureAuthorizationRuleProtocol(keyName: String, rights: AccessRightsEnum) -> SharedAccessSignatureAuthorizationRuleProtocol {
    return SharedAccessSignatureAuthorizationRuleData(keyName: keyName, rights: rights)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SharedAccessSignatureAuthorizationRuleListResultData : SharedAccessSignatureAuthorizationRuleListResultProtocol {
    public var value: [SharedAccessSignatureAuthorizationRuleProtocol?]?
    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([SharedAccessSignatureAuthorizationRuleData?]?.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! [SharedAccessSignatureAuthorizationRuleData?]?, forKey: .value)}
    if self._nextLink != nil {try container.encode(self._nextLink, forKey: ._nextLink)}
  }
}

extension DataFactory {
  public static func createSharedAccessSignatureAuthorizationRuleListResultProtocol() -> SharedAccessSignatureAuthorizationRuleListResultProtocol {
    return SharedAccessSignatureAuthorizationRuleListResultData()
  }
}


// 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 StorageEndpointPropertiesData : StorageEndpointPropertiesProtocol {
    public var sasTtlAsIso8601: String?
    public var connectionString: String
    public var containerName: String

        enum CodingKeys: String, CodingKey {case sasTtlAsIso8601 = "sasTtlAsIso8601"
        case connectionString = "connectionString"
        case containerName = "containerName"
        }

  public init(connectionString: String, containerName: String)  {
    self.connectionString = connectionString
    self.containerName = containerName
  }

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

extension DataFactory {
  public static func createStorageEndpointPropertiesProtocol(connectionString: String, containerName: String) -> StorageEndpointPropertiesProtocol {
    return StorageEndpointPropertiesData(connectionString: connectionString, containerName: containerName)
  }
}


// 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
// CertificateBodyDescriptionProtocol is the JSON-serialized X509 Certificate.
public protocol CertificateBodyDescriptionProtocol : Codable {
     var certificate: 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
// CertificateDescriptionProtocol is the X509 Certificate.
public protocol CertificateDescriptionProtocol : Codable {
     var properties: CertificatePropertiesProtocol? { get set }
     var id: String? { get set }
     var name: String? { get set }
     var etag: 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
// CertificateListDescriptionProtocol is the JSON-serialized array of Certificate objects.
public protocol CertificateListDescriptionProtocol : Codable {
     var value: [CertificateDescriptionProtocol?]? { 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
// CertificatePropertiesProtocol is the description of an X509 CA Certificate.
public protocol CertificatePropertiesProtocol : Codable {
     var subject: String? { get set }
     var expiry: Date? { get set }
     var thumbprint: String? { get set }
     var isVerified: Bool? { get set }
     var created: Date? { get set }
     var updated: Date? { 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
// CertificatePropertiesWithNonceProtocol is the description of an X509 CA Certificate including the challenge nonce
// issued for the Proof-Of-Possession flow.
public protocol CertificatePropertiesWithNonceProtocol : Codable {
     var subject: String? { get set }
     var expiry: Date? { get set }
     var thumbprint: String? { get set }
     var isVerified: Bool? { get set }
     var created: Date? { get set }
     var updated: Date? { get set }
     var verificationCode: 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
// CertificateVerificationDescriptionProtocol is the JSON-serialized leaf certificate
public protocol CertificateVerificationDescriptionProtocol : Codable {
     var certificate: 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
// CertificateWithNonceDescriptionProtocol is the X509 Certificate.
public protocol CertificateWithNonceDescriptionProtocol : Codable {
     var properties: CertificatePropertiesWithNonceProtocol? { get set }
     var id: String? { get set }
     var name: String? { get set }
     var etag: 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
// CloudToDevicePropertiesProtocol is the IoT hub cloud-to-device messaging properties.
public protocol CloudToDevicePropertiesProtocol : Codable {
     var maxDeliveryCount: Int32? { get set }
     var defaultTtlAsIso8601: String? { get set }
     var feedback: FeedbackPropertiesProtocol? { 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
// ErrorDetailsProtocol is error details.
public protocol ErrorDetailsProtocol : Codable {
     var code: String? { get set }
     var httpStatusCode: String? { get set }
     var message: String? { get set }
     var details: 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
// EventHubConsumerGroupInfoProtocol is the properties of the EventHubConsumerGroupInfo object.
public protocol EventHubConsumerGroupInfoProtocol : Codable {
     var tags: [String:String]? { get set }
     var id: String? { get set }
     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
// EventHubConsumerGroupsListResultProtocol is the JSON-serialized array of Event Hub-compatible consumer group names
// with a next link.
public protocol EventHubConsumerGroupsListResultProtocol : Codable {
     var value: [String]? { 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 the properties of the provisioned Event Hub-compatible endpoint used by the IoT hub.
public protocol EventHubPropertiesProtocol : Codable {
     var retentionTimeInDays: Int64? { get set }
     var partitionCount: Int32? { get set }
     var partitionIds: [String]? { get set }
     var path: String? { get set }
     var endpoint: 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
// ExportDevicesRequestProtocol is use to provide parameters when requesting an export of all devices in the IoT hub.
public protocol ExportDevicesRequestProtocol : Codable {
     var exportBlobContainerUri: String { get set }
     var excludeKeys: Bool { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// FallbackRoutePropertiesProtocol is the properties of the fallback route. IoT Hub uses these properties when it
// routes messages to the fallback endpoint.
public protocol FallbackRoutePropertiesProtocol : Codable {
     var source: String { get set }
     var condition: String? { get set }
     var endpointNames: [String] { get set }
     var isEnabled: Bool { get set }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
// FeedbackPropertiesProtocol is the properties of the feedback queue for cloud-to-device messages.
public protocol FeedbackPropertiesProtocol : Codable {
     var lockDurationAsIso8601: String? { get set }
     var ttlAsIso8601: String? { get set }
     var maxDeliveryCount: 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
// ImportDevicesRequestProtocol is use to provide parameters when requesting an import of all devices in the hub.
public protocol ImportDevicesRequestProtocol : Codable {
     var inputBlobContainerUri: String { get set }
     var outputBlobContainerUri: 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
// IotHubCapacityProtocol is ioT Hub capacity information.
public protocol IotHubCapacityProtocol : Codable {
     var minimum: Int64? { get set }
     var maximum: Int64? { get set }
     var _default: Int64? { get set }
     var scaleType: IotHubScaleTypeEnum? { 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
// IotHubDescriptionListResultProtocol is the JSON-serialized array of IotHubDescription objects with a next link.
public protocol IotHubDescriptionListResultProtocol : Codable {
     var value: [IotHubDescriptionProtocol?]? { 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
// IotHubDescriptionProtocol is the description of the IoT hub.
public protocol IotHubDescriptionProtocol : ResourceProtocol {
     var subscriptionid: String { get set }
     var resourcegroup: String { get set }
     var etag: String? { get set }
     var properties: IotHubPropertiesProtocol? { get set }
     var sku: IotHubSkuInfoProtocol { 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
// IotHubNameAvailabilityInfoProtocol is the properties indicating whether a given IoT hub name is available.
public protocol IotHubNameAvailabilityInfoProtocol : Codable {
     var nameAvailable: Bool? { get set }
     var reason: IotHubNameUnavailabilityReasonEnum? { 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
// IotHubPropertiesProtocol is the properties of an IoT hub.
public protocol IotHubPropertiesProtocol : Codable {
     var authorizationPolicies: [SharedAccessSignatureAuthorizationRuleProtocol?]? { get set }
     var ipFilterRules: [IpFilterRuleProtocol?]? { get set }
     var provisioningState: String? { get set }
     var hostName: String? { get set }
     var eventHubEndpoints: [String:EventHubPropertiesProtocol?]? { get set }
     var routing: RoutingPropertiesProtocol? { get set }
     var storageEndpoints: [String:StorageEndpointPropertiesProtocol?]? { get set }
     var messagingEndpoints: [String:MessagingEndpointPropertiesProtocol?]? { get set }
     var enableFileUploadNotifications: Bool? { get set }
     var cloudToDevice: CloudToDevicePropertiesProtocol? { get set }
     var comments: String? { get set }
     var operationsMonitoringProperties: OperationsMonitoringPropertiesProtocol? { get set }
     var features: CapabilitiesEnum? { 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
// IotHubQuotaMetricInfoListResultProtocol is the JSON-serialized array of IotHubQuotaMetricInfo objects with a next
// link.
public protocol IotHubQuotaMetricInfoListResultProtocol : Codable {
     var value: [IotHubQuotaMetricInfoProtocol?]? { 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
// IotHubQuotaMetricInfoProtocol is quota metrics properties.
public protocol IotHubQuotaMetricInfoProtocol : Codable {
     var name: String? { get set }
     var currentValue: Int64? { get set }
     var maxValue: 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
// IotHubSkuDescriptionListResultProtocol is the JSON-serialized array of IotHubSkuDescription objects with a next
// link.
public protocol IotHubSkuDescriptionListResultProtocol : Codable {
     var value: [IotHubSkuDescriptionProtocol?]? { 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
// IotHubSkuDescriptionProtocol is SKU properties.
public protocol IotHubSkuDescriptionProtocol : Codable {
     var resourceType: String? { get set }
     var sku: IotHubSkuInfoProtocol { get set }
     var capacity: IotHubCapacityProtocol { 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
// IotHubSkuInfoProtocol is information about the SKU of the IoT hub.
public protocol IotHubSkuInfoProtocol : Codable {
     var name: IotHubSkuEnum { get set }
     var tier: IotHubSkuTierEnum? { get set }
     var capacity: 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
// IpFilterRuleProtocol is the IP filter rules for the IoT hub.
public protocol IpFilterRuleProtocol : Codable {
     var filterName: String { get set }
     var action: IpFilterActionTypeEnum { get set }
     var ipMask: 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
// JobResponseListResultProtocol is the JSON-serialized array of JobResponse objects with a next link.
public protocol JobResponseListResultProtocol : Codable {
     var value: [JobResponseProtocol?]? { 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
// JobResponseProtocol is the properties of the Job Response object.
public protocol JobResponseProtocol : Codable {
     var jobId: String? { get set }
     var startTimeUtc: Date? { get set }
     var endTimeUtc: Date? { get set }
     var type: JobTypeEnum? { get set }
     var status: JobStatusEnum? { get set }
     var failureReason: String? { get set }
     var statusMessage: String? { get set }
     var parentJobId: 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
// MessagingEndpointPropertiesProtocol is the properties of the messaging endpoints used by this IoT hub.
public protocol MessagingEndpointPropertiesProtocol : Codable {
     var lockDurationAsIso8601: String? { get set }
     var ttlAsIso8601: String? { get set }
     var maxDeliveryCount: 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
// 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
// OperationInputsProtocol is input values.
public protocol OperationInputsProtocol : 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
// OperationListResultProtocol is result of the request to list IoT 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 ioT 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
// OperationsMonitoringPropertiesProtocol is the operations monitoring properties for the IoT hub. The possible keys to
// the dictionary are Connections, DeviceTelemetry, C2DCommands, DeviceIdentityOperations, FileUploadOperations,
// Routes, D2CTwinOperations, C2DTwinOperations, TwinQueries, JobsOperations, DirectMethods.
public protocol OperationsMonitoringPropertiesProtocol : Codable {
     var events: [String:OperationMonitoringLevelEnum?]? { 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
// RegistryStatisticsProtocol is identity registry statistics.
public protocol RegistryStatisticsProtocol : Codable {
     var totalDeviceCount: Int64? { get set }
     var enabledDeviceCount: Int64? { get set }
     var disabledDeviceCount: Int64? { get set }
}