// Copyright (c) Microsoft Corporation. All rights 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 ErrorMessageData : ErrorMessageProtocol {
    public var lang: String?
    public var value: String?

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createErrorMessageProtocol() -> ErrorMessageProtocol {
    return ErrorMessageData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ExitCodeMappingData : ExitCodeMappingProtocol {
    public var code: Int32
    public var exitOptions: ExitOptionsProtocol

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

  public init(code: Int32, exitOptions: ExitOptionsProtocol)  {
    self.code = code
    self.exitOptions = exitOptions
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.code = try container.decode(Int32.self, forKey: .code)
    self.exitOptions = try container.decode(ExitOptionsData.self, forKey: .exitOptions)
    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.code, forKey: .code)
    try container.encode(self.exitOptions as! ExitOptionsData, forKey: .exitOptions)
  }
}

extension DataFactory {
  public static func createExitCodeMappingProtocol(code: Int32, exitOptions: ExitOptionsProtocol) -> ExitCodeMappingProtocol {
    return ExitCodeMappingData(code: code, exitOptions: exitOptions)
  }
}


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

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

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

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

extension DataFactory {
  public static func createExitCodeRangeMappingProtocol(start: Int32, end: Int32, exitOptions: ExitOptionsProtocol) -> ExitCodeRangeMappingProtocol {
    return ExitCodeRangeMappingData(start: start, end: end, exitOptions: exitOptions)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ExitConditionsData : ExitConditionsProtocol {
    public var exitCodes: [ExitCodeMappingProtocol?]?
    public var exitCodeRanges: [ExitCodeRangeMappingProtocol?]?
    public var preProcessingError: ExitOptionsProtocol?
    public var fileUploadError: ExitOptionsProtocol?
    public var _default: ExitOptionsProtocol?

        enum CodingKeys: String, CodingKey {case exitCodes = "exitCodes"
        case exitCodeRanges = "exitCodeRanges"
        case preProcessingError = "preProcessingError"
        case fileUploadError = "fileUploadError"
        case _default = "default"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.exitCodes) {
        self.exitCodes = try container.decode([ExitCodeMappingData?]?.self, forKey: .exitCodes)
    }
    if container.contains(.exitCodeRanges) {
        self.exitCodeRanges = try container.decode([ExitCodeRangeMappingData?]?.self, forKey: .exitCodeRanges)
    }
    if container.contains(.preProcessingError) {
        self.preProcessingError = try container.decode(ExitOptionsData?.self, forKey: .preProcessingError)
    }
    if container.contains(.fileUploadError) {
        self.fileUploadError = try container.decode(ExitOptionsData?.self, forKey: .fileUploadError)
    }
    if container.contains(._default) {
        self._default = try container.decode(ExitOptionsData?.self, forKey: ._default)
    }
    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.exitCodes != nil {try container.encode(self.exitCodes as! [ExitCodeMappingData?]?, forKey: .exitCodes)}
    if self.exitCodeRanges != nil {try container.encode(self.exitCodeRanges as! [ExitCodeRangeMappingData?]?, forKey: .exitCodeRanges)}
    if self.preProcessingError != nil {try container.encode(self.preProcessingError as! ExitOptionsData?, forKey: .preProcessingError)}
    if self.fileUploadError != nil {try container.encode(self.fileUploadError as! ExitOptionsData?, forKey: .fileUploadError)}
    if self._default != nil {try container.encode(self._default as! ExitOptionsData?, forKey: ._default)}
  }
}

extension DataFactory {
  public static func createExitConditionsProtocol() -> ExitConditionsProtocol {
    return ExitConditionsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 ExitOptionsData : ExitOptionsProtocol {
    public var jobAction: JobActionEnum?
    public var dependencyAction: DependencyActionEnum?

        enum CodingKeys: String, CodingKey {case jobAction = "jobAction"
        case dependencyAction = "dependencyAction"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createExitOptionsProtocol() -> ExitOptionsProtocol {
    return ExitOptionsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FileDeleteFromComputeNodeHeadersData : FileDeleteFromComputeNodeHeadersProtocol {
    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 createFileDeleteFromComputeNodeHeadersProtocol() -> FileDeleteFromComputeNodeHeadersProtocol {
    return FileDeleteFromComputeNodeHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FileDeleteFromTaskHeadersData : FileDeleteFromTaskHeadersProtocol {
    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 createFileDeleteFromTaskHeadersProtocol() -> FileDeleteFromTaskHeadersProtocol {
    return FileDeleteFromTaskHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FileGetFromComputeNodeHeadersData : FileGetFromComputeNodeHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?
    public var ocpCreationTime: Date?
    public var ocpBatchFileIsdirectory: Bool?
    public var ocpBatchFileUrl: String?
    public var ocpBatchFileMode: String?
    public var contentType: String?
    public var contentLength: Int64?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case ocpCreationTime = "ocp-creation-time"
        case ocpBatchFileIsdirectory = "ocp-batch-file-isdirectory"
        case ocpBatchFileUrl = "ocp-batch-file-url"
        case ocpBatchFileMode = "ocp-batch-file-mode"
        case contentType = "Content-Type"
        case contentLength = "Content-Length"
        }

  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(.ocpCreationTime) {
        self.ocpCreationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .ocpCreationTime)), format: .dateTimeRfc1123)
    }
    if container.contains(.ocpBatchFileIsdirectory) {
        self.ocpBatchFileIsdirectory = try container.decode(Bool?.self, forKey: .ocpBatchFileIsdirectory)
    }
    if container.contains(.ocpBatchFileUrl) {
        self.ocpBatchFileUrl = try container.decode(String?.self, forKey: .ocpBatchFileUrl)
    }
    if container.contains(.ocpBatchFileMode) {
        self.ocpBatchFileMode = try container.decode(String?.self, forKey: .ocpBatchFileMode)
    }
    if container.contains(.contentType) {
        self.contentType = try container.decode(String?.self, forKey: .contentType)
    }
    if container.contains(.contentLength) {
        self.contentLength = try container.decode(Int64?.self, forKey: .contentLength)
    }
    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.ocpCreationTime != nil {
        try container.encode(DateConverter.toString(date: self.ocpCreationTime!, format: .dateTimeRfc1123), forKey: .ocpCreationTime)
    }
    if self.ocpBatchFileIsdirectory != nil {try container.encode(self.ocpBatchFileIsdirectory, forKey: .ocpBatchFileIsdirectory)}
    if self.ocpBatchFileUrl != nil {try container.encode(self.ocpBatchFileUrl, forKey: .ocpBatchFileUrl)}
    if self.ocpBatchFileMode != nil {try container.encode(self.ocpBatchFileMode, forKey: .ocpBatchFileMode)}
    if self.contentType != nil {try container.encode(self.contentType, forKey: .contentType)}
    if self.contentLength != nil {try container.encode(self.contentLength, forKey: .contentLength)}
  }
}

extension DataFactory {
  public static func createFileGetFromComputeNodeHeadersProtocol() -> FileGetFromComputeNodeHeadersProtocol {
    return FileGetFromComputeNodeHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FileGetFromTaskHeadersData : FileGetFromTaskHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?
    public var ocpCreationTime: Date?
    public var ocpBatchFileIsdirectory: Bool?
    public var ocpBatchFileUrl: String?
    public var ocpBatchFileMode: String?
    public var contentType: String?
    public var contentLength: Int64?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case ocpCreationTime = "ocp-creation-time"
        case ocpBatchFileIsdirectory = "ocp-batch-file-isdirectory"
        case ocpBatchFileUrl = "ocp-batch-file-url"
        case ocpBatchFileMode = "ocp-batch-file-mode"
        case contentType = "Content-Type"
        case contentLength = "Content-Length"
        }

  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(.ocpCreationTime) {
        self.ocpCreationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .ocpCreationTime)), format: .dateTimeRfc1123)
    }
    if container.contains(.ocpBatchFileIsdirectory) {
        self.ocpBatchFileIsdirectory = try container.decode(Bool?.self, forKey: .ocpBatchFileIsdirectory)
    }
    if container.contains(.ocpBatchFileUrl) {
        self.ocpBatchFileUrl = try container.decode(String?.self, forKey: .ocpBatchFileUrl)
    }
    if container.contains(.ocpBatchFileMode) {
        self.ocpBatchFileMode = try container.decode(String?.self, forKey: .ocpBatchFileMode)
    }
    if container.contains(.contentType) {
        self.contentType = try container.decode(String?.self, forKey: .contentType)
    }
    if container.contains(.contentLength) {
        self.contentLength = try container.decode(Int64?.self, forKey: .contentLength)
    }
    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.ocpCreationTime != nil {
        try container.encode(DateConverter.toString(date: self.ocpCreationTime!, format: .dateTimeRfc1123), forKey: .ocpCreationTime)
    }
    if self.ocpBatchFileIsdirectory != nil {try container.encode(self.ocpBatchFileIsdirectory, forKey: .ocpBatchFileIsdirectory)}
    if self.ocpBatchFileUrl != nil {try container.encode(self.ocpBatchFileUrl, forKey: .ocpBatchFileUrl)}
    if self.ocpBatchFileMode != nil {try container.encode(self.ocpBatchFileMode, forKey: .ocpBatchFileMode)}
    if self.contentType != nil {try container.encode(self.contentType, forKey: .contentType)}
    if self.contentLength != nil {try container.encode(self.contentLength, forKey: .contentLength)}
  }
}

extension DataFactory {
  public static func createFileGetFromTaskHeadersProtocol() -> FileGetFromTaskHeadersProtocol {
    return FileGetFromTaskHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FileGetPropertiesFromComputeNodeHeadersData : FileGetPropertiesFromComputeNodeHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?
    public var ocpCreationTime: Date?
    public var ocpBatchFileIsdirectory: Bool?
    public var ocpBatchFileUrl: String?
    public var ocpBatchFileMode: String?
    public var contentType: String?
    public var contentLength: Int64?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case ocpCreationTime = "ocp-creation-time"
        case ocpBatchFileIsdirectory = "ocp-batch-file-isdirectory"
        case ocpBatchFileUrl = "ocp-batch-file-url"
        case ocpBatchFileMode = "ocp-batch-file-mode"
        case contentType = "Content-Type"
        case contentLength = "Content-Length"
        }

  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(.ocpCreationTime) {
        self.ocpCreationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .ocpCreationTime)), format: .dateTimeRfc1123)
    }
    if container.contains(.ocpBatchFileIsdirectory) {
        self.ocpBatchFileIsdirectory = try container.decode(Bool?.self, forKey: .ocpBatchFileIsdirectory)
    }
    if container.contains(.ocpBatchFileUrl) {
        self.ocpBatchFileUrl = try container.decode(String?.self, forKey: .ocpBatchFileUrl)
    }
    if container.contains(.ocpBatchFileMode) {
        self.ocpBatchFileMode = try container.decode(String?.self, forKey: .ocpBatchFileMode)
    }
    if container.contains(.contentType) {
        self.contentType = try container.decode(String?.self, forKey: .contentType)
    }
    if container.contains(.contentLength) {
        self.contentLength = try container.decode(Int64?.self, forKey: .contentLength)
    }
    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.ocpCreationTime != nil {
        try container.encode(DateConverter.toString(date: self.ocpCreationTime!, format: .dateTimeRfc1123), forKey: .ocpCreationTime)
    }
    if self.ocpBatchFileIsdirectory != nil {try container.encode(self.ocpBatchFileIsdirectory, forKey: .ocpBatchFileIsdirectory)}
    if self.ocpBatchFileUrl != nil {try container.encode(self.ocpBatchFileUrl, forKey: .ocpBatchFileUrl)}
    if self.ocpBatchFileMode != nil {try container.encode(self.ocpBatchFileMode, forKey: .ocpBatchFileMode)}
    if self.contentType != nil {try container.encode(self.contentType, forKey: .contentType)}
    if self.contentLength != nil {try container.encode(self.contentLength, forKey: .contentLength)}
  }
}

extension DataFactory {
  public static func createFileGetPropertiesFromComputeNodeHeadersProtocol() -> FileGetPropertiesFromComputeNodeHeadersProtocol {
    return FileGetPropertiesFromComputeNodeHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FileGetPropertiesFromTaskHeadersData : FileGetPropertiesFromTaskHeadersProtocol {
    public var clientRequestId: String?
    public var requestId: String?
    public var eTag: String?
    public var lastModified: Date?
    public var ocpCreationTime: Date?
    public var ocpBatchFileIsdirectory: Bool?
    public var ocpBatchFileUrl: String?
    public var ocpBatchFileMode: String?
    public var contentType: String?
    public var contentLength: Int64?

        enum CodingKeys: String, CodingKey {case clientRequestId = "client-request-id"
        case requestId = "request-id"
        case eTag = "ETag"
        case lastModified = "Last-Modified"
        case ocpCreationTime = "ocp-creation-time"
        case ocpBatchFileIsdirectory = "ocp-batch-file-isdirectory"
        case ocpBatchFileUrl = "ocp-batch-file-url"
        case ocpBatchFileMode = "ocp-batch-file-mode"
        case contentType = "Content-Type"
        case contentLength = "Content-Length"
        }

  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(.ocpCreationTime) {
        self.ocpCreationTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .ocpCreationTime)), format: .dateTimeRfc1123)
    }
    if container.contains(.ocpBatchFileIsdirectory) {
        self.ocpBatchFileIsdirectory = try container.decode(Bool?.self, forKey: .ocpBatchFileIsdirectory)
    }
    if container.contains(.ocpBatchFileUrl) {
        self.ocpBatchFileUrl = try container.decode(String?.self, forKey: .ocpBatchFileUrl)
    }
    if container.contains(.ocpBatchFileMode) {
        self.ocpBatchFileMode = try container.decode(String?.self, forKey: .ocpBatchFileMode)
    }
    if container.contains(.contentType) {
        self.contentType = try container.decode(String?.self, forKey: .contentType)
    }
    if container.contains(.contentLength) {
        self.contentLength = try container.decode(Int64?.self, forKey: .contentLength)
    }
    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.ocpCreationTime != nil {
        try container.encode(DateConverter.toString(date: self.ocpCreationTime!, format: .dateTimeRfc1123), forKey: .ocpCreationTime)
    }
    if self.ocpBatchFileIsdirectory != nil {try container.encode(self.ocpBatchFileIsdirectory, forKey: .ocpBatchFileIsdirectory)}
    if self.ocpBatchFileUrl != nil {try container.encode(self.ocpBatchFileUrl, forKey: .ocpBatchFileUrl)}
    if self.ocpBatchFileMode != nil {try container.encode(self.ocpBatchFileMode, forKey: .ocpBatchFileMode)}
    if self.contentType != nil {try container.encode(self.contentType, forKey: .contentType)}
    if self.contentLength != nil {try container.encode(self.contentLength, forKey: .contentLength)}
  }
}

extension DataFactory {
  public static func createFileGetPropertiesFromTaskHeadersProtocol() -> FileGetPropertiesFromTaskHeadersProtocol {
    return FileGetPropertiesFromTaskHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FileListFromComputeNodeHeadersData : FileListFromComputeNodeHeadersProtocol {
    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 createFileListFromComputeNodeHeadersProtocol() -> FileListFromComputeNodeHeadersProtocol {
    return FileListFromComputeNodeHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FileListFromTaskHeadersData : FileListFromTaskHeadersProtocol {
    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 createFileListFromTaskHeadersProtocol() -> FileListFromTaskHeadersProtocol {
    return FileListFromTaskHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 FilePropertiesData : FilePropertiesProtocol {
    public var creationTime: Date?
    public var lastModified: Date
    public var contentLength: Int64
    public var contentType: String?
    public var fileMode: String?

        enum CodingKeys: String, CodingKey {case creationTime = "creationTime"
        case lastModified = "lastModified"
        case contentLength = "contentLength"
        case contentType = "contentType"
        case fileMode = "fileMode"
        }

  public init(lastModified: Date, contentLength: Int64)  {
    self.lastModified = lastModified
    self.contentLength = contentLength
  }

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

extension DataFactory {
  public static func createFilePropertiesProtocol(lastModified: Date, contentLength: Int64) -> FilePropertiesProtocol {
    return FilePropertiesData(lastModified: lastModified, contentLength: contentLength)
  }
}


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

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

  public init()  {
  }

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

extension DataFactory {
  public static func createImageReferenceProtocol() -> ImageReferenceProtocol {
    return ImageReferenceData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 InboundEndpointData : InboundEndpointProtocol {
    public var name: String
    public var _protocol: InboundEndpointProtocolEnum
    public var publicIPAddress: String
    public var publicFQDN: String
    public var frontendPort: Int32
    public var backendPort: Int32

        enum CodingKeys: String, CodingKey {case name = "name"
        case _protocol = "protocol"
        case publicIPAddress = "publicIPAddress"
        case publicFQDN = "publicFQDN"
        case frontendPort = "frontendPort"
        case backendPort = "backendPort"
        }

  public init(name: String, _protocol: InboundEndpointProtocolEnum, publicIPAddress: String, publicFQDN: String, frontendPort: Int32, backendPort: Int32)  {
    self.name = name
    self._protocol = _protocol
    self.publicIPAddress = publicIPAddress
    self.publicFQDN = publicFQDN
    self.frontendPort = frontendPort
    self.backendPort = backendPort
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.name, forKey: .name)
    try container.encode(self._protocol, forKey: ._protocol)
    try container.encode(self.publicIPAddress, forKey: .publicIPAddress)
    try container.encode(self.publicFQDN, forKey: .publicFQDN)
    try container.encode(self.frontendPort, forKey: .frontendPort)
    try container.encode(self.backendPort, forKey: .backendPort)
  }
}

extension DataFactory {
  public static func createInboundEndpointProtocol(name: String, _protocol: InboundEndpointProtocolEnum, publicIPAddress: String, publicFQDN: String, frontendPort: Int32, backendPort: Int32) -> InboundEndpointProtocol {
    return InboundEndpointData(name: name, _protocol: _protocol, publicIPAddress: publicIPAddress, publicFQDN: publicFQDN, frontendPort: frontendPort, backendPort: backendPort)
  }
}


// InboundEndpointProtocol enumerates the values for inbound endpoint protocol.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum InboundEndpointProtocolEnum: String, Codable
{
// Tcp specifies the tcp state for inbound endpoint protocol.
    case Tcp = "tcp"
// Udp specifies the udp state for inbound endpoint protocol.
    case Udp = "udp"
}


// Copyright (c) Microsoft Corporation. All rights 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 InboundNATPoolData : InboundNATPoolProtocol {
    public var name: String
    public var _protocol: InboundEndpointProtocolEnum
    public var backendPort: Int32
    public var frontendPortRangeStart: Int32
    public var frontendPortRangeEnd: Int32
    public var networkSecurityGroupRules: [NetworkSecurityGroupRuleProtocol?]?

        enum CodingKeys: String, CodingKey {case name = "name"
        case _protocol = "protocol"
        case backendPort = "backendPort"
        case frontendPortRangeStart = "frontendPortRangeStart"
        case frontendPortRangeEnd = "frontendPortRangeEnd"
        case networkSecurityGroupRules = "networkSecurityGroupRules"
        }

  public init(name: String, _protocol: InboundEndpointProtocolEnum, backendPort: Int32, frontendPortRangeStart: Int32, frontendPortRangeEnd: Int32)  {
    self.name = name
    self._protocol = _protocol
    self.backendPort = backendPort
    self.frontendPortRangeStart = frontendPortRangeStart
    self.frontendPortRangeEnd = frontendPortRangeEnd
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.name = try container.decode(String.self, forKey: .name)
    self._protocol = try container.decode(InboundEndpointProtocolEnum.self, forKey: ._protocol)
    self.backendPort = try container.decode(Int32.self, forKey: .backendPort)
    self.frontendPortRangeStart = try container.decode(Int32.self, forKey: .frontendPortRangeStart)
    self.frontendPortRangeEnd = try container.decode(Int32.self, forKey: .frontendPortRangeEnd)
    if container.contains(.networkSecurityGroupRules) {
        self.networkSecurityGroupRules = try container.decode([NetworkSecurityGroupRuleData?]?.self, forKey: .networkSecurityGroupRules)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(self.name, forKey: .name)
    try container.encode(self._protocol, forKey: ._protocol)
    try container.encode(self.backendPort, forKey: .backendPort)
    try container.encode(self.frontendPortRangeStart, forKey: .frontendPortRangeStart)
    try container.encode(self.frontendPortRangeEnd, forKey: .frontendPortRangeEnd)
    if self.networkSecurityGroupRules != nil {try container.encode(self.networkSecurityGroupRules as! [NetworkSecurityGroupRuleData?]?, forKey: .networkSecurityGroupRules)}
  }
}

extension DataFactory {
  public static func createInboundNATPoolProtocol(name: String, _protocol: InboundEndpointProtocolEnum, backendPort: Int32, frontendPortRangeStart: Int32, frontendPortRangeEnd: Int32) -> InboundNATPoolProtocol {
    return InboundNATPoolData(name: name, _protocol: _protocol, backendPort: backendPort, frontendPortRangeStart: frontendPortRangeStart, frontendPortRangeEnd: frontendPortRangeEnd)
  }
}


// JobAction enumerates the values for job action.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum JobActionEnum: String, Codable
{
// JobActionDisable specifies the job action disable state for job action.
    case JobActionDisable = "disable"
// JobActionNone specifies the job action none state for job action.
    case JobActionNone = "none"
// JobActionTerminate specifies the job action terminate state for job action.
    case JobActionTerminate = "terminate"
}


// Copyright (c) Microsoft Corporation. All rights 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 JobAddHeadersData : JobAddHeadersProtocol {
    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 createJobAddHeadersProtocol() -> JobAddHeadersProtocol {
    return JobAddHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobAddParameterData : JobAddParameterProtocol {
    public var id: String
    public var displayName: String?
    public var priority: Int32?
    public var constraints: JobConstraintsProtocol?
    public var jobManagerTask: JobManagerTaskProtocol?
    public var jobPreparationTask: JobPreparationTaskProtocol?
    public var jobReleaseTask: JobReleaseTaskProtocol?
    public var commonEnvironmentSettings: [EnvironmentSettingProtocol?]?
    public var poolInfo: PoolInformationProtocol
    public var onAllTasksComplete: OnAllTasksCompleteEnum?
    public var onTaskFailure: OnTaskFailureEnum?
    public var metadata: [MetadataItemProtocol?]?
    public var usesTaskDependencies: Bool?

        enum CodingKeys: String, CodingKey {case id = "id"
        case displayName = "displayName"
        case priority = "priority"
        case constraints = "constraints"
        case jobManagerTask = "jobManagerTask"
        case jobPreparationTask = "jobPreparationTask"
        case jobReleaseTask = "jobReleaseTask"
        case commonEnvironmentSettings = "commonEnvironmentSettings"
        case poolInfo = "poolInfo"
        case onAllTasksComplete = "onAllTasksComplete"
        case onTaskFailure = "onTaskFailure"
        case metadata = "metadata"
        case usesTaskDependencies = "usesTaskDependencies"
        }

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

  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)
    }
    if container.contains(.priority) {
        self.priority = try container.decode(Int32?.self, forKey: .priority)
    }
    if container.contains(.constraints) {
        self.constraints = try container.decode(JobConstraintsData?.self, forKey: .constraints)
    }
    if container.contains(.jobManagerTask) {
        self.jobManagerTask = try container.decode(JobManagerTaskData?.self, forKey: .jobManagerTask)
    }
    if container.contains(.jobPreparationTask) {
        self.jobPreparationTask = try container.decode(JobPreparationTaskData?.self, forKey: .jobPreparationTask)
    }
    if container.contains(.jobReleaseTask) {
        self.jobReleaseTask = try container.decode(JobReleaseTaskData?.self, forKey: .jobReleaseTask)
    }
    if container.contains(.commonEnvironmentSettings) {
        self.commonEnvironmentSettings = try container.decode([EnvironmentSettingData?]?.self, forKey: .commonEnvironmentSettings)
    }
    self.poolInfo = try container.decode(PoolInformationData.self, forKey: .poolInfo)
    if container.contains(.onAllTasksComplete) {
        self.onAllTasksComplete = try container.decode(OnAllTasksCompleteEnum?.self, forKey: .onAllTasksComplete)
    }
    if container.contains(.onTaskFailure) {
        self.onTaskFailure = try container.decode(OnTaskFailureEnum?.self, forKey: .onTaskFailure)
    }
    if container.contains(.metadata) {
        self.metadata = try container.decode([MetadataItemData?]?.self, forKey: .metadata)
    }
    if container.contains(.usesTaskDependencies) {
        self.usesTaskDependencies = try container.decode(Bool?.self, forKey: .usesTaskDependencies)
    }
    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)}
    if self.priority != nil {try container.encode(self.priority, forKey: .priority)}
    if self.constraints != nil {try container.encode(self.constraints as! JobConstraintsData?, forKey: .constraints)}
    if self.jobManagerTask != nil {try container.encode(self.jobManagerTask as! JobManagerTaskData?, forKey: .jobManagerTask)}
    if self.jobPreparationTask != nil {try container.encode(self.jobPreparationTask as! JobPreparationTaskData?, forKey: .jobPreparationTask)}
    if self.jobReleaseTask != nil {try container.encode(self.jobReleaseTask as! JobReleaseTaskData?, forKey: .jobReleaseTask)}
    if self.commonEnvironmentSettings != nil {try container.encode(self.commonEnvironmentSettings as! [EnvironmentSettingData?]?, forKey: .commonEnvironmentSettings)}
    try container.encode(self.poolInfo as! PoolInformationData, forKey: .poolInfo)
    if self.onAllTasksComplete != nil {try container.encode(self.onAllTasksComplete, forKey: .onAllTasksComplete)}
    if self.onTaskFailure != nil {try container.encode(self.onTaskFailure, forKey: .onTaskFailure)}
    if self.metadata != nil {try container.encode(self.metadata as! [MetadataItemData?]?, forKey: .metadata)}
    if self.usesTaskDependencies != nil {try container.encode(self.usesTaskDependencies, forKey: .usesTaskDependencies)}
  }
}

extension DataFactory {
  public static func createJobAddParameterProtocol(id: String, poolInfo: PoolInformationProtocol) -> JobAddParameterProtocol {
    return JobAddParameterData(id: id, poolInfo: poolInfo)
  }
}


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

        enum CodingKeys: String, CodingKey {case maxWallClockTime = "maxWallClockTime"
        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(.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.maxTaskRetryCount != nil {try container.encode(self.maxTaskRetryCount, forKey: .maxTaskRetryCount)}
  }
}

extension DataFactory {
  public static func createJobConstraintsProtocol() -> JobConstraintsProtocol {
    return JobConstraintsData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobDeleteHeadersData : JobDeleteHeadersProtocol {
    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 createJobDeleteHeadersProtocol() -> JobDeleteHeadersProtocol {
    return JobDeleteHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobDisableHeadersData : JobDisableHeadersProtocol {
    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 createJobDisableHeadersProtocol() -> JobDisableHeadersProtocol {
    return JobDisableHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobDisableParameterData : JobDisableParameterProtocol {
    public var disableTasks: DisableJobOptionEnum

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

  public init(disableTasks: DisableJobOptionEnum)  {
    self.disableTasks = disableTasks
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.disableTasks = try container.decode(DisableJobOptionEnum.self, forKey: .disableTasks)
    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.disableTasks, forKey: .disableTasks)
  }
}

extension DataFactory {
  public static func createJobDisableParameterProtocol(disableTasks: DisableJobOptionEnum) -> JobDisableParameterProtocol {
    return JobDisableParameterData(disableTasks: disableTasks)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobEnableHeadersData : JobEnableHeadersProtocol {
    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 createJobEnableHeadersProtocol() -> JobEnableHeadersProtocol {
    return JobEnableHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobExecutionInformationData : JobExecutionInformationProtocol {
    public var startTime: Date
    public var endTime: Date?
    public var poolId: String?
    public var schedulingError: JobSchedulingErrorProtocol?
    public var terminateReason: String?

        enum CodingKeys: String, CodingKey {case startTime = "startTime"
        case endTime = "endTime"
        case poolId = "poolId"
        case schedulingError = "schedulingError"
        case terminateReason = "terminateReason"
        }

  public init(startTime: Date)  {
    self.startTime = startTime
  }

  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)!
    if container.contains(.endTime) {
        self.endTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .endTime)), format: .dateTime)
    }
    if container.contains(.poolId) {
        self.poolId = try container.decode(String?.self, forKey: .poolId)
    }
    if container.contains(.schedulingError) {
        self.schedulingError = try container.decode(JobSchedulingErrorData?.self, forKey: .schedulingError)
    }
    if container.contains(.terminateReason) {
        self.terminateReason = try container.decode(String?.self, forKey: .terminateReason)
    }
    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)
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
    if self.poolId != nil {try container.encode(self.poolId, forKey: .poolId)}
    if self.schedulingError != nil {try container.encode(self.schedulingError as! JobSchedulingErrorData?, forKey: .schedulingError)}
    if self.terminateReason != nil {try container.encode(self.terminateReason, forKey: .terminateReason)}
  }
}

extension DataFactory {
  public static func createJobExecutionInformationProtocol(startTime: Date) -> JobExecutionInformationProtocol {
    return JobExecutionInformationData(startTime: startTime)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobGetAllLifetimeStatisticsHeadersData : JobGetAllLifetimeStatisticsHeadersProtocol {
    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 createJobGetAllLifetimeStatisticsHeadersProtocol() -> JobGetAllLifetimeStatisticsHeadersProtocol {
    return JobGetAllLifetimeStatisticsHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobGetHeadersData : JobGetHeadersProtocol {
    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 createJobGetHeadersProtocol() -> JobGetHeadersProtocol {
    return JobGetHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobGetTaskCountsHeadersData : JobGetTaskCountsHeadersProtocol {
    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 createJobGetTaskCountsHeadersProtocol() -> JobGetTaskCountsHeadersProtocol {
    return JobGetTaskCountsHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobListFromJobScheduleHeadersData : JobListFromJobScheduleHeadersProtocol {
    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 createJobListFromJobScheduleHeadersProtocol() -> JobListFromJobScheduleHeadersProtocol {
    return JobListFromJobScheduleHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobListHeadersData : JobListHeadersProtocol {
    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 createJobListHeadersProtocol() -> JobListHeadersProtocol {
    return JobListHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobListPreparationAndReleaseTaskStatusHeadersData : JobListPreparationAndReleaseTaskStatusHeadersProtocol {
    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 createJobListPreparationAndReleaseTaskStatusHeadersProtocol() -> JobListPreparationAndReleaseTaskStatusHeadersProtocol {
    return JobListPreparationAndReleaseTaskStatusHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobManagerTaskData : JobManagerTaskProtocol {
    public var id: String
    public var displayName: String?
    public var commandLine: String
    public var containerSettings: TaskContainerSettingsProtocol?
    public var resourceFiles: [ResourceFileProtocol?]?
    public var outputFiles: [OutputFileProtocol?]?
    public var environmentSettings: [EnvironmentSettingProtocol?]?
    public var constraints: TaskConstraintsProtocol?
    public var killJobOnCompletion: Bool?
    public var userIdentity: UserIdentityProtocol?
    public var runExclusive: Bool?
    public var applicationPackageReferences: [ApplicationPackageReferenceProtocol?]?
    public var authenticationTokenSettings: AuthenticationTokenSettingsProtocol?
    public var allowLowPriorityNode: Bool?

        enum CodingKeys: String, CodingKey {case id = "id"
        case displayName = "displayName"
        case commandLine = "commandLine"
        case containerSettings = "containerSettings"
        case resourceFiles = "resourceFiles"
        case outputFiles = "outputFiles"
        case environmentSettings = "environmentSettings"
        case constraints = "constraints"
        case killJobOnCompletion = "killJobOnCompletion"
        case userIdentity = "userIdentity"
        case runExclusive = "runExclusive"
        case applicationPackageReferences = "applicationPackageReferences"
        case authenticationTokenSettings = "authenticationTokenSettings"
        case allowLowPriorityNode = "allowLowPriorityNode"
        }

  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(.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(.constraints) {
        self.constraints = try container.decode(TaskConstraintsData?.self, forKey: .constraints)
    }
    if container.contains(.killJobOnCompletion) {
        self.killJobOnCompletion = try container.decode(Bool?.self, forKey: .killJobOnCompletion)
    }
    if container.contains(.userIdentity) {
        self.userIdentity = try container.decode(UserIdentityData?.self, forKey: .userIdentity)
    }
    if container.contains(.runExclusive) {
        self.runExclusive = try container.decode(Bool?.self, forKey: .runExclusive)
    }
    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 container.contains(.allowLowPriorityNode) {
        self.allowLowPriorityNode = try container.decode(Bool?.self, forKey: .allowLowPriorityNode)
    }
    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.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.constraints != nil {try container.encode(self.constraints as! TaskConstraintsData?, forKey: .constraints)}
    if self.killJobOnCompletion != nil {try container.encode(self.killJobOnCompletion, forKey: .killJobOnCompletion)}
    if self.userIdentity != nil {try container.encode(self.userIdentity as! UserIdentityData?, forKey: .userIdentity)}
    if self.runExclusive != nil {try container.encode(self.runExclusive, forKey: .runExclusive)}
    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)}
    if self.allowLowPriorityNode != nil {try container.encode(self.allowLowPriorityNode, forKey: .allowLowPriorityNode)}
  }
}

extension DataFactory {
  public static func createJobManagerTaskProtocol(id: String, commandLine: String) -> JobManagerTaskProtocol {
    return JobManagerTaskData(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 JobPatchHeadersData : JobPatchHeadersProtocol {
    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 createJobPatchHeadersProtocol() -> JobPatchHeadersProtocol {
    return JobPatchHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobPatchParameterData : JobPatchParameterProtocol {
    public var priority: Int32?
    public var onAllTasksComplete: OnAllTasksCompleteEnum?
    public var constraints: JobConstraintsProtocol?
    public var poolInfo: PoolInformationProtocol?
    public var metadata: [MetadataItemProtocol?]?

        enum CodingKeys: String, CodingKey {case priority = "priority"
        case onAllTasksComplete = "onAllTasksComplete"
        case constraints = "constraints"
        case poolInfo = "poolInfo"
        case metadata = "metadata"
        }

  public init()  {
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      if container.contains(.priority) {
        self.priority = try container.decode(Int32?.self, forKey: .priority)
    }
    if container.contains(.onAllTasksComplete) {
        self.onAllTasksComplete = try container.decode(OnAllTasksCompleteEnum?.self, forKey: .onAllTasksComplete)
    }
    if container.contains(.constraints) {
        self.constraints = try container.decode(JobConstraintsData?.self, forKey: .constraints)
    }
    if container.contains(.poolInfo) {
        self.poolInfo = try container.decode(PoolInformationData?.self, forKey: .poolInfo)
    }
    if container.contains(.metadata) {
        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.priority != nil {try container.encode(self.priority, forKey: .priority)}
    if self.onAllTasksComplete != nil {try container.encode(self.onAllTasksComplete, forKey: .onAllTasksComplete)}
    if self.constraints != nil {try container.encode(self.constraints as! JobConstraintsData?, forKey: .constraints)}
    if self.poolInfo != nil {try container.encode(self.poolInfo as! PoolInformationData?, forKey: .poolInfo)}
    if self.metadata != nil {try container.encode(self.metadata as! [MetadataItemData?]?, forKey: .metadata)}
  }
}

extension DataFactory {
  public static func createJobPatchParameterProtocol() -> JobPatchParameterProtocol {
    return JobPatchParameterData()
  }
}