import Foundation
import azureSwiftRuntime
public protocol FileGetFromComputeNode  {
    var headerParameters: [String: String] { get set }
    var poolId : String { get set }
    var nodeId : String { get set }
    var filePath : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ocpRange : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Data?, Error?) -> Void) -> Void ;
}

extension Commands.File {
// GetFromComputeNode returns the content of the specified compute node file.
    internal class GetFromComputeNodeCommand : BaseCommand, FileGetFromComputeNode {
        public var poolId : String
        public var nodeId : String
        public var filePath : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ocpRange : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(poolId: String, nodeId: String, filePath: String) {
            self.poolId = poolId
            self.nodeId = nodeId
            self.filePath = filePath
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/pools/{poolId}/nodes/{nodeId}/files/{filePath}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{poolId}"] = String(describing: self.poolId)
            self.pathParameters["{nodeId}"] = String(describing: self.nodeId)
            self.pathParameters["{filePath}"] = String(describing: self.filePath)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ocpRange != nil { headerParameters["ocp-range"] = String(describing: self.ocpRange!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            return DataWrapper(data: data);
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Data?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: DataWrapper?, error: Error?) in
                let data = result?.data as Data?
                completionHandler(data!, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol FileGetFromTask  {
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var taskId : String { get set }
    var filePath : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ocpRange : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Data?, Error?) -> Void) -> Void ;
}

extension Commands.File {
// GetFromTask returns the content of the specified task file.
    internal class GetFromTaskCommand : BaseCommand, FileGetFromTask {
        public var jobId : String
        public var taskId : String
        public var filePath : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ocpRange : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobId: String, taskId: String, filePath: String) {
            self.jobId = jobId
            self.taskId = taskId
            self.filePath = filePath
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}/tasks/{taskId}/files/{filePath}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            self.pathParameters["{taskId}"] = String(describing: self.taskId)
            self.pathParameters["{filePath}"] = String(describing: self.filePath)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ocpRange != nil { headerParameters["ocp-range"] = String(describing: self.ocpRange!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            return DataWrapper(data: data);
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Data?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: DataWrapper?, error: Error?) in
                let data = result?.data as Data?
                completionHandler(data!, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol FileGetPropertiesFromComputeNode  {
    var headerParameters: [String: String] { get set }
    var poolId : String { get set }
    var nodeId : String { get set }
    var filePath : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.File {
// GetPropertiesFromComputeNode gets the properties of the specified compute node file.
    internal class GetPropertiesFromComputeNodeCommand : BaseCommand, FileGetPropertiesFromComputeNode {
        public var poolId : String
        public var nodeId : String
        public var filePath : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(poolId: String, nodeId: String, filePath: String) {
            self.poolId = poolId
            self.nodeId = nodeId
            self.filePath = filePath
            super.init()
            self.method = "Head"
            self.isLongRunningOperation = false
            self.path = "/pools/{poolId}/nodes/{nodeId}/files/{filePath}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{poolId}"] = String(describing: self.poolId)
            self.pathParameters["{nodeId}"] = String(describing: self.nodeId)
            self.pathParameters["{filePath}"] = String(describing: self.filePath)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol FileGetPropertiesFromTask  {
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var taskId : String { get set }
    var filePath : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.File {
// GetPropertiesFromTask gets the properties of the specified task file.
    internal class GetPropertiesFromTaskCommand : BaseCommand, FileGetPropertiesFromTask {
        public var jobId : String
        public var taskId : String
        public var filePath : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobId: String, taskId: String, filePath: String) {
            self.jobId = jobId
            self.taskId = taskId
            self.filePath = filePath
            super.init()
            self.method = "Head"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}/tasks/{taskId}/files/{filePath}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            self.pathParameters["{taskId}"] = String(describing: self.taskId)
            self.pathParameters["{filePath}"] = String(describing: self.filePath)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol FileListFromComputeNode  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var poolId : String { get set }
    var nodeId : String { get set }
    var filter : String? { get set }
    var recursive : Bool? { get set }
    var maxResults : Int32? { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (NodeFileListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.File {
// ListFromComputeNode sends the list from compute node request.
    internal class ListFromComputeNodeCommand : BaseCommand, FileListFromComputeNode {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var poolId : String
        public var nodeId : String
        public var filter : String?
        public var recursive : Bool?
        public var maxResults : Int32?
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?

        public init(poolId: String, nodeId: String) {
            self.poolId = poolId
            self.nodeId = nodeId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/pools/{poolId}/nodes/{nodeId}/files"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{poolId}"] = String(describing: self.poolId)
            self.pathParameters["{nodeId}"] = String(describing: self.nodeId)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.recursive != nil { queryParameters["recursive"] = String(describing: self.recursive!) }
            if self.maxResults != nil { queryParameters["maxresults"] = String(describing: self.maxResults!) }
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "OdatanextLink"
                }
                let result = try decoder.decode(NodeFileListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (NodeFileListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: NodeFileListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol FileListFromTask  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var taskId : String { get set }
    var filter : String? { get set }
    var recursive : Bool? { get set }
    var maxResults : Int32? { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (NodeFileListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.File {
// ListFromTask sends the list from task request.
    internal class ListFromTaskCommand : BaseCommand, FileListFromTask {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var jobId : String
        public var taskId : String
        public var filter : String?
        public var recursive : Bool?
        public var maxResults : Int32?
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?

        public init(jobId: String, taskId: String) {
            self.jobId = jobId
            self.taskId = taskId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}/tasks/{taskId}/files"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            self.pathParameters["{taskId}"] = String(describing: self.taskId)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.recursive != nil { queryParameters["recursive"] = String(describing: self.recursive!) }
            if self.maxResults != nil { queryParameters["maxresults"] = String(describing: self.maxResults!) }
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "OdatanextLink"
                }
                let result = try decoder.decode(NodeFileListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (NodeFileListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: NodeFileListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


// 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.

// Job is the a client for issuing REST requests to the Azure Batch service.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct Job {
    public static func Add(job: JobAddParameterProtocol) -> JobAdd {
        return AddCommand(job: job)
    }
    public static func Delete(jobId: String) -> JobDelete {
        return DeleteCommand(jobId: jobId)
    }
    public static func Disable(jobId: String, jobDisableParameter: JobDisableParameterProtocol) -> JobDisable {
        return DisableCommand(jobId: jobId, jobDisableParameter: jobDisableParameter)
    }
    public static func Enable(jobId: String) -> JobEnable {
        return EnableCommand(jobId: jobId)
    }
    public static func Get(jobId: String) -> JobGet {
        return GetCommand(jobId: jobId)
    }
    public static func GetAllLifetimeStatistics() -> JobGetAllLifetimeStatistics {
        return GetAllLifetimeStatisticsCommand()
    }
    public static func GetTaskCounts(jobId: String) -> JobGetTaskCounts {
        return GetTaskCountsCommand(jobId: jobId)
    }
    public static func List() -> JobList {
        return ListCommand()
    }
    public static func ListFromJobSchedule(jobScheduleId: String) -> JobListFromJobSchedule {
        return ListFromJobScheduleCommand(jobScheduleId: jobScheduleId)
    }
    public static func ListPreparationAndReleaseTaskStatus(jobId: String) -> JobListPreparationAndReleaseTaskStatus {
        return ListPreparationAndReleaseTaskStatusCommand(jobId: jobId)
    }
    public static func Patch(jobId: String, jobPatchParameter: JobPatchParameterProtocol) -> JobPatch {
        return PatchCommand(jobId: jobId, jobPatchParameter: jobPatchParameter)
    }
    public static func Terminate(jobId: String) -> JobTerminate {
        return TerminateCommand(jobId: jobId)
    }
    public static func Update(jobId: String, jobUpdateParameter: JobUpdateParameterProtocol) -> JobUpdate {
        return UpdateCommand(jobId: jobId, jobUpdateParameter: jobUpdateParameter)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol JobAdd  {
    var headerParameters: [String: String] { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var job :  JobAddParameterProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Job {
// Add the Batch service supports two ways to control the work done as part of a job. In the first approach, the user
// specifies a Job Manager task. The Batch service launches this task when it is ready to start the job. The Job
// Manager task controls all other tasks that run under this job, by using the Task APIs. In the second approach, the
// user directly controls the execution of tasks under an active job, by using the Task APIs. Also note: when naming
// jobs, avoid including sensitive information such as user names or secret project names. This information may appear
// in telemetry logs accessible to Microsoft Support engineers.
    internal class AddCommand : BaseCommand, JobAdd {
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
    public var job :  JobAddParameterProtocol?

        public init(job: JobAddParameterProtocol) {
            self.job = job
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/jobs"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            self.body = job

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(job as? JobAddParameterData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobDelete  {
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Job {
// Delete deleting a job also deletes all tasks that are part of that job, and all job statistics. This also overrides
// the retention period for task data; that is, if the job contains tasks which are still retained on compute nodes,
// the Batch services deletes those tasks' working directories and all their contents.  When a Delete Job request is
// received, the Batch service sets the job to the deleting state. All update operations on a job that is in deleting
// state will fail with status code 409 (Conflict), with additional information indicating that the job is being
// deleted.
    internal class DeleteCommand : BaseCommand, JobDelete {
        public var jobId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobId: String) {
            self.jobId = jobId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobDisable  {
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    var jobDisableParameter :  JobDisableParameterProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Job {
// Disable the Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks
// parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling
// state until the disable operation is completed and all tasks have been dealt with according to the disableTasks
// option; the job then moves to the disabled state. No new tasks are started under the job until it moves back to
// active state. If you try to disable a job that is in any state other than active, disabling, or disabled, the
// request fails with status code 409.
    internal class DisableCommand : BaseCommand, JobDisable {
        public var jobId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?
    public var jobDisableParameter :  JobDisableParameterProtocol?

        public init(jobId: String, jobDisableParameter: JobDisableParameterProtocol) {
            self.jobId = jobId
            self.jobDisableParameter = jobDisableParameter
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}/disable"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }
            self.body = jobDisableParameter

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(jobDisableParameter as? JobDisableParameterData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobEnable  {
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Job {
// Enable when you call this API, the Batch service sets a disabled job to the enabling state. After the this operation
// is completed, the job moves to the active state, and scheduling of new tasks under the job resumes. The Batch
// service does not allow a task to remain in the active state for more than 7 days. Therefore, if you enable a job
// containing active tasks which were added more than 7 days ago, those tasks will not run.
    internal class EnableCommand : BaseCommand, JobEnable {
        public var jobId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobId: String) {
            self.jobId = jobId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}/enable"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobGet  {
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var select : String? { get set }
    var expand : String? { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (CloudJobProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Job {
// Get sends the get request.
    internal class GetCommand : BaseCommand, JobGet {
        public var jobId : String
        public var select : String?
        public var expand : String?
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobId: String) {
            self.jobId = jobId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            if self.select != nil { queryParameters["$select"] = String(describing: self.select!) }
            if self.expand != nil { queryParameters["$expand"] = String(describing: self.expand!) }
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(CloudJobData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CloudJobProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: CloudJobData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobGetAllLifetimeStatistics  {
    var headerParameters: [String: String] { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (JobStatisticsProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Job {
// GetAllLifetimeStatistics statistics are aggregated across all jobs that have ever existed in the account, from
// account creation to the last update time of the statistics.
    internal class GetAllLifetimeStatisticsCommand : BaseCommand, JobGetAllLifetimeStatistics {
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?

    public override init() {
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/lifetimejobstats"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(JobStatisticsData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (JobStatisticsProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: JobStatisticsData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobGetTaskCounts  {
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (TaskCountsProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Job {
// GetTaskCounts task counts provide a count of the tasks by active, running or completed task state, and a count of
// tasks which succeeded or failed. Tasks in the preparing state are counted as running. If the validationStatus is
// unvalidated, then the Batch service has not been able to check state counts against the task states as reported in
// the List Tasks API. The validationStatus may be unvalidated if the job contains more than 200,000 tasks.
    internal class GetTaskCountsCommand : BaseCommand, JobGetTaskCounts {
        public var jobId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?

        public init(jobId: String) {
            self.jobId = jobId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}/taskcounts"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(TaskCountsData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (TaskCountsProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: TaskCountsData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var filter : String? { get set }
    var select : String? { get set }
    var expand : String? { get set }
    var maxResults : Int32? { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (CloudJobListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Job {
// List sends the list request.
    internal class ListCommand : BaseCommand, JobList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var filter : String?
        public var select : String?
        public var expand : String?
        public var maxResults : Int32?
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?

    public override init() {
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/jobs"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.select != nil { queryParameters["$select"] = String(describing: self.select!) }
            if self.expand != nil { queryParameters["$expand"] = String(describing: self.expand!) }
            if self.maxResults != nil { queryParameters["maxresults"] = String(describing: self.maxResults!) }
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "OdatanextLink"
                }
                let result = try decoder.decode(CloudJobListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CloudJobListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: CloudJobListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobListFromJobSchedule  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var jobScheduleId : String { get set }
    var filter : String? { get set }
    var select : String? { get set }
    var expand : String? { get set }
    var maxResults : Int32? { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (CloudJobListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Job {
// ListFromJobSchedule sends the list from job schedule request.
    internal class ListFromJobScheduleCommand : BaseCommand, JobListFromJobSchedule {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var jobScheduleId : String
        public var filter : String?
        public var select : String?
        public var expand : String?
        public var maxResults : Int32?
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?

        public init(jobScheduleId: String) {
            self.jobScheduleId = jobScheduleId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/jobschedules/{jobScheduleId}/jobs"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobScheduleId}"] = String(describing: self.jobScheduleId)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.select != nil { queryParameters["$select"] = String(describing: self.select!) }
            if self.expand != nil { queryParameters["$expand"] = String(describing: self.expand!) }
            if self.maxResults != nil { queryParameters["maxresults"] = String(describing: self.maxResults!) }
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "OdatanextLink"
                }
                let result = try decoder.decode(CloudJobListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CloudJobListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: CloudJobListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobListPreparationAndReleaseTaskStatus  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var filter : String? { get set }
    var select : String? { get set }
    var maxResults : Int32? { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (CloudJobListPreparationAndReleaseTaskStatusResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.Job {
// ListPreparationAndReleaseTaskStatus this API returns the Job Preparation and Job Release task status on all compute
// nodes that have run the Job Preparation or Job Release task. This includes nodes which have since been removed from
// the pool. If this API is invoked on a job which has no Job Preparation or Job Release task, the Batch service
// returns HTTP status code 409 (Conflict) with an error code of JobPreparationTaskNotSpecified.
    internal class ListPreparationAndReleaseTaskStatusCommand : BaseCommand, JobListPreparationAndReleaseTaskStatus {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var jobId : String
        public var filter : String?
        public var select : String?
        public var maxResults : Int32?
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?

        public init(jobId: String) {
            self.jobId = jobId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}/jobpreparationandreleasetaskstatus"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.select != nil { queryParameters["$select"] = String(describing: self.select!) }
            if self.maxResults != nil { queryParameters["maxresults"] = String(describing: self.maxResults!) }
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "OdatanextLink"
                }
                let result = try decoder.decode(CloudJobListPreparationAndReleaseTaskStatusResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CloudJobListPreparationAndReleaseTaskStatusResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: CloudJobListPreparationAndReleaseTaskStatusResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobPatch  {
    var headerParameters: [String: String] { get set }
    var jobId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    var jobPatchParameter :  JobPatchParameterProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.Job {
// Patch this replaces only the job properties specified in the request. For example, if the job has constraints, and a
// request does not specify the constraints element, then the job keeps the existing constraints.
    internal class PatchCommand : BaseCommand, JobPatch {
        public var jobId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?
    public var jobPatchParameter :  JobPatchParameterProtocol?

        public init(jobId: String, jobPatchParameter: JobPatchParameterProtocol) {
            self.jobId = jobId
            self.jobPatchParameter = jobPatchParameter
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/jobs/{jobId}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobId}"] = String(describing: self.jobId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }
            self.body = jobPatchParameter

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(jobPatchParameter as? JobPatchParameterData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


// 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.

// JobSchedule is the a client for issuing REST requests to the Azure Batch service.
import Foundation
import azureSwiftRuntime
extension Commands {
public struct JobSchedule {
    public static func Add(cloudJobSchedule: JobScheduleAddParameterProtocol) -> JobScheduleAdd {
        return AddCommand(cloudJobSchedule: cloudJobSchedule)
    }
    public static func Delete(jobScheduleId: String) -> JobScheduleDelete {
        return DeleteCommand(jobScheduleId: jobScheduleId)
    }
    public static func Disable(jobScheduleId: String) -> JobScheduleDisable {
        return DisableCommand(jobScheduleId: jobScheduleId)
    }
    public static func Enable(jobScheduleId: String) -> JobScheduleEnable {
        return EnableCommand(jobScheduleId: jobScheduleId)
    }
    public static func Exists(jobScheduleId: String) -> JobScheduleExists {
        return ExistsCommand(jobScheduleId: jobScheduleId)
    }
    public static func Get(jobScheduleId: String) -> JobScheduleGet {
        return GetCommand(jobScheduleId: jobScheduleId)
    }
    public static func List() -> JobScheduleList {
        return ListCommand()
    }
    public static func Patch(jobScheduleId: String, jobSchedulePatchParameter: JobSchedulePatchParameterProtocol) -> JobSchedulePatch {
        return PatchCommand(jobScheduleId: jobScheduleId, jobSchedulePatchParameter: jobSchedulePatchParameter)
    }
    public static func Terminate(jobScheduleId: String) -> JobScheduleTerminate {
        return TerminateCommand(jobScheduleId: jobScheduleId)
    }
    public static func Update(jobScheduleId: String, jobScheduleUpdateParameter: JobScheduleUpdateParameterProtocol) -> JobScheduleUpdate {
        return UpdateCommand(jobScheduleId: jobScheduleId, jobScheduleUpdateParameter: jobScheduleUpdateParameter)
    }
}
}


import Foundation
import azureSwiftRuntime
public protocol JobScheduleAdd  {
    var headerParameters: [String: String] { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var cloudJobSchedule :  JobScheduleAddParameterProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.JobSchedule {
// Add sends the add request.
    internal class AddCommand : BaseCommand, JobScheduleAdd {
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
    public var cloudJobSchedule :  JobScheduleAddParameterProtocol?

        public init(cloudJobSchedule: JobScheduleAddParameterProtocol) {
            self.cloudJobSchedule = cloudJobSchedule
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/jobschedules"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            self.body = cloudJobSchedule

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(cloudJobSchedule as? JobScheduleAddParameterData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobScheduleDelete  {
    var headerParameters: [String: String] { get set }
    var jobScheduleId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.JobSchedule {
// Delete when you delete a job schedule, this also deletes all jobs and tasks under that schedule. When tasks are
// deleted, all the files in their working directories on the compute nodes are also deleted (the retention period is
// ignored). The job schedule statistics are no longer accessible once the job schedule is deleted, though they are
// still counted towards account lifetime statistics.
    internal class DeleteCommand : BaseCommand, JobScheduleDelete {
        public var jobScheduleId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobScheduleId: String) {
            self.jobScheduleId = jobScheduleId
            super.init()
            self.method = "Delete"
            self.isLongRunningOperation = false
            self.path = "/jobschedules/{jobScheduleId}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobScheduleId}"] = String(describing: self.jobScheduleId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobScheduleDisable  {
    var headerParameters: [String: String] { get set }
    var jobScheduleId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.JobSchedule {
// Disable no new jobs will be created until the job schedule is enabled again.
    internal class DisableCommand : BaseCommand, JobScheduleDisable {
        public var jobScheduleId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobScheduleId: String) {
            self.jobScheduleId = jobScheduleId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/jobschedules/{jobScheduleId}/disable"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobScheduleId}"] = String(describing: self.jobScheduleId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobScheduleEnable  {
    var headerParameters: [String: String] { get set }
    var jobScheduleId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.JobSchedule {
// Enable sends the enable request.
    internal class EnableCommand : BaseCommand, JobScheduleEnable {
        public var jobScheduleId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobScheduleId: String) {
            self.jobScheduleId = jobScheduleId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/jobschedules/{jobScheduleId}/enable"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobScheduleId}"] = String(describing: self.jobScheduleId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobScheduleExists  {
    var headerParameters: [String: String] { get set }
    var jobScheduleId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.JobSchedule {
// Exists sends the exists request.
    internal class ExistsCommand : BaseCommand, JobScheduleExists {
        public var jobScheduleId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobScheduleId: String) {
            self.jobScheduleId = jobScheduleId
            super.init()
            self.method = "Head"
            self.isLongRunningOperation = false
            self.path = "/jobschedules/{jobScheduleId}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobScheduleId}"] = String(describing: self.jobScheduleId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobScheduleGet  {
    var headerParameters: [String: String] { get set }
    var jobScheduleId : String { get set }
    var select : String? { get set }
    var expand : String? { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (CloudJobScheduleProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.JobSchedule {
// Get gets information about the specified job schedule.
    internal class GetCommand : BaseCommand, JobScheduleGet {
        public var jobScheduleId : String
        public var select : String?
        public var expand : String?
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobScheduleId: String) {
            self.jobScheduleId = jobScheduleId
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/jobschedules/{jobScheduleId}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobScheduleId}"] = String(describing: self.jobScheduleId)
            if self.select != nil { queryParameters["$select"] = String(describing: self.select!) }
            if self.expand != nil { queryParameters["$expand"] = String(describing: self.expand!) }
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                let result = try decoder.decode(CloudJobScheduleData?.self, from: data)
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CloudJobScheduleProtocol?, Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (result: CloudJobScheduleData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobScheduleList  {
    var nextLink: String? { get }
    var hasAdditionalPages : Bool { get }
    var headerParameters: [String: String] { get set }
    var filter : String? { get set }
    var select : String? { get set }
    var expand : String? { get set }
    var maxResults : Int32? { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (CloudJobScheduleListResultProtocol?, Error?) -> Void) -> Void ;
}

extension Commands.JobSchedule {
// List sends the list request.
    internal class ListCommand : BaseCommand, JobScheduleList {
        var nextLink: String?
        public var hasAdditionalPages : Bool {
        get {
            return nextLink != nil
        }
    }
        public var filter : String?
        public var select : String?
        public var expand : String?
        public var maxResults : Int32?
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?

    public override init() {
            super.init()
            self.method = "Get"
            self.isLongRunningOperation = false
            self.path = "/jobschedules"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            if self.filter != nil { queryParameters["$filter"] = String(describing: self.filter!) }
            if self.select != nil { queryParameters["$select"] = String(describing: self.select!) }
            if self.expand != nil { queryParameters["$expand"] = String(describing: self.expand!) }
            if self.maxResults != nil { queryParameters["maxresults"] = String(describing: self.maxResults!) }
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }

        }

        public override func returnFunc(data: Data) throws -> Decodable? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let decoder = try CoderFactory.decoder(for: mimeType)
                if var pageDecoder = decoder as? PageDecoder {
                    pageDecoder.isPagedData = true
                    pageDecoder.nextLinkName = "OdatanextLink"
                }
                let result = try decoder.decode(CloudJobScheduleListResultData?.self, from: data)
                if var pageDecoder = decoder as? PageDecoder {
                    self.nextLink = pageDecoder.nextLink
                }
                return result;
            }
            throw DecodeError.unknownMimeType
        }
        public func execute(client: RuntimeClient,
            completionHandler: @escaping (CloudJobScheduleListResultProtocol?, Error?) -> Void) -> Void {
            if self.nextLink != nil {
                self.path = nextLink!
                self.nextLink = nil;
                self.pathType = .absolute
            }
            client.executeAsync(command: self) {
                (result: CloudJobScheduleListResultData?, error: Error?) in
                completionHandler(result, error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobSchedulePatch  {
    var headerParameters: [String: String] { get set }
    var jobScheduleId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    var jobSchedulePatchParameter :  JobSchedulePatchParameterProtocol?  { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.JobSchedule {
// Patch this replaces only the job schedule properties specified in the request. For example, if the schedule property
// is not specified with this request, then the Batch service will keep the existing schedule. Changes to a job
// schedule only impact jobs created by the schedule after the update has taken place; currently running jobs are
// unaffected.
    internal class PatchCommand : BaseCommand, JobSchedulePatch {
        public var jobScheduleId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?
    public var jobSchedulePatchParameter :  JobSchedulePatchParameterProtocol?

        public init(jobScheduleId: String, jobSchedulePatchParameter: JobSchedulePatchParameterProtocol) {
            self.jobScheduleId = jobScheduleId
            self.jobSchedulePatchParameter = jobSchedulePatchParameter
            super.init()
            self.method = "Patch"
            self.isLongRunningOperation = false
            self.path = "/jobschedules/{jobScheduleId}"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobScheduleId}"] = String(describing: self.jobScheduleId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }
            self.body = jobSchedulePatchParameter

        }
        public override func encodeBody() throws -> Data? {
            let contentType = "application/json"
            if let mimeType = MimeType.getType(forStr: contentType) {
                let encoder = try CoderFactory.encoder(for: mimeType)
                let encodedValue = try encoder.encode(jobSchedulePatchParameter as? JobSchedulePatchParameterData)
                return encodedValue
            }
            throw DecodeError.unknownMimeType
        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}


import Foundation
import azureSwiftRuntime
public protocol JobScheduleTerminate  {
    var headerParameters: [String: String] { get set }
    var jobScheduleId : String { get set }
    var timeout : Int32? { get set }
    var apiVersion : String { get set }
    var clientRequestId : String? { get set }
    var returnClientRequestId : Bool? { get set }
    var ocpDate : Date? { get set }
    var ifMatch : String? { get set }
    var ifNoneMatch : String? { get set }
    var ifModifiedSince : Date? { get set }
    var ifUnmodifiedSince : Date? { get set }
    func execute(client: RuntimeClient,
    completionHandler: @escaping (Error?) -> Void) -> Void;
}

extension Commands.JobSchedule {
// Terminate sends the terminate request.
    internal class TerminateCommand : BaseCommand, JobScheduleTerminate {
        public var jobScheduleId : String
        public var timeout : Int32?
        public var apiVersion = "2017-09-01.6.0"
        public var clientRequestId : String?
        public var returnClientRequestId : Bool?
        public var ocpDate : Date?
        public var ifMatch : String?
        public var ifNoneMatch : String?
        public var ifModifiedSince : Date?
        public var ifUnmodifiedSince : Date?

        public init(jobScheduleId: String) {
            self.jobScheduleId = jobScheduleId
            super.init()
            self.method = "Post"
            self.isLongRunningOperation = false
            self.path = "/jobschedules/{jobScheduleId}/terminate"
            self.headerParameters = ["Content-Type":"application/json; odata=minimalmetadata; charset=utf-8"]
        }

        public override func preCall()  {
            self.pathParameters["{jobScheduleId}"] = String(describing: self.jobScheduleId)
            if self.timeout != nil { queryParameters["timeout"] = String(describing: self.timeout!) }
            self.queryParameters["api-version"] = String(describing: self.apiVersion)
            if self.clientRequestId != nil { headerParameters["client-request-id"] = String(describing: self.clientRequestId!) }
            if self.returnClientRequestId != nil { headerParameters["return-client-request-id"] = String(describing: self.returnClientRequestId!) }
            if self.ocpDate != nil { headerParameters["ocp-date"] = String(describing: self.ocpDate!) }
            if self.ifMatch != nil { headerParameters["If-Match"] = String(describing: self.ifMatch!) }
            if self.ifNoneMatch != nil { headerParameters["If-None-Match"] = String(describing: self.ifNoneMatch!) }
            if self.ifModifiedSince != nil { headerParameters["If-Modified-Since"] = String(describing: self.ifModifiedSince!) }
            if self.ifUnmodifiedSince != nil { headerParameters["If-Unmodified-Since"] = String(describing: self.ifUnmodifiedSince!) }

        }

        public func execute(client: RuntimeClient,
            completionHandler: @escaping (Error?) -> Void) -> Void {
            client.executeAsync(command: self) {
                (error) in
                completionHandler(error)
            }
        }
    }
}