// Copyright (c) Microsoft Corporation. All rights 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 JobPreparationAndReleaseTaskExecutionInformationData : JobPreparationAndReleaseTaskExecutionInformationProtocol {
    public var poolId: String?
    public var nodeId: String?
    public var nodeUrl: String?
    public var jobPreparationTaskExecutionInfo: JobPreparationTaskExecutionInformationProtocol?
    public var jobReleaseTaskExecutionInfo: JobReleaseTaskExecutionInformationProtocol?

        enum CodingKeys: String, CodingKey {case poolId = "poolId"
        case nodeId = "nodeId"
        case nodeUrl = "nodeUrl"
        case jobPreparationTaskExecutionInfo = "jobPreparationTaskExecutionInfo"
        case jobReleaseTaskExecutionInfo = "jobReleaseTaskExecutionInfo"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createJobPreparationAndReleaseTaskExecutionInformationProtocol() -> JobPreparationAndReleaseTaskExecutionInformationProtocol {
    return JobPreparationAndReleaseTaskExecutionInformationData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobPreparationTaskData : JobPreparationTaskProtocol {
    public var id: String?
    public var commandLine: String
    public var containerSettings: TaskContainerSettingsProtocol?
    public var resourceFiles: [ResourceFileProtocol?]?
    public var environmentSettings: [EnvironmentSettingProtocol?]?
    public var constraints: TaskConstraintsProtocol?
    public var waitForSuccess: Bool?
    public var userIdentity: UserIdentityProtocol?
    public var rerunOnNodeRebootAfterSuccess: Bool?

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

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

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

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

extension DataFactory {
  public static func createJobPreparationTaskProtocol(commandLine: String) -> JobPreparationTaskProtocol {
    return JobPreparationTaskData(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 JobPreparationTaskExecutionInformationData : JobPreparationTaskExecutionInformationProtocol {
    public var startTime: Date
    public var endTime: Date?
    public var state: JobPreparationTaskStateEnum
    public var taskRootDirectory: String?
    public var taskRootDirectoryUrl: String?
    public var exitCode: Int32?
    public var containerInfo: TaskContainerExecutionInformationProtocol?
    public var failureInfo: TaskFailureInformationProtocol?
    public var retryCount: Int32
    public var lastRetryTime: Date?
    public var result: TaskExecutionResultEnum?

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

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

  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)
    }
    self.state = try container.decode(JobPreparationTaskStateEnum.self, forKey: .state)
    if container.contains(.taskRootDirectory) {
        self.taskRootDirectory = try container.decode(String?.self, forKey: .taskRootDirectory)
    }
    if container.contains(.taskRootDirectoryUrl) {
        self.taskRootDirectoryUrl = try container.decode(String?.self, forKey: .taskRootDirectoryUrl)
    }
    if container.contains(.exitCode) {
        self.exitCode = try container.decode(Int32?.self, forKey: .exitCode)
    }
    if container.contains(.containerInfo) {
        self.containerInfo = try container.decode(TaskContainerExecutionInformationData?.self, forKey: .containerInfo)
    }
    if container.contains(.failureInfo) {
        self.failureInfo = try container.decode(TaskFailureInformationData?.self, forKey: .failureInfo)
    }
    self.retryCount = try container.decode(Int32.self, forKey: .retryCount)
    if container.contains(.lastRetryTime) {
        self.lastRetryTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastRetryTime)), format: .dateTime)
    }
    if container.contains(.result) {
        self.result = try container.decode(TaskExecutionResultEnum?.self, forKey: .result)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(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)
    }
    try container.encode(self.state, forKey: .state)
    if self.taskRootDirectory != nil {try container.encode(self.taskRootDirectory, forKey: .taskRootDirectory)}
    if self.taskRootDirectoryUrl != nil {try container.encode(self.taskRootDirectoryUrl, forKey: .taskRootDirectoryUrl)}
    if self.exitCode != nil {try container.encode(self.exitCode, forKey: .exitCode)}
    if self.containerInfo != nil {try container.encode(self.containerInfo as! TaskContainerExecutionInformationData?, forKey: .containerInfo)}
    if self.failureInfo != nil {try container.encode(self.failureInfo as! TaskFailureInformationData?, forKey: .failureInfo)}
    try container.encode(self.retryCount, forKey: .retryCount)
    if self.lastRetryTime != nil {
        try container.encode(DateConverter.toString(date: self.lastRetryTime!, format: .dateTime), forKey: .lastRetryTime)
    }
    if self.result != nil {try container.encode(self.result, forKey: .result)}
  }
}

extension DataFactory {
  public static func createJobPreparationTaskExecutionInformationProtocol(startTime: Date, state: JobPreparationTaskStateEnum, retryCount: Int32) -> JobPreparationTaskExecutionInformationProtocol {
    return JobPreparationTaskExecutionInformationData(startTime: startTime, state: state, retryCount: retryCount)
  }
}


// JobPreparationTaskState enumerates the values for job preparation task state.

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct JobReleaseTaskData : JobReleaseTaskProtocol {
    public var id: String?
    public var commandLine: String
    public var containerSettings: TaskContainerSettingsProtocol?
    public var resourceFiles: [ResourceFileProtocol?]?
    public var environmentSettings: [EnvironmentSettingProtocol?]?
    public var maxWallClockTime: String?
    public var retentionTime: String?
    public var userIdentity: UserIdentityProtocol?

        enum CodingKeys: String, CodingKey {case id = "id"
        case commandLine = "commandLine"
        case containerSettings = "containerSettings"
        case resourceFiles = "resourceFiles"
        case environmentSettings = "environmentSettings"
        case maxWallClockTime = "maxWallClockTime"
        case retentionTime = "retentionTime"
        case userIdentity = "userIdentity"
        }

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

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

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

extension DataFactory {
  public static func createJobReleaseTaskProtocol(commandLine: String) -> JobReleaseTaskProtocol {
    return JobReleaseTaskData(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 JobReleaseTaskExecutionInformationData : JobReleaseTaskExecutionInformationProtocol {
    public var startTime: Date
    public var endTime: Date?
    public var state: JobReleaseTaskStateEnum
    public var taskRootDirectory: String?
    public var taskRootDirectoryUrl: String?
    public var exitCode: Int32?
    public var containerInfo: TaskContainerExecutionInformationProtocol?
    public var failureInfo: TaskFailureInformationProtocol?
    public var result: TaskExecutionResultEnum?

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

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

  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)
    }
    self.state = try container.decode(JobReleaseTaskStateEnum.self, forKey: .state)
    if container.contains(.taskRootDirectory) {
        self.taskRootDirectory = try container.decode(String?.self, forKey: .taskRootDirectory)
    }
    if container.contains(.taskRootDirectoryUrl) {
        self.taskRootDirectoryUrl = try container.decode(String?.self, forKey: .taskRootDirectoryUrl)
    }
    if container.contains(.exitCode) {
        self.exitCode = try container.decode(Int32?.self, forKey: .exitCode)
    }
    if container.contains(.containerInfo) {
        self.containerInfo = try container.decode(TaskContainerExecutionInformationData?.self, forKey: .containerInfo)
    }
    if container.contains(.failureInfo) {
        self.failureInfo = try container.decode(TaskFailureInformationData?.self, forKey: .failureInfo)
    }
    if container.contains(.result) {
        self.result = try container.decode(TaskExecutionResultEnum?.self, forKey: .result)
    }
    if var pageDecoder = decoder as? PageDecoder  {
      if pageDecoder.isPagedData,
        let nextLinkName = pageDecoder.nextLinkName {
          pageDecoder.nextLink = try UnknownCodingKey.decodeStringForKey(decoder: decoder, keyForDecode: nextLinkName)
      }
    }
  }

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    try container.encode(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)
    }
    try container.encode(self.state, forKey: .state)
    if self.taskRootDirectory != nil {try container.encode(self.taskRootDirectory, forKey: .taskRootDirectory)}
    if self.taskRootDirectoryUrl != nil {try container.encode(self.taskRootDirectoryUrl, forKey: .taskRootDirectoryUrl)}
    if self.exitCode != nil {try container.encode(self.exitCode, forKey: .exitCode)}
    if self.containerInfo != nil {try container.encode(self.containerInfo as! TaskContainerExecutionInformationData?, forKey: .containerInfo)}
    if self.failureInfo != nil {try container.encode(self.failureInfo as! TaskFailureInformationData?, forKey: .failureInfo)}
    if self.result != nil {try container.encode(self.result, forKey: .result)}
  }
}

extension DataFactory {
  public static func createJobReleaseTaskExecutionInformationProtocol(startTime: Date, state: JobReleaseTaskStateEnum) -> JobReleaseTaskExecutionInformationProtocol {
    return JobReleaseTaskExecutionInformationData(startTime: startTime, state: state)
  }
}


// JobReleaseTaskState enumerates the values for job release task state.

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


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct JobScheduleAddHeadersData : JobScheduleAddHeadersProtocol {
    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 createJobScheduleAddHeadersProtocol() -> JobScheduleAddHeadersProtocol {
    return JobScheduleAddHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleAddParameterData : JobScheduleAddParameterProtocol {
    public var id: String
    public var displayName: String?
    public var schedule: ScheduleProtocol
    public var jobSpecification: JobSpecificationProtocol
    public var metadata: [MetadataItemProtocol?]?

        enum CodingKeys: String, CodingKey {case id = "id"
        case displayName = "displayName"
        case schedule = "schedule"
        case jobSpecification = "jobSpecification"
        case metadata = "metadata"
        }

  public init(id: String, schedule: ScheduleProtocol, jobSpecification: JobSpecificationProtocol)  {
    self.id = id
    self.schedule = schedule
    self.jobSpecification = jobSpecification
  }

  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.schedule = try container.decode(ScheduleData.self, forKey: .schedule)
    self.jobSpecification = try container.decode(JobSpecificationData.self, forKey: .jobSpecification)
    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)
    try container.encode(self.id, forKey: .id)
    if self.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    try container.encode(self.schedule as! ScheduleData, forKey: .schedule)
    try container.encode(self.jobSpecification as! JobSpecificationData, forKey: .jobSpecification)
    if self.metadata != nil {try container.encode(self.metadata as! [MetadataItemData?]?, forKey: .metadata)}
  }
}

extension DataFactory {
  public static func createJobScheduleAddParameterProtocol(id: String, schedule: ScheduleProtocol, jobSpecification: JobSpecificationProtocol) -> JobScheduleAddParameterProtocol {
    return JobScheduleAddParameterData(id: id, schedule: schedule, jobSpecification: jobSpecification)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleDeleteHeadersData : JobScheduleDeleteHeadersProtocol {
    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 createJobScheduleDeleteHeadersProtocol() -> JobScheduleDeleteHeadersProtocol {
    return JobScheduleDeleteHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleDisableHeadersData : JobScheduleDisableHeadersProtocol {
    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 createJobScheduleDisableHeadersProtocol() -> JobScheduleDisableHeadersProtocol {
    return JobScheduleDisableHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleEnableHeadersData : JobScheduleEnableHeadersProtocol {
    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 createJobScheduleEnableHeadersProtocol() -> JobScheduleEnableHeadersProtocol {
    return JobScheduleEnableHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleExecutionInformationData : JobScheduleExecutionInformationProtocol {
    public var nextRunTime: Date?
    public var recentJob: RecentJobProtocol?
    public var endTime: Date?

        enum CodingKeys: String, CodingKey {case nextRunTime = "nextRunTime"
        case recentJob = "recentJob"
        case endTime = "endTime"
        }

  public init()  {
  }

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

  public func encode(to encoder: Encoder) throws {
    var container = encoder.container(keyedBy: CodingKeys.self)
    if self.nextRunTime != nil {
        try container.encode(DateConverter.toString(date: self.nextRunTime!, format: .dateTime), forKey: .nextRunTime)
    }
    if self.recentJob != nil {try container.encode(self.recentJob as! RecentJobData?, forKey: .recentJob)}
    if self.endTime != nil {
        try container.encode(DateConverter.toString(date: self.endTime!, format: .dateTime), forKey: .endTime)
    }
  }
}

extension DataFactory {
  public static func createJobScheduleExecutionInformationProtocol() -> JobScheduleExecutionInformationProtocol {
    return JobScheduleExecutionInformationData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleExistsHeadersData : JobScheduleExistsHeadersProtocol {
    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 createJobScheduleExistsHeadersProtocol() -> JobScheduleExistsHeadersProtocol {
    return JobScheduleExistsHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleGetHeadersData : JobScheduleGetHeadersProtocol {
    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 createJobScheduleGetHeadersProtocol() -> JobScheduleGetHeadersProtocol {
    return JobScheduleGetHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleListHeadersData : JobScheduleListHeadersProtocol {
    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 createJobScheduleListHeadersProtocol() -> JobScheduleListHeadersProtocol {
    return JobScheduleListHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobSchedulePatchHeadersData : JobSchedulePatchHeadersProtocol {
    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 createJobSchedulePatchHeadersProtocol() -> JobSchedulePatchHeadersProtocol {
    return JobSchedulePatchHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobSchedulePatchParameterData : JobSchedulePatchParameterProtocol {
    public var schedule: ScheduleProtocol?
    public var jobSpecification: JobSpecificationProtocol?
    public var metadata: [MetadataItemProtocol?]?

        enum CodingKeys: String, CodingKey {case schedule = "schedule"
        case jobSpecification = "jobSpecification"
        case metadata = "metadata"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createJobSchedulePatchParameterProtocol() -> JobSchedulePatchParameterProtocol {
    return JobSchedulePatchParameterData()
  }
}


// JobScheduleState enumerates the values for job schedule state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum JobScheduleStateEnum: String, Codable
{
// JobScheduleStateActive specifies the job schedule state active state for job schedule state.
    case JobScheduleStateActive = "active"
// JobScheduleStateCompleted specifies the job schedule state completed state for job schedule state.
    case JobScheduleStateCompleted = "completed"
// JobScheduleStateDeleting specifies the job schedule state deleting state for job schedule state.
    case JobScheduleStateDeleting = "deleting"
// JobScheduleStateDisabled specifies the job schedule state disabled state for job schedule state.
    case JobScheduleStateDisabled = "disabled"
// JobScheduleStateTerminating specifies the job schedule state terminating state for job schedule state.
    case JobScheduleStateTerminating = "terminating"
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleStatisticsData : JobScheduleStatisticsProtocol {
    public var url: String
    public var startTime: Date
    public var lastUpdateTime: Date
    public var userCPUTime: String
    public var kernelCPUTime: String
    public var wallClockTime: String
    public var readIOps: Int64
    public var writeIOps: Int64
    public var readIOGiB: Double
    public var writeIOGiB: Double
    public var numSucceededTasks: Int64
    public var numFailedTasks: Int64
    public var numTaskRetries: Int64
    public var waitTime: String

        enum CodingKeys: String, CodingKey {case url = "url"
        case startTime = "startTime"
        case lastUpdateTime = "lastUpdateTime"
        case userCPUTime = "userCPUTime"
        case kernelCPUTime = "kernelCPUTime"
        case wallClockTime = "wallClockTime"
        case readIOps = "readIOps"
        case writeIOps = "writeIOps"
        case readIOGiB = "readIOGiB"
        case writeIOGiB = "writeIOGiB"
        case numSucceededTasks = "numSucceededTasks"
        case numFailedTasks = "numFailedTasks"
        case numTaskRetries = "numTaskRetries"
        case waitTime = "waitTime"
        }

  public init(url: String, startTime: Date, lastUpdateTime: Date, userCPUTime: String, kernelCPUTime: String, wallClockTime: String, readIOps: Int64, writeIOps: Int64, readIOGiB: Double, writeIOGiB: Double, numSucceededTasks: Int64, numFailedTasks: Int64, numTaskRetries: Int64, waitTime: String)  {
    self.url = url
    self.startTime = startTime
    self.lastUpdateTime = lastUpdateTime
    self.userCPUTime = userCPUTime
    self.kernelCPUTime = kernelCPUTime
    self.wallClockTime = wallClockTime
    self.readIOps = readIOps
    self.writeIOps = writeIOps
    self.readIOGiB = readIOGiB
    self.writeIOGiB = writeIOGiB
    self.numSucceededTasks = numSucceededTasks
    self.numFailedTasks = numFailedTasks
    self.numTaskRetries = numTaskRetries
    self.waitTime = waitTime
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.url = try container.decode(String.self, forKey: .url)
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)!
        self.lastUpdateTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUpdateTime)), format: .dateTime)!
    self.userCPUTime = try container.decode(String.self, forKey: .userCPUTime)
    self.kernelCPUTime = try container.decode(String.self, forKey: .kernelCPUTime)
    self.wallClockTime = try container.decode(String.self, forKey: .wallClockTime)
    self.readIOps = try container.decode(Int64.self, forKey: .readIOps)
    self.writeIOps = try container.decode(Int64.self, forKey: .writeIOps)
    self.readIOGiB = try container.decode(Double.self, forKey: .readIOGiB)
    self.writeIOGiB = try container.decode(Double.self, forKey: .writeIOGiB)
    self.numSucceededTasks = try container.decode(Int64.self, forKey: .numSucceededTasks)
    self.numFailedTasks = try container.decode(Int64.self, forKey: .numFailedTasks)
    self.numTaskRetries = try container.decode(Int64.self, forKey: .numTaskRetries)
    self.waitTime = try container.decode(String.self, forKey: .waitTime)
    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.url, forKey: .url)
    try container.encode(DateConverter.toString(date: self.startTime, format: .dateTime), forKey: .startTime)
    try container.encode(DateConverter.toString(date: self.lastUpdateTime, format: .dateTime), forKey: .lastUpdateTime)
    try container.encode(self.userCPUTime, forKey: .userCPUTime)
    try container.encode(self.kernelCPUTime, forKey: .kernelCPUTime)
    try container.encode(self.wallClockTime, forKey: .wallClockTime)
    try container.encode(self.readIOps, forKey: .readIOps)
    try container.encode(self.writeIOps, forKey: .writeIOps)
    try container.encode(self.readIOGiB, forKey: .readIOGiB)
    try container.encode(self.writeIOGiB, forKey: .writeIOGiB)
    try container.encode(self.numSucceededTasks, forKey: .numSucceededTasks)
    try container.encode(self.numFailedTasks, forKey: .numFailedTasks)
    try container.encode(self.numTaskRetries, forKey: .numTaskRetries)
    try container.encode(self.waitTime, forKey: .waitTime)
  }
}

extension DataFactory {
  public static func createJobScheduleStatisticsProtocol(url: String, startTime: Date, lastUpdateTime: Date, userCPUTime: String, kernelCPUTime: String, wallClockTime: String, readIOps: Int64, writeIOps: Int64, readIOGiB: Double, writeIOGiB: Double, numSucceededTasks: Int64, numFailedTasks: Int64, numTaskRetries: Int64, waitTime: String) -> JobScheduleStatisticsProtocol {
    return JobScheduleStatisticsData(url: url, startTime: startTime, lastUpdateTime: lastUpdateTime, userCPUTime: userCPUTime, kernelCPUTime: kernelCPUTime, wallClockTime: wallClockTime, readIOps: readIOps, writeIOps: writeIOps, readIOGiB: readIOGiB, writeIOGiB: writeIOGiB, numSucceededTasks: numSucceededTasks, numFailedTasks: numFailedTasks, numTaskRetries: numTaskRetries, waitTime: waitTime)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleTerminateHeadersData : JobScheduleTerminateHeadersProtocol {
    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 createJobScheduleTerminateHeadersProtocol() -> JobScheduleTerminateHeadersProtocol {
    return JobScheduleTerminateHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleUpdateHeadersData : JobScheduleUpdateHeadersProtocol {
    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 createJobScheduleUpdateHeadersProtocol() -> JobScheduleUpdateHeadersProtocol {
    return JobScheduleUpdateHeadersData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobScheduleUpdateParameterData : JobScheduleUpdateParameterProtocol {
    public var schedule: ScheduleProtocol
    public var jobSpecification: JobSpecificationProtocol
    public var metadata: [MetadataItemProtocol?]?

        enum CodingKeys: String, CodingKey {case schedule = "schedule"
        case jobSpecification = "jobSpecification"
        case metadata = "metadata"
        }

  public init(schedule: ScheduleProtocol, jobSpecification: JobSpecificationProtocol)  {
    self.schedule = schedule
    self.jobSpecification = jobSpecification
  }

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

extension DataFactory {
  public static func createJobScheduleUpdateParameterProtocol(schedule: ScheduleProtocol, jobSpecification: JobSpecificationProtocol) -> JobScheduleUpdateParameterProtocol {
    return JobScheduleUpdateParameterData(schedule: schedule, jobSpecification: jobSpecification)
  }
}


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

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

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

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

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

extension DataFactory {
  public static func createJobSchedulingErrorProtocol(category: ErrorCategoryEnum) -> JobSchedulingErrorProtocol {
    return JobSchedulingErrorData(category: category)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct JobSpecificationData : JobSpecificationProtocol {
    public var priority: Int32?
    public var displayName: String?
    public var usesTaskDependencies: Bool?
    public var onAllTasksComplete: OnAllTasksCompleteEnum?
    public var onTaskFailure: OnTaskFailureEnum?
    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 metadata: [MetadataItemProtocol?]?

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

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

  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(.displayName) {
        self.displayName = try container.decode(String?.self, forKey: .displayName)
    }
    if container.contains(.usesTaskDependencies) {
        self.usesTaskDependencies = try container.decode(Bool?.self, forKey: .usesTaskDependencies)
    }
    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(.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(.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.displayName != nil {try container.encode(self.displayName, forKey: .displayName)}
    if self.usesTaskDependencies != nil {try container.encode(self.usesTaskDependencies, forKey: .usesTaskDependencies)}
    if self.onAllTasksComplete != nil {try container.encode(self.onAllTasksComplete, forKey: .onAllTasksComplete)}
    if self.onTaskFailure != nil {try container.encode(self.onTaskFailure, forKey: .onTaskFailure)}
    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.metadata != nil {try container.encode(self.metadata as! [MetadataItemData?]?, forKey: .metadata)}
  }
}

extension DataFactory {
  public static func createJobSpecificationProtocol(poolInfo: PoolInformationProtocol) -> JobSpecificationProtocol {
    return JobSpecificationData(poolInfo: poolInfo)
  }
}


// JobState enumerates the values for job state.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
public enum JobStateEnum: String, Codable
{
// JobStateActive specifies the job state active state for job state.
    case JobStateActive = "active"
// JobStateCompleted specifies the job state completed state for job state.
    case JobStateCompleted = "completed"
// JobStateDeleting specifies the job state deleting state for job state.
    case JobStateDeleting = "deleting"
// JobStateDisabled specifies the job state disabled state for job state.
    case JobStateDisabled = "disabled"
// JobStateDisabling specifies the job state disabling state for job state.
    case JobStateDisabling = "disabling"
// JobStateEnabling specifies the job state enabling state for job state.
    case JobStateEnabling = "enabling"
// JobStateTerminating specifies the job state terminating state for job state.
    case JobStateTerminating = "terminating"
}


// Copyright (c) Microsoft Corporation. All rights 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 JobStatisticsData : JobStatisticsProtocol {
    public var url: String
    public var startTime: Date
    public var lastUpdateTime: Date
    public var userCPUTime: String
    public var kernelCPUTime: String
    public var wallClockTime: String
    public var readIOps: Int64
    public var writeIOps: Int64
    public var readIOGiB: Double
    public var writeIOGiB: Double
    public var numSucceededTasks: Int64
    public var numFailedTasks: Int64
    public var numTaskRetries: Int64
    public var waitTime: String

        enum CodingKeys: String, CodingKey {case url = "url"
        case startTime = "startTime"
        case lastUpdateTime = "lastUpdateTime"
        case userCPUTime = "userCPUTime"
        case kernelCPUTime = "kernelCPUTime"
        case wallClockTime = "wallClockTime"
        case readIOps = "readIOps"
        case writeIOps = "writeIOps"
        case readIOGiB = "readIOGiB"
        case writeIOGiB = "writeIOGiB"
        case numSucceededTasks = "numSucceededTasks"
        case numFailedTasks = "numFailedTasks"
        case numTaskRetries = "numTaskRetries"
        case waitTime = "waitTime"
        }

  public init(url: String, startTime: Date, lastUpdateTime: Date, userCPUTime: String, kernelCPUTime: String, wallClockTime: String, readIOps: Int64, writeIOps: Int64, readIOGiB: Double, writeIOGiB: Double, numSucceededTasks: Int64, numFailedTasks: Int64, numTaskRetries: Int64, waitTime: String)  {
    self.url = url
    self.startTime = startTime
    self.lastUpdateTime = lastUpdateTime
    self.userCPUTime = userCPUTime
    self.kernelCPUTime = kernelCPUTime
    self.wallClockTime = wallClockTime
    self.readIOps = readIOps
    self.writeIOps = writeIOps
    self.readIOGiB = readIOGiB
    self.writeIOGiB = writeIOGiB
    self.numSucceededTasks = numSucceededTasks
    self.numFailedTasks = numFailedTasks
    self.numTaskRetries = numTaskRetries
    self.waitTime = waitTime
  }

  public init(from decoder: Decoder) throws {
    let container = try decoder.container(keyedBy: CodingKeys.self)
      self.url = try container.decode(String.self, forKey: .url)
        self.startTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .startTime)), format: .dateTime)!
        self.lastUpdateTime = DateConverter.fromString(dateStr: (try container.decode(String?.self, forKey: .lastUpdateTime)), format: .dateTime)!
    self.userCPUTime = try container.decode(String.self, forKey: .userCPUTime)
    self.kernelCPUTime = try container.decode(String.self, forKey: .kernelCPUTime)
    self.wallClockTime = try container.decode(String.self, forKey: .wallClockTime)
    self.readIOps = try container.decode(Int64.self, forKey: .readIOps)
    self.writeIOps = try container.decode(Int64.self, forKey: .writeIOps)
    self.readIOGiB = try container.decode(Double.self, forKey: .readIOGiB)
    self.writeIOGiB = try container.decode(Double.self, forKey: .writeIOGiB)
    self.numSucceededTasks = try container.decode(Int64.self, forKey: .numSucceededTasks)
    self.numFailedTasks = try container.decode(Int64.self, forKey: .numFailedTasks)
    self.numTaskRetries = try container.decode(Int64.self, forKey: .numTaskRetries)
    self.waitTime = try container.decode(String.self, forKey: .waitTime)
    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.url, forKey: .url)
    try container.encode(DateConverter.toString(date: self.startTime, format: .dateTime), forKey: .startTime)
    try container.encode(DateConverter.toString(date: self.lastUpdateTime, format: .dateTime), forKey: .lastUpdateTime)
    try container.encode(self.userCPUTime, forKey: .userCPUTime)
    try container.encode(self.kernelCPUTime, forKey: .kernelCPUTime)
    try container.encode(self.wallClockTime, forKey: .wallClockTime)
    try container.encode(self.readIOps, forKey: .readIOps)
    try container.encode(self.writeIOps, forKey: .writeIOps)
    try container.encode(self.readIOGiB, forKey: .readIOGiB)
    try container.encode(self.writeIOGiB, forKey: .writeIOGiB)
    try container.encode(self.numSucceededTasks, forKey: .numSucceededTasks)
    try container.encode(self.numFailedTasks, forKey: .numFailedTasks)
    try container.encode(self.numTaskRetries, forKey: .numTaskRetries)
    try container.encode(self.waitTime, forKey: .waitTime)
  }
}

extension DataFactory {
  public static func createJobStatisticsProtocol(url: String, startTime: Date, lastUpdateTime: Date, userCPUTime: String, kernelCPUTime: String, wallClockTime: String, readIOps: Int64, writeIOps: Int64, readIOGiB: Double, writeIOGiB: Double, numSucceededTasks: Int64, numFailedTasks: Int64, numTaskRetries: Int64, waitTime: String) -> JobStatisticsProtocol {
    return JobStatisticsData(url: url, startTime: startTime, lastUpdateTime: lastUpdateTime, userCPUTime: userCPUTime, kernelCPUTime: kernelCPUTime, wallClockTime: wallClockTime, readIOps: readIOps, writeIOps: writeIOps, readIOGiB: readIOGiB, writeIOGiB: writeIOGiB, numSucceededTasks: numSucceededTasks, numFailedTasks: numFailedTasks, numTaskRetries: numTaskRetries, waitTime: waitTime)
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobTerminateHeadersData : JobTerminateHeadersProtocol {
    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 createJobTerminateHeadersProtocol() -> JobTerminateHeadersProtocol {
    return JobTerminateHeadersData()
  }
}


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

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

  public init()  {
  }

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

extension DataFactory {
  public static func createJobTerminateParameterProtocol() -> JobTerminateParameterProtocol {
    return JobTerminateParameterData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 JobUpdateHeadersData : JobUpdateHeadersProtocol {
    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 createJobUpdateHeadersProtocol() -> JobUpdateHeadersProtocol {
    return JobUpdateHeadersData()
  }
}


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

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

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

  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(.constraints) {
        self.constraints = try container.decode(JobConstraintsData?.self, forKey: .constraints)
    }
    self.poolInfo = try container.decode(PoolInformationData.self, forKey: .poolInfo)
    if container.contains(.metadata) {
        self.metadata = try container.decode([MetadataItemData?]?.self, forKey: .metadata)
    }
    if container.contains(.onAllTasksComplete) {
        self.onAllTasksComplete = try container.decode(OnAllTasksCompleteEnum?.self, forKey: .onAllTasksComplete)
    }
    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.constraints != nil {try container.encode(self.constraints as! JobConstraintsData?, forKey: .constraints)}
    try container.encode(self.poolInfo as! PoolInformationData, forKey: .poolInfo)
    if self.metadata != nil {try container.encode(self.metadata as! [MetadataItemData?]?, forKey: .metadata)}
    if self.onAllTasksComplete != nil {try container.encode(self.onAllTasksComplete, forKey: .onAllTasksComplete)}
  }
}

extension DataFactory {
  public static func createJobUpdateParameterProtocol(poolInfo: PoolInformationProtocol) -> JobUpdateParameterProtocol {
    return JobUpdateParameterData(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 LinuxUserConfigurationData : LinuxUserConfigurationProtocol {
    public var uid: Int32?
    public var gid: Int32?
    public var sshPrivateKey: String?

        enum CodingKeys: String, CodingKey {case uid = "uid"
        case gid = "gid"
        case sshPrivateKey = "sshPrivateKey"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createLinuxUserConfigurationProtocol() -> LinuxUserConfigurationProtocol {
    return LinuxUserConfigurationData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 MetadataItemData : MetadataItemProtocol {
    public var name: String
    public var value: String

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

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

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

extension DataFactory {
  public static func createMetadataItemProtocol(name: String, value: String) -> MetadataItemProtocol {
    return MetadataItemData(name: name, value: value)
  }
}


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
import Foundation
import azureSwiftRuntime
internal struct MultiInstanceSettingsData : MultiInstanceSettingsProtocol {
    public var numberOfInstances: Int32?
    public var coordinationCommandLine: String
    public var commonResourceFiles: [ResourceFileProtocol?]?

        enum CodingKeys: String, CodingKey {case numberOfInstances = "numberOfInstances"
        case coordinationCommandLine = "coordinationCommandLine"
        case commonResourceFiles = "commonResourceFiles"
        }

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

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

extension DataFactory {
  public static func createMultiInstanceSettingsProtocol(coordinationCommandLine: String) -> MultiInstanceSettingsProtocol {
    return MultiInstanceSettingsData(coordinationCommandLine: coordinationCommandLine)
  }
}


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

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

  public init()  {
  }

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

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

extension DataFactory {
  public static func createNameValuePairProtocol() -> NameValuePairProtocol {
    return NameValuePairData()
  }
}


// Copyright (c) Microsoft Corporation. All rights 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 NetworkConfigurationData : NetworkConfigurationProtocol {
    public var subnetId: String?
    public var endpointConfiguration: PoolEndpointConfigurationProtocol?

        enum CodingKeys: String, CodingKey {case subnetId = "subnetId"
        case endpointConfiguration = "endpointConfiguration"
        }

  public init()  {
  }

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

extension DataFactory {
  public static func createNetworkConfigurationProtocol() -> NetworkConfigurationProtocol {
    return NetworkConfigurationData()
  }
}


// NetworkSecurityGroupRuleAccess enumerates the values for network security group rule access.

// Copyright (c) Microsoft Corporation. All rights 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 NetworkSecurityGroupRuleAccessEnum: String, Codable
{
// Allow specifies the allow state for network security group rule access.
    case Allow = "allow"
// Deny specifies the deny state for network security group rule access.
    case Deny = "deny"
}