// Copyright (c) Microsoft Corporation. All rights 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 CostThresholdPropertiesData : CostThresholdPropertiesProtocol {
    public var thresholdId: String?
    public var percentageThreshold: PercentageCostThresholdPropertiesProtocol?
    public var displayOnChart: CostThresholdStatusEnum?
    public var sendNotificationWhenExceeded: CostThresholdStatusEnum?
    public var notificationSent: String?

        enum CodingKeys: String, CodingKey {case thresholdId = "thresholdId"
        case percentageThreshold = "percentageThreshold"
        case displayOnChart = "displayOnChart"
        case sendNotificationWhenExceeded = "sendNotificationWhenExceeded"
        case notificationSent = "notificationSent"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createCostThresholdPropertiesProtocol() -> CostThresholdPropertiesProtocol {
    return CostThresholdPropertiesData()
  }
}


// CostThresholdStatus enumerates the values for cost threshold 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 CostThresholdStatusEnum: String, Codable
{
// Disabled specifies the disabled state for cost threshold status.
    case Disabled = "Disabled"
// Enabled specifies the enabled state for cost threshold status.
    case Enabled = "Enabled"
}


// CostType enumerates the values for cost type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum CostTypeEnum: String, Codable
{
// Projected specifies the projected state for cost type.
    case Projected = "Projected"
// Reported specifies the reported state for cost type.
    case Reported = "Reported"
// Unavailable specifies the unavailable state for cost type.
    case Unavailable = "Unavailable"
}


// Copyright (c) Microsoft Corporation. All rights 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 CustomImageData : CustomImageProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: CustomImagePropertiesProtocol

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

  public init(properties: CustomImagePropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(CustomImagePropertiesData.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)}
    try container.encode(self.properties as! CustomImagePropertiesData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createCustomImageProtocol(properties: CustomImagePropertiesProtocol) -> CustomImageProtocol {
    return CustomImageData(properties: properties)
  }
}


// CustomImageOsType enumerates the values for custom image os type.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum CustomImageOsTypeEnum: String, Codable
{
// Linux specifies the linux state for custom image os type.
    case Linux = "Linux"
// None specifies the none state for custom image os type.
    case None = "None"
// Windows specifies the windows state for custom image os type.
    case Windows = "Windows"
}


// Copyright (c) Microsoft Corporation. All rights 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 CustomImagePropertiesCustomData : CustomImagePropertiesCustomProtocol {
    public var imageName: String?
    public var sysPrep: Bool?
    public var osType: CustomImageOsTypeEnum

        enum CodingKeys: String, CodingKey {case imageName = "imageName"
        case sysPrep = "sysPrep"
        case osType = "osType"
        }

  public init(osType: CustomImageOsTypeEnum)  {
    self.osType = osType
  }

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

extension DataFactory {
  public static func createCustomImagePropertiesCustomProtocol(osType: CustomImageOsTypeEnum) -> CustomImagePropertiesCustomProtocol {
    return CustomImagePropertiesCustomData(osType: osType)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 CustomImagePropertiesData : CustomImagePropertiesProtocol {
    public var vm: CustomImagePropertiesFromVmProtocol?
    public var vhd: CustomImagePropertiesCustomProtocol?
    public var description: String?
    public var author: String?
    public var creationDate: Date?
    public var managedImageId: String?
    public var provisioningState: String?
    public var uniqueIdentifier: String?

        enum CodingKeys: String, CodingKey {case vm = "vm"
        case vhd = "vhd"
        case description = "description"
        case author = "author"
        case creationDate = "creationDate"
        case managedImageId = "managedImageId"
        case provisioningState = "provisioningState"
        case uniqueIdentifier = "uniqueIdentifier"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.vm) {
        self.vm = try container.decode(CustomImagePropertiesFromVmData?.self, forKey: .vm)
    }
    if container.contains(.vhd) {
        self.vhd = try container.decode(CustomImagePropertiesCustomData?.self, forKey: .vhd)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.author) {
        self.author = try container.decode(String?.self, forKey: .author)
    }
    if container.contains(.creationDate) {
        self.creationDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationDate)), format: .dateTime)
    }
    if container.contains(.managedImageId) {
        self.managedImageId = try container.decode(String?.self, forKey: .managedImageId)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.uniqueIdentifier) {
        self.uniqueIdentifier = try container.decode(String?.self, forKey: .uniqueIdentifier)
    }
    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.vm != nil {try container.encode(self.vm as! CustomImagePropertiesFromVmData?, forKey: .vm)}
    if self.vhd != nil {try container.encode(self.vhd as! CustomImagePropertiesCustomData?, forKey: .vhd)}
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.author != nil {try container.encode(self.author, forKey: .author)}
    if self.creationDate != nil {
        try container.encode(DateConverter.toString(date: self.creationDate!, format: .dateTime), forKey: .creationDate)
    }
    if self.managedImageId != nil {try container.encode(self.managedImageId, forKey: .managedImageId)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.uniqueIdentifier != nil {try container.encode(self.uniqueIdentifier, forKey: .uniqueIdentifier)}
  }
}

extension DataFactory {
  public static func createCustomImagePropertiesProtocol() -> CustomImagePropertiesProtocol {
    return CustomImagePropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 CustomImagePropertiesFromVmData : CustomImagePropertiesFromVmProtocol {
    public var sourceVmId: String?
    public var windowsOsInfo: WindowsOsInfoProtocol?
    public var linuxOsInfo: LinuxOsInfoProtocol?

        enum CodingKeys: String, CodingKey {case sourceVmId = "sourceVmId"
        case windowsOsInfo = "windowsOsInfo"
        case linuxOsInfo = "linuxOsInfo"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createCustomImagePropertiesFromVmProtocol() -> CustomImagePropertiesFromVmProtocol {
    return CustomImagePropertiesFromVmData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DataDiskPropertiesData : DataDiskPropertiesProtocol {
    public var attachNewDataDiskOptions: AttachNewDataDiskOptionsProtocol?
    public var existingLabDiskId: String?
    public var hostCaching: HostCachingOptionsEnum?

        enum CodingKeys: String, CodingKey {case attachNewDataDiskOptions = "attachNewDataDiskOptions"
        case existingLabDiskId = "existingLabDiskId"
        case hostCaching = "hostCaching"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createDataDiskPropertiesProtocol() -> DataDiskPropertiesProtocol {
    return DataDiskPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DayDetailsData : DayDetailsProtocol {
    public var time: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDayDetailsProtocol() -> DayDetailsProtocol {
    return DayDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DayDetailsFragmentData : DayDetailsFragmentProtocol {
    public var time: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDayDetailsFragmentProtocol() -> DayDetailsFragmentProtocol {
    return DayDetailsFragmentData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DetachDataDiskPropertiesData : DetachDataDiskPropertiesProtocol {
    public var existingLabDiskId: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDetachDataDiskPropertiesProtocol() -> DetachDataDiskPropertiesProtocol {
    return DetachDataDiskPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DetachDiskPropertiesData : DetachDiskPropertiesProtocol {
    public var leasedByLabVmId: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createDetachDiskPropertiesProtocol() -> DetachDiskPropertiesProtocol {
    return DetachDiskPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiskData : DiskProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: DiskPropertiesProtocol

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

  public init(properties: DiskPropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(DiskPropertiesData.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)}
    try container.encode(self.properties as! DiskPropertiesData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createDiskProtocol(properties: DiskPropertiesProtocol) -> DiskProtocol {
    return DiskData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DiskPropertiesData : DiskPropertiesProtocol {
    public var diskType: StorageTypeEnum?
    public var diskSizeGiB: Int32?
    public var leasedByLabVmId: String?
    public var diskBlobName: String?
    public var diskUri: String?
    public var createdDate: Date?
    public var hostCaching: String?
    public var managedDiskId: String?
    public var provisioningState: String?
    public var uniqueIdentifier: String?

        enum CodingKeys: String, CodingKey {case diskType = "diskType"
        case diskSizeGiB = "diskSizeGiB"
        case leasedByLabVmId = "leasedByLabVmId"
        case diskBlobName = "diskBlobName"
        case diskUri = "diskUri"
        case createdDate = "createdDate"
        case hostCaching = "hostCaching"
        case managedDiskId = "managedDiskId"
        case provisioningState = "provisioningState"
        case uniqueIdentifier = "uniqueIdentifier"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.diskType) {
        self.diskType = try container.decode(StorageTypeEnum?.self, forKey: .diskType)
    }
    if container.contains(.diskSizeGiB) {
        self.diskSizeGiB = try container.decode(Int32?.self, forKey: .diskSizeGiB)
    }
    if container.contains(.leasedByLabVmId) {
        self.leasedByLabVmId = try container.decode(String?.self, forKey: .leasedByLabVmId)
    }
    if container.contains(.diskBlobName) {
        self.diskBlobName = try container.decode(String?.self, forKey: .diskBlobName)
    }
    if container.contains(.diskUri) {
        self.diskUri = try container.decode(String?.self, forKey: .diskUri)
    }
    if container.contains(.createdDate) {
        self.createdDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdDate)), format: .dateTime)
    }
    if container.contains(.hostCaching) {
        self.hostCaching = try container.decode(String?.self, forKey: .hostCaching)
    }
    if container.contains(.managedDiskId) {
        self.managedDiskId = try container.decode(String?.self, forKey: .managedDiskId)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.uniqueIdentifier) {
        self.uniqueIdentifier = try container.decode(String?.self, forKey: .uniqueIdentifier)
    }
    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.diskType != nil {try container.encode(self.diskType, forKey: .diskType)}
    if self.diskSizeGiB != nil {try container.encode(self.diskSizeGiB, forKey: .diskSizeGiB)}
    if self.leasedByLabVmId != nil {try container.encode(self.leasedByLabVmId, forKey: .leasedByLabVmId)}
    if self.diskBlobName != nil {try container.encode(self.diskBlobName, forKey: .diskBlobName)}
    if self.diskUri != nil {try container.encode(self.diskUri, forKey: .diskUri)}
    if self.createdDate != nil {
        try container.encode(DateConverter.toString(date: self.createdDate!, format: .dateTime), forKey: .createdDate)
    }
    if self.hostCaching != nil {try container.encode(self.hostCaching, forKey: .hostCaching)}
    if self.managedDiskId != nil {try container.encode(self.managedDiskId, forKey: .managedDiskId)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.uniqueIdentifier != nil {try container.encode(self.uniqueIdentifier, forKey: .uniqueIdentifier)}
  }
}

extension DataFactory {
  public static func createDiskPropertiesProtocol() -> DiskPropertiesProtocol {
    return DiskPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 DtlEnvironmentData : DtlEnvironmentProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: EnvironmentPropertiesProtocol

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

  public init(properties: EnvironmentPropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(EnvironmentPropertiesData.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)}
    try container.encode(self.properties as! EnvironmentPropertiesData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createDtlEnvironmentProtocol(properties: EnvironmentPropertiesProtocol) -> DtlEnvironmentProtocol {
    return DtlEnvironmentData(properties: properties)
  }
}


// EnableStatus enumerates the values for enable 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 EnableStatusEnum: String, Codable
{
// EnableStatusDisabled specifies the enable status disabled state for enable status.
    case EnableStatusDisabled = "Disabled"
// EnableStatusEnabled specifies the enable status enabled state for enable status.
    case EnableStatusEnabled = "Enabled"
}


// Copyright (c) Microsoft Corporation. All rights 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 EnvironmentDeploymentPropertiesData : EnvironmentDeploymentPropertiesProtocol {
    public var armTemplateId: String?
    public var parameters: [ArmTemplateParameterPropertiesProtocol?]?

        enum CodingKeys: String, CodingKey {case armTemplateId = "armTemplateId"
        case parameters = "parameters"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createEnvironmentDeploymentPropertiesProtocol() -> EnvironmentDeploymentPropertiesProtocol {
    return EnvironmentDeploymentPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EnvironmentPropertiesData : EnvironmentPropertiesProtocol {
    public var deploymentProperties: EnvironmentDeploymentPropertiesProtocol?
    public var armTemplateDisplayName: String?
    public var resourceGroupId: String?
    public var createdByUser: String?
    public var provisioningState: String?
    public var uniqueIdentifier: String?

        enum CodingKeys: String, CodingKey {case deploymentProperties = "deploymentProperties"
        case armTemplateDisplayName = "armTemplateDisplayName"
        case resourceGroupId = "resourceGroupId"
        case createdByUser = "createdByUser"
        case provisioningState = "provisioningState"
        case uniqueIdentifier = "uniqueIdentifier"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createEnvironmentPropertiesProtocol() -> EnvironmentPropertiesProtocol {
    return EnvironmentPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EvaluatePoliciesPropertiesData : EvaluatePoliciesPropertiesProtocol {
    public var factName: String?
    public var factData: String?
    public var valueOffset: String?

        enum CodingKeys: String, CodingKey {case factName = "factName"
        case factData = "factData"
        case valueOffset = "valueOffset"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createEvaluatePoliciesPropertiesProtocol() -> EvaluatePoliciesPropertiesProtocol {
    return EvaluatePoliciesPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EvaluatePoliciesRequestData : EvaluatePoliciesRequestProtocol {
    public var policies: [EvaluatePoliciesPropertiesProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createEvaluatePoliciesRequestProtocol() -> EvaluatePoliciesRequestProtocol {
    return EvaluatePoliciesRequestData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EvaluatePoliciesResponseData : EvaluatePoliciesResponseProtocol {
    public var results: [PolicySetResultProtocol?]?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createEvaluatePoliciesResponseProtocol() -> EvaluatePoliciesResponseProtocol {
    return EvaluatePoliciesResponseData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EventData : EventProtocol {
    public var eventName: NotificationChannelEventTypeEnum?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createEventProtocol() -> EventProtocol {
    return EventData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 EventFragmentData : EventFragmentProtocol {
    public var eventName: NotificationChannelEventTypeEnum?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createEventFragmentProtocol() -> EventFragmentProtocol {
    return EventFragmentData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ExportResourceUsageParametersData : ExportResourceUsageParametersProtocol {
    public var blobStorageAbsoluteSasUri: String?
    public var usageStartDate: Date?

        enum CodingKeys: String, CodingKey {case blobStorageAbsoluteSasUri = "blobStorageAbsoluteSasUri"
        case usageStartDate = "usageStartDate"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createExportResourceUsageParametersProtocol() -> ExportResourceUsageParametersProtocol {
    return ExportResourceUsageParametersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ExternalSubnetData : ExternalSubnetProtocol {
    public var id: String?
    public var name: String?

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

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

extension DataFactory {
  public static func createExternalSubnetProtocol() -> ExternalSubnetProtocol {
    return ExternalSubnetData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ExternalSubnetFragmentData : ExternalSubnetFragmentProtocol {
    public var id: String?
    public var name: String?

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

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

extension DataFactory {
  public static func createExternalSubnetFragmentProtocol() -> ExternalSubnetFragmentProtocol {
    return ExternalSubnetFragmentData()
  }
}


// FileUploadOptions enumerates the values for file upload options.

// Copyright (c) Microsoft Corporation. All rights 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 FileUploadOptionsEnum: String, Codable
{
// FileUploadOptionsNone specifies the file upload options none state for file upload options.
    case FileUploadOptionsNone = "None"
// FileUploadOptionsUploadFilesAndGenerateSasTokens specifies the file upload options upload files and generate sas
// tokens state for file upload options.
    case FileUploadOptionsUploadFilesAndGenerateSasTokens = "UploadFilesAndGenerateSasTokens"
}


// Copyright (c) Microsoft Corporation. All rights 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 FormulaData : FormulaProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: FormulaPropertiesProtocol

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

  public init(properties: FormulaPropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(FormulaPropertiesData.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)}
    try container.encode(self.properties as! FormulaPropertiesData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createFormulaProtocol(properties: FormulaPropertiesProtocol) -> FormulaProtocol {
    return FormulaData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FormulaPropertiesData : FormulaPropertiesProtocol {
    public var description: String?
    public var author: String?
    public var osType: String?
    public var creationDate: Date?
    public var formulaContent: LabVirtualMachineCreationParameterProtocol?
    public var vm: FormulaPropertiesFromVmProtocol?
    public var provisioningState: String?
    public var uniqueIdentifier: String?

        enum CodingKeys: String, CodingKey {case description = "description"
        case author = "author"
        case osType = "osType"
        case creationDate = "creationDate"
        case formulaContent = "formulaContent"
        case vm = "vm"
        case provisioningState = "provisioningState"
        case uniqueIdentifier = "uniqueIdentifier"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.author) {
        self.author = try container.decode(String?.self, forKey: .author)
    }
    if container.contains(.osType) {
        self.osType = try container.decode(String?.self, forKey: .osType)
    }
    if container.contains(.creationDate) {
        self.creationDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .creationDate)), format: .dateTime)
    }
    if container.contains(.formulaContent) {
        self.formulaContent = try container.decode(LabVirtualMachineCreationParameterData?.self, forKey: .formulaContent)
    }
    if container.contains(.vm) {
        self.vm = try container.decode(FormulaPropertiesFromVmData?.self, forKey: .vm)
    }
    if container.contains(.provisioningState) {
        self.provisioningState = try container.decode(String?.self, forKey: .provisioningState)
    }
    if container.contains(.uniqueIdentifier) {
        self.uniqueIdentifier = try container.decode(String?.self, forKey: .uniqueIdentifier)
    }
    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.description != nil {try container.encode(self.description, forKey: .description)}
    if self.author != nil {try container.encode(self.author, forKey: .author)}
    if self.osType != nil {try container.encode(self.osType, forKey: .osType)}
    if self.creationDate != nil {
        try container.encode(DateConverter.toString(date: self.creationDate!, format: .dateTime), forKey: .creationDate)
    }
    if self.formulaContent != nil {try container.encode(self.formulaContent as! LabVirtualMachineCreationParameterData?, forKey: .formulaContent)}
    if self.vm != nil {try container.encode(self.vm as! FormulaPropertiesFromVmData?, forKey: .vm)}
    if self.provisioningState != nil {try container.encode(self.provisioningState, forKey: .provisioningState)}
    if self.uniqueIdentifier != nil {try container.encode(self.uniqueIdentifier, forKey: .uniqueIdentifier)}
  }
}

extension DataFactory {
  public static func createFormulaPropertiesProtocol() -> FormulaPropertiesProtocol {
    return FormulaPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FormulaPropertiesFromVmData : FormulaPropertiesFromVmProtocol {
    public var labVmId: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createFormulaPropertiesFromVmProtocol() -> FormulaPropertiesFromVmProtocol {
    return FormulaPropertiesFromVmData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 GalleryImageData : GalleryImageProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: GalleryImagePropertiesProtocol

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

  public init(properties: GalleryImagePropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(GalleryImagePropertiesData.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)}
    try container.encode(self.properties as! GalleryImagePropertiesData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createGalleryImageProtocol(properties: GalleryImagePropertiesProtocol) -> GalleryImageProtocol {
    return GalleryImageData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 GalleryImagePropertiesData : GalleryImagePropertiesProtocol {
    public var author: String?
    public var createdDate: Date?
    public var description: String?
    public var imageReference: GalleryImageReferenceProtocol?
    public var icon: String?
    public var enabled: Bool?

        enum CodingKeys: String, CodingKey {case author = "author"
        case createdDate = "createdDate"
        case description = "description"
        case imageReference = "imageReference"
        case icon = "icon"
        case enabled = "enabled"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.author) {
        self.author = try container.decode(String?.self, forKey: .author)
    }
    if container.contains(.createdDate) {
        self.createdDate = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .createdDate)), format: .dateTime)
    }
    if container.contains(.description) {
        self.description = try container.decode(String?.self, forKey: .description)
    }
    if container.contains(.imageReference) {
        self.imageReference = try container.decode(GalleryImageReferenceData?.self, forKey: .imageReference)
    }
    if container.contains(.icon) {
        self.icon = try container.decode(String?.self, forKey: .icon)
    }
    if container.contains(.enabled) {
        self.enabled = try container.decode(Bool?.self, forKey: .enabled)
    }
    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.author != nil {try container.encode(self.author, forKey: .author)}
    if self.createdDate != nil {
        try container.encode(DateConverter.toString(date: self.createdDate!, format: .dateTime), forKey: .createdDate)
    }
    if self.description != nil {try container.encode(self.description, forKey: .description)}
    if self.imageReference != nil {try container.encode(self.imageReference as! GalleryImageReferenceData?, forKey: .imageReference)}
    if self.icon != nil {try container.encode(self.icon, forKey: .icon)}
    if self.enabled != nil {try container.encode(self.enabled, forKey: .enabled)}
  }
}

extension DataFactory {
  public static func createGalleryImagePropertiesProtocol() -> GalleryImagePropertiesProtocol {
    return GalleryImagePropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 GalleryImageReferenceData : GalleryImageReferenceProtocol {
    public var offer: String?
    public var publisher: String?
    public var sku: String?
    public var osType: String?
    public var version: String?

        enum CodingKeys: String, CodingKey {case offer = "offer"
        case publisher = "publisher"
        case sku = "sku"
        case osType = "osType"
        case version = "version"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createGalleryImageReferenceProtocol() -> GalleryImageReferenceProtocol {
    return GalleryImageReferenceData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 GalleryImageReferenceFragmentData : GalleryImageReferenceFragmentProtocol {
    public var offer: String?
    public var publisher: String?
    public var sku: String?
    public var osType: String?
    public var version: String?

        enum CodingKeys: String, CodingKey {case offer = "offer"
        case publisher = "publisher"
        case sku = "sku"
        case osType = "osType"
        case version = "version"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createGalleryImageReferenceFragmentProtocol() -> GalleryImageReferenceFragmentProtocol {
    return GalleryImageReferenceFragmentData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 GenerateArmTemplateRequestData : GenerateArmTemplateRequestProtocol {
    public var virtualMachineName: String?
    public var parameters: [ParameterInfoProtocol?]?
    public var location: String?
    public var fileUploadOptions: FileUploadOptionsEnum?

        enum CodingKeys: String, CodingKey {case virtualMachineName = "virtualMachineName"
        case parameters = "parameters"
        case location = "location"
        case fileUploadOptions = "fileUploadOptions"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createGenerateArmTemplateRequestProtocol() -> GenerateArmTemplateRequestProtocol {
    return GenerateArmTemplateRequestData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 GenerateUploadUriParameterData : GenerateUploadUriParameterProtocol {
    public var blobName: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createGenerateUploadUriParameterProtocol() -> GenerateUploadUriParameterProtocol {
    return GenerateUploadUriParameterData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 GenerateUploadUriResponseData : GenerateUploadUriResponseProtocol {
    public var uploadUri: String?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createGenerateUploadUriResponseProtocol() -> GenerateUploadUriResponseProtocol {
    return GenerateUploadUriResponseData()
  }
}


// HostCachingOptions enumerates the values for host caching options.

// Copyright (c) Microsoft Corporation. All rights 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 HostCachingOptionsEnum: String, Codable
{
// HostCachingOptionsNone specifies the host caching options none state for host caching options.
    case HostCachingOptionsNone = "None"
// HostCachingOptionsReadOnly specifies the host caching options read only state for host caching options.
    case HostCachingOptionsReadOnly = "ReadOnly"
// HostCachingOptionsReadWrite specifies the host caching options read write state for host caching options.
    case HostCachingOptionsReadWrite = "ReadWrite"
}


// Copyright (c) Microsoft Corporation. All rights 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 HourDetailsData : HourDetailsProtocol {
    public var minute: Int32?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createHourDetailsProtocol() -> HourDetailsProtocol {
    return HourDetailsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 HourDetailsFragmentData : HourDetailsFragmentProtocol {
    public var minute: Int32?

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

  public init()  {
  }

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

extension DataFactory {
  public static func createHourDetailsFragmentProtocol() -> HourDetailsFragmentProtocol {
    return HourDetailsFragmentData()
  }
}


// HttpStatusCode enumerates the values for http status 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 HttpStatusCodeEnum: String, Codable
{
// Accepted specifies the accepted state for http status code.
    case Accepted = "Accepted"
// BadGateway specifies the bad gateway state for http status code.
    case BadGateway = "BadGateway"
// BadRequest specifies the bad request state for http status code.
    case BadRequest = "BadRequest"
// Conflict specifies the conflict state for http status code.
    case Conflict = "Conflict"
// Continue specifies the continue state for http status code.
    case Continue = "Continue"
// Created specifies the created state for http status code.
    case Created = "Created"
// ExpectationFailed specifies the expectation failed state for http status code.
    case ExpectationFailed = "ExpectationFailed"
// Forbidden specifies the forbidden state for http status code.
    case Forbidden = "Forbidden"
// GatewayTimeout specifies the gateway timeout state for http status code.
    case GatewayTimeout = "GatewayTimeout"
// Gone specifies the gone state for http status code.
    case Gone = "Gone"
// HttpVersionNotSupported specifies the http version not supported state for http status code.
    case HttpVersionNotSupported = "HttpVersionNotSupported"
// InternalServerError specifies the internal server error state for http status code.
    case InternalServerError = "InternalServerError"
// LengthRequired specifies the length required state for http status code.
    case LengthRequired = "LengthRequired"
// MethodNotAllowed specifies the method not allowed state for http status code.
    case MethodNotAllowed = "MethodNotAllowed"
// MovedPermanently specifies the moved permanently state for http status code.
    case MovedPermanently = "MovedPermanently"
// MultipleChoices specifies the multiple choices state for http status code.
    case MultipleChoices = "MultipleChoices"
// NoContent specifies the no content state for http status code.
    case NoContent = "NoContent"
// NonAuthoritativeInformation specifies the non authoritative information state for http status code.
    case NonAuthoritativeInformation = "NonAuthoritativeInformation"
// NotAcceptable specifies the not acceptable state for http status code.
    case NotAcceptable = "NotAcceptable"
// NotFound specifies the not found state for http status code.
    case NotFound = "NotFound"
// NotImplemented specifies the not implemented state for http status code.
    case NotImplemented = "NotImplemented"
// NotModified specifies the not modified state for http status code.
    case NotModified = "NotModified"
// OK specifies the ok state for http status code.
    case OK = "OK"
// PartialContent specifies the partial content state for http status code.
    case PartialContent = "PartialContent"
// PaymentRequired specifies the payment required state for http status code.
    case PaymentRequired = "PaymentRequired"
// PreconditionFailed specifies the precondition failed state for http status code.
    case PreconditionFailed = "PreconditionFailed"
// ProxyAuthenticationRequired specifies the proxy authentication required state for http status code.
    case ProxyAuthenticationRequired = "ProxyAuthenticationRequired"
// Redirect specifies the redirect state for http status code.
    case Redirect = "Redirect"
// RequestedRangeNotSatisfiable specifies the requested range not satisfiable state for http status code.
    case RequestedRangeNotSatisfiable = "RequestedRangeNotSatisfiable"
// RequestEntityTooLarge specifies the request entity too large state for http status code.
    case RequestEntityTooLarge = "RequestEntityTooLarge"
// RequestTimeout specifies the request timeout state for http status code.
    case RequestTimeout = "RequestTimeout"
// RequestUriTooLong specifies the request uri too long state for http status code.
    case RequestUriTooLong = "RequestUriTooLong"
// ResetContent specifies the reset content state for http status code.
    case ResetContent = "ResetContent"
// SeeOther specifies the see other state for http status code.
    case SeeOther = "SeeOther"
// ServiceUnavailable specifies the service unavailable state for http status code.
    case ServiceUnavailable = "ServiceUnavailable"
// SwitchingProtocols specifies the switching protocols state for http status code.
    case SwitchingProtocols = "SwitchingProtocols"
// TemporaryRedirect specifies the temporary redirect state for http status code.
    case TemporaryRedirect = "TemporaryRedirect"
// Unauthorized specifies the unauthorized state for http status code.
    case Unauthorized = "Unauthorized"
// UnsupportedMediaType specifies the unsupported media type state for http status code.
    case UnsupportedMediaType = "UnsupportedMediaType"
// Unused specifies the unused state for http status code.
    case Unused = "Unused"
// UpgradeRequired specifies the upgrade required state for http status code.
    case UpgradeRequired = "UpgradeRequired"
// UseProxy specifies the use proxy state for http status code.
    case UseProxy = "UseProxy"
}


// Copyright (c) Microsoft Corporation. All rights 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 IdentityPropertiesData : IdentityPropertiesProtocol {
    public var type: String?
    public var principalId: String?
    public var tenantId: String?
    public var clientSecretUrl: String?

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

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

extension DataFactory {
  public static func createIdentityPropertiesProtocol() -> IdentityPropertiesProtocol {
    return IdentityPropertiesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 InboundNatRuleData : InboundNatRuleProtocol {
    public var transportProtocol: TransportProtocolEnum?
    public var frontendPort: Int32?
    public var backendPort: Int32?

        enum CodingKeys: String, CodingKey {case transportProtocol = "transportProtocol"
        case frontendPort = "frontendPort"
        case backendPort = "backendPort"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInboundNatRuleProtocol() -> InboundNatRuleProtocol {
    return InboundNatRuleData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 InboundNatRuleFragmentData : InboundNatRuleFragmentProtocol {
    public var transportProtocol: TransportProtocolEnum?
    public var frontendPort: Int32?
    public var backendPort: Int32?

        enum CodingKeys: String, CodingKey {case transportProtocol = "transportProtocol"
        case frontendPort = "frontendPort"
        case backendPort = "backendPort"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createInboundNatRuleFragmentProtocol() -> InboundNatRuleFragmentProtocol {
    return InboundNatRuleFragmentData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 LabCostData : LabCostProtocol, ResourceProtocol {
    public var id: String?
    public var name: String?
    public var type: String?
    public var location: String?
    public var tags: [String:String]?
    public var properties: LabCostPropertiesProtocol

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

  public init(properties: LabCostPropertiesProtocol)  {
    self.properties = properties
  }

  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)
    }
    self.properties = try container.decode(LabCostPropertiesData.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)}
    try container.encode(self.properties as! LabCostPropertiesData, forKey: .properties)
  }
}

extension DataFactory {
  public static func createLabCostProtocol(properties: LabCostPropertiesProtocol) -> LabCostProtocol {
    return LabCostData(properties: properties)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 LabCostDetailsPropertiesData : LabCostDetailsPropertiesProtocol {
    public var date: Date?
    public var cost: Double?
    public var costType: CostTypeEnum?

        enum CodingKeys: String, CodingKey {case date = "date"
        case cost = "cost"
        case costType = "costType"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createLabCostDetailsPropertiesProtocol() -> LabCostDetailsPropertiesProtocol {
    return LabCostDetailsPropertiesData()
  }
}