// Copyright (c) Microsoft Corporation. All rights 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 PoolUpdatePropertiesHeadersData : PoolUpdatePropertiesHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?
    public var dataServiceId: String?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case dataServiceId = "DataServiceId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPoolUpdatePropertiesHeadersProtocol() -> PoolUpdatePropertiesHeadersProtocol {
    return PoolUpdatePropertiesHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 PoolUpdatePropertiesParameterData : PoolUpdatePropertiesParameterProtocol {
    public var startTask: StartTaskProtocol?
    public var certificateReferences: [CertificateReferenceProtocol]
    public var applicationPackageReferences: [ApplicationPackageReferenceProtocol]
    public var metadata: [MetadataItemProtocol]

        enum CodingKeys: String, CodingKey {case startTask = "startTask"
        case certificateReferences = "certificateReferences"
        case applicationPackageReferences = "applicationPackageReferences"
        case metadata = "metadata"
        }

  public init(certificateReferences: [CertificateReferenceProtocol], applicationPackageReferences: [ApplicationPackageReferenceProtocol], metadata: [MetadataItemProtocol])  {
    self.certificateReferences = certificateReferences
    self.applicationPackageReferences = applicationPackageReferences
    self.metadata = metadata
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTask) {
        self.startTask = try container.decode(StartTaskData?.self, forKey: .startTask)
    }
    self.certificateReferences = try container.decode([CertificateReferenceData].self, forKey: .certificateReferences)
    self.applicationPackageReferences = try container.decode([ApplicationPackageReferenceData].self, forKey: .applicationPackageReferences)
    self.metadata = try container.decode([MetadataItemData].self, forKey: .metadata)
    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.startTask != nil {try container.encode(self.startTask as! StartTaskData?, forKey: .startTask)}
    try container.encode(self.certificateReferences as! [CertificateReferenceData], forKey: .certificateReferences)
    try container.encode(self.applicationPackageReferences as! [ApplicationPackageReferenceData], forKey: .applicationPackageReferences)
    try container.encode(self.metadata as! [MetadataItemData], forKey: .metadata)
  }
}

extension DataFactory {
  public static func createPoolUpdatePropertiesParameterProtocol(certificateReferences: [CertificateReferenceProtocol], applicationPackageReferences: [ApplicationPackageReferenceProtocol], metadata: [MetadataItemProtocol]) -> PoolUpdatePropertiesParameterProtocol {
    return PoolUpdatePropertiesParameterData(certificateReferences: certificateReferences, applicationPackageReferences: applicationPackageReferences, metadata: metadata)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 PoolUpgradeOSHeadersData : PoolUpgradeOSHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?
    public var dataServiceId: String?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case dataServiceId = "DataServiceId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createPoolUpgradeOSHeadersProtocol() -> PoolUpgradeOSHeadersProtocol {
    return PoolUpgradeOSHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 PoolUpgradeOSParameterData : PoolUpgradeOSParameterProtocol {
    public var targetOSVersion: String

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

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

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

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

extension DataFactory {
  public static func createPoolUpgradeOSParameterProtocol(targetOSVersion: String) -> PoolUpgradeOSParameterProtocol {
    return PoolUpgradeOSParameterData(targetOSVersion: targetOSVersion)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 PoolUsageMetricsData : PoolUsageMetricsProtocol {
    public var poolId: String
    public var startTime: Date
    public var endTime: Date
    public var vmSize: String
    public var totalCoreHours: Double
    public var dataIngressGiB: Double
    public var dataEgressGiB: Double

        enum CodingKeys: String, CodingKey {case poolId = "poolId"
        case startTime = "startTime"
        case endTime = "endTime"
        case vmSize = "vmSize"
        case totalCoreHours = "totalCoreHours"
        case dataIngressGiB = "dataIngressGiB"
        case dataEgressGiB = "dataEgressGiB"
        }

  public init(poolId: String, startTime: Date, endTime: Date, vmSize: String, totalCoreHours: Double, dataIngressGiB: Double, dataEgressGiB: Double)  {
    self.poolId = poolId
    self.startTime = startTime
    self.endTime = endTime
    self.vmSize = vmSize
    self.totalCoreHours = totalCoreHours
    self.dataIngressGiB = dataIngressGiB
    self.dataEgressGiB = dataEgressGiB
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.poolId = try container.decode(String.self, forKey: .poolId)
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)!
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)!
    self.vmSize = try container.decode(String.self, forKey: .vmSize)
    self.totalCoreHours = try container.decode(Double.self, forKey: .totalCoreHours)
    self.dataIngressGiB = try container.decode(Double.self, forKey: .dataIngressGiB)
    self.dataEgressGiB = try container.decode(Double.self, forKey: .dataEgressGiB)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.poolId, forKey: .poolId)
    try container.encode(DateConverter.toString(date: self.startTime, format: .dateTime), forKey: .startTime)
    try container.encode(DateConverter.toString(date: self.endTime, format: .dateTime), forKey: .endTime)
    try container.encode(self.vmSize, forKey: .vmSize)
    try container.encode(self.totalCoreHours, forKey: .totalCoreHours)
    try container.encode(self.dataIngressGiB, forKey: .dataIngressGiB)
    try container.encode(self.dataEgressGiB, forKey: .dataEgressGiB)
  }
}

extension DataFactory {
  public static func createPoolUsageMetricsProtocol(poolId: String, startTime: Date, endTime: Date, vmSize: String, totalCoreHours: Double, dataIngressGiB: Double, dataEgressGiB: Double) -> PoolUsageMetricsProtocol {
    return PoolUsageMetricsData(poolId: poolId, startTime: startTime, endTime: endTime, vmSize: vmSize, totalCoreHours: totalCoreHours, dataIngressGiB: dataIngressGiB, dataEgressGiB: dataEgressGiB)
  }
}


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

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

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

extension DataFactory {
  public static func createRecentJobProtocol() -> RecentJobProtocol {
    return RecentJobData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ResizeErrorData : ResizeErrorProtocol {
    public var code: String?
    public var message: String?
    public var values: [NameValuePairProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createResizeErrorProtocol() -> ResizeErrorProtocol {
    return ResizeErrorData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ResourceFileData : ResourceFileProtocol {
    public var blobSource: String
    public var filePath: String
    public var fileMode: String?

        enum CodingKeys: String, CodingKey {case blobSource = "blobSource"
        case filePath = "filePath"
        case fileMode = "fileMode"
        }

  public init(blobSource: String, filePath: String)  {
    self.blobSource = blobSource
    self.filePath = filePath
  }

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

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

extension DataFactory {
  public static func createResourceFileProtocol(blobSource: String, filePath: String) -> ResourceFileProtocol {
    return ResourceFileData(blobSource: blobSource, filePath: filePath)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ResourceStatisticsData : ResourceStatisticsProtocol {
    public var startTime: Date
    public var lastUpdateTime: Date
    public var avgCPUPercentage: Double
    public var avgMemoryGiB: Double
    public var peakMemoryGiB: Double
    public var avgDiskGiB: Double
    public var peakDiskGiB: Double
    public var diskReadIOps: Int64
    public var diskWriteIOps: Int64
    public var diskReadGiB: Double
    public var diskWriteGiB: Double
    public var networkReadGiB: Double
    public var networkWriteGiB: Double

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case lastUpdateTime = "lastUpdateTime"
        case avgCPUPercentage = "avgCPUPercentage"
        case avgMemoryGiB = "avgMemoryGiB"
        case peakMemoryGiB = "peakMemoryGiB"
        case avgDiskGiB = "avgDiskGiB"
        case peakDiskGiB = "peakDiskGiB"
        case diskReadIOps = "diskReadIOps"
        case diskWriteIOps = "diskWriteIOps"
        case diskReadGiB = "diskReadGiB"
        case diskWriteGiB = "diskWriteGiB"
        case networkReadGiB = "networkReadGiB"
        case networkWriteGiB = "networkWriteGiB"
        }

  public init(startTime: Date, lastUpdateTime: Date, avgCPUPercentage: Double, avgMemoryGiB: Double, peakMemoryGiB: Double, avgDiskGiB: Double, peakDiskGiB: Double, diskReadIOps: Int64, diskWriteIOps: Int64, diskReadGiB: Double, diskWriteGiB: Double, networkReadGiB: Double, networkWriteGiB: Double)  {
    self.startTime = startTime
    self.lastUpdateTime = lastUpdateTime
    self.avgCPUPercentage = avgCPUPercentage
    self.avgMemoryGiB = avgMemoryGiB
    self.peakMemoryGiB = peakMemoryGiB
    self.avgDiskGiB = avgDiskGiB
    self.peakDiskGiB = peakDiskGiB
    self.diskReadIOps = diskReadIOps
    self.diskWriteIOps = diskWriteIOps
    self.diskReadGiB = diskReadGiB
    self.diskWriteGiB = diskWriteGiB
    self.networkReadGiB = networkReadGiB
    self.networkWriteGiB = networkWriteGiB
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
          self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)!
        self.lastUpdateTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUpdateTime)), format: .dateTime)!
    self.avgCPUPercentage = try container.decode(Double.self, forKey: .avgCPUPercentage)
    self.avgMemoryGiB = try container.decode(Double.self, forKey: .avgMemoryGiB)
    self.peakMemoryGiB = try container.decode(Double.self, forKey: .peakMemoryGiB)
    self.avgDiskGiB = try container.decode(Double.self, forKey: .avgDiskGiB)
    self.peakDiskGiB = try container.decode(Double.self, forKey: .peakDiskGiB)
    self.diskReadIOps = try container.decode(Int64.self, forKey: .diskReadIOps)
    self.diskWriteIOps = try container.decode(Int64.self, forKey: .diskWriteIOps)
    self.diskReadGiB = try container.decode(Double.self, forKey: .diskReadGiB)
    self.diskWriteGiB = try container.decode(Double.self, forKey: .diskWriteGiB)
    self.networkReadGiB = try container.decode(Double.self, forKey: .networkReadGiB)
    self.networkWriteGiB = try container.decode(Double.self, forKey: .networkWriteGiB)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(DateConverter.toString(date: self.startTime, format: .dateTime), forKey: .startTime)
    try container.encode(DateConverter.toString(date: self.lastUpdateTime, format: .dateTime), forKey: .lastUpdateTime)
    try container.encode(self.avgCPUPercentage, forKey: .avgCPUPercentage)
    try container.encode(self.avgMemoryGiB, forKey: .avgMemoryGiB)
    try container.encode(self.peakMemoryGiB, forKey: .peakMemoryGiB)
    try container.encode(self.avgDiskGiB, forKey: .avgDiskGiB)
    try container.encode(self.peakDiskGiB, forKey: .peakDiskGiB)
    try container.encode(self.diskReadIOps, forKey: .diskReadIOps)
    try container.encode(self.diskWriteIOps, forKey: .diskWriteIOps)
    try container.encode(self.diskReadGiB, forKey: .diskReadGiB)
    try container.encode(self.diskWriteGiB, forKey: .diskWriteGiB)
    try container.encode(self.networkReadGiB, forKey: .networkReadGiB)
    try container.encode(self.networkWriteGiB, forKey: .networkWriteGiB)
  }
}

extension DataFactory {
  public static func createResourceStatisticsProtocol(startTime: Date, lastUpdateTime: Date, avgCPUPercentage: Double, avgMemoryGiB: Double, peakMemoryGiB: Double, avgDiskGiB: Double, peakDiskGiB: Double, diskReadIOps: Int64, diskWriteIOps: Int64, diskReadGiB: Double, diskWriteGiB: Double, networkReadGiB: Double, networkWriteGiB: Double) -> ResourceStatisticsProtocol {
    return ResourceStatisticsData(startTime: startTime, lastUpdateTime: lastUpdateTime, avgCPUPercentage: avgCPUPercentage, avgMemoryGiB: avgMemoryGiB, peakMemoryGiB: peakMemoryGiB, avgDiskGiB: avgDiskGiB, peakDiskGiB: peakDiskGiB, diskReadIOps: diskReadIOps, diskWriteIOps: diskWriteIOps, diskReadGiB: diskReadGiB, diskWriteGiB: diskWriteGiB, networkReadGiB: networkReadGiB, networkWriteGiB: networkWriteGiB)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ScheduleData : ScheduleProtocol {
    public var doNotRunUntil: Date?
    public var doNotRunAfter: Date?
    public var startWindow: String?
    public var recurrenceInterval: String?

        enum CodingKeys: String, CodingKey {case doNotRunUntil = "doNotRunUntil"
        case doNotRunAfter = "doNotRunAfter"
        case startWindow = "startWindow"
        case recurrenceInterval = "recurrenceInterval"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createScheduleProtocol() -> ScheduleProtocol {
    return ScheduleData()
  }
}


// SchedulingState enumerates the values for scheduling state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SchedulingStateEnum: String, Codable
{
// Disabled specifies the disabled state for scheduling state.
    case Disabled = "disabled"
// Enabled specifies the enabled state for scheduling state.
    case Enabled = "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 StartTaskData : StartTaskProtocol {
    public var commandLine: String
    public var containerSettings: TaskContainerSettingsProtocol?
    public var resourceFiles: [ResourceFileProtocol?]?
    public var environmentSettings: [EnvironmentSettingProtocol?]?
    public var userIdentity: UserIdentityProtocol?
    public var maxTaskRetryCount: Int32?
    public var waitForSuccess: Bool?

        enum CodingKeys: String, CodingKey {case commandLine = "commandLine"
        case containerSettings = "containerSettings"
        case resourceFiles = "resourceFiles"
        case environmentSettings = "environmentSettings"
        case userIdentity = "userIdentity"
        case maxTaskRetryCount = "maxTaskRetryCount"
        case waitForSuccess = "waitForSuccess"
        }

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

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.commandLine = try container.decode(String.self, forKey: .commandLine)
    if container.contains(.containerSettings) {
        self.containerSettings = try container.decode(TaskContainerSettingsData?.self, forKey: .containerSettings)
    }
    if container.contains(.resourceFiles) {
        self.resourceFiles = try container.decode([ResourceFileData?]?.self, forKey: .resourceFiles)
    }
    if container.contains(.environmentSettings) {
        self.environmentSettings = try container.decode([EnvironmentSettingData?]?.self, forKey: .environmentSettings)
    }
    if container.contains(.userIdentity) {
        self.userIdentity = try container.decode(UserIdentityData?.self, forKey: .userIdentity)
    }
    if container.contains(.maxTaskRetryCount) {
        self.maxTaskRetryCount = try container.decode(Int32?.self, forKey: .maxTaskRetryCount)
    }
    if container.contains(.waitForSuccess) {
        self.waitForSuccess = try container.decode(Bool?.self, forKey: .waitForSuccess)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.commandLine, forKey: .commandLine)
    if self.containerSettings != nil {try container.encode(self.containerSettings as! TaskContainerSettingsData?, forKey: .containerSettings)}
    if self.resourceFiles != nil {try container.encode(self.resourceFiles as! [ResourceFileData?]?, forKey: .resourceFiles)}
    if self.environmentSettings != nil {try container.encode(self.environmentSettings as! [EnvironmentSettingData?]?, forKey: .environmentSettings)}
    if self.userIdentity != nil {try container.encode(self.userIdentity as! UserIdentityData?, forKey: .userIdentity)}
    if self.maxTaskRetryCount != nil {try container.encode(self.maxTaskRetryCount, forKey: .maxTaskRetryCount)}
    if self.waitForSuccess != nil {try container.encode(self.waitForSuccess, forKey: .waitForSuccess)}
  }
}

extension DataFactory {
  public static func createStartTaskProtocol(commandLine: String) -> StartTaskProtocol {
    return StartTaskData(commandLine: commandLine)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 StartTaskInformationData : StartTaskInformationProtocol {
    public var state: StartTaskStateEnum
    public var startTime: Date
    public var endTime: Date?
    public var exitCode: Int32?
    public var containerInfo: TaskContainerExecutionInformationProtocol?
    public var failureInfo: TaskFailureInformationProtocol?
    public var retryCount: Int32
    public var lastRetryTime: Date?
    public var result: TaskExecutionResultEnum?

        enum CodingKeys: String, CodingKey {case state = "state"
        case startTime = "startTime"
        case endTime = "endTime"
        case exitCode = "exitCode"
        case containerInfo = "containerInfo"
        case failureInfo = "failureInfo"
        case retryCount = "retryCount"
        case lastRetryTime = "lastRetryTime"
        case result = "result"
        }

  public init(state: StartTaskStateEnum, startTime: Date, retryCount: Int32)  {
    self.state = state
    self.startTime = startTime
    self.retryCount = retryCount
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.state = try container.decode(StartTaskStateEnum.self, forKey: .state)
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)!
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.exitCode) {
        self.exitCode = try container.decode(Int32?.self, forKey: .exitCode)
    }
    if container.contains(.containerInfo) {
        self.containerInfo = try container.decode(TaskContainerExecutionInformationData?.self, forKey: .containerInfo)
    }
    if container.contains(.failureInfo) {
        self.failureInfo = try container.decode(TaskFailureInformationData?.self, forKey: .failureInfo)
    }
    self.retryCount = try container.decode(Int32.self, forKey: .retryCount)
    if container.contains(.lastRetryTime) {
        self.lastRetryTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRetryTime)), format: .dateTime)
    }
    if container.contains(.result) {
        self.result = try container.decode(TaskExecutionResultEnum?.self, forKey: .result)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.state, forKey: .state)
    try container.encode(DateConverter.toString(date: self.startTime, format: .dateTime), forKey: .startTime)
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.exitCode != nil {try container.encode(self.exitCode, forKey: .exitCode)}
    if self.containerInfo != nil {try container.encode(self.containerInfo as! TaskContainerExecutionInformationData?, forKey: .containerInfo)}
    if self.failureInfo != nil {try container.encode(self.failureInfo as! TaskFailureInformationData?, forKey: .failureInfo)}
    try container.encode(self.retryCount, forKey: .retryCount)
    if self.lastRetryTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRetryTime!, format: .dateTime), forKey: .lastRetryTime)
    }
    if self.result != nil {try container.encode(self.result, forKey: .result)}
  }
}

extension DataFactory {
  public static func createStartTaskInformationProtocol(state: StartTaskStateEnum, startTime: Date, retryCount: Int32) -> StartTaskInformationProtocol {
    return StartTaskInformationData(state: state, startTime: startTime, retryCount: retryCount)
  }
}


// StartTaskState enumerates the values for start task state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum StartTaskStateEnum: String, Codable
{
// StartTaskStateCompleted specifies the start task state completed state for start task state.
    case StartTaskStateCompleted = "completed"
// StartTaskStateRunning specifies the start task state running state for start task state.
    case StartTaskStateRunning = "running"
}


// StorageAccountType enumerates the values for storage account 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 StorageAccountTypeEnum: String, Codable
{
// PremiumLRS specifies the premium lrs state for storage account type.
    case PremiumLRS = "premium_lrs"
// StandardLRS specifies the standard lrs state for storage account type.
    case StandardLRS = "standard_lrs"
}


// Copyright (c) Microsoft Corporation. All rights 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 SubtaskInformationData : SubtaskInformationProtocol {
    public var id: Int32?
    public var nodeInfo: ComputeNodeInformationProtocol?
    public var startTime: Date?
    public var endTime: Date?
    public var exitCode: Int32?
    public var containerInfo: TaskContainerExecutionInformationProtocol?
    public var failureInfo: TaskFailureInformationProtocol?
    public var state: SubtaskStateEnum?
    public var stateTransitionTime: Date?
    public var previousState: SubtaskStateEnum?
    public var previousStateTransitionTime: Date?
    public var result: TaskExecutionResultEnum?

        enum CodingKeys: String, CodingKey {case id = "id"
        case nodeInfo = "nodeInfo"
        case startTime = "startTime"
        case endTime = "endTime"
        case exitCode = "exitCode"
        case containerInfo = "containerInfo"
        case failureInfo = "failureInfo"
        case state = "state"
        case stateTransitionTime = "stateTransitionTime"
        case previousState = "previousState"
        case previousStateTransitionTime = "previousStateTransitionTime"
        case result = "result"
        }

  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(Int32?.self, forKey: .id)
    }
    if container.contains(.nodeInfo) {
        self.nodeInfo = try container.decode(ComputeNodeInformationData?.self, forKey: .nodeInfo)
    }
    if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.exitCode) {
        self.exitCode = try container.decode(Int32?.self, forKey: .exitCode)
    }
    if container.contains(.containerInfo) {
        self.containerInfo = try container.decode(TaskContainerExecutionInformationData?.self, forKey: .containerInfo)
    }
    if container.contains(.failureInfo) {
        self.failureInfo = try container.decode(TaskFailureInformationData?.self, forKey: .failureInfo)
    }
    if container.contains(.state) {
        self.state = try container.decode(SubtaskStateEnum?.self, forKey: .state)
    }
    if container.contains(.stateTransitionTime) {
        self.stateTransitionTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .stateTransitionTime)), format: .dateTime)
    }
    if container.contains(.previousState) {
        self.previousState = try container.decode(SubtaskStateEnum?.self, forKey: .previousState)
    }
    if container.contains(.previousStateTransitionTime) {
        self.previousStateTransitionTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .previousStateTransitionTime)), format: .dateTime)
    }
    if container.contains(.result) {
        self.result = try container.decode(TaskExecutionResultEnum?.self, forKey: .result)
    }
    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.nodeInfo != nil {try container.encode(self.nodeInfo as! ComputeNodeInformationData?, forKey: .nodeInfo)}
    if self.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.exitCode != nil {try container.encode(self.exitCode, forKey: .exitCode)}
    if self.containerInfo != nil {try container.encode(self.containerInfo as! TaskContainerExecutionInformationData?, forKey: .containerInfo)}
    if self.failureInfo != nil {try container.encode(self.failureInfo as! TaskFailureInformationData?, forKey: .failureInfo)}
    if self.state != nil {try container.encode(self.state, forKey: .state)}
    if self.stateTransitionTime != nil {
        try container.encode(DateConverter.toString(date: self.stateTransitionTime!, format: .dateTime), forKey: .stateTransitionTime)
    }
    if self.previousState != nil {try container.encode(self.previousState, forKey: .previousState)}
    if self.previousStateTransitionTime != nil {
        try container.encode(DateConverter.toString(date: self.previousStateTransitionTime!, format: .dateTime), forKey: .previousStateTransitionTime)
    }
    if self.result != nil {try container.encode(self.result, forKey: .result)}
  }
}

extension DataFactory {
  public static func createSubtaskInformationProtocol() -> SubtaskInformationProtocol {
    return SubtaskInformationData()
  }
}


// SubtaskState enumerates the values for subtask state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum SubtaskStateEnum: String, Codable
{
// SubtaskStateCompleted specifies the subtask state completed state for subtask state.
    case SubtaskStateCompleted = "completed"
// SubtaskStatePreparing specifies the subtask state preparing state for subtask state.
    case SubtaskStatePreparing = "preparing"
// SubtaskStateRunning specifies the subtask state running state for subtask state.
    case SubtaskStateRunning = "running"
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskAddCollectionHeadersData : TaskAddCollectionHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskAddCollectionHeadersProtocol() -> TaskAddCollectionHeadersProtocol {
    return TaskAddCollectionHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskAddCollectionParameterData : TaskAddCollectionParameterProtocol {
    public var value: [TaskAddParameterProtocol]

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

  public init(value: [TaskAddParameterProtocol])  {
    self.value = value
  }

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

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

extension DataFactory {
  public static func createTaskAddCollectionParameterProtocol(value: [TaskAddParameterProtocol]) -> TaskAddCollectionParameterProtocol {
    return TaskAddCollectionParameterData(value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskAddCollectionResultData : TaskAddCollectionResultProtocol {
    public var value: [TaskAddResultProtocol?]?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createTaskAddCollectionResultProtocol() -> TaskAddCollectionResultProtocol {
    return TaskAddCollectionResultData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskAddHeadersData : TaskAddHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?
    public var dataServiceId: String?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case dataServiceId = "DataServiceId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskAddHeadersProtocol() -> TaskAddHeadersProtocol {
    return TaskAddHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskAddParameterData : TaskAddParameterProtocol {
    public var id: String
    public var displayName: String?
    public var commandLine: String
    public var containerSettings: TaskContainerSettingsProtocol?
    public var exitConditions: ExitConditionsProtocol?
    public var resourceFiles: [ResourceFileProtocol?]?
    public var outputFiles: [OutputFileProtocol?]?
    public var environmentSettings: [EnvironmentSettingProtocol?]?
    public var affinityInfo: AffinityInformationProtocol?
    public var constraints: TaskConstraintsProtocol?
    public var userIdentity: UserIdentityProtocol?
    public var multiInstanceSettings: MultiInstanceSettingsProtocol?
    public var dependsOn: TaskDependenciesProtocol?
    public var applicationPackageReferences: [ApplicationPackageReferenceProtocol?]?
    public var authenticationTokenSettings: AuthenticationTokenSettingsProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case displayName = "displayName"
        case commandLine = "commandLine"
        case containerSettings = "containerSettings"
        case exitConditions = "exitConditions"
        case resourceFiles = "resourceFiles"
        case outputFiles = "outputFiles"
        case environmentSettings = "environmentSettings"
        case affinityInfo = "affinityInfo"
        case constraints = "constraints"
        case userIdentity = "userIdentity"
        case multiInstanceSettings = "multiInstanceSettings"
        case dependsOn = "dependsOn"
        case applicationPackageReferences = "applicationPackageReferences"
        case authenticationTokenSettings = "authenticationTokenSettings"
        }

  public init(id: String, commandLine: String)  {
    self.id = id
    self.commandLine = commandLine
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.id = try container.decode(String.self, forKey: .id)
    if container.contains(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    self.commandLine = try container.decode(String.self, forKey: .commandLine)
    if container.contains(.containerSettings) {
        self.containerSettings = try container.decode(TaskContainerSettingsData?.self, forKey: .containerSettings)
    }
    if container.contains(.exitConditions) {
        self.exitConditions = try container.decode(ExitConditionsData?.self, forKey: .exitConditions)
    }
    if container.contains(.resourceFiles) {
        self.resourceFiles = try container.decode([ResourceFileData?]?.self, forKey: .resourceFiles)
    }
    if container.contains(.outputFiles) {
        self.outputFiles = try container.decode([OutputFileData?]?.self, forKey: .outputFiles)
    }
    if container.contains(.environmentSettings) {
        self.environmentSettings = try container.decode([EnvironmentSettingData?]?.self, forKey: .environmentSettings)
    }
    if container.contains(.affinityInfo) {
        self.affinityInfo = try container.decode(AffinityInformationData?.self, forKey: .affinityInfo)
    }
    if container.contains(.constraints) {
        self.constraints = try container.decode(TaskConstraintsData?.self, forKey: .constraints)
    }
    if container.contains(.userIdentity) {
        self.userIdentity = try container.decode(UserIdentityData?.self, forKey: .userIdentity)
    }
    if container.contains(.multiInstanceSettings) {
        self.multiInstanceSettings = try container.decode(MultiInstanceSettingsData?.self, forKey: .multiInstanceSettings)
    }
    if container.contains(.dependsOn) {
        self.dependsOn = try container.decode(TaskDependenciesData?.self, forKey: .dependsOn)
    }
    if container.contains(.applicationPackageReferences) {
        self.applicationPackageReferences = try container.decode([ApplicationPackageReferenceData?]?.self, forKey: .applicationPackageReferences)
    }
    if container.contains(.authenticationTokenSettings) {
        self.authenticationTokenSettings = try container.decode(AuthenticationTokenSettingsData?.self, forKey: .authenticationTokenSettings)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.id, forKey: .id)
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    try container.encode(self.commandLine, forKey: .commandLine)
    if self.containerSettings != nil {try container.encode(self.containerSettings as! TaskContainerSettingsData?, forKey: .containerSettings)}
    if self.exitConditions != nil {try container.encode(self.exitConditions as! ExitConditionsData?, forKey: .exitConditions)}
    if self.resourceFiles != nil {try container.encode(self.resourceFiles as! [ResourceFileData?]?, forKey: .resourceFiles)}
    if self.outputFiles != nil {try container.encode(self.outputFiles as! [OutputFileData?]?, forKey: .outputFiles)}
    if self.environmentSettings != nil {try container.encode(self.environmentSettings as! [EnvironmentSettingData?]?, forKey: .environmentSettings)}
    if self.affinityInfo != nil {try container.encode(self.affinityInfo as! AffinityInformationData?, forKey: .affinityInfo)}
    if self.constraints != nil {try container.encode(self.constraints as! TaskConstraintsData?, forKey: .constraints)}
    if self.userIdentity != nil {try container.encode(self.userIdentity as! UserIdentityData?, forKey: .userIdentity)}
    if self.multiInstanceSettings != nil {try container.encode(self.multiInstanceSettings as! MultiInstanceSettingsData?, forKey: .multiInstanceSettings)}
    if self.dependsOn != nil {try container.encode(self.dependsOn as! TaskDependenciesData?, forKey: .dependsOn)}
    if self.applicationPackageReferences != nil {try container.encode(self.applicationPackageReferences as! [ApplicationPackageReferenceData?]?, forKey: .applicationPackageReferences)}
    if self.authenticationTokenSettings != nil {try container.encode(self.authenticationTokenSettings as! AuthenticationTokenSettingsData?, forKey: .authenticationTokenSettings)}
  }
}

extension DataFactory {
  public static func createTaskAddParameterProtocol(id: String, commandLine: String) -> TaskAddParameterProtocol {
    return TaskAddParameterData(id: id, commandLine: commandLine)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskAddResultData : TaskAddResultProtocol {
    public var status: TaskAddStatusEnum
    public var taskId: String
    public var eTag: String?
    public var lastModified: Date?
    public var location: String?
    public var error: BatchErrorProtocol?

        enum CodingKeys: String, CodingKey {case status = "status"
        case taskId = "taskId"
        case eTag = "eTag"
        case lastModified = "lastModified"
        case location = "location"
        case error = "error"
        }

  public init(status: TaskAddStatusEnum, taskId: String)  {
    self.status = status
    self.taskId = taskId
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.status = try container.decode(TaskAddStatusEnum.self, forKey: .status)
    self.taskId = try container.decode(String.self, forKey: .taskId)
    if container.contains(.eTag) {
        self.eTag = try container.decode(String?.self, forKey: .eTag)
    }
    if container.contains(.lastModified) {
        self.lastModified = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastModified)), format: .dateTime)
    }
    if container.contains(.location) {
        self.location = try container.decode(String?.self, forKey: .location)
    }
    if container.contains(.error) {
        self.error = try container.decode(BatchErrorData?.self, forKey: .error)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.status, forKey: .status)
    try container.encode(self.taskId, forKey: .taskId)
    if self.eTag != nil {try container.encode(self.eTag, forKey: .eTag)}
    if self.lastModified != nil {
        try container.encode(DateConverter.toString(date: self.lastModified!, format: .dateTime), forKey: .lastModified)
    }
    if self.location != nil {try container.encode(self.location, forKey: .location)}
    if self.error != nil {try container.encode(self.error as! BatchErrorData?, forKey: .error)}
  }
}

extension DataFactory {
  public static func createTaskAddResultProtocol(status: TaskAddStatusEnum, taskId: String) -> TaskAddResultProtocol {
    return TaskAddResultData(status: status, taskId: taskId)
  }
}


// TaskAddStatus enumerates the values for task add 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 TaskAddStatusEnum: String, Codable
{
// TaskAddStatusClientError specifies the task add status client error state for task add status.
    case TaskAddStatusClientError = "clienterror"
// TaskAddStatusServerError specifies the task add status server error state for task add status.
    case TaskAddStatusServerError = "servererror"
// TaskAddStatusSuccess specifies the task add status success state for task add status.
    case TaskAddStatusSuccess = "success"
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskConstraintsData : TaskConstraintsProtocol {
    public var maxWallClockTime: String?
    public var retentionTime: String?
    public var maxTaskRetryCount: Int32?

        enum CodingKeys: String, CodingKey {case maxWallClockTime = "maxWallClockTime"
        case retentionTime = "retentionTime"
        case maxTaskRetryCount = "maxTaskRetryCount"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskConstraintsProtocol() -> TaskConstraintsProtocol {
    return TaskConstraintsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskContainerExecutionInformationData : TaskContainerExecutionInformationProtocol {
    public var containerId: String?
    public var state: String?
    public var error: String?

        enum CodingKeys: String, CodingKey {case containerId = "containerId"
        case state = "state"
        case error = "error"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskContainerExecutionInformationProtocol() -> TaskContainerExecutionInformationProtocol {
    return TaskContainerExecutionInformationData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskContainerSettingsData : TaskContainerSettingsProtocol {
    public var containerRunOptions: String?
    public var imageName: String
    public var registry: ContainerRegistryProtocol?

        enum CodingKeys: String, CodingKey {case containerRunOptions = "containerRunOptions"
        case imageName = "imageName"
        case registry = "registry"
        }

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

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

extension DataFactory {
  public static func createTaskContainerSettingsProtocol(imageName: String) -> TaskContainerSettingsProtocol {
    return TaskContainerSettingsData(imageName: imageName)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskCountsData : TaskCountsProtocol {
    public var active: Int32
    public var running: Int32
    public var completed: Int32
    public var succeeded: Int32
    public var failed: Int32
    public var validationStatus: TaskCountValidationStatusEnum

        enum CodingKeys: String, CodingKey {case active = "active"
        case running = "running"
        case completed = "completed"
        case succeeded = "succeeded"
        case failed = "failed"
        case validationStatus = "validationStatus"
        }

  public init(active: Int32, running: Int32, completed: Int32, succeeded: Int32, failed: Int32, validationStatus: TaskCountValidationStatusEnum)  {
    self.active = active
    self.running = running
    self.completed = completed
    self.succeeded = succeeded
    self.failed = failed
    self.validationStatus = validationStatus
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.active = try container.decode(Int32.self, forKey: .active)
    self.running = try container.decode(Int32.self, forKey: .running)
    self.completed = try container.decode(Int32.self, forKey: .completed)
    self.succeeded = try container.decode(Int32.self, forKey: .succeeded)
    self.failed = try container.decode(Int32.self, forKey: .failed)
    self.validationStatus = try container.decode(TaskCountValidationStatusEnum.self, forKey: .validationStatus)
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.active, forKey: .active)
    try container.encode(self.running, forKey: .running)
    try container.encode(self.completed, forKey: .completed)
    try container.encode(self.succeeded, forKey: .succeeded)
    try container.encode(self.failed, forKey: .failed)
    try container.encode(self.validationStatus, forKey: .validationStatus)
  }
}

extension DataFactory {
  public static func createTaskCountsProtocol(active: Int32, running: Int32, completed: Int32, succeeded: Int32, failed: Int32, validationStatus: TaskCountValidationStatusEnum) -> TaskCountsProtocol {
    return TaskCountsData(active: active, running: running, completed: completed, succeeded: succeeded, failed: failed, validationStatus: validationStatus)
  }
}


// TaskCountValidationStatus enumerates the values for task count validation 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 TaskCountValidationStatusEnum: String, Codable
{
// Unvalidated specifies the unvalidated state for task count validation status.
    case Unvalidated = "unvalidated"
// Validated specifies the validated state for task count validation status.
    case Validated = "validated"
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskDeleteHeadersData : TaskDeleteHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskDeleteHeadersProtocol() -> TaskDeleteHeadersProtocol {
    return TaskDeleteHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskDependenciesData : TaskDependenciesProtocol {
    public var taskIds: [String]?
    public var taskIdRanges: [TaskIdRangeProtocol?]?

        enum CodingKeys: String, CodingKey {case taskIds = "taskIds"
        case taskIdRanges = "taskIdRanges"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskDependenciesProtocol() -> TaskDependenciesProtocol {
    return TaskDependenciesData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskExecutionInformationData : TaskExecutionInformationProtocol {
    public var startTime: Date?
    public var endTime: Date?
    public var exitCode: Int32?
    public var containerInfo: TaskContainerExecutionInformationProtocol?
    public var failureInfo: TaskFailureInformationProtocol?
    public var retryCount: Int32
    public var lastRetryTime: Date?
    public var requeueCount: Int32
    public var lastRequeueTime: Date?
    public var result: TaskExecutionResultEnum?

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case exitCode = "exitCode"
        case containerInfo = "containerInfo"
        case failureInfo = "failureInfo"
        case retryCount = "retryCount"
        case lastRetryTime = "lastRetryTime"
        case requeueCount = "requeueCount"
        case lastRequeueTime = "lastRequeueTime"
        case result = "result"
        }

  public init(retryCount: Int32, requeueCount: Int32)  {
    self.retryCount = retryCount
    self.requeueCount = requeueCount
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.startTime) {
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)
    }
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.exitCode) {
        self.exitCode = try container.decode(Int32?.self, forKey: .exitCode)
    }
    if container.contains(.containerInfo) {
        self.containerInfo = try container.decode(TaskContainerExecutionInformationData?.self, forKey: .containerInfo)
    }
    if container.contains(.failureInfo) {
        self.failureInfo = try container.decode(TaskFailureInformationData?.self, forKey: .failureInfo)
    }
    self.retryCount = try container.decode(Int32.self, forKey: .retryCount)
    if container.contains(.lastRetryTime) {
        self.lastRetryTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRetryTime)), format: .dateTime)
    }
    self.requeueCount = try container.decode(Int32.self, forKey: .requeueCount)
    if container.contains(.lastRequeueTime) {
        self.lastRequeueTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRequeueTime)), format: .dateTime)
    }
    if container.contains(.result) {
        self.result = try container.decode(TaskExecutionResultEnum?.self, forKey: .result)
    }
    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.startTime != nil {
        try container.encode(DateConverter.toString(date: self.startTime!, format: .dateTime), forKey: .startTime)
    }
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.exitCode != nil {try container.encode(self.exitCode, forKey: .exitCode)}
    if self.containerInfo != nil {try container.encode(self.containerInfo as! TaskContainerExecutionInformationData?, forKey: .containerInfo)}
    if self.failureInfo != nil {try container.encode(self.failureInfo as! TaskFailureInformationData?, forKey: .failureInfo)}
    try container.encode(self.retryCount, forKey: .retryCount)
    if self.lastRetryTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRetryTime!, format: .dateTime), forKey: .lastRetryTime)
    }
    try container.encode(self.requeueCount, forKey: .requeueCount)
    if self.lastRequeueTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRequeueTime!, format: .dateTime), forKey: .lastRequeueTime)
    }
    if self.result != nil {try container.encode(self.result, forKey: .result)}
  }
}

extension DataFactory {
  public static func createTaskExecutionInformationProtocol(retryCount: Int32, requeueCount: Int32) -> TaskExecutionInformationProtocol {
    return TaskExecutionInformationData(retryCount: retryCount, requeueCount: requeueCount)
  }
}


// TaskExecutionResult enumerates the values for task execution result.

// Copyright (c) Microsoft Corporation. All rights 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 TaskExecutionResultEnum: String, Codable
{
// Failure specifies the failure state for task execution result.
    case Failure = "failure"
// Success specifies the success state for task execution result.
    case Success = "success"
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskFailureInformationData : TaskFailureInformationProtocol {
    public var category: ErrorCategoryEnum
    public var code: String?
    public var message: String?
    public var details: [NameValuePairProtocol?]?

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

  public init(category: ErrorCategoryEnum)  {
    self.category = category
  }

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

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

extension DataFactory {
  public static func createTaskFailureInformationProtocol(category: ErrorCategoryEnum) -> TaskFailureInformationProtocol {
    return TaskFailureInformationData(category: category)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskGetHeadersData : TaskGetHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?
    public var dataServiceId: String?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case dataServiceId = "DataServiceId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskGetHeadersProtocol() -> TaskGetHeadersProtocol {
    return TaskGetHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskIdRangeData : TaskIdRangeProtocol {
    public var start: Int32
    public var end: Int32

        enum CodingKeys: String, CodingKey {case start = "start"
        case end = "end"
        }

  public init(start: Int32, end: Int32)  {
    self.start = start
    self.end = end
  }

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

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

extension DataFactory {
  public static func createTaskIdRangeProtocol(start: Int32, end: Int32) -> TaskIdRangeProtocol {
    return TaskIdRangeData(start: start, end: end)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskInformationData : TaskInformationProtocol {
    public var taskUrl: String?
    public var jobId: String?
    public var taskId: String?
    public var subtaskId: Int32?
    public var taskState: TaskStateEnum
    public var executionInfo: TaskExecutionInformationProtocol?

        enum CodingKeys: String, CodingKey {case taskUrl = "taskUrl"
        case jobId = "jobId"
        case taskId = "taskId"
        case subtaskId = "subtaskId"
        case taskState = "taskState"
        case executionInfo = "executionInfo"
        }

  public init(taskState: TaskStateEnum)  {
    self.taskState = taskState
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.taskUrl) {
        self.taskUrl = try container.decode(String?.self, forKey: .taskUrl)
    }
    if container.contains(.jobId) {
        self.jobId = try container.decode(String?.self, forKey: .jobId)
    }
    if container.contains(.taskId) {
        self.taskId = try container.decode(String?.self, forKey: .taskId)
    }
    if container.contains(.subtaskId) {
        self.subtaskId = try container.decode(Int32?.self, forKey: .subtaskId)
    }
    self.taskState = try container.decode(TaskStateEnum.self, forKey: .taskState)
    if container.contains(.executionInfo) {
        self.executionInfo = try container.decode(TaskExecutionInformationData?.self, forKey: .executionInfo)
    }
    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.taskUrl != nil {try container.encode(self.taskUrl, forKey: .taskUrl)}
    if self.jobId != nil {try container.encode(self.jobId, forKey: .jobId)}
    if self.taskId != nil {try container.encode(self.taskId, forKey: .taskId)}
    if self.subtaskId != nil {try container.encode(self.subtaskId, forKey: .subtaskId)}
    try container.encode(self.taskState, forKey: .taskState)
    if self.executionInfo != nil {try container.encode(self.executionInfo as! TaskExecutionInformationData?, forKey: .executionInfo)}
  }
}

extension DataFactory {
  public static func createTaskInformationProtocol(taskState: TaskStateEnum) -> TaskInformationProtocol {
    return TaskInformationData(taskState: taskState)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskListHeadersData : TaskListHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskListHeadersProtocol() -> TaskListHeadersProtocol {
    return TaskListHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskListSubtasksHeadersData : TaskListSubtasksHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskListSubtasksHeadersProtocol() -> TaskListSubtasksHeadersProtocol {
    return TaskListSubtasksHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskReactivateHeadersData : TaskReactivateHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?
    public var dataServiceId: String?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case dataServiceId = "DataServiceId"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createTaskReactivateHeadersProtocol() -> TaskReactivateHeadersProtocol {
    return TaskReactivateHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 TaskSchedulingPolicyData : TaskSchedulingPolicyProtocol {
    public var nodeFillType: ComputeNodeFillTypeEnum

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

  public init(nodeFillType: ComputeNodeFillTypeEnum)  {
    self.nodeFillType = nodeFillType
  }

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

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

extension DataFactory {
  public static func createTaskSchedulingPolicyProtocol(nodeFillType: ComputeNodeFillTypeEnum) -> TaskSchedulingPolicyProtocol {
    return TaskSchedulingPolicyData(nodeFillType: nodeFillType)
  }
}


// TaskState enumerates the values for task state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum TaskStateEnum: String, Codable
{
// TaskStateActive specifies the task state active state for task state.
    case TaskStateActive = "active"
// TaskStateCompleted specifies the task state completed state for task state.
    case TaskStateCompleted = "completed"
// TaskStatePreparing specifies the task state preparing state for task state.
    case TaskStatePreparing = "preparing"
// TaskStateRunning specifies the task state running state for task state.
    case TaskStateRunning = "running"
}