// AccessTier enumerates the values for access 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 AccessTierEnum: String, Codable
{
// Cool specifies the cool state for access tier.
    case Cool = "Cool"
// Hot specifies the hot state for access tier.
    case Hot = "Hot"
}


// 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 AccountSasParametersData : AccountSasParametersProtocol {
    public var services: ServicesEnum
    public var resourceTypes: SignedResourceTypesEnum
    public var permissions: PermissionsEnum
    public var iPAddressOrRange: String?
    public var protocols: HttpProtocolEnum?
    public var sharedAccessStartTime: Date?
    public var sharedAccessExpiryTime: Date
    public var keyToSign: String?

        enum CodingKeys: String, CodingKey {case services = "signedServices"
        case resourceTypes = "signedResourceTypes"
        case permissions = "signedPermission"
        case iPAddressOrRange = "signedIp"
        case protocols = "signedProtocol"
        case sharedAccessStartTime = "signedStart"
        case sharedAccessExpiryTime = "signedExpiry"
        case keyToSign = "keyToSign"
        }

  public init(services: ServicesEnum, resourceTypes: SignedResourceTypesEnum, permissions: PermissionsEnum, sharedAccessExpiryTime: Date)  {
    self.services = services
    self.resourceTypes = resourceTypes
    self.permissions = permissions
    self.sharedAccessExpiryTime = sharedAccessExpiryTime
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.services = try container.decode(ServicesEnum.self, forKey: .services)
    self.resourceTypes = try container.decode(SignedResourceTypesEnum.self, forKey: .resourceTypes)
    self.permissions = try container.decode(PermissionsEnum.self, forKey: .permissions)
    if container.contains(.iPAddressOrRange) {
        self.iPAddressOrRange = try container.decode(String?.self, forKey: .iPAddressOrRange)
    }
    if container.contains(.protocols) {
        self.protocols = try container.decode(HttpProtocolEnum?.self, forKey: .protocols)
    }
    if container.contains(.sharedAccessStartTime) {
        self.sharedAccessStartTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .sharedAccessStartTime)), format: .dateTime)
    }
        self.sharedAccessExpiryTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .sharedAccessExpiryTime)), format: .dateTime)!
    if container.contains(.keyToSign) {
        self.keyToSign = try container.decode(String?.self, forKey: .keyToSign)
    }
    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.services, forKey: .services)
    try container.encode(self.resourceTypes, forKey: .resourceTypes)
    try container.encode(self.permissions, forKey: .permissions)
    if self.iPAddressOrRange != nil {try container.encode(self.iPAddressOrRange, forKey: .iPAddressOrRange)}
    if self.protocols != nil {try container.encode(self.protocols, forKey: .protocols)}
    if self.sharedAccessStartTime != nil {
        try container.encode(DateConverter.toString(date: self.sharedAccessStartTime!, format: .dateTime), forKey: .sharedAccessStartTime)
    }
    try container.encode(DateConverter.toString(date: self.sharedAccessExpiryTime, format: .dateTime), forKey: .sharedAccessExpiryTime)
    if self.keyToSign != nil {try container.encode(self.keyToSign, forKey: .keyToSign)}
  }
}

extension DataFactory {
  public static func createAccountSasParametersProtocol(services: ServicesEnum, resourceTypes: SignedResourceTypesEnum, permissions: PermissionsEnum, sharedAccessExpiryTime: Date) -> AccountSasParametersProtocol {
    return AccountSasParametersData(services: services, resourceTypes: resourceTypes, permissions: permissions, sharedAccessExpiryTime: sharedAccessExpiryTime)
  }
}


// AccountStatus enumerates the values for account 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 AccountStatusEnum: String, Codable
{
// Available specifies the available state for account status.
    case Available = "available"
// Unavailable specifies the unavailable state for account status.
    case Unavailable = "unavailable"
}


// Action enumerates the values for action.

// 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 ActionEnum: String, Codable
{
// Allow specifies the allow state for action.
    case Allow = "Allow"
}


// Bypass enumerates the values for bypass.

// 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 BypassEnum: String, Codable
{
// AzureServices specifies the azure services state for bypass.
    case AzureServices = "AzureServices"
// Logging specifies the logging state for bypass.
    case Logging = "Logging"
// Metrics specifies the metrics state for bypass.
    case Metrics = "Metrics"
// None specifies the none state for bypass.
    case None = "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 CheckNameAvailabilityResultData : CheckNameAvailabilityResultProtocol {
    public var nameAvailable: Bool?
    public var reason: ReasonEnum?
    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(ReasonEnum?.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 createCheckNameAvailabilityResultProtocol() -> CheckNameAvailabilityResultProtocol {
    return CheckNameAvailabilityResultData()
  }
}


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

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

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

extension DataFactory {
  public static func createCustomDomainProtocol(name: String) -> CustomDomainProtocol {
    return CustomDomainData(name: name)
  }
}


// DefaultAction enumerates the values for default action.

// 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 DefaultActionEnum: String, Codable
{
// DefaultActionAllow specifies the default action allow state for default action.
    case DefaultActionAllow = "Allow"
// DefaultActionDeny specifies the default action deny state for default action.
    case DefaultActionDeny = "Deny"
}


// 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 DimensionData : DimensionProtocol {
    public var name: String?
    public var displayName: String?

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

  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(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    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.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
  }
}

extension DataFactory {
  public static func createDimensionProtocol() -> DimensionProtocol {
    return DimensionData()
  }
}


// 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 EncryptionData : EncryptionProtocol {
    public var services: EncryptionServicesProtocol?
    public var keySource: KeySourceEnum
    public var keyVaultProperties: KeyVaultPropertiesProtocol?

        enum CodingKeys: String, CodingKey {case services = "services"
        case keySource = "keySource"
        case keyVaultProperties = "keyvaultproperties"
        }

  public init(keySource: KeySourceEnum)  {
    self.keySource = keySource
  }

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

extension DataFactory {
  public static func createEncryptionProtocol(keySource: KeySourceEnum) -> EncryptionProtocol {
    return EncryptionData(keySource: keySource)
  }
}


// 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 EncryptionServiceData : EncryptionServiceProtocol {
    public var enabled: Bool?
    public var lastEnabledTime: Date?

        enum CodingKeys: String, CodingKey {case enabled = "enabled"
        case lastEnabledTime = "lastEnabledTime"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.enabled) {
        self.enabled = try container.decode(Bool?.self, forKey: .enabled)
    }
    if container.contains(.lastEnabledTime) {
        self.lastEnabledTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastEnabledTime)), format: .dateTime)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.enabled != nil {try container.encode(self.enabled, forKey: .enabled)}
    if self.lastEnabledTime != nil {
        try container.encode(DateConverter.toString(date: self.lastEnabledTime!, format: .dateTime), forKey: .lastEnabledTime)
    }
  }
}

extension DataFactory {
  public static func createEncryptionServiceProtocol() -> EncryptionServiceProtocol {
    return EncryptionServiceData()
  }
}


// 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 EncryptionServicesData : EncryptionServicesProtocol {
    public var blob: EncryptionServiceProtocol?
    public var file: EncryptionServiceProtocol?
    public var table: EncryptionServiceProtocol?
    public var queue: EncryptionServiceProtocol?

        enum CodingKeys: String, CodingKey {case blob = "blob"
        case file = "file"
        case table = "table"
        case queue = "queue"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createEncryptionServicesProtocol() -> EncryptionServicesProtocol {
    return EncryptionServicesData()
  }
}


// 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 EndpointsData : EndpointsProtocol {
    public var blob: String?
    public var queue: String?
    public var table: String?
    public var file: String?

        enum CodingKeys: String, CodingKey {case blob = "blob"
        case queue = "queue"
        case table = "table"
        case file = "file"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createEndpointsProtocol() -> EndpointsProtocol {
    return EndpointsData()
  }
}


// HttpProtocol enumerates the values for http protocol.

// 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 HttpProtocolEnum: String, Codable
{
// Https specifies the https state for http protocol.
    case Https = "https"
// Httpshttp specifies the httpshttp state for http protocol.
    case Httpshttp = "https,http"
}


// 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 IdentityData : IdentityProtocol {
    public var principalId: String?
    public var tenantId: String?
    public var type: String

        enum CodingKeys: String, CodingKey {case principalId = "principalId"
        case tenantId = "tenantId"
        case type = "type"
        }

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

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

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

extension DataFactory {
  public static func createIdentityProtocol(type: String) -> IdentityProtocol {
    return IdentityData(type: 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.
import Foundation
import azureSwiftRuntime
internal struct IPRuleData : IPRuleProtocol {
    public var iPAddressOrRange: String
    public var action: ActionEnum?

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

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

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

extension DataFactory {
  public static func createIPRuleProtocol(iPAddressOrRange: String) -> IPRuleProtocol {
    return IPRuleData(iPAddressOrRange: iPAddressOrRange)
  }
}


// KeyPermission enumerates the values for key permission.

// 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 KeyPermissionEnum: String, Codable
{
// Full specifies the full state for key permission.
    case Full = "Full"
// Read specifies the read state for key permission.
    case Read = "Read"
}


// KeySource enumerates the values for key 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 KeySourceEnum: String, Codable
{
// MicrosoftKeyvault specifies the microsoft keyvault state for key source.
    case MicrosoftKeyvault = "Microsoft.Keyvault"
// MicrosoftStorage specifies the microsoft storage state for key source.
    case MicrosoftStorage = "Microsoft.Storage"
}


// 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 KeyVaultPropertiesData : KeyVaultPropertiesProtocol {
    public var keyName: String?
    public var keyVersion: String?
    public var keyVaultUri: String?

        enum CodingKeys: String, CodingKey {case keyName = "keyname"
        case keyVersion = "keyversion"
        case keyVaultUri = "keyvaulturi"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createKeyVaultPropertiesProtocol() -> KeyVaultPropertiesProtocol {
    return KeyVaultPropertiesData()
  }
}


// Kind enumerates the values for kind.

// 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 KindEnum: String, Codable
{
// BlobStorage specifies the blob storage state for kind.
    case BlobStorage = "BlobStorage"
// Storage specifies the storage state for kind.
    case Storage = "Storage"
// StorageV2 specifies the storage v2 state for kind.
    case StorageV2 = "StorageV2"
}


// 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 ListAccountSasResponseData : ListAccountSasResponseProtocol {
    public var accountSasToken: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createListAccountSasResponseProtocol() -> ListAccountSasResponseProtocol {
    return ListAccountSasResponseData()
  }
}


// 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 ListServiceSasResponseData : ListServiceSasResponseProtocol {
    public var serviceSasToken: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createListServiceSasResponseProtocol() -> ListServiceSasResponseProtocol {
    return ListServiceSasResponseData()
  }
}


// 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 MetricSpecificationData : MetricSpecificationProtocol {
    public var name: String?
    public var displayName: String?
    public var displayDescription: String?
    public var unit: String?
    public var dimensions: [DimensionProtocol?]?
    public var aggregationType: String?
    public var fillGapWithZero: Bool?
    public var category: String?
    public var resourceIdDimensionNameOverride: String?

        enum CodingKeys: String, CodingKey {case name = "name"
        case displayName = "displayName"
        case displayDescription = "displayDescription"
        case unit = "unit"
        case dimensions = "dimensions"
        case aggregationType = "aggregationType"
        case fillGapWithZero = "fillGapWithZero"
        case category = "category"
        case resourceIdDimensionNameOverride = "resourceIdDimensionNameOverride"
        }

  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(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    if container.contains(.displayDescription) {
        self.displayDescription = try container.decode(String?.self, forKey: .displayDescription)
    }
    if container.contains(.unit) {
        self.unit = try container.decode(String?.self, forKey: .unit)
    }
    if container.contains(.dimensions) {
        self.dimensions = try container.decode([DimensionData?]?.self, forKey: .dimensions)
    }
    if container.contains(.aggregationType) {
        self.aggregationType = try container.decode(String?.self, forKey: .aggregationType)
    }
    if container.contains(.fillGapWithZero) {
        self.fillGapWithZero = try container.decode(Bool?.self, forKey: .fillGapWithZero)
    }
    if container.contains(.category) {
        self.category = try container.decode(String?.self, forKey: .category)
    }
    if container.contains(.resourceIdDimensionNameOverride) {
        self.resourceIdDimensionNameOverride = try container.decode(String?.self, forKey: .resourceIdDimensionNameOverride)
    }
    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.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.displayDescription != nil {try container.encode(self.displayDescription, forKey: .displayDescription)}
    if self.unit != nil {try container.encode(self.unit, forKey: .unit)}
    if self.dimensions != nil {try container.encode(self.dimensions as! [DimensionData?]?, forKey: .dimensions)}
    if self.aggregationType != nil {try container.encode(self.aggregationType, forKey: .aggregationType)}
    if self.fillGapWithZero != nil {try container.encode(self.fillGapWithZero, forKey: .fillGapWithZero)}
    if self.category != nil {try container.encode(self.category, forKey: .category)}
    if self.resourceIdDimensionNameOverride != nil {try container.encode(self.resourceIdDimensionNameOverride, forKey: .resourceIdDimensionNameOverride)}
  }
}

extension DataFactory {
  public static func createMetricSpecificationProtocol() -> MetricSpecificationProtocol {
    return MetricSpecificationData()
  }
}


// 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 NetworkRuleSetData : NetworkRuleSetProtocol {
    public var bypass: BypassEnum?
    public var virtualNetworkRules: [VirtualNetworkRuleProtocol?]?
    public var ipRules: [IPRuleProtocol?]?
    public var defaultAction: DefaultActionEnum

        enum CodingKeys: String, CodingKey {case bypass = "bypass"
        case virtualNetworkRules = "virtualNetworkRules"
        case ipRules = "ipRules"
        case defaultAction = "defaultAction"
        }

  public init(defaultAction: DefaultActionEnum)  {
    self.defaultAction = defaultAction
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.bypass) {
        self.bypass = try container.decode(BypassEnum?.self, forKey: .bypass)
    }
    if container.contains(.virtualNetworkRules) {
        self.virtualNetworkRules = try container.decode([VirtualNetworkRuleData?]?.self, forKey: .virtualNetworkRules)
    }
    if container.contains(.ipRules) {
        self.ipRules = try container.decode([IPRuleData?]?.self, forKey: .ipRules)
    }
    self.defaultAction = try container.decode(DefaultActionEnum.self, forKey: .defaultAction)
    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.bypass != nil {try container.encode(self.bypass, forKey: .bypass)}
    if self.virtualNetworkRules != nil {try container.encode(self.virtualNetworkRules as! [VirtualNetworkRuleData?]?, forKey: .virtualNetworkRules)}
    if self.ipRules != nil {try container.encode(self.ipRules as! [IPRuleData?]?, forKey: .ipRules)}
    try container.encode(self.defaultAction, forKey: .defaultAction)
  }
}

extension DataFactory {
  public static func createNetworkRuleSetProtocol(defaultAction: DefaultActionEnum) -> NetworkRuleSetProtocol {
    return NetworkRuleSetData(defaultAction: defaultAction)
  }
}


// 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?
    public var origin: String?
    public var operationProperties: OperationPropertiesProtocol?

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

  public init()  {
  }

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

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


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

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

  public init()  {
  }

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

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

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


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

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

  public init()  {
  }

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

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

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


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

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

  public init()  {
  }

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

extension DataFactory {
  public static func createOperationPropertiesProtocol() -> OperationPropertiesProtocol {
    return OperationPropertiesData()
  }
}


// Permissions enumerates the values for permissions.

// 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 PermissionsEnum: String, Codable
{
// A specifies the a state for permissions.
    case A = "a"
// C specifies the c state for permissions.
    case C = "c"
// D specifies the d state for permissions.
    case D = "d"
// L specifies the l state for permissions.
    case L = "l"
// P specifies the p state for permissions.
    case P = "p"
// R specifies the r state for permissions.
    case R = "r"
// U specifies the u state for permissions.
    case U = "u"
// W specifies the w state for permissions.
    case W = "w"
}


// ProvisioningState enumerates the values for provisioning state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum ProvisioningStateEnum: String, Codable
{
// Creating specifies the creating state for provisioning state.
    case Creating = "Creating"
// ResolvingDNS specifies the resolving dns state for provisioning state.
    case ResolvingDNS = "ResolvingDNS"
// Succeeded specifies the succeeded state for provisioning state.
    case Succeeded = "Succeeded"
}


// ReasonCode enumerates the values for reason code.

// 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 ReasonCodeEnum: String, Codable
{
// NotAvailableForSubscription specifies the not available for subscription state for reason code.
    case NotAvailableForSubscription = "NotAvailableForSubscription"
// QuotaId specifies the quota id state for reason code.
    case QuotaId = "QuotaId"
}


// Reason enumerates the values for 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 ReasonEnum: String, Codable
{
// AccountNameInvalid specifies the account name invalid state for reason.
    case AccountNameInvalid = "AccountNameInvalid"
// AlreadyExists specifies the already exists state for reason.
    case AlreadyExists = "AlreadyExists"
}


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

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

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

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct RestrictionData : RestrictionProtocol {
    public var type: String?
    public var values: [String]?
    public var reasonCode: ReasonCodeEnum?

        enum CodingKeys: String, CodingKey {case type = "type"
        case values = "values"
        case reasonCode = "reasonCode"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createRestrictionProtocol() -> RestrictionProtocol {
    return RestrictionData()
  }
}


// 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 ServiceSasParametersData : ServiceSasParametersProtocol {
    public var canonicalizedResource: String
    public var resource: SignedResourceEnum
    public var permissions: PermissionsEnum?
    public var iPAddressOrRange: String?
    public var protocols: HttpProtocolEnum?
    public var sharedAccessStartTime: Date?
    public var sharedAccessExpiryTime: Date?
    public var identifier: String?
    public var partitionKeyStart: String?
    public var partitionKeyEnd: String?
    public var rowKeyStart: String?
    public var rowKeyEnd: String?
    public var keyToSign: String?
    public var cacheControl: String?
    public var contentDisposition: String?
    public var contentEncoding: String?
    public var contentLanguage: String?
    public var contentType: String?

        enum CodingKeys: String, CodingKey {case canonicalizedResource = "canonicalizedResource"
        case resource = "signedResource"
        case permissions = "signedPermission"
        case iPAddressOrRange = "signedIp"
        case protocols = "signedProtocol"
        case sharedAccessStartTime = "signedStart"
        case sharedAccessExpiryTime = "signedExpiry"
        case identifier = "signedIdentifier"
        case partitionKeyStart = "startPk"
        case partitionKeyEnd = "endPk"
        case rowKeyStart = "startRk"
        case rowKeyEnd = "endRk"
        case keyToSign = "keyToSign"
        case cacheControl = "rscc"
        case contentDisposition = "rscd"
        case contentEncoding = "rsce"
        case contentLanguage = "rscl"
        case contentType = "rsct"
        }

  public init(canonicalizedResource: String, resource: SignedResourceEnum)  {
    self.canonicalizedResource = canonicalizedResource
    self.resource = resource
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.canonicalizedResource = try container.decode(String.self, forKey: .canonicalizedResource)
    self.resource = try container.decode(SignedResourceEnum.self, forKey: .resource)
    if container.contains(.permissions) {
        self.permissions = try container.decode(PermissionsEnum?.self, forKey: .permissions)
    }
    if container.contains(.iPAddressOrRange) {
        self.iPAddressOrRange = try container.decode(String?.self, forKey: .iPAddressOrRange)
    }
    if container.contains(.protocols) {
        self.protocols = try container.decode(HttpProtocolEnum?.self, forKey: .protocols)
    }
    if container.contains(.sharedAccessStartTime) {
        self.sharedAccessStartTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .sharedAccessStartTime)), format: .dateTime)
    }
    if container.contains(.sharedAccessExpiryTime) {
        self.sharedAccessExpiryTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .sharedAccessExpiryTime)), format: .dateTime)
    }
    if container.contains(.identifier) {
        self.identifier = try container.decode(String?.self, forKey: .identifier)
    }
    if container.contains(.partitionKeyStart) {
        self.partitionKeyStart = try container.decode(String?.self, forKey: .partitionKeyStart)
    }
    if container.contains(.partitionKeyEnd) {
        self.partitionKeyEnd = try container.decode(String?.self, forKey: .partitionKeyEnd)
    }
    if container.contains(.rowKeyStart) {
        self.rowKeyStart = try container.decode(String?.self, forKey: .rowKeyStart)
    }
    if container.contains(.rowKeyEnd) {
        self.rowKeyEnd = try container.decode(String?.self, forKey: .rowKeyEnd)
    }
    if container.contains(.keyToSign) {
        self.keyToSign = try container.decode(String?.self, forKey: .keyToSign)
    }
    if container.contains(.cacheControl) {
        self.cacheControl = try container.decode(String?.self, forKey: .cacheControl)
    }
    if container.contains(.contentDisposition) {
        self.contentDisposition = try container.decode(String?.self, forKey: .contentDisposition)
    }
    if container.contains(.contentEncoding) {
        self.contentEncoding = try container.decode(String?.self, forKey: .contentEncoding)
    }
    if container.contains(.contentLanguage) {
        self.contentLanguage = try container.decode(String?.self, forKey: .contentLanguage)
    }
    if container.contains(.contentType) {
        self.contentType = try container.decode(String?.self, forKey: .contentType)
    }
    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.canonicalizedResource, forKey: .canonicalizedResource)
    try container.encode(self.resource, forKey: .resource)
    if self.permissions != nil {try container.encode(self.permissions, forKey: .permissions)}
    if self.iPAddressOrRange != nil {try container.encode(self.iPAddressOrRange, forKey: .iPAddressOrRange)}
    if self.protocols != nil {try container.encode(self.protocols, forKey: .protocols)}
    if self.sharedAccessStartTime != nil {
        try container.encode(DateConverter.toString(date: self.sharedAccessStartTime!, format: .dateTime), forKey: .sharedAccessStartTime)
    }
    if self.sharedAccessExpiryTime != nil {
        try container.encode(DateConverter.toString(date: self.sharedAccessExpiryTime!, format: .dateTime), forKey: .sharedAccessExpiryTime)
    }
    if self.identifier != nil {try container.encode(self.identifier, forKey: .identifier)}
    if self.partitionKeyStart != nil {try container.encode(self.partitionKeyStart, forKey: .partitionKeyStart)}
    if self.partitionKeyEnd != nil {try container.encode(self.partitionKeyEnd, forKey: .partitionKeyEnd)}
    if self.rowKeyStart != nil {try container.encode(self.rowKeyStart, forKey: .rowKeyStart)}
    if self.rowKeyEnd != nil {try container.encode(self.rowKeyEnd, forKey: .rowKeyEnd)}
    if self.keyToSign != nil {try container.encode(self.keyToSign, forKey: .keyToSign)}
    if self.cacheControl != nil {try container.encode(self.cacheControl, forKey: .cacheControl)}
    if self.contentDisposition != nil {try container.encode(self.contentDisposition, forKey: .contentDisposition)}
    if self.contentEncoding != nil {try container.encode(self.contentEncoding, forKey: .contentEncoding)}
    if self.contentLanguage != nil {try container.encode(self.contentLanguage, forKey: .contentLanguage)}
    if self.contentType != nil {try container.encode(self.contentType, forKey: .contentType)}
  }
}

extension DataFactory {
  public static func createServiceSasParametersProtocol(canonicalizedResource: String, resource: SignedResourceEnum) -> ServiceSasParametersProtocol {
    return ServiceSasParametersData(canonicalizedResource: canonicalizedResource, resource: resource)
  }
}


// Services enumerates the values for services.

// 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 ServicesEnum: String, Codable
{
// B specifies the b state for services.
    case B = "b"
// F specifies the f state for services.
    case F = "f"
// Q specifies the q state for services.
    case Q = "q"
// T specifies the t state for services.
    case T = "t"
}


// 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 ServiceSpecificationData : ServiceSpecificationProtocol {
    public var metricSpecifications: [MetricSpecificationProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createServiceSpecificationProtocol() -> ServiceSpecificationProtocol {
    return ServiceSpecificationData()
  }
}


// SignedResource enumerates the values for signed resource.

// 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 SignedResourceEnum: String, Codable
{
// SignedResourceB specifies the signed resource b state for signed resource.
    case SignedResourceB = "b"
// SignedResourceC specifies the signed resource c state for signed resource.
    case SignedResourceC = "c"
// SignedResourceF specifies the signed resource f state for signed resource.
    case SignedResourceF = "f"
// SignedResourceS specifies the signed resource s state for signed resource.
    case SignedResourceS = "s"
}


// SignedResourceTypes enumerates the values for signed resource types.

// 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 SignedResourceTypesEnum: String, Codable
{
// SignedResourceTypesC specifies the signed resource types c state for signed resource types.
    case SignedResourceTypesC = "c"
// SignedResourceTypesO specifies the signed resource types o state for signed resource types.
    case SignedResourceTypesO = "o"
// SignedResourceTypesS specifies the signed resource types s state for signed resource types.
    case SignedResourceTypesS = "s"
}


// 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 SKUCapabilityData : SKUCapabilityProtocol {
    public var name: String?
    public var value: String?

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

  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(.value) {
        self.value = try container.decode(String?.self, forKey: .value)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

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

extension DataFactory {
  public static func createSKUCapabilityProtocol() -> SKUCapabilityProtocol {
    return SKUCapabilityData()
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct SkuData : SkuProtocol {
    public var name: SkuNameEnum
    public var tier: SkuTierEnum?
    public var resourceType: String?
    public var kind: KindEnum?
    public var locations: [String]?
    public var capabilities: [SKUCapabilityProtocol?]?
    public var restrictions: [RestrictionProtocol?]?

        enum CodingKeys: String, CodingKey {case name = "name"
        case tier = "tier"
        case resourceType = "resourceType"
        case kind = "kind"
        case locations = "locations"
        case capabilities = "capabilities"
        case restrictions = "restrictions"
        }

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.name = try container.decode(SkuNameEnum.self, forKey: .name)
    if container.contains(.tier) {
        self.tier = try container.decode(SkuTierEnum?.self, forKey: .tier)
    }
    if container.contains(.resourceType) {
        self.resourceType = try container.decode(String?.self, forKey: .resourceType)
    }
    if container.contains(.kind) {
        self.kind = try container.decode(KindEnum?.self, forKey: .kind)
    }
    if container.contains(.locations) {
        self.locations = try container.decode([String]?.self, forKey: .locations)
    }
    if container.contains(.capabilities) {
        self.capabilities = try container.decode([SKUCapabilityData?]?.self, forKey: .capabilities)
    }
    if container.contains(.restrictions) {
        self.restrictions = try container.decode([RestrictionData?]?.self, forKey: .restrictions)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.name, forKey: .name)
    if self.tier != nil {try container.encode(self.tier, forKey: .tier)}
    if self.resourceType != nil {try container.encode(self.resourceType, forKey: .resourceType)}
    if self.kind != nil {try container.encode(self.kind, forKey: .kind)}
    if self.locations != nil {try container.encode(self.locations as! [String]?, forKey: .locations)}
    if self.capabilities != nil {try container.encode(self.capabilities as! [SKUCapabilityData?]?, forKey: .capabilities)}
    if self.restrictions != nil {try container.encode(self.restrictions as! [RestrictionData?]?, forKey: .restrictions)}
  }
}

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


// SkuName enumerates the values for sku name.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SkuNameEnum: String, Codable
{
// PremiumLRS specifies the premium lrs state for sku name.
    case PremiumLRS = "Premium_LRS"
// StandardGRS specifies the standard grs state for sku name.
    case StandardGRS = "Standard_GRS"
// StandardLRS specifies the standard lrs state for sku name.
    case StandardLRS = "Standard_LRS"
// StandardRAGRS specifies the standard ragrs state for sku name.
    case StandardRAGRS = "Standard_RAGRS"
// StandardZRS specifies the standard zrs state for sku name.
    case StandardZRS = "Standard_ZRS"
}


// SkuTier enumerates the values for sku tier.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SkuTierEnum: String, Codable
{
// Premium specifies the premium state for sku tier.
    case Premium = "Premium"
// Standard specifies the standard state for sku tier.
    case Standard = "Standard"
}


// State enumerates the values for state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum StateEnum: String, Codable
{
// StateDeprovisioning specifies the state deprovisioning state for state.
    case StateDeprovisioning = "deprovisioning"
// StateFailed specifies the state failed state for state.
    case StateFailed = "failed"
// StateNetworkSourceDeleted specifies the state network source deleted state for state.
    case StateNetworkSourceDeleted = "networkSourceDeleted"
// StateProvisioning specifies the state provisioning state for state.
    case StateProvisioning = "provisioning"
// StateSucceeded specifies the state succeeded state for state.
    case StateSucceeded = "succeeded"
}


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

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

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

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

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

extension DataFactory {
  public static func createStorageAccountCheckNameAvailabilityParametersProtocol(name: String, type: String) -> StorageAccountCheckNameAvailabilityParametersProtocol {
    return StorageAccountCheckNameAvailabilityParametersData(name: name, type: 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.
import Foundation
import azureSwiftRuntime
internal struct StorageAccountCreateParametersData : StorageAccountCreateParametersProtocol {
    public var sku: SkuProtocol
    public var kind: KindEnum
    public var location: String
    public var tags: [String:String]?
    public var identity: IdentityProtocol?
    public var properties: StorageAccountPropertiesCreateParametersProtocol?

        enum CodingKeys: String, CodingKey {case sku = "sku"
        case kind = "kind"
        case location = "location"
        case tags = "tags"
        case identity = "identity"
        case properties = "properties"
        }

  public init(sku: SkuProtocol, kind: KindEnum, location: String)  {
    self.sku = sku
    self.kind = kind
    self.location = location
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.sku = try container.decode(SkuData.self, forKey: .sku)
    self.kind = try container.decode(KindEnum.self, forKey: .kind)
    self.location = try container.decode(String.self, forKey: .location)
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.identity) {
        self.identity = try container.decode(IdentityData?.self, forKey: .identity)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(StorageAccountPropertiesCreateParametersData?.self, forKey: .properties)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.sku as! SkuData, forKey: .sku)
    try container.encode(self.kind, forKey: .kind)
    try container.encode(self.location, forKey: .location)
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.identity != nil {try container.encode(self.identity as! IdentityData?, forKey: .identity)}
    if self.properties != nil {try container.encode(self.properties as! StorageAccountPropertiesCreateParametersData?, forKey: .properties)}
  }
}

extension DataFactory {
  public static func createStorageAccountCreateParametersProtocol(sku: SkuProtocol, kind: KindEnum, location: String) -> StorageAccountCreateParametersProtocol {
    return StorageAccountCreateParametersData(sku: sku, kind: kind, 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 StorageAccountData : StorageAccountProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var sku: SkuProtocol?
    public var kind: KindEnum?
    public var identity: IdentityProtocol?
    public var properties: StorageAccountPropertiesProtocol?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createStorageAccountProtocol() -> StorageAccountProtocol {
    return StorageAccountData()
  }
}


// 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 StorageAccountKeyData : StorageAccountKeyProtocol {
    public var keyName: String?
    public var value: String?
    public var permissions: KeyPermissionEnum?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createStorageAccountKeyProtocol() -> StorageAccountKeyProtocol {
    return StorageAccountKeyData()
  }
}


// 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 StorageAccountListKeysResultData : StorageAccountListKeysResultProtocol {
    public var keys: [StorageAccountKeyProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createStorageAccountListKeysResultProtocol() -> StorageAccountListKeysResultProtocol {
    return StorageAccountListKeysResultData()
  }
}


// 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 StorageAccountListResultData : StorageAccountListResultProtocol {
    public var value: [StorageAccountProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createStorageAccountListResultProtocol() -> StorageAccountListResultProtocol {
    return StorageAccountListResultData()
  }
}


// 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 StorageAccountPropertiesCreateParametersData : StorageAccountPropertiesCreateParametersProtocol {
    public var customDomain: CustomDomainProtocol?
    public var encryption: EncryptionProtocol?
    public var networkRuleSet: NetworkRuleSetProtocol?
    public var accessTier: AccessTierEnum?
    public var enableHttpsTrafficOnly: Bool?

        enum CodingKeys: String, CodingKey {case customDomain = "customDomain"
        case encryption = "encryption"
        case networkRuleSet = "networkAcls"
        case accessTier = "accessTier"
        case enableHttpsTrafficOnly = "supportsHttpsTrafficOnly"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.customDomain) {
        self.customDomain = try container.decode(CustomDomainData?.self, forKey: .customDomain)
    }
    if container.contains(.encryption) {
        self.encryption = try container.decode(EncryptionData?.self, forKey: .encryption)
    }
    if container.contains(.networkRuleSet) {
        self.networkRuleSet = try container.decode(NetworkRuleSetData?.self, forKey: .networkRuleSet)
    }
    if container.contains(.accessTier) {
        self.accessTier = try container.decode(AccessTierEnum?.self, forKey: .accessTier)
    }
    if container.contains(.enableHttpsTrafficOnly) {
        self.enableHttpsTrafficOnly = try container.decode(Bool?.self, forKey: .enableHttpsTrafficOnly)
    }
    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.customDomain != nil {try container.encode(self.customDomain as! CustomDomainData?, forKey: .customDomain)}
    if self.encryption != nil {try container.encode(self.encryption as! EncryptionData?, forKey: .encryption)}
    if self.networkRuleSet != nil {try container.encode(self.networkRuleSet as! NetworkRuleSetData?, forKey: .networkRuleSet)}
    if self.accessTier != nil {try container.encode(self.accessTier, forKey: .accessTier)}
    if self.enableHttpsTrafficOnly != nil {try container.encode(self.enableHttpsTrafficOnly, forKey: .enableHttpsTrafficOnly)}
  }
}

extension DataFactory {
  public static func createStorageAccountPropertiesCreateParametersProtocol() -> StorageAccountPropertiesCreateParametersProtocol {
    return StorageAccountPropertiesCreateParametersData()
  }
}


// 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 StorageAccountPropertiesData : StorageAccountPropertiesProtocol {
    public var provisioningState: ProvisioningStateEnum?
    public var primaryEndpoints: EndpointsProtocol?
    public var primaryLocation: String?
    public var statusOfPrimary: AccountStatusEnum?
    public var lastGeoFailoverTime: Date?
    public var secondaryLocation: String?
    public var statusOfSecondary: AccountStatusEnum?
    public var creationTime: Date?
    public var customDomain: CustomDomainProtocol?
    public var secondaryEndpoints: EndpointsProtocol?
    public var encryption: EncryptionProtocol?
    public var accessTier: AccessTierEnum?
    public var enableHttpsTrafficOnly: Bool?
    public var networkRuleSet: NetworkRuleSetProtocol?

        enum CodingKeys: String, CodingKey {case provisioningState = "provisioningState"
        case primaryEndpoints = "primaryEndpoints"
        case primaryLocation = "primaryLocation"
        case statusOfPrimary = "statusOfPrimary"
        case lastGeoFailoverTime = "lastGeoFailoverTime"
        case secondaryLocation = "secondaryLocation"
        case statusOfSecondary = "statusOfSecondary"
        case creationTime = "creationTime"
        case customDomain = "customDomain"
        case secondaryEndpoints = "secondaryEndpoints"
        case encryption = "encryption"
        case accessTier = "accessTier"
        case enableHttpsTrafficOnly = "supportsHttpsTrafficOnly"
        case networkRuleSet = "networkAcls"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(ProvisioningStateEnum?.self, forKey: .provisioningState)
    }
    if container.contains(.primaryEndpoints) {
        self.primaryEndpoints = try container.decode(EndpointsData?.self, forKey: .primaryEndpoints)
    }
    if container.contains(.primaryLocation) {
        self.primaryLocation = try container.decode(String?.self, forKey: .primaryLocation)
    }
    if container.contains(.statusOfPrimary) {
        self.statusOfPrimary = try container.decode(AccountStatusEnum?.self, forKey: .statusOfPrimary)
    }
    if container.contains(.lastGeoFailoverTime) {
        self.lastGeoFailoverTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastGeoFailoverTime)), format: .dateTime)
    }
    if container.contains(.secondaryLocation) {
        self.secondaryLocation = try container.decode(String?.self, forKey: .secondaryLocation)
    }
    if container.contains(.statusOfSecondary) {
        self.statusOfSecondary = try container.decode(AccountStatusEnum?.self, forKey: .statusOfSecondary)
    }
    if container.contains(.creationTime) {
        self.creationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationTime)), format: .dateTime)
    }
    if container.contains(.customDomain) {
        self.customDomain = try container.decode(CustomDomainData?.self, forKey: .customDomain)
    }
    if container.contains(.secondaryEndpoints) {
        self.secondaryEndpoints = try container.decode(EndpointsData?.self, forKey: .secondaryEndpoints)
    }
    if container.contains(.encryption) {
        self.encryption = try container.decode(EncryptionData?.self, forKey: .encryption)
    }
    if container.contains(.accessTier) {
        self.accessTier = try container.decode(AccessTierEnum?.self, forKey: .accessTier)
    }
    if container.contains(.enableHttpsTrafficOnly) {
        self.enableHttpsTrafficOnly = try container.decode(Bool?.self, forKey: .enableHttpsTrafficOnly)
    }
    if container.contains(.networkRuleSet) {
        self.networkRuleSet = try container.decode(NetworkRuleSetData?.self, forKey: .networkRuleSet)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.primaryEndpoints != nil {try container.encode(self.primaryEndpoints as! EndpointsData?, forKey: .primaryEndpoints)}
    if self.primaryLocation != nil {try container.encode(self.primaryLocation, forKey: .primaryLocation)}
    if self.statusOfPrimary != nil {try container.encode(self.statusOfPrimary, forKey: .statusOfPrimary)}
    if self.lastGeoFailoverTime != nil {
        try container.encode(DateConverter.toString(date: self.lastGeoFailoverTime!, format: .dateTime), forKey: .lastGeoFailoverTime)
    }
    if self.secondaryLocation != nil {try container.encode(self.secondaryLocation, forKey: .secondaryLocation)}
    if self.statusOfSecondary != nil {try container.encode(self.statusOfSecondary, forKey: .statusOfSecondary)}
    if self.creationTime != nil {
        try container.encode(DateConverter.toString(date: self.creationTime!, format: .dateTime), forKey: .creationTime)
    }
    if self.customDomain != nil {try container.encode(self.customDomain as! CustomDomainData?, forKey: .customDomain)}
    if self.secondaryEndpoints != nil {try container.encode(self.secondaryEndpoints as! EndpointsData?, forKey: .secondaryEndpoints)}
    if self.encryption != nil {try container.encode(self.encryption as! EncryptionData?, forKey: .encryption)}
    if self.accessTier != nil {try container.encode(self.accessTier, forKey: .accessTier)}
    if self.enableHttpsTrafficOnly != nil {try container.encode(self.enableHttpsTrafficOnly, forKey: .enableHttpsTrafficOnly)}
    if self.networkRuleSet != nil {try container.encode(self.networkRuleSet as! NetworkRuleSetData?, forKey: .networkRuleSet)}
  }
}

extension DataFactory {
  public static func createStorageAccountPropertiesProtocol() -> StorageAccountPropertiesProtocol {
    return StorageAccountPropertiesData()
  }
}


// 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 StorageAccountPropertiesUpdateParametersData : StorageAccountPropertiesUpdateParametersProtocol {
    public var customDomain: CustomDomainProtocol?
    public var encryption: EncryptionProtocol?
    public var accessTier: AccessTierEnum?
    public var enableHttpsTrafficOnly: Bool?
    public var networkRuleSet: NetworkRuleSetProtocol?

        enum CodingKeys: String, CodingKey {case customDomain = "customDomain"
        case encryption = "encryption"
        case accessTier = "accessTier"
        case enableHttpsTrafficOnly = "supportsHttpsTrafficOnly"
        case networkRuleSet = "networkAcls"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.customDomain) {
        self.customDomain = try container.decode(CustomDomainData?.self, forKey: .customDomain)
    }
    if container.contains(.encryption) {
        self.encryption = try container.decode(EncryptionData?.self, forKey: .encryption)
    }
    if container.contains(.accessTier) {
        self.accessTier = try container.decode(AccessTierEnum?.self, forKey: .accessTier)
    }
    if container.contains(.enableHttpsTrafficOnly) {
        self.enableHttpsTrafficOnly = try container.decode(Bool?.self, forKey: .enableHttpsTrafficOnly)
    }
    if container.contains(.networkRuleSet) {
        self.networkRuleSet = try container.decode(NetworkRuleSetData?.self, forKey: .networkRuleSet)
    }
    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.customDomain != nil {try container.encode(self.customDomain as! CustomDomainData?, forKey: .customDomain)}
    if self.encryption != nil {try container.encode(self.encryption as! EncryptionData?, forKey: .encryption)}
    if self.accessTier != nil {try container.encode(self.accessTier, forKey: .accessTier)}
    if self.enableHttpsTrafficOnly != nil {try container.encode(self.enableHttpsTrafficOnly, forKey: .enableHttpsTrafficOnly)}
    if self.networkRuleSet != nil {try container.encode(self.networkRuleSet as! NetworkRuleSetData?, forKey: .networkRuleSet)}
  }
}

extension DataFactory {
  public static func createStorageAccountPropertiesUpdateParametersProtocol() -> StorageAccountPropertiesUpdateParametersProtocol {
    return StorageAccountPropertiesUpdateParametersData()
  }
}


// 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 StorageAccountRegenerateKeyParametersData : StorageAccountRegenerateKeyParametersProtocol {
    public var keyName: String

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

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

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

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

extension DataFactory {
  public static func createStorageAccountRegenerateKeyParametersProtocol(keyName: String) -> StorageAccountRegenerateKeyParametersProtocol {
    return StorageAccountRegenerateKeyParametersData(keyName: keyName)
  }
}


// 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 StorageAccountUpdateParametersData : StorageAccountUpdateParametersProtocol {
    public var sku: SkuProtocol?
    public var tags: [String:String]?
    public var identity: IdentityProtocol?
    public var properties: StorageAccountPropertiesUpdateParametersProtocol?
    public var kind: KindEnum?

        enum CodingKeys: String, CodingKey {case sku = "sku"
        case tags = "tags"
        case identity = "identity"
        case properties = "properties"
        case kind = "kind"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.sku) {
        self.sku = try container.decode(SkuData?.self, forKey: .sku)
    }
    if container.contains(.tags) {
        self.tags = try container.decode([String:String]?.self, forKey: .tags)
    }
    if container.contains(.identity) {
        self.identity = try container.decode(IdentityData?.self, forKey: .identity)
    }
    if container.contains(.properties) {
        self.properties = try container.decode(StorageAccountPropertiesUpdateParametersData?.self, forKey: .properties)
    }
    if container.contains(.kind) {
        self.kind = try container.decode(KindEnum?.self, forKey: .kind)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.sku != nil {try container.encode(self.sku as! SkuData?, forKey: .sku)}
    if self.tags != nil {try container.encode(self.tags, forKey: .tags)}
    if self.identity != nil {try container.encode(self.identity as! IdentityData?, forKey: .identity)}
    if self.properties != nil {try container.encode(self.properties as! StorageAccountPropertiesUpdateParametersData?, forKey: .properties)}
    if self.kind != nil {try container.encode(self.kind, forKey: .kind)}
  }
}

extension DataFactory {
  public static func createStorageAccountUpdateParametersProtocol() -> StorageAccountUpdateParametersProtocol {
    return StorageAccountUpdateParametersData()
  }
}


// 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 StorageSkuListResultData : StorageSkuListResultProtocol {
    public var value: [SkuProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createStorageSkuListResultProtocol() -> StorageSkuListResultProtocol {
    return StorageSkuListResultData()
  }
}