text: var batchServiceClient=function(e){function t(r){if(i[r])return i[r].exports;var o=i[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=3)}([function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=i(2);t.CloudError=r.CloudErrorMapper,t.BaseResource=r.BaseResourceMapper,t.PoolUsageMetrics={required:!1,serializedName:"PoolUsageMetrics",type:{name:"Composite",className:"PoolUsageMetrics",modelProperties:{poolId:{required:!0,serializedName:"poolId",type:{name:"String"}},startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},endTime:{required:!0,serializedName:"endTime",type:{name:"DateTime"}},vmSize:{required:!0,serializedName:"vmSize",type:{name:"String"}},totalCoreHours:{required:!0,serializedName:"totalCoreHours",type:{name:"Number"}},dataIngressGiB:{required:!0,serializedName:"dataIngressGiB",type:{name:"Number"}},dataEgressGiB:{required:!0,serializedName:"dataEgressGiB",type:{name:"Number"}}}}},t.ImageReference={required:!1,serializedName:"ImageReference",type:{name:"Composite",className:"ImageReference",modelProperties:{publisher:{required:!1,serializedName:"publisher",type:{name:"String"}},offer:{required:!1,serializedName:"offer",type:{name:"String"}},sku:{required:!1,serializedName:"sku",type:{name:"String"}},version:{required:!1,serializedName:"version",type:{name:"String"}},virtualMachineImageId:{required:!1,serializedName:"virtualMachineImageId",type:{name:"String"}}}}},t.NodeAgentSku={required:!1,serializedName:"NodeAgentSku",type:{name:"Composite",className:"NodeAgentSku",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"String"}},verifiedImageReferences:{required:!1,serializedName:"verifiedImageReferences",type:{name:"Sequence",element:{required:!1,serializedName:"ImageReferenceElementType",type:{name:"Composite",className:"ImageReference"}}}},osType:{required:!1,serializedName:"osType",type:{name:"Enum",allowedValues:["linux","windows"]}}}}},t.AuthenticationTokenSettings={required:!1,serializedName:"AuthenticationTokenSettings",type:{name:"Composite",className:"AuthenticationTokenSettings",modelProperties:{access:{required:!1,serializedName:"access",type:{name:"Sequence",element:{required:!1,serializedName:"AccessScopeElementType",type:{name:"Enum",allowedValues:["job"]}}}}}}},t.UsageStatistics={required:!1,serializedName:"UsageStatistics",type:{name:"Composite",className:"UsageStatistics",modelProperties:{startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},lastUpdateTime:{required:!0,serializedName:"lastUpdateTime",type:{name:"DateTime"}},dedicatedCoreTime:{required:!0,serializedName:"dedicatedCoreTime",type:{name:"TimeSpan"}}}}},t.ResourceStatistics={required:!1,serializedName:"ResourceStatistics",type:{name:"Composite",className:"ResourceStatistics",modelProperties:{startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},lastUpdateTime:{required:!0,serializedName:"lastUpdateTime",type:{name:"DateTime"}},avgCPUPercentage:{required:!0,serializedName:"avgCPUPercentage",type:{name:"Number"}},avgMemoryGiB:{required:!0,serializedName:"avgMemoryGiB",type:{name:"Number"}},peakMemoryGiB:{required:!0,serializedName:"peakMemoryGiB",type:{name:"Number"}},avgDiskGiB:{required:!0,serializedName:"avgDiskGiB",type:{name:"Number"}},peakDiskGiB:{required:!0,serializedName:"peakDiskGiB",type:{name:"Number"}},diskReadIOps:{required:!0,serializedName:"diskReadIOps",type:{name:"Number"}},diskWriteIOps:{required:!0,serializedName:"diskWriteIOps",type:{name:"Number"}},diskReadGiB:{required:!0,serializedName:"diskReadGiB",type:{name:"Number"}},diskWriteGiB:{required:!0,serializedName:"diskWriteGiB",type:{name:"Number"}},networkReadGiB:{required:!0,serializedName:"networkReadGiB",type:{name:"Number"}},networkWriteGiB:{required:!0,serializedName:"networkWriteGiB",type:{name:"Number"}}}}},t.PoolStatistics={required:!1,serializedName:"PoolStatistics",type:{name:"Composite",className:"PoolStatistics",modelProperties:{url:{required:!0,serializedName:"url",type:{name:"String"}},startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},lastUpdateTime:{required:!0,serializedName:"lastUpdateTime",type:{name:"DateTime"}},usageStats:{required:!1,serializedName:"usageStats",type:{name:"Composite",className:"UsageStatistics"}},resourceStats:{required:!1,serializedName:"resourceStats",type:{name:"Composite",className:"ResourceStatistics"}}}}},t.JobStatistics={required:!1,serializedName:"JobStatistics",type:{name:"Composite",className:"JobStatistics",modelProperties:{url:{required:!0,serializedName:"url",type:{name:"String"}},startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},lastUpdateTime:{required:!0,serializedName:"lastUpdateTime",type:{name:"DateTime"}},userCPUTime:{required:!0,serializedName:"userCPUTime",type:{name:"TimeSpan"}},kernelCPUTime:{required:!0,serializedName:"kernelCPUTime",type:{name:"TimeSpan"}},wallClockTime:{required:!0,serializedName:"wallClockTime",type:{name:"TimeSpan"}},readIOps:{required:!0,serializedName:"readIOps",type:{name:"Number"}},writeIOps:{required:!0,serializedName:"writeIOps",type:{name:"Number"}},readIOGiB:{required:!0,serializedName:"readIOGiB",type:{name:"Number"}},writeIOGiB:{required:!0,serializedName:"writeIOGiB",type:{name:"Number"}},numSucceededTasks:{required:!0,serializedName:"numSucceededTasks",type:{name:"Number"}},numFailedTasks:{required:!0,serializedName:"numFailedTasks",type:{name:"Number"}},numTaskRetries:{required:!0,serializedName:"numTaskRetries",type:{name:"Number"}},waitTime:{required:!0,serializedName:"waitTime",type:{name:"TimeSpan"}}}}},t.NameValuePair={required:!1,serializedName:"NameValuePair",type:{name:"Composite",className:"NameValuePair",modelProperties:{name:{required:!1,serializedName:"name",type:{name:"String"}},value:{required:!1,serializedName:"value",type:{name:"String"}}}}},t.DeleteCertificateError={required:!1,serializedName:"DeleteCertificateError",type:{name:"Composite",className:"DeleteCertificateError",modelProperties:{code:{required:!1,serializedName:"code",type:{name:"String"}},message:{required:!1,serializedName:"message",type:{name:"String"}},values:{required:!1,serializedName:"values",type:{name:"Sequence",element:{required:!1,serializedName:"NameValuePairElementType",type:{name:"Composite",className:"NameValuePair"}}}}}}},t.Certificate={required:!1,serializedName:"Certificate",type:{name:"Composite",className:"Certificate",modelProperties:{thumbprint:{required:!1,serializedName:"thumbprint",type:{name:"String"}},thumbprintAlgorithm:{required:!1,serializedName:"thumbprintAlgorithm",type:{name:"String"}},url:{required:!1,serializedName:"url",type:{name:"String"}},state:{required:!1,serializedName:"state",type:{name:"Enum",allowedValues:["active","deleting","deleteFailed"]}},stateTransitionTime:{required:!1,serializedName:"stateTransitionTime",type:{name:"DateTime"}},previousState:{required:!1,serializedName:"previousState",type:{name:"Enum",allowedValues:["active","deleting","deleteFailed"]}},previousStateTransitionTime:{required:!1,serializedName:"previousStateTransitionTime",type:{name:"DateTime"}},publicData:{required:!1,serializedName:"publicData",type:{name:"String"}},deleteCertificateError:{required:!1,serializedName:"deleteCertificateError",type:{name:"Composite",className:"DeleteCertificateError"}}}}},t.ApplicationPackageReference={required:!1,serializedName:"ApplicationPackageReference",type:{name:"Composite",className:"ApplicationPackageReference",modelProperties:{applicationId:{required:!0,serializedName:"applicationId",type:{name:"String"}},version:{required:!1,serializedName:"version",type:{name:"String"}}}}},t.ApplicationSummary={required:!1,serializedName:"ApplicationSummary",type:{name:"Composite",className:"ApplicationSummary",modelProperties:{id:{required:!0,serializedName:"id",type:{name:"String"}},displayName:{required:!0,serializedName:"displayName",type:{name:"String"}},versions:{required:!0,serializedName:"versions",type:{name:"Sequence",element:{required:!1,serializedName:"stringElementType",type:{name:"String"}}}}}}},t.CertificateAddParameter={required:!1,serializedName:"CertificateAddParameter",type:{name:"Composite",className:"CertificateAddParameter",modelProperties:{thumbprint:{required:!0,serializedName:"thumbprint",type:{name:"String"}},thumbprintAlgorithm:{required:!0,serializedName:"thumbprintAlgorithm",type:{name:"String"}},data:{required:!0,serializedName:"data",type:{name:"String"}},certificateFormat:{required:!1,serializedName:"certificateFormat",type:{name:"Enum",allowedValues:["pfx","cer"]}},password:{required:!1,serializedName:"password",type:{name:"String"}}}}},t.FileProperties={required:!1,serializedName:"FileProperties",type:{name:"Composite",className:"FileProperties",modelProperties:{creationTime:{required:!1,serializedName:"creationTime",type:{name:"DateTime"}},lastModified:{required:!0,serializedName:"lastModified",type:{name:"DateTime"}},contentLength:{required:!0,serializedName:"contentLength",type:{name:"Number"}},contentType:{required:!1,serializedName:"contentType",type:{name:"String"}},fileMode:{required:!1,serializedName:"fileMode",type:{name:"String"}}}}},t.NodeFile={required:!1,serializedName:"NodeFile",type:{name:"Composite",className:"NodeFile",modelProperties:{name:{required:!1,serializedName:"name",type:{name:"String"}},url:{required:!1,serializedName:"url",type:{name:"String"}},isDirectory:{required:!1,serializedName:"isDirectory",type:{name:"Boolean"}},properties:{required:!1,serializedName:"properties",type:{name:"Composite",className:"FileProperties"}}}}},t.Schedule={required:!1,serializedName:"Schedule",type:{name:"Composite",className:"Schedule",modelProperties:{doNotRunUntil:{required:!1,serializedName:"doNotRunUntil",type:{name:"DateTime"}},doNotRunAfter:{required:!1,serializedName:"doNotRunAfter",type:{name:"DateTime"}},startWindow:{required:!1,serializedName:"startWindow",type:{name:"TimeSpan"}},recurrenceInterval:{required:!1,serializedName:"recurrenceInterval",type:{name:"TimeSpan"}}}}},t.JobConstraints={required:!1,serializedName:"JobConstraints",type:{name:"Composite",className:"JobConstraints",modelProperties:{maxWallClockTime:{required:!1,serializedName:"maxWallClockTime",type:{name:"TimeSpan"}},maxTaskRetryCount:{required:!1,serializedName:"maxTaskRetryCount",type:{name:"Number"}}}}},t.ContainerRegistry={required:!1,serializedName:"ContainerRegistry",type:{name:"Composite",className:"ContainerRegistry",modelProperties:{registryServer:{required:!1,serializedName:"registryServer",type:{name:"String"}},userName:{required:!0,serializedName:"username",type:{name:"String"}},password:{required:!0,serializedName:"password",type:{name:"String"}}}}},t.TaskContainerSettings={required:!1,serializedName:"TaskContainerSettings",type:{name:"Composite",className:"TaskContainerSettings",modelProperties:{containerRunOptions:{required:!1,serializedName:"containerRunOptions",type:{name:"String"}},imageName:{required:!0,serializedName:"imageName",type:{name:"String"}},registry:{required:!1,serializedName:"registry",type:{name:"Composite",className:"ContainerRegistry"}}}}},t.ResourceFile={required:!1,serializedName:"ResourceFile",type:{name:"Composite",className:"ResourceFile",modelProperties:{blobSource:{required:!0,serializedName:"blobSource",type:{name:"String"}},filePath:{required:!0,serializedName:"filePath",type:{name:"String"}},fileMode:{required:!1,serializedName:"fileMode",type:{name:"String"}}}}},t.EnvironmentSetting={required:!1,serializedName:"EnvironmentSetting",type:{name:"Composite",className:"EnvironmentSetting",modelProperties:{name:{required:!0,serializedName:"name",type:{name:"String"}},value:{required:!1,serializedName:"value",type:{name:"String"}}}}},t.ExitOptions={required:!1,serializedName:"ExitOptions",type:{name:"Composite",className:"ExitOptions",modelProperties:{jobAction:{required:!1,serializedName:"jobAction",type:{name:"Enum",allowedValues:["none","disable","terminate"]}},dependencyAction:{required:!1,serializedName:"dependencyAction",type:{name:"Enum",allowedValues:["satisfy","block"]}}}}},t.ExitCodeMapping={required:!1,serializedName:"ExitCodeMapping",type:{name:"Composite",className:"ExitCodeMapping",modelProperties:{code:{required:!0,serializedName:"code",type:{name:"Number"}},exitOptions:{required:!0,serializedName:"exitOptions",type:{name:"Composite",className:"ExitOptions"}}}}},t.ExitCodeRangeMapping={required:!1,serializedName:"ExitCodeRangeMapping",type:{name:"Composite",className:"ExitCodeRangeMapping",modelProperties:{start:{required:!0,serializedName:"start",type:{name:"Number"}},end:{required:!0,serializedName:"end",type:{name:"Number"}},exitOptions:{required:!0,serializedName:"exitOptions",type:{name:"Composite",className:"ExitOptions"}}}}},t.ExitConditions={required:!1,serializedName:"ExitConditions",type:{name:"Composite",className:"ExitConditions",modelProperties:{exitCodes:{required:!1,serializedName:"exitCodes",type:{name:"Sequence",element:{required:!1,serializedName:"ExitCodeMappingElementType",type:{name:"Composite",className:"ExitCodeMapping"}}}},exitCodeRanges:{required:!1,serializedName:"exitCodeRanges",type:{name:"Sequence",element:{required:!1,serializedName:"ExitCodeRangeMappingElementType",type:{name:"Composite",className:"ExitCodeRangeMapping"}}}},preProcessingError:{required:!1,serializedName:"preProcessingError",type:{name:"Composite",className:"ExitOptions"}},fileUploadError:{required:!1,serializedName:"fileUploadError",type:{name:"Composite",className:"ExitOptions"}},default:{required:!1,serializedName:"default",type:{name:"Composite",className:"ExitOptions"}}}}},t.AutoUserSpecification={required:!1,serializedName:"AutoUserSpecification",type:{name:"Composite",className:"AutoUserSpecification",modelProperties:{scope:{required:!1,serializedName:"scope",type:{name:"Enum",allowedValues:["task","pool"]}},elevationLevel:{required:!1,serializedName:"elevationLevel",type:{name:"Enum",allowedValues:["nonAdmin","admin"]}}}}},t.UserIdentity={required:!1,serializedName:"UserIdentity",type:{name:"Composite",className:"UserIdentity",modelProperties:{userName:{required:!1,serializedName:"username",type:{name:"String"}},autoUser:{required:!1,serializedName:"autoUser",type:{name:"Composite",className:"AutoUserSpecification"}}}}},t.LinuxUserConfiguration={required:!1,serializedName:"LinuxUserConfiguration",type:{name:"Composite",className:"LinuxUserConfiguration",modelProperties:{uid:{required:!1,serializedName:"uid",type:{name:"Number"}},gid:{required:!1,serializedName:"gid",type:{name:"Number"}},sshPrivateKey:{required:!1,serializedName:"sshPrivateKey",type:{name:"String"}}}}},t.UserAccount={required:!1,serializedName:"UserAccount",type:{name:"Composite",className:"UserAccount",modelProperties:{name:{required:!0,serializedName:"name",type:{name:"String"}},password:{required:!0,serializedName:"password",type:{name:"String"}},elevationLevel:{required:!1,serializedName:"elevationLevel",type:{name:"Enum",allowedValues:["nonAdmin","admin"]}},linuxUserConfiguration:{required:!1,serializedName:"linuxUserConfiguration",type:{name:"Composite",className:"LinuxUserConfiguration"}}}}},t.TaskConstraints={required:!1,serializedName:"TaskConstraints",type:{name:"Composite",className:"TaskConstraints",modelProperties:{maxWallClockTime:{required:!1,serializedName:"maxWallClockTime",type:{name:"TimeSpan"}},retentionTime:{required:!1,serializedName:"retentionTime",type:{name:"TimeSpan"}},maxTaskRetryCount:{required:!1,serializedName:"maxTaskRetryCount",type:{name:"Number"}}}}},t.OutputFileBlobContainerDestination={required:!1,serializedName:"OutputFileBlobContainerDestination",type:{name:"Composite",className:"OutputFileBlobContainerDestination",modelProperties:{path:{required:!1,serializedName:"path",type:{name:"String"}},containerUrl:{required:!0,serializedName:"containerUrl",type:{name:"String"}}}}},t.OutputFileDestination={required:!1,serializedName:"OutputFileDestination",type:{name:"Composite",className:"OutputFileDestination",modelProperties:{container:{required:!1,serializedName:"container",type:{name:"Composite",className:"OutputFileBlobContainerDestination"}}}}},t.OutputFileUploadOptions={required:!1,serializedName:"OutputFileUploadOptions",type:{name:"Composite",className:"OutputFileUploadOptions",modelProperties:{uploadCondition:{required:!0,serializedName:"uploadCondition",type:{name:"Enum",allowedValues:["taskSuccess","taskFailure","taskCompletion"]}}}}},t.OutputFile={required:!1,serializedName:"OutputFile",type:{name:"Composite",className:"OutputFile",modelProperties:{filePattern:{required:!0,serializedName:"filePattern",type:{name:"String"}},destination:{required:!0,serializedName:"destination",type:{name:"Composite",className:"OutputFileDestination"}},uploadOptions:{required:!0,serializedName:"uploadOptions",type:{name:"Composite",className:"OutputFileUploadOptions"}}}}},t.JobManagerTask={required:!1,serializedName:"JobManagerTask",type:{name:"Composite",className:"JobManagerTask",modelProperties:{id:{required:!0,serializedName:"id",type:{name:"String"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},commandLine:{required:!0,serializedName:"commandLine",type:{name:"String"}},containerSettings:{required:!1,serializedName:"containerSettings",type:{name:"Composite",className:"TaskContainerSettings"}},resourceFiles:{required:!1,serializedName:"resourceFiles",type:{name:"Sequence",element:{required:!1,serializedName:"ResourceFileElementType",type:{name:"Composite",className:"ResourceFile"}}}},outputFiles:{required:!1,serializedName:"outputFiles",type:{name:"Sequence",element:{required:!1,serializedName:"OutputFileElementType",type:{name:"Composite",className:"OutputFile"}}}},environmentSettings:{required:!1,serializedName:"environmentSettings",type:{name:"Sequence",element:{required:!1,serializedName:"EnvironmentSettingElementType",type:{name:"Composite",className:"EnvironmentSetting"}}}},constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"TaskConstraints"}},killJobOnCompletion:{required:!1,serializedName:"killJobOnCompletion",type:{name:"Boolean"}},userIdentity:{required:!1,serializedName:"userIdentity",type:{name:"Composite",className:"UserIdentity"}},runExclusive:{required:!1,serializedName:"runExclusive",type:{name:"Boolean"}},applicationPackageReferences:{required:!1,serializedName:"applicationPackageReferences",type:{name:"Sequence",element:{required:!1,serializedName:"ApplicationPackageReferenceElementType",type:{name:"Composite",className:"ApplicationPackageReference"}}}},authenticationTokenSettings:{required:!1,serializedName:"authenticationTokenSettings",type:{name:"Composite",className:"AuthenticationTokenSettings"}},allowLowPriorityNode:{required:!1,serializedName:"allowLowPriorityNode",type:{name:"Boolean"}}}}},t.JobPreparationTask={required:!1,serializedName:"JobPreparationTask",type:{name:"Composite",className:"JobPreparationTask",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"String"}},commandLine:{required:!0,serializedName:"commandLine",type:{name:"String"}},containerSettings:{required:!1,serializedName:"containerSettings",type:{name:"Composite",className:"TaskContainerSettings"}},resourceFiles:{required:!1,serializedName:"resourceFiles",type:{name:"Sequence",element:{required:!1,serializedName:"ResourceFileElementType",type:{name:"Composite",className:"ResourceFile"}}}},environmentSettings:{required:!1,serializedName:"environmentSettings",type:{name:"Sequence",element:{required:!1,serializedName:"EnvironmentSettingElementType",type:{name:"Composite",className:"EnvironmentSetting"}}}},constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"TaskConstraints"}},waitForSuccess:{required:!1,serializedName:"waitForSuccess",type:{name:"Boolean"}},userIdentity:{required:!1,serializedName:"userIdentity",type:{name:"Composite",className:"UserIdentity"}},rerunOnNodeRebootAfterSuccess:{required:!1,serializedName:"rerunOnNodeRebootAfterSuccess",type:{name:"Boolean"}}}}},t.JobReleaseTask={required:!1,serializedName:"JobReleaseTask",type:{name:"Composite",className:"JobReleaseTask",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"String"}},commandLine:{required:!0,serializedName:"commandLine",type:{name:"String"}},containerSettings:{required:!1,serializedName:"containerSettings",type:{name:"Composite",className:"TaskContainerSettings"}},resourceFiles:{required:!1,serializedName:"resourceFiles",type:{name:"Sequence",element:{required:!1,serializedName:"ResourceFileElementType",type:{name:"Composite",className:"ResourceFile"}}}},environmentSettings:{required:!1,serializedName:"environmentSettings",type:{name:"Sequence",element:{required:!1,serializedName:"EnvironmentSettingElementType",type:{name:"Composite",className:"EnvironmentSetting"}}}},maxWallClockTime:{required:!1,serializedName:"maxWallClockTime",type:{name:"TimeSpan"}},retentionTime:{required:!1,serializedName:"retentionTime",type:{name:"TimeSpan"}},userIdentity:{required:!1,serializedName:"userIdentity",type:{name:"Composite",className:"UserIdentity"}}}}},t.TaskSchedulingPolicy={required:!1,serializedName:"TaskSchedulingPolicy",type:{name:"Composite",className:"TaskSchedulingPolicy",modelProperties:{nodeFillType:{required:!0,serializedName:"nodeFillType",type:{name:"Enum",allowedValues:["spread","pack"]}}}}},t.StartTask={required:!1,serializedName:"StartTask",type:{name:"Composite",className:"StartTask",modelProperties:{commandLine:{required:!0,serializedName:"commandLine",type:{name:"String"}},containerSettings:{required:!1,serializedName:"containerSettings",type:{name:"Composite",className:"TaskContainerSettings"}},resourceFiles:{required:!1,serializedName:"resourceFiles",type:{name:"Sequence",element:{required:!1,serializedName:"ResourceFileElementType",type:{name:"Composite",className:"ResourceFile"}}}},environmentSettings:{required:!1,serializedName:"environmentSettings",type:{name:"Sequence",element:{required:!1,serializedName:"EnvironmentSettingElementType",type:{name:"Composite",className:"EnvironmentSetting"}}}},userIdentity:{required:!1,serializedName:"userIdentity",type:{name:"Composite",className:"UserIdentity"}},maxTaskRetryCount:{required:!1,serializedName:"maxTaskRetryCount",type:{name:"Number"}},waitForSuccess:{required:!1,serializedName:"waitForSuccess",type:{name:"Boolean"}}}}},t.CertificateReference={required:!1,serializedName:"CertificateReference",type:{name:"Composite",className:"CertificateReference",modelProperties:{thumbprint:{required:!0,serializedName:"thumbprint",type:{name:"String"}},thumbprintAlgorithm:{required:!0,serializedName:"thumbprintAlgorithm",type:{name:"String"}},storeLocation:{required:!1,serializedName:"storeLocation",type:{name:"Enum",allowedValues:["currentUser","localMachine"]}},storeName:{required:!1,serializedName:"storeName",type:{name:"String"}},visibility:{required:!1,serializedName:"visibility",type:{name:"Sequence",element:{required:!1,serializedName:"CertificateVisibilityElementType",type:{name:"Enum",allowedValues:["startTask","task","remoteUser"]}}}}}}},t.MetadataItem={required:!1,serializedName:"MetadataItem",type:{name:"Composite",className:"MetadataItem",modelProperties:{name:{required:!0,serializedName:"name",type:{name:"String"}},value:{required:!0,serializedName:"value",type:{name:"String"}}}}},t.CloudServiceConfiguration={required:!1,serializedName:"CloudServiceConfiguration",type:{name:"Composite",className:"CloudServiceConfiguration",modelProperties:{osFamily:{required:!0,serializedName:"osFamily",type:{name:"String"}},targetOSVersion:{required:!1,serializedName:"targetOSVersion",type:{name:"String"}},currentOSVersion:{required:!1,readOnly:!0,serializedName:"currentOSVersion",type:{name:"String"}}}}},t.OSDisk={required:!1,serializedName:"OSDisk",type:{name:"Composite",className:"OSDisk",modelProperties:{caching:{required:!1,serializedName:"caching",type:{name:"Enum",allowedValues:["none","readOnly","readWrite"]}}}}},t.WindowsConfiguration={required:!1,serializedName:"WindowsConfiguration",type:{name:"Composite",className:"WindowsConfiguration",modelProperties:{enableAutomaticUpdates:{required:!1,serializedName:"enableAutomaticUpdates",type:{name:"Boolean"}}}}},t.DataDisk={required:!1,serializedName:"DataDisk",type:{name:"Composite",className:"DataDisk",modelProperties:{lun:{required:!0,serializedName:"lun",type:{name:"Number"}},caching:{required:!1,serializedName:"caching",type:{name:"Enum",allowedValues:["none","readOnly","readWrite"]}},diskSizeGB:{required:!0,serializedName:"diskSizeGB",type:{name:"Number"}},storageAccountType:{required:!1,serializedName:"storageAccountType",type:{name:"Enum",allowedValues:["Standard_LRS","Premium_LRS"]}}}}},t.ContainerConfiguration={required:!1,serializedName:"ContainerConfiguration",type:{name:"Composite",className:"ContainerConfiguration",modelProperties:{type:{required:!0,isConstant:!0,serializedName:"type",defaultValue:"docker",type:{name:"String"}},containerImageNames:{required:!1,serializedName:"containerImageNames",type:{name:"Sequence",element:{required:!1,serializedName:"stringElementType",type:{name:"String"}}}},containerRegistries:{required:!1,serializedName:"containerRegistries",type:{name:"Sequence",element:{required:!1,serializedName:"ContainerRegistryElementType",type:{name:"Composite",className:"ContainerRegistry"}}}}}}},t.VirtualMachineConfiguration={required:!1,serializedName:"VirtualMachineConfiguration",type:{name:"Composite",className:"VirtualMachineConfiguration",modelProperties:{imageReference:{required:!0,serializedName:"imageReference",type:{name:"Composite",className:"ImageReference"}},osDisk:{required:!1,serializedName:"osDisk",type:{name:"Composite",className:"OSDisk"}},nodeAgentSKUId:{required:!0,serializedName:"nodeAgentSKUId",type:{name:"String"}},windowsConfiguration:{required:!1,serializedName:"windowsConfiguration",type:{name:"Composite",className:"WindowsConfiguration"}},dataDisks:{required:!1,serializedName:"dataDisks",type:{name:"Sequence",element:{required:!1,serializedName:"DataDiskElementType",type:{name:"Composite",className:"DataDisk"}}}},licenseType:{required:!1,serializedName:"licenseType",type:{name:"String"}},containerConfiguration:{required:!1,serializedName:"containerConfiguration",type:{name:"Composite",className:"ContainerConfiguration"}}}}},t.NetworkSecurityGroupRule={required:!1,serializedName:"NetworkSecurityGroupRule",type:{name:"Composite",className:"NetworkSecurityGroupRule",modelProperties:{priority:{required:!0,serializedName:"priority",type:{name:"Number"}},access:{required:!0,serializedName:"access",type:{name:"Enum",allowedValues:["allow","deny"]}},sourceAddressPrefix:{required:!0,serializedName:"sourceAddressPrefix",type:{name:"String"}}}}},t.InboundNATPool={required:!1,serializedName:"InboundNATPool",type:{name:"Composite",className:"InboundNATPool",modelProperties:{name:{required:!0,serializedName:"name",type:{name:"String"}},protocol:{required:!0,serializedName:"protocol",type:{name:"Enum",allowedValues:["tcp","udp"]}},backendPort:{required:!0,serializedName:"backendPort",type:{name:"Number"}},frontendPortRangeStart:{required:!0,serializedName:"frontendPortRangeStart",type:{name:"Number"}},frontendPortRangeEnd:{required:!0,serializedName:"frontendPortRangeEnd",type:{name:"Number"}},networkSecurityGroupRules:{required:!1,serializedName:"networkSecurityGroupRules",type:{name:"Sequence",element:{required:!1,serializedName:"NetworkSecurityGroupRuleElementType",type:{name:"Composite",className:"NetworkSecurityGroupRule"}}}}}}},t.PoolEndpointConfiguration={required:!1,serializedName:"PoolEndpointConfiguration",type:{name:"Composite",className:"PoolEndpointConfiguration",modelProperties:{inboundNATPools:{required:!0,serializedName:"inboundNATPools",type:{name:"Sequence",element:{required:!1,serializedName:"InboundNATPoolElementType",type:{name:"Composite",className:"InboundNATPool"}}}}}}},t.NetworkConfiguration={required:!1,serializedName:"NetworkConfiguration",type:{name:"Composite",className:"NetworkConfiguration",modelProperties:{subnetId:{required:!1,serializedName:"subnetId",type:{name:"String"}},endpointConfiguration:{required:!1,serializedName:"endpointConfiguration",type:{name:"Composite",className:"PoolEndpointConfiguration"}}}}},t.PoolSpecification={required:!1,serializedName:"PoolSpecification",type:{name:"Composite",className:"PoolSpecification",modelProperties:{displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},vmSize:{required:!0,serializedName:"vmSize",type:{name:"String"}},cloudServiceConfiguration:{required:!1,serializedName:"cloudServiceConfiguration",type:{name:"Composite",className:"CloudServiceConfiguration"}},virtualMachineConfiguration:{required:!1,serializedName:"virtualMachineConfiguration",type:{name:"Composite",className:"VirtualMachineConfiguration"}},maxTasksPerNode:{required:!1,serializedName:"maxTasksPerNode",type:{name:"Number"}},taskSchedulingPolicy:{required:!1,serializedName:"taskSchedulingPolicy",type:{name:"Composite",className:"TaskSchedulingPolicy"}},resizeTimeout:{required:!1,serializedName:"resizeTimeout",type:{name:"TimeSpan"}},targetDedicatedNodes:{required:!1,serializedName:"targetDedicatedNodes",type:{name:"Number"}},targetLowPriorityNodes:{required:!1,serializedName:"targetLowPriorityNodes",type:{name:"Number"}},enableAutoScale:{required:!1,serializedName:"enableAutoScale",type:{name:"Boolean"}},autoScaleFormula:{required:!1,serializedName:"autoScaleFormula",type:{name:"String"}},autoScaleEvaluationInterval:{required:!1,serializedName:"autoScaleEvaluationInterval",type:{name:"TimeSpan"}},enableInterNodeCommunication:{required:!1,serializedName:"enableInterNodeCommunication",type:{name:"Boolean"}},networkConfiguration:{required:!1,serializedName:"networkConfiguration",type:{name:"Composite",className:"NetworkConfiguration"}},startTask:{required:!1,serializedName:"startTask",type:{name:"Composite",className:"StartTask"}},certificateReferences:{required:!1,serializedName:"certificateReferences",type:{name:"Sequence",element:{required:!1,serializedName:"CertificateReferenceElementType",type:{name:"Composite",className:"CertificateReference"}}}},applicationPackageReferences:{required:!1,serializedName:"applicationPackageReferences",type:{name:"Sequence",element:{required:!1,serializedName:"ApplicationPackageReferenceElementType",type:{name:"Composite",className:"ApplicationPackageReference"}}}},applicationLicenses:{required:!1,serializedName:"applicationLicenses",type:{name:"Sequence",element:{required:!1,serializedName:"stringElementType",type:{name:"String"}}}},userAccounts:{required:!1,serializedName:"userAccounts",type:{name:"Sequence",element:{required:!1,serializedName:"UserAccountElementType",type:{name:"Composite",className:"UserAccount"}}}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}}}}},t.AutoPoolSpecification={required:!1,serializedName:"AutoPoolSpecification",type:{name:"Composite",className:"AutoPoolSpecification",modelProperties:{autoPoolIdPrefix:{required:!1,serializedName:"autoPoolIdPrefix",type:{name:"String"}},poolLifetimeOption:{required:!0,serializedName:"poolLifetimeOption",type:{name:"Enum",allowedValues:["jobSchedule","job"]}},keepAlive:{required:!1,serializedName:"keepAlive",type:{name:"Boolean"}},pool:{required:!1,serializedName:"pool",type:{name:"Composite",className:"PoolSpecification"}}}}},t.PoolInformation={required:!1,serializedName:"PoolInformation",type:{name:"Composite",className:"PoolInformation",modelProperties:{poolId:{required:!1,serializedName:"poolId",type:{name:"String"}},autoPoolSpecification:{required:!1,serializedName:"autoPoolSpecification",type:{name:"Composite",className:"AutoPoolSpecification"}}}}},t.JobSpecification={required:!1,serializedName:"JobSpecification",type:{name:"Composite",className:"JobSpecification",modelProperties:{priority:{required:!1,serializedName:"priority",type:{name:"Number"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},usesTaskDependencies:{required:!1,serializedName:"usesTaskDependencies",type:{name:"Boolean"}},onAllTasksComplete:{required:!1,serializedName:"onAllTasksComplete",type:{name:"Enum",allowedValues:["noAction","terminateJob"]}},onTaskFailure:{required:!1,serializedName:"onTaskFailure",type:{name:"Enum",allowedValues:["noAction","performExitOptionsJobAction"]}},constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"JobConstraints"}},jobManagerTask:{required:!1,serializedName:"jobManagerTask",type:{name:"Composite",className:"JobManagerTask"}},jobPreparationTask:{required:!1,serializedName:"jobPreparationTask",type:{name:"Composite",className:"JobPreparationTask"}},jobReleaseTask:{required:!1,serializedName:"jobReleaseTask",type:{name:"Composite",className:"JobReleaseTask"}},commonEnvironmentSettings:{required:!1,serializedName:"commonEnvironmentSettings",type:{name:"Sequence",element:{required:!1,serializedName:"EnvironmentSettingElementType",type:{name:"Composite",className:"EnvironmentSetting"}}}},poolInfo:{required:!0,serializedName:"poolInfo",defaultValue:{},type:{name:"Composite",className:"PoolInformation"}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}}}}},t.RecentJob={required:!1,serializedName:"RecentJob",type:{name:"Composite",className:"RecentJob",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"String"}},url:{required:!1,serializedName:"url",type:{name:"String"}}}}},t.JobScheduleExecutionInformation={required:!1,serializedName:"JobScheduleExecutionInformation",type:{name:"Composite",className:"JobScheduleExecutionInformation",modelProperties:{nextRunTime:{required:!1,serializedName:"nextRunTime",type:{name:"DateTime"}},recentJob:{required:!1,serializedName:"recentJob",type:{name:"Composite",className:"RecentJob"}},endTime:{required:!1,serializedName:"endTime",type:{name:"DateTime"}}}}},t.JobScheduleStatistics={required:!1,serializedName:"JobScheduleStatistics",type:{name:"Composite",className:"JobScheduleStatistics",modelProperties:{url:{required:!0,serializedName:"url",type:{name:"String"}},startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},lastUpdateTime:{required:!0,serializedName:"lastUpdateTime",type:{name:"DateTime"}},userCPUTime:{required:!0,serializedName:"userCPUTime",type:{name:"TimeSpan"}},kernelCPUTime:{required:!0,serializedName:"kernelCPUTime",type:{name:"TimeSpan"}},wallClockTime:{required:!0,serializedName:"wallClockTime",type:{name:"TimeSpan"}},readIOps:{required:!0,serializedName:"readIOps",type:{name:"Number"}},writeIOps:{required:!0,serializedName:"writeIOps",type:{name:"Number"}},readIOGiB:{required:!0,serializedName:"readIOGiB",type:{name:"Number"}},writeIOGiB:{required:!0,serializedName:"writeIOGiB",type:{name:"Number"}},numSucceededTasks:{required:!0,serializedName:"numSucceededTasks",type:{name:"Number"}},numFailedTasks:{required:!0,serializedName:"numFailedTasks",type:{name:"Number"}},numTaskRetries:{required:!0,serializedName:"numTaskRetries",type:{name:"Number"}},waitTime:{required:!0,serializedName:"waitTime",type:{name:"TimeSpan"}}}}},t.CloudJobSchedule={required:!1,serializedName:"CloudJobSchedule",type:{name:"Composite",className:"CloudJobSchedule",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"String"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},url:{required:!1,serializedName:"url",type:{name:"String"}},eTag:{required:!1,serializedName:"eTag",type:{name:"String"}},lastModified:{required:!1,serializedName:"lastModified",type:{name:"DateTime"}},creationTime:{required:!1,serializedName:"creationTime",type:{name:"DateTime"}},state:{required:!1,serializedName:"state",type:{name:"Enum",allowedValues:["active","completed","disabled","terminating","deleting"]}},stateTransitionTime:{required:!1,serializedName:"stateTransitionTime",type:{name:"DateTime"}},previousState:{required:!1,serializedName:"previousState",type:{name:"Enum",allowedValues:["active","completed","disabled","terminating","deleting"]}},previousStateTransitionTime:{required:!1,serializedName:"previousStateTransitionTime",type:{name:"DateTime"}},schedule:{required:!1,serializedName:"schedule",type:{name:"Composite",className:"Schedule"}},jobSpecification:{required:!1,serializedName:"jobSpecification",type:{name:"Composite",className:"JobSpecification"}},executionInfo:{required:!1,serializedName:"executionInfo",type:{name:"Composite",className:"JobScheduleExecutionInformation"}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}},stats:{required:!1,serializedName:"stats",type:{name:"Composite",className:"JobScheduleStatistics"}}}}},t.JobScheduleAddParameter={required:!1,serializedName:"JobScheduleAddParameter",type:{name:"Composite",className:"JobScheduleAddParameter",modelProperties:{id:{required:!0,serializedName:"id",type:{name:"String"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},schedule:{required:!0,serializedName:"schedule",type:{name:"Composite",className:"Schedule"}},jobSpecification:{required:!0,serializedName:"jobSpecification",defaultValue:{},type:{name:"Composite",className:"JobSpecification"}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}}}}},t.JobSchedulingError={required:!1,serializedName:"JobSchedulingError",type:{name:"Composite",className:"JobSchedulingError",modelProperties:{category:{required:!0,serializedName:"category",type:{name:"Enum",allowedValues:["userError","serverError"]}},code:{required:!1,serializedName:"code",type:{name:"String"}},message:{required:!1,serializedName:"message",type:{name:"String"}},details:{required:!1,serializedName:"details",type:{name:"Sequence",element:{required:!1,serializedName:"NameValuePairElementType",type:{name:"Composite",className:"NameValuePair"}}}}}}},t.JobExecutionInformation={required:!1,serializedName:"JobExecutionInformation",type:{name:"Composite",className:"JobExecutionInformation",modelProperties:{startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},endTime:{required:!1,serializedName:"endTime",type:{name:"DateTime"}},poolId:{required:!1,serializedName:"poolId",type:{name:"String"}},schedulingError:{required:!1,serializedName:"schedulingError",type:{name:"Composite",className:"JobSchedulingError"}},terminateReason:{required:!1,serializedName:"terminateReason",type:{name:"String"}}}}},t.CloudJob={required:!1,serializedName:"CloudJob",type:{name:"Composite",className:"CloudJob",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"String"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},usesTaskDependencies:{required:!1,serializedName:"usesTaskDependencies",type:{name:"Boolean"}},url:{required:!1,serializedName:"url",type:{name:"String"}},eTag:{required:!1,serializedName:"eTag",type:{name:"String"}},lastModified:{required:!1,serializedName:"lastModified",type:{name:"DateTime"}},creationTime:{required:!1,serializedName:"creationTime",type:{name:"DateTime"}},state:{required:!1,serializedName:"state",type:{name:"Enum",allowedValues:["active","disabling","disabled","enabling","terminating","completed","deleting"]}},stateTransitionTime:{required:!1,serializedName:"stateTransitionTime",type:{name:"DateTime"}},previousState:{required:!1,serializedName:"previousState",type:{name:"Enum",allowedValues:["active","disabling","disabled","enabling","terminating","completed","deleting"]}},previousStateTransitionTime:{required:!1,serializedName:"previousStateTransitionTime",type:{name:"DateTime"}},priority:{required:!1,serializedName:"priority",type:{name:"Number"}},constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"JobConstraints"}},jobManagerTask:{required:!1,serializedName:"jobManagerTask",type:{name:"Composite",className:"JobManagerTask"}},jobPreparationTask:{required:!1,serializedName:"jobPreparationTask",type:{name:"Composite",className:"JobPreparationTask"}},jobReleaseTask:{required:!1,serializedName:"jobReleaseTask",type:{name:"Composite",className:"JobReleaseTask"}},commonEnvironmentSettings:{required:!1,serializedName:"commonEnvironmentSettings",type:{name:"Sequence",element:{required:!1,serializedName:"EnvironmentSettingElementType",type:{name:"Composite",className:"EnvironmentSetting"}}}},poolInfo:{required:!1,serializedName:"poolInfo",type:{name:"Composite",className:"PoolInformation"}},onAllTasksComplete:{required:!1,serializedName:"onAllTasksComplete",type:{name:"Enum",allowedValues:["noAction","terminateJob"]}},onTaskFailure:{required:!1,serializedName:"onTaskFailure",type:{name:"Enum",allowedValues:["noAction","performExitOptionsJobAction"]}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}},executionInfo:{required:!1,serializedName:"executionInfo",type:{name:"Composite",className:"JobExecutionInformation"}},stats:{required:!1,serializedName:"stats",type:{name:"Composite",className:"JobStatistics"}}}}},t.JobAddParameter={required:!1,serializedName:"JobAddParameter",type:{name:"Composite",className:"JobAddParameter",modelProperties:{id:{required:!0,serializedName:"id",type:{name:"String"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},priority:{required:!1,serializedName:"priority",type:{name:"Number"}},constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"JobConstraints"}},jobManagerTask:{required:!1,serializedName:"jobManagerTask",type:{name:"Composite",className:"JobManagerTask"}},jobPreparationTask:{required:!1,serializedName:"jobPreparationTask",type:{name:"Composite",className:"JobPreparationTask"}},jobReleaseTask:{required:!1,serializedName:"jobReleaseTask",type:{name:"Composite",className:"JobReleaseTask"}},commonEnvironmentSettings:{required:!1,serializedName:"commonEnvironmentSettings",type:{name:"Sequence",element:{required:!1,serializedName:"EnvironmentSettingElementType",type:{name:"Composite",className:"EnvironmentSetting"}}}},poolInfo:{required:!0,serializedName:"poolInfo",defaultValue:{},type:{name:"Composite",className:"PoolInformation"}},onAllTasksComplete:{required:!1,serializedName:"onAllTasksComplete",type:{name:"Enum",allowedValues:["noAction","terminateJob"]}},onTaskFailure:{required:!1,serializedName:"onTaskFailure",type:{name:"Enum",allowedValues:["noAction","performExitOptionsJobAction"]}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}},usesTaskDependencies:{required:!1,serializedName:"usesTaskDependencies",type:{name:"Boolean"}}}}},t.TaskContainerExecutionInformation={required:!1,serializedName:"TaskContainerExecutionInformation",type:{name:"Composite",className:"TaskContainerExecutionInformation",modelProperties:{containerId:{required:!1,serializedName:"containerId",type:{name:"String"}},state:{required:!1,serializedName:"state",type:{name:"String"}},error:{required:!1,serializedName:"error",type:{name:"String"}}}}},t.TaskFailureInformation={required:!1,serializedName:"TaskFailureInformation",type:{name:"Composite",className:"TaskFailureInformation",modelProperties:{category:{required:!0,serializedName:"category",type:{name:"Enum",allowedValues:["userError","serverError"]}},code:{required:!1,serializedName:"code",type:{name:"String"}},message:{required:!1,serializedName:"message",type:{name:"String"}},details:{required:!1,serializedName:"details",type:{name:"Sequence",element:{required:!1,serializedName:"NameValuePairElementType",type:{name:"Composite",className:"NameValuePair"}}}}}}},t.JobPreparationTaskExecutionInformation={required:!1,serializedName:"JobPreparationTaskExecutionInformation",type:{name:"Composite",className:"JobPreparationTaskExecutionInformation",modelProperties:{startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},endTime:{required:!1,serializedName:"endTime",type:{name:"DateTime"}},state:{required:!0,serializedName:"state",type:{name:"Enum",allowedValues:["running","completed"]}},taskRootDirectory:{required:!1,serializedName:"taskRootDirectory",type:{name:"String"}},taskRootDirectoryUrl:{required:!1,serializedName:"taskRootDirectoryUrl",type:{name:"String"}},exitCode:{required:!1,serializedName:"exitCode",type:{name:"Number"}},containerInfo:{required:!1,serializedName:"containerInfo",type:{name:"Composite",className:"TaskContainerExecutionInformation"}},failureInfo:{required:!1,serializedName:"failureInfo",type:{name:"Composite",className:"TaskFailureInformation"}},retryCount:{required:!0,serializedName:"retryCount",type:{name:"Number"}},lastRetryTime:{required:!1,serializedName:"lastRetryTime",type:{name:"DateTime"}},result:{required:!1,serializedName:"result",type:{name:"Enum",allowedValues:["success","failure"]}}}}},t.JobReleaseTaskExecutionInformation={required:!1,serializedName:"JobReleaseTaskExecutionInformation",type:{name:"Composite",className:"JobReleaseTaskExecutionInformation",modelProperties:{startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},endTime:{required:!1,serializedName:"endTime",type:{name:"DateTime"}},state:{required:!0,serializedName:"state",type:{name:"Enum",allowedValues:["running","completed"]}},taskRootDirectory:{required:!1,serializedName:"taskRootDirectory",type:{name:"String"}},taskRootDirectoryUrl:{required:!1,serializedName:"taskRootDirectoryUrl",type:{name:"String"}},exitCode:{required:!1,serializedName:"exitCode",type:{name:"Number"}},containerInfo:{required:!1,serializedName:"containerInfo",type:{name:"Composite",className:"TaskContainerExecutionInformation"}},failureInfo:{required:!1,serializedName:"failureInfo",type:{name:"Composite",className:"TaskFailureInformation"}},result:{required:!1,serializedName:"result",type:{name:"Enum",allowedValues:["success","failure"]}}}}},t.JobPreparationAndReleaseTaskExecutionInformation={required:!1,serializedName:"JobPreparationAndReleaseTaskExecutionInformation",type:{name:"Composite",className:"JobPreparationAndReleaseTaskExecutionInformation",modelProperties:{poolId:{required:!1,serializedName:"poolId",type:{name:"String"}},nodeId:{required:!1,serializedName:"nodeId",type:{name:"String"}},nodeUrl:{required:!1,serializedName:"nodeUrl",type:{name:"String"}},jobPreparationTaskExecutionInfo:{required:!1,serializedName:"jobPreparationTaskExecutionInfo",type:{name:"Composite",className:"JobPreparationTaskExecutionInformation"}},jobReleaseTaskExecutionInfo:{required:!1,serializedName:"jobReleaseTaskExecutionInfo",type:{name:"Composite",className:"JobReleaseTaskExecutionInformation"}}}}},t.TaskCounts={required:!1,serializedName:"TaskCounts",type:{name:"Composite",className:"TaskCounts",modelProperties:{active:{required:!0,serializedName:"active",type:{name:"Number"}},running:{required:!0,serializedName:"running",type:{name:"Number"}},completed:{required:!0,serializedName:"completed",type:{name:"Number"}},succeeded:{required:!0,serializedName:"succeeded",type:{name:"Number"}},failed:{required:!0,serializedName:"failed",type:{name:"Number"}},validationStatus:{required:!0,serializedName:"validationStatus",type:{name:"Enum",allowedValues:["validated","unvalidated"]}}}}},t.AutoScaleRunError={required:!1,serializedName:"AutoScaleRunError",type:{name:"Composite",className:"AutoScaleRunError",modelProperties:{code:{required:!1,serializedName:"code",type:{name:"String"}},message:{required:!1,serializedName:"message",type:{name:"String"}},values:{required:!1,serializedName:"values",type:{name:"Sequence",element:{required:!1,serializedName:"NameValuePairElementType",type:{name:"Composite",className:"NameValuePair"}}}}}}},t.AutoScaleRun={required:!1,serializedName:"AutoScaleRun",type:{name:"Composite",className:"AutoScaleRun",modelProperties:{timestamp:{required:!0,serializedName:"timestamp",type:{name:"DateTime"}},results:{required:!1,serializedName:"results",type:{name:"String"}},error:{required:!1,serializedName:"error",type:{name:"Composite",className:"AutoScaleRunError"}}}}},t.ResizeError={required:!1,serializedName:"ResizeError",type:{name:"Composite",className:"ResizeError",modelProperties:{code:{required:!1,serializedName:"code",type:{name:"String"}},message:{required:!1,serializedName:"message",type:{name:"String"}},values:{required:!1,serializedName:"values",type:{name:"Sequence",element:{required:!1,serializedName:"NameValuePairElementType",type:{name:"Composite",className:"NameValuePair"}}}}}}},t.CloudPool={required:!1,serializedName:"CloudPool",type:{name:"Composite",className:"CloudPool",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"String"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},url:{required:!1,serializedName:"url",type:{name:"String"}},eTag:{required:!1,serializedName:"eTag",type:{name:"String"}},lastModified:{required:!1,serializedName:"lastModified",type:{name:"DateTime"}},creationTime:{required:!1,serializedName:"creationTime",type:{name:"DateTime"}},state:{required:!1,serializedName:"state",type:{name:"Enum",allowedValues:["active","deleting","upgrading"]}},stateTransitionTime:{required:!1,serializedName:"stateTransitionTime",type:{name:"DateTime"}},allocationState:{required:!1,serializedName:"allocationState",type:{name:"Enum",allowedValues:["steady","resizing","stopping"]}},allocationStateTransitionTime:{required:!1,serializedName:"allocationStateTransitionTime",type:{name:"DateTime"}},vmSize:{required:!1,serializedName:"vmSize",type:{name:"String"}},cloudServiceConfiguration:{required:!1,serializedName:"cloudServiceConfiguration",type:{name:"Composite",className:"CloudServiceConfiguration"}},virtualMachineConfiguration:{required:!1,serializedName:"virtualMachineConfiguration",type:{name:"Composite",className:"VirtualMachineConfiguration"}},resizeTimeout:{required:!1,serializedName:"resizeTimeout",type:{name:"TimeSpan"}},resizeErrors:{required:!1,serializedName:"resizeErrors",type:{name:"Sequence",element:{required:!1,serializedName:"ResizeErrorElementType",type:{name:"Composite",className:"ResizeError"}}}},currentDedicatedNodes:{required:!1,serializedName:"currentDedicatedNodes",type:{name:"Number"}},currentLowPriorityNodes:{required:!1,serializedName:"currentLowPriorityNodes",type:{name:"Number"}},targetDedicatedNodes:{required:!1,serializedName:"targetDedicatedNodes",type:{name:"Number"}},targetLowPriorityNodes:{required:!1,serializedName:"targetLowPriorityNodes",type:{name:"Number"}},enableAutoScale:{required:!1,serializedName:"enableAutoScale",type:{name:"Boolean"}},autoScaleFormula:{required:!1,serializedName:"autoScaleFormula",type:{name:"String"}},autoScaleEvaluationInterval:{required:!1,serializedName:"autoScaleEvaluationInterval",type:{name:"TimeSpan"}},autoScaleRun:{required:!1,serializedName:"autoScaleRun",type:{name:"Composite",className:"AutoScaleRun"}},enableInterNodeCommunication:{required:!1,serializedName:"enableInterNodeCommunication",type:{name:"Boolean"}},networkConfiguration:{required:!1,serializedName:"networkConfiguration",type:{name:"Composite",className:"NetworkConfiguration"}},startTask:{required:!1,serializedName:"startTask",type:{name:"Composite",className:"StartTask"}},certificateReferences:{required:!1,serializedName:"certificateReferences",type:{name:"Sequence",element:{required:!1,serializedName:"CertificateReferenceElementType",type:{name:"Composite",className:"CertificateReference"}}}},applicationPackageReferences:{required:!1,serializedName:"applicationPackageReferences",type:{name:"Sequence",element:{required:!1,serializedName:"ApplicationPackageReferenceElementType",type:{name:"Composite",className:"ApplicationPackageReference"}}}},applicationLicenses:{required:!1,serializedName:"applicationLicenses",type:{name:"Sequence",element:{required:!1,serializedName:"stringElementType",type:{name:"String"}}}},maxTasksPerNode:{required:!1,serializedName:"maxTasksPerNode",type:{name:"Number"}},taskSchedulingPolicy:{required:!1,serializedName:"taskSchedulingPolicy",type:{name:"Composite",className:"TaskSchedulingPolicy"}},userAccounts:{required:!1,serializedName:"userAccounts",type:{name:"Sequence",element:{required:!1,serializedName:"UserAccountElementType",type:{name:"Composite",className:"UserAccount"}}}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}},stats:{required:!1,serializedName:"stats",type:{name:"Composite",className:"PoolStatistics"}}}}},t.PoolAddParameter={required:!1,serializedName:"PoolAddParameter",type:{name:"Composite",className:"PoolAddParameter",modelProperties:{id:{required:!0,serializedName:"id",type:{name:"String"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},vmSize:{required:!0,serializedName:"vmSize",type:{name:"String"}},cloudServiceConfiguration:{required:!1,serializedName:"cloudServiceConfiguration",type:{name:"Composite",className:"CloudServiceConfiguration"}},virtualMachineConfiguration:{required:!1,serializedName:"virtualMachineConfiguration",type:{name:"Composite",className:"VirtualMachineConfiguration"}},resizeTimeout:{required:!1,serializedName:"resizeTimeout",type:{name:"TimeSpan"}},targetDedicatedNodes:{required:!1,serializedName:"targetDedicatedNodes",type:{name:"Number"}},targetLowPriorityNodes:{required:!1,serializedName:"targetLowPriorityNodes",type:{name:"Number"}},enableAutoScale:{required:!1,serializedName:"enableAutoScale",type:{name:"Boolean"}},autoScaleFormula:{required:!1,serializedName:"autoScaleFormula",type:{name:"String"}},autoScaleEvaluationInterval:{required:!1,serializedName:"autoScaleEvaluationInterval",type:{name:"TimeSpan"}},enableInterNodeCommunication:{required:!1,serializedName:"enableInterNodeCommunication",type:{name:"Boolean"}},networkConfiguration:{required:!1,serializedName:"networkConfiguration",type:{name:"Composite",className:"NetworkConfiguration"}},startTask:{required:!1,serializedName:"startTask",type:{name:"Composite",className:"StartTask"}},certificateReferences:{required:!1,serializedName:"certificateReferences",type:{name:"Sequence",element:{required:!1,serializedName:"CertificateReferenceElementType",type:{name:"Composite",className:"CertificateReference"}}}},applicationPackageReferences:{required:!1,serializedName:"applicationPackageReferences",type:{name:"Sequence",element:{required:!1,serializedName:"ApplicationPackageReferenceElementType",type:{name:"Composite",className:"ApplicationPackageReference"}}}},applicationLicenses:{required:!1,serializedName:"applicationLicenses",type:{name:"Sequence",element:{required:!1,serializedName:"stringElementType",type:{name:"String"}}}},maxTasksPerNode:{required:!1,serializedName:"maxTasksPerNode",type:{name:"Number"}},taskSchedulingPolicy:{required:!1,serializedName:"taskSchedulingPolicy",type:{name:"Composite",className:"TaskSchedulingPolicy"}},userAccounts:{required:!1,serializedName:"userAccounts",type:{name:"Sequence",element:{required:!1,serializedName:"UserAccountElementType",type:{name:"Composite",className:"UserAccount"}}}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}}}}},t.AffinityInformation={required:!1,serializedName:"AffinityInformation",type:{name:"Composite",className:"AffinityInformation",modelProperties:{affinityId:{required:!0,serializedName:"affinityId",type:{name:"String"}}}}},t.TaskExecutionInformation={required:!1,serializedName:"TaskExecutionInformation",type:{name:"Composite",className:"TaskExecutionInformation",modelProperties:{startTime:{required:!1,serializedName:"startTime",type:{name:"DateTime"}},endTime:{required:!1,serializedName:"endTime",type:{name:"DateTime"}},exitCode:{required:!1,serializedName:"exitCode",type:{name:"Number"}},containerInfo:{required:!1,serializedName:"containerInfo",type:{name:"Composite",className:"TaskContainerExecutionInformation"}},failureInfo:{required:!1,serializedName:"failureInfo",type:{name:"Composite",className:"TaskFailureInformation"}},retryCount:{required:!0,serializedName:"retryCount",type:{name:"Number"}},lastRetryTime:{required:!1,serializedName:"lastRetryTime",type:{name:"DateTime"}},requeueCount:{required:!0,serializedName:"requeueCount",type:{name:"Number"}},lastRequeueTime:{required:!1,serializedName:"lastRequeueTime",type:{name:"DateTime"}},result:{required:!1,serializedName:"result",type:{name:"Enum",allowedValues:["success","failure"]}}}}},t.ComputeNodeInformation={required:!1,serializedName:"ComputeNodeInformation",type:{name:"Composite",className:"ComputeNodeInformation",modelProperties:{affinityId:{required:!1,serializedName:"affinityId",type:{name:"String"}},nodeUrl:{required:!1,serializedName:"nodeUrl",type:{name:"String"}},poolId:{required:!1,serializedName:"poolId",type:{name:"String"}},nodeId:{required:!1,serializedName:"nodeId",type:{name:"String"}},taskRootDirectory:{required:!1,serializedName:"taskRootDirectory",type:{name:"String"}},taskRootDirectoryUrl:{required:!1,serializedName:"taskRootDirectoryUrl",type:{name:"String"}}}}},t.MultiInstanceSettings={required:!1,serializedName:"MultiInstanceSettings",type:{name:"Composite",className:"MultiInstanceSettings",modelProperties:{numberOfInstances:{required:!1,serializedName:"numberOfInstances",type:{name:"Number"}},coordinationCommandLine:{required:!0,serializedName:"coordinationCommandLine",type:{name:"String"}},commonResourceFiles:{required:!1,serializedName:"commonResourceFiles",type:{name:"Sequence",element:{required:!1,serializedName:"ResourceFileElementType",type:{name:"Composite",className:"ResourceFile"}}}}}}},t.TaskStatistics={required:!1,serializedName:"TaskStatistics",type:{name:"Composite",className:"TaskStatistics",modelProperties:{url:{required:!0,serializedName:"url",type:{name:"String"}},startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},lastUpdateTime:{required:!0,serializedName:"lastUpdateTime",type:{name:"DateTime"}},userCPUTime:{required:!0,serializedName:"userCPUTime",type:{name:"TimeSpan"}},kernelCPUTime:{required:!0,serializedName:"kernelCPUTime",type:{name:"TimeSpan"}},wallClockTime:{required:!0,serializedName:"wallClockTime",type:{name:"TimeSpan"}},readIOps:{required:!0,serializedName:"readIOps",type:{name:"Number"}},writeIOps:{required:!0,serializedName:"writeIOps",type:{name:"Number"}},readIOGiB:{required:!0,serializedName:"readIOGiB",type:{name:"Number"}},writeIOGiB:{required:!0,serializedName:"writeIOGiB",type:{name:"Number"}},waitTime:{required:!0,serializedName:"waitTime",type:{name:"TimeSpan"}}}}},t.TaskIdRange={required:!1,serializedName:"TaskIdRange",type:{name:"Composite",className:"TaskIdRange",modelProperties:{start:{required:!0,serializedName:"start",type:{name:"Number"}},end:{required:!0,serializedName:"end",type:{name:"Number"}}}}},t.TaskDependencies={required:!1,serializedName:"TaskDependencies",type:{name:"Composite",className:"TaskDependencies",modelProperties:{taskIds:{required:!1,serializedName:"taskIds",type:{name:"Sequence",element:{required:!1,serializedName:"stringElementType",type:{name:"String"}}}},taskIdRanges:{required:!1,serializedName:"taskIdRanges",type:{name:"Sequence",element:{required:!1,serializedName:"TaskIdRangeElementType",type:{name:"Composite",className:"TaskIdRange"}}}}}}},t.CloudTask={required:!1,serializedName:"CloudTask",type:{name:"Composite",className:"CloudTask",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"String"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},url:{required:!1,serializedName:"url",type:{name:"String"}},eTag:{required:!1,serializedName:"eTag",type:{name:"String"}},lastModified:{required:!1,serializedName:"lastModified",type:{name:"DateTime"}},creationTime:{required:!1,serializedName:"creationTime",type:{name:"DateTime"}},exitConditions:{required:!1,serializedName:"exitConditions",type:{name:"Composite",className:"ExitConditions"}},state:{required:!1,serializedName:"state",type:{name:"Enum",allowedValues:["active","preparing","running","completed"]}},stateTransitionTime:{required:!1,serializedName:"stateTransitionTime",type:{name:"DateTime"}},previousState:{required:!1,serializedName:"previousState",type:{name:"Enum",allowedValues:["active","preparing","running","completed"]}},previousStateTransitionTime:{required:!1,serializedName:"previousStateTransitionTime",type:{name:"DateTime"}},commandLine:{required:!1,serializedName:"commandLine",type:{name:"String"}},containerSettings:{required:!1,serializedName:"containerSettings",type:{name:"Composite",className:"TaskContainerSettings"}},resourceFiles:{required:!1,serializedName:"resourceFiles",type:{name:"Sequence",element:{required:!1,serializedName:"ResourceFileElementType",type:{name:"Composite",className:"ResourceFile"}}}},outputFiles:{required:!1,serializedName:"outputFiles",type:{name:"Sequence",element:{required:!1,serializedName:"OutputFileElementType",type:{name:"Composite",className:"OutputFile"}}}},environmentSettings:{required:!1,serializedName:"environmentSettings",type:{name:"Sequence",element:{required:!1,serializedName:"EnvironmentSettingElementType",type:{name:"Composite",className:"EnvironmentSetting"}}}},affinityInfo:{required:!1,serializedName:"affinityInfo",type:{name:"Composite",className:"AffinityInformation"}},constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"TaskConstraints"}},userIdentity:{required:!1,serializedName:"userIdentity",type:{name:"Composite",className:"UserIdentity"}},executionInfo:{required:!1,serializedName:"executionInfo",type:{name:"Composite",className:"TaskExecutionInformation"}},nodeInfo:{required:!1,serializedName:"nodeInfo",type:{name:"Composite",className:"ComputeNodeInformation"}},multiInstanceSettings:{required:!1,serializedName:"multiInstanceSettings",type:{name:"Composite",className:"MultiInstanceSettings"}},stats:{required:!1,serializedName:"stats",type:{name:"Composite",className:"TaskStatistics"}},dependsOn:{required:!1,serializedName:"dependsOn",type:{name:"Composite",className:"TaskDependencies"}},applicationPackageReferences:{required:!1,serializedName:"applicationPackageReferences",type:{name:"Sequence",element:{required:!1,serializedName:"ApplicationPackageReferenceElementType",type:{name:"Composite",className:"ApplicationPackageReference"}}}},authenticationTokenSettings:{required:!1,serializedName:"authenticationTokenSettings",type:{name:"Composite",className:"AuthenticationTokenSettings"}}}}},t.TaskAddParameter={required:!1,serializedName:"TaskAddParameter",type:{name:"Composite",className:"TaskAddParameter",modelProperties:{id:{required:!0,serializedName:"id",type:{name:"String"}},displayName:{required:!1,serializedName:"displayName",type:{name:"String"}},commandLine:{required:!0,serializedName:"commandLine",type:{name:"String"}},containerSettings:{required:!1,serializedName:"containerSettings",type:{name:"Composite",className:"TaskContainerSettings"}},exitConditions:{required:!1,serializedName:"exitConditions",type:{name:"Composite",className:"ExitConditions"}},resourceFiles:{required:!1,serializedName:"resourceFiles",type:{name:"Sequence",element:{required:!1,serializedName:"ResourceFileElementType",type:{name:"Composite",className:"ResourceFile"}}}},outputFiles:{required:!1,serializedName:"outputFiles",type:{name:"Sequence",element:{required:!1,serializedName:"OutputFileElementType",type:{name:"Composite",className:"OutputFile"}}}},environmentSettings:{required:!1,serializedName:"environmentSettings",type:{name:"Sequence",element:{required:!1,serializedName:"EnvironmentSettingElementType",type:{name:"Composite",className:"EnvironmentSetting"}}}},affinityInfo:{required:!1,serializedName:"affinityInfo",type:{name:"Composite",className:"AffinityInformation"}},constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"TaskConstraints"}},userIdentity:{required:!1,serializedName:"userIdentity",type:{name:"Composite",className:"UserIdentity"}},multiInstanceSettings:{required:!1,serializedName:"multiInstanceSettings",type:{name:"Composite",className:"MultiInstanceSettings"}},dependsOn:{required:!1,serializedName:"dependsOn",type:{name:"Composite",className:"TaskDependencies"}},applicationPackageReferences:{required:!1,serializedName:"applicationPackageReferences",type:{name:"Sequence",element:{required:!1,serializedName:"ApplicationPackageReferenceElementType",type:{name:"Composite",className:"ApplicationPackageReference"}}}},authenticationTokenSettings:{required:!1,serializedName:"authenticationTokenSettings",type:{name:"Composite",className:"AuthenticationTokenSettings"}}}}},t.TaskAddCollectionParameter={required:!1,serializedName:"TaskAddCollectionParameter",type:{name:"Composite",className:"TaskAddCollectionParameter",modelProperties:{value:{required:!0,serializedName:"value",constraints:{MaxItems:100},type:{name:"Sequence",element:{required:!1,serializedName:"TaskAddParameterElementType",type:{name:"Composite",className:"TaskAddParameter"}}}}}}},t.ErrorMessage={required:!1,serializedName:"ErrorMessage",type:{name:"Composite",className:"ErrorMessage",modelProperties:{lang:{required:!1,serializedName:"lang",type:{name:"String"}},value:{required:!1,serializedName:"value",type:{name:"String"}}}}},t.BatchErrorDetail={required:!1,serializedName:"BatchErrorDetail",type:{name:"Composite",className:"BatchErrorDetail",modelProperties:{key:{required:!1,serializedName:"key",type:{name:"String"}},value:{required:!1,serializedName:"value",type:{name:"String"}}}}},t.BatchError={required:!1,serializedName:"BatchError",type:{name:"Composite",className:"BatchError",modelProperties:{code:{required:!1,serializedName:"code",type:{name:"String"}},message:{required:!1,serializedName:"message",type:{name:"Composite",className:"ErrorMessage"}},values:{required:!1,serializedName:"values",type:{name:"Sequence",element:{required:!1,serializedName:"BatchErrorDetailElementType",type:{name:"Composite",className:"BatchErrorDetail"}}}}}}},t.TaskAddResult={required:!1,serializedName:"TaskAddResult",type:{name:"Composite",className:"TaskAddResult",modelProperties:{status:{required:!0,serializedName:"status",type:{name:"Enum",allowedValues:["success","clientError","serverError"]}},taskId:{required:!0,serializedName:"taskId",type:{name:"String"}},eTag:{required:!1,serializedName:"eTag",type:{name:"String"}},lastModified:{required:!1,serializedName:"lastModified",type:{name:"DateTime"}},location:{required:!1,serializedName:"location",type:{name:"String"}},error:{required:!1,serializedName:"error",type:{name:"Composite",className:"BatchError"}}}}},t.TaskAddCollectionResult={required:!1,serializedName:"TaskAddCollectionResult",type:{name:"Composite",className:"TaskAddCollectionResult",modelProperties:{value:{required:!1,serializedName:"value",type:{name:"Sequence",element:{required:!1,serializedName:"TaskAddResultElementType",type:{name:"Composite",className:"TaskAddResult"}}}}}}},t.SubtaskInformation={required:!1,serializedName:"SubtaskInformation",type:{name:"Composite",className:"SubtaskInformation",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"Number"}},nodeInfo:{required:!1,serializedName:"nodeInfo",type:{name:"Composite",className:"ComputeNodeInformation"}},startTime:{required:!1,serializedName:"startTime",type:{name:"DateTime"}},endTime:{required:!1,serializedName:"endTime",type:{name:"DateTime"}},exitCode:{required:!1,serializedName:"exitCode",type:{name:"Number"}},containerInfo:{required:!1,serializedName:"containerInfo",type:{name:"Composite",className:"TaskContainerExecutionInformation"}},failureInfo:{required:!1,serializedName:"failureInfo",type:{name:"Composite",className:"TaskFailureInformation"}},state:{required:!1,serializedName:"state",type:{name:"Enum",allowedValues:["preparing","running","completed"]}},stateTransitionTime:{required:!1,serializedName:"stateTransitionTime",type:{name:"DateTime"}},previousState:{required:!1,serializedName:"previousState",type:{name:"Enum",allowedValues:["preparing","running","completed"]}},previousStateTransitionTime:{required:!1,serializedName:"previousStateTransitionTime",type:{name:"DateTime"}},result:{required:!1,serializedName:"result",type:{name:"Enum",allowedValues:["success","failure"]}}}}},t.CloudTaskListSubtasksResult={required:!1,serializedName:"CloudTaskListSubtasksResult",type:{name:"Composite",className:"CloudTaskListSubtasksResult",modelProperties:{value:{required:!1,serializedName:"value",type:{name:"Sequence",element:{required:!1,serializedName:"SubtaskInformationElementType",type:{name:"Composite",className:"SubtaskInformation"}}}}}}},t.TaskInformation={required:!1,serializedName:"TaskInformation",type:{name:"Composite",className:"TaskInformation",modelProperties:{taskUrl:{required:!1,serializedName:"taskUrl",type:{name:"String"}},jobId:{required:!1,serializedName:"jobId",type:{name:"String"}},taskId:{required:!1,serializedName:"taskId",type:{name:"String"}},subtaskId:{required:!1,serializedName:"subtaskId",type:{name:"Number"}},taskState:{required:!0,serializedName:"taskState",type:{name:"Enum",allowedValues:["active","preparing","running","completed"]}},executionInfo:{required:!1,serializedName:"executionInfo",type:{name:"Composite",className:"TaskExecutionInformation"}}}}},t.StartTaskInformation={required:!1,serializedName:"StartTaskInformation",type:{name:"Composite",className:"StartTaskInformation",modelProperties:{state:{required:!0,serializedName:"state",type:{name:"Enum",allowedValues:["running","completed"]}},startTime:{required:!0,serializedName:"startTime",type:{name:"DateTime"}},endTime:{required:!1,serializedName:"endTime",type:{name:"DateTime"}},exitCode:{required:!1,serializedName:"exitCode",type:{name:"Number"}},containerInfo:{required:!1,serializedName:"containerInfo",type:{name:"Composite",className:"TaskContainerExecutionInformation"}},failureInfo:{required:!1,serializedName:"failureInfo",type:{name:"Composite",className:"TaskFailureInformation"}},retryCount:{required:!0,serializedName:"retryCount",type:{name:"Number"}},lastRetryTime:{required:!1,serializedName:"lastRetryTime",type:{name:"DateTime"}},result:{required:!1,serializedName:"result",type:{name:"Enum",allowedValues:["success","failure"]}}}}},t.ComputeNodeError={required:!1,serializedName:"ComputeNodeError",type:{name:"Composite",className:"ComputeNodeError",modelProperties:{code:{required:!1,serializedName:"code",type:{name:"String"}},message:{required:!1,serializedName:"message",type:{name:"String"}},errorDetails:{required:!1,serializedName:"errorDetails",type:{name:"Sequence",element:{required:!1,serializedName:"NameValuePairElementType",type:{name:"Composite",className:"NameValuePair"}}}}}}},t.InboundEndpoint={required:!1,serializedName:"InboundEndpoint",type:{name:"Composite",className:"InboundEndpoint",modelProperties:{name:{required:!0,serializedName:"name",type:{name:"String"}},protocol:{required:!0,serializedName:"protocol",type:{name:"Enum",allowedValues:["tcp","udp"]}},publicIPAddress:{required:!0,serializedName:"publicIPAddress",type:{name:"String"}},publicFQDN:{required:!0,serializedName:"publicFQDN",type:{name:"String"}},frontendPort:{required:!0,serializedName:"frontendPort",type:{name:"Number"}},backendPort:{required:!0,serializedName:"backendPort",type:{name:"Number"}}}}},t.ComputeNodeEndpointConfiguration={required:!1,serializedName:"ComputeNodeEndpointConfiguration",type:{name:"Composite",className:"ComputeNodeEndpointConfiguration",modelProperties:{inboundEndpoints:{required:!0,serializedName:"inboundEndpoints",type:{name:"Sequence",element:{required:!1,serializedName:"InboundEndpointElementType",type:{name:"Composite",className:"InboundEndpoint"}}}}}}},t.ComputeNode={required:!1,serializedName:"ComputeNode",type:{name:"Composite",className:"ComputeNode",modelProperties:{id:{required:!1,serializedName:"id",type:{name:"String"}},url:{required:!1,serializedName:"url",type:{name:"String"}},state:{required:!1,serializedName:"state",type:{name:"Enum",allowedValues:["idle","rebooting","reimaging","running","unusable","creating","starting","waitingForStartTask","startTaskFailed","unknown","leavingPool","offline","preempted"]}},schedulingState:{required:!1,serializedName:"schedulingState",type:{name:"Enum",allowedValues:["enabled","disabled"]}},stateTransitionTime:{required:!1,serializedName:"stateTransitionTime",type:{name:"DateTime"}},lastBootTime:{required:!1,serializedName:"lastBootTime",type:{name:"DateTime"}},allocationTime:{required:!1,serializedName:"allocationTime",type:{name:"DateTime"}},ipAddress:{required:!1,serializedName:"ipAddress",type:{name:"String"}},affinityId:{required:!1,serializedName:"affinityId",type:{name:"String"}},vmSize:{required:!1,serializedName:"vmSize",type:{name:"String"}},totalTasksRun:{required:!1,serializedName:"totalTasksRun",type:{name:"Number"}},runningTasksCount:{required:!1,serializedName:"runningTasksCount",type:{name:"Number"}},totalTasksSucceeded:{required:!1,serializedName:"totalTasksSucceeded",type:{name:"Number"}},recentTasks:{required:!1,serializedName:"recentTasks",type:{name:"Sequence",element:{required:!1,serializedName:"TaskInformationElementType",type:{name:"Composite",className:"TaskInformation"}}}},startTask:{required:!1,serializedName:"startTask",type:{name:"Composite",className:"StartTask"}},startTaskInfo:{required:!1,serializedName:"startTaskInfo",type:{name:"Composite",className:"StartTaskInformation"}},certificateReferences:{required:!1,serializedName:"certificateReferences",type:{name:"Sequence",element:{required:!1,serializedName:"CertificateReferenceElementType",type:{name:"Composite",className:"CertificateReference"}}}},errors:{required:!1,serializedName:"errors",type:{name:"Sequence",element:{required:!1,serializedName:"ComputeNodeErrorElementType",type:{name:"Composite",className:"ComputeNodeError"}}}},isDedicated:{required:!1,serializedName:"isDedicated",type:{name:"Boolean"}},endpointConfiguration:{required:!1,serializedName:"endpointConfiguration",type:{name:"Composite",className:"ComputeNodeEndpointConfiguration"}}}}},t.ComputeNodeUser={required:!1,serializedName:"ComputeNodeUser",type:{name:"Composite",className:"ComputeNodeUser",modelProperties:{name:{required:!0,serializedName:"name",type:{name:"String"}},isAdmin:{required:!1,serializedName:"isAdmin",type:{name:"Boolean"}},expiryTime:{required:!1,serializedName:"expiryTime",type:{name:"DateTime"}},password:{required:!1,serializedName:"password",type:{name:"String"}},sshPublicKey:{required:!1,serializedName:"sshPublicKey",type:{name:"String"}}}}},t.ComputeNodeGetRemoteLoginSettingsResult={required:!1,serializedName:"ComputeNodeGetRemoteLoginSettingsResult",type:{name:"Composite",className:"ComputeNodeGetRemoteLoginSettingsResult",modelProperties:{remoteLoginIPAddress:{required:!0,serializedName:"remoteLoginIPAddress",type:{name:"String"}},remoteLoginPort:{required:!0,serializedName:"remoteLoginPort",type:{name:"Number"}}}}},t.JobSchedulePatchParameter={required:!1,serializedName:"JobSchedulePatchParameter",type:{name:"Composite",className:"JobSchedulePatchParameter",modelProperties:{schedule:{required:!1,serializedName:"schedule",type:{name:"Composite",className:"Schedule"}},jobSpecification:{required:!1,serializedName:"jobSpecification",type:{name:"Composite",className:"JobSpecification"}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}}}}},t.JobScheduleUpdateParameter={required:!1,serializedName:"JobScheduleUpdateParameter",type:{name:"Composite",className:"JobScheduleUpdateParameter",modelProperties:{schedule:{required:!0,serializedName:"schedule",type:{name:"Composite",className:"Schedule"}},jobSpecification:{required:!0,serializedName:"jobSpecification",defaultValue:{},type:{name:"Composite",className:"JobSpecification"}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}}}}},t.JobDisableParameter={required:!1,serializedName:"JobDisableParameter",type:{name:"Composite",className:"JobDisableParameter",modelProperties:{disableTasks:{required:!0,serializedName:"disableTasks",type:{name:"Enum",allowedValues:["requeue","terminate","wait"]}}}}},t.JobTerminateParameter={required:!1,serializedName:"JobTerminateParameter",type:{name:"Composite",className:"JobTerminateParameter",modelProperties:{terminateReason:{required:!1,serializedName:"terminateReason",type:{name:"String"}}}}},t.JobPatchParameter={required:!1,serializedName:"JobPatchParameter",type:{name:"Composite",className:"JobPatchParameter",modelProperties:{priority:{required:!1,serializedName:"priority",type:{name:"Number"}},onAllTasksComplete:{required:!1,serializedName:"onAllTasksComplete",type:{name:"Enum",allowedValues:["noAction","terminateJob"]}},constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"JobConstraints"}},poolInfo:{required:!1,serializedName:"poolInfo",type:{name:"Composite",className:"PoolInformation"}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}}}}},t.JobUpdateParameter={required:!1,serializedName:"JobUpdateParameter",type:{name:"Composite",className:"JobUpdateParameter",modelProperties:{priority:{required:!1,serializedName:"priority",type:{name:"Number"}},constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"JobConstraints"}},poolInfo:{required:!0,serializedName:"poolInfo",defaultValue:{},type:{name:"Composite",className:"PoolInformation"}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}},onAllTasksComplete:{required:!1,serializedName:"onAllTasksComplete",type:{name:"Enum",allowedValues:["noAction","terminateJob"]}}}}},t.PoolEnableAutoScaleParameter={required:!1,serializedName:"PoolEnableAutoScaleParameter",type:{name:"Composite",className:"PoolEnableAutoScaleParameter",modelProperties:{autoScaleFormula:{required:!1,serializedName:"autoScaleFormula",type:{name:"String"}},autoScaleEvaluationInterval:{required:!1,serializedName:"autoScaleEvaluationInterval",type:{name:"TimeSpan"}}}}},t.PoolEvaluateAutoScaleParameter={required:!1,serializedName:"PoolEvaluateAutoScaleParameter",type:{name:"Composite",className:"PoolEvaluateAutoScaleParameter",modelProperties:{autoScaleFormula:{required:!0,serializedName:"autoScaleFormula",type:{name:"String"}}}}},t.PoolResizeParameter={required:!1,serializedName:"PoolResizeParameter",type:{name:"Composite",className:"PoolResizeParameter",modelProperties:{targetDedicatedNodes:{required:!1,serializedName:"targetDedicatedNodes",type:{name:"Number"}},targetLowPriorityNodes:{required:!1,serializedName:"targetLowPriorityNodes",type:{name:"Number"}},resizeTimeout:{required:!1,serializedName:"resizeTimeout",type:{name:"TimeSpan"}},nodeDeallocationOption:{required:!1,serializedName:"nodeDeallocationOption",type:{name:"Enum",allowedValues:["requeue","terminate","taskCompletion","retainedData"]}}}}},t.PoolUpdatePropertiesParameter={required:!1,serializedName:"PoolUpdatePropertiesParameter",type:{name:"Composite",className:"PoolUpdatePropertiesParameter",modelProperties:{startTask:{required:!1,serializedName:"startTask",type:{name:"Composite",className:"StartTask"}},certificateReferences:{required:!0,serializedName:"certificateReferences",type:{name:"Sequence",element:{required:!1,serializedName:"CertificateReferenceElementType",type:{name:"Composite",className:"CertificateReference"}}}},applicationPackageReferences:{required:!0,serializedName:"applicationPackageReferences",type:{name:"Sequence",element:{required:!1,serializedName:"ApplicationPackageReferenceElementType",type:{name:"Composite",className:"ApplicationPackageReference"}}}},metadata:{required:!0,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}}}}},t.PoolUpgradeOSParameter={required:!1,serializedName:"PoolUpgradeOSParameter",type:{name:"Composite",className:"PoolUpgradeOSParameter",modelProperties:{targetOSVersion:{required:!0,serializedName:"targetOSVersion",type:{name:"String"}}}}},t.PoolPatchParameter={required:!1,serializedName:"PoolPatchParameter",type:{name:"Composite",className:"PoolPatchParameter",modelProperties:{startTask:{required:!1,serializedName:"startTask",type:{name:"Composite",className:"StartTask"}},certificateReferences:{required:!1,serializedName:"certificateReferences",type:{name:"Sequence",element:{required:!1,serializedName:"CertificateReferenceElementType",type:{name:"Composite",className:"CertificateReference"}}}},applicationPackageReferences:{required:!1,serializedName:"applicationPackageReferences",type:{name:"Sequence",element:{required:!1,serializedName:"ApplicationPackageReferenceElementType",type:{name:"Composite",className:"ApplicationPackageReference"}}}},metadata:{required:!1,serializedName:"metadata",type:{name:"Sequence",element:{required:!1,serializedName:"MetadataItemElementType",type:{name:"Composite",className:"MetadataItem"}}}}}}},t.TaskUpdateParameter={required:!1,serializedName:"TaskUpdateParameter",type:{name:"Composite",className:"TaskUpdateParameter",modelProperties:{constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"TaskConstraints"}}}}},t.NodeUpdateUserParameter={required:!1,serializedName:"NodeUpdateUserParameter",type:{name:"Composite",className:"NodeUpdateUserParameter",modelProperties:{password:{required:!1,serializedName:"password",type:{name:"String"}},expiryTime:{required:!1,serializedName:"expiryTime",type:{name:"DateTime"}},sshPublicKey:{required:!1,serializedName:"sshPublicKey",type:{name:"String"}}}}},t.NodeRebootParameter={required:!1,serializedName:"NodeRebootParameter",type:{name:"Composite",className:"NodeRebootParameter",modelProperties:{nodeRebootOption:{required:!1,serializedName:"nodeRebootOption",type:{name:"Enum",allowedValues:["requeue","terminate","taskCompletion","retainedData"]}}}}},t.NodeReimageParameter={required:!1,serializedName:"NodeReimageParameter",type:{name:"Composite",className:"NodeReimageParameter",modelProperties:{nodeReimageOption:{required:!1,serializedName:"nodeReimageOption",type:{name:"Enum",allowedValues:["requeue","terminate","taskCompletion","retainedData"]}}}}},t.NodeDisableSchedulingParameter={required:!1,serializedName:"NodeDisableSchedulingParameter",type:{name:"Composite",className:"NodeDisableSchedulingParameter",modelProperties:{nodeDisableSchedulingOption:{required:!1,serializedName:"nodeDisableSchedulingOption",type:{name:"Enum",allowedValues:["requeue","terminate","taskCompletion"]}}}}},t.NodeRemoveParameter={required:!1,serializedName:"NodeRemoveParameter",type:{name:"Composite",className:"NodeRemoveParameter",modelProperties:{nodeList:{required:!0,serializedName:"nodeList",constraints:{MaxItems:100},type:{name:"Sequence",element:{required:!1,serializedName:"stringElementType",type:{name:"String"}}}},resizeTimeout:{required:!1,serializedName:"resizeTimeout",type:{name:"TimeSpan"}},nodeDeallocationOption:{required:!1,serializedName:"nodeDeallocationOption",type:{name:"Enum",allowedValues:["requeue","terminate","taskCompletion","retainedData"]}}}}},t.ApplicationListOptions={required:!1,type:{name:"Composite",className:"ApplicationListOptions",modelProperties:{maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ApplicationGetOptions={required:!1,type:{name:"Composite",className:"ApplicationGetOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolListUsageMetricsOptions={required:!1,type:{name:"Composite",className:"PoolListUsageMetricsOptions",modelProperties:{startTime:{required:!1,type:{name:"DateTime"}},endTime:{required:!1,type:{name:"DateTime"}},filter:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolGetAllLifetimeStatisticsOptions={required:!1,type:{name:"Composite",className:"PoolGetAllLifetimeStatisticsOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolAddOptions={required:!1,type:{name:"Composite",className:"PoolAddOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolListOptions={required:!1,type:{name:"Composite",className:"PoolListOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},select:{required:!1,type:{name:"String"}},expand:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolDeleteMethodOptions={required:!1,type:{name:"Composite",className:"PoolDeleteMethodOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolExistsOptions={required:!1,type:{name:"Composite",className:"PoolExistsOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolGetOptions={required:!1,type:{name:"Composite",className:"PoolGetOptions",modelProperties:{select:{required:!1,type:{name:"String"}},expand:{required:!1,type:{name:"String"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolPatchOptions={required:!1,type:{name:"Composite",className:"PoolPatchOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolDisableAutoScaleOptions={required:!1,type:{name:"Composite",className:"PoolDisableAutoScaleOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolEnableAutoScaleOptions={required:!1,type:{name:"Composite",className:"PoolEnableAutoScaleOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolEvaluateAutoScaleOptions={required:!1,type:{name:"Composite",className:"PoolEvaluateAutoScaleOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolResizeOptions={required:!1,type:{name:"Composite",className:"PoolResizeOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolStopResizeOptions={required:!1,type:{name:"Composite",className:"PoolStopResizeOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolUpdatePropertiesOptions={required:!1,type:{name:"Composite",className:"PoolUpdatePropertiesOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolUpgradeOSOptions={required:!1,type:{name:"Composite",className:"PoolUpgradeOSOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolRemoveNodesOptions={required:!1,type:{name:"Composite",className:"PoolRemoveNodesOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.AccountListNodeAgentSkusOptions={required:!1,type:{name:"Composite",className:"AccountListNodeAgentSkusOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobGetAllLifetimeStatisticsOptions={required:!1,type:{name:"Composite",className:"JobGetAllLifetimeStatisticsOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobDeleteMethodOptions={required:!1,type:{name:"Composite",className:"JobDeleteMethodOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobGetOptions={required:!1,type:{name:"Composite",className:"JobGetOptions",modelProperties:{select:{required:!1,type:{name:"String"}},expand:{required:!1,type:{name:"String"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobPatchOptions={required:!1,type:{name:"Composite",className:"JobPatchOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobUpdateOptions={required:!1,type:{name:"Composite",className:"JobUpdateOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobDisableOptions={required:!1,type:{name:"Composite",className:"JobDisableOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobEnableOptions={required:!1,type:{name:"Composite",className:"JobEnableOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobTerminateOptions={required:!1,type:{name:"Composite",className:"JobTerminateOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobAddOptions={required:!1,type:{name:"Composite",className:"JobAddOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobListOptions={required:!1,type:{name:"Composite",className:"JobListOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},select:{required:!1,type:{name:"String"}},expand:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobListFromJobScheduleOptions={required:!1,type:{name:"Composite",className:"JobListFromJobScheduleOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},select:{required:!1,type:{name:"String"}},expand:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobListPreparationAndReleaseTaskStatusOptions={required:!1,type:{name:"Composite",className:"JobListPreparationAndReleaseTaskStatusOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},select:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobGetTaskCountsOptions={required:!1,type:{name:"Composite",className:"JobGetTaskCountsOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.CertificateAddOptions={required:!1,type:{name:"Composite",className:"CertificateAddOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.CertificateListOptions={required:!1,type:{name:"Composite",className:"CertificateListOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},select:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.CertificateCancelDeletionOptions={required:!1,type:{name:"Composite",className:"CertificateCancelDeletionOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.CertificateDeleteMethodOptions={required:!1,type:{name:"Composite",className:"CertificateDeleteMethodOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.CertificateGetOptions={required:!1,type:{name:"Composite",className:"CertificateGetOptions",modelProperties:{select:{required:!1,type:{name:"String"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileDeleteFromTaskOptions={required:!1,type:{name:"Composite",className:"FileDeleteFromTaskOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileGetFromTaskOptions={required:!1,type:{name:"Composite",className:"FileGetFromTaskOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ocpRange:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileGetPropertiesFromTaskOptions={required:!1,type:{name:"Composite",className:"FileGetPropertiesFromTaskOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileDeleteFromComputeNodeOptions={required:!1,type:{name:"Composite",className:"FileDeleteFromComputeNodeOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileGetFromComputeNodeOptions={required:!1,type:{name:"Composite",className:"FileGetFromComputeNodeOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ocpRange:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileGetPropertiesFromComputeNodeOptions={required:!1,type:{name:"Composite",className:"FileGetPropertiesFromComputeNodeOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileListFromTaskOptions={required:!1,type:{name:"Composite",className:"FileListFromTaskOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileListFromComputeNodeOptions={required:!1,type:{name:"Composite",className:"FileListFromComputeNodeOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleExistsOptions={required:!1,type:{name:"Composite",className:"JobScheduleExistsOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleDeleteMethodOptions={required:!1,type:{name:"Composite",className:"JobScheduleDeleteMethodOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleGetOptions={required:!1,type:{name:"Composite",className:"JobScheduleGetOptions",modelProperties:{select:{required:!1,type:{name:"String"}},expand:{required:!1,type:{name:"String"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobSchedulePatchOptions={required:!1,type:{name:"Composite",className:"JobSchedulePatchOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleUpdateOptions={required:!1,type:{name:"Composite",className:"JobScheduleUpdateOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleDisableOptions={required:!1,type:{name:"Composite",className:"JobScheduleDisableOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleEnableOptions={required:!1,type:{name:"Composite",className:"JobScheduleEnableOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleTerminateOptions={required:!1,type:{name:"Composite",className:"JobScheduleTerminateOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleAddOptions={required:!1,type:{name:"Composite",className:"JobScheduleAddOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleListOptions={required:!1,type:{name:"Composite",className:"JobScheduleListOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},select:{required:!1,type:{name:"String"}},expand:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskAddOptions={required:!1,type:{name:"Composite",className:"TaskAddOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskListOptions={required:!1,type:{name:"Composite",className:"TaskListOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},select:{required:!1,type:{name:"String"}},expand:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskAddCollectionOptions={required:!1,type:{name:"Composite",className:"TaskAddCollectionOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskDeleteMethodOptions={required:!1,type:{name:"Composite",className:"TaskDeleteMethodOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskGetOptions={required:!1,type:{name:"Composite",className:"TaskGetOptions",modelProperties:{select:{required:!1,type:{name:"String"}},expand:{required:!1,type:{name:"String"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskUpdateOptions={required:!1,type:{name:"Composite",className:"TaskUpdateOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskListSubtasksOptions={required:!1,type:{name:"Composite",className:"TaskListSubtasksOptions",modelProperties:{select:{required:!1,type:{name:"String"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskTerminateOptions={required:!1,type:{name:"Composite",className:"TaskTerminateOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskReactivateOptions={required:!1,type:{name:"Composite",className:"TaskReactivateOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}},ifMatch:{required:!1,type:{name:"String"}},ifNoneMatch:{required:!1,type:{name:"String"}},ifModifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}},ifUnmodifiedSince:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeAddUserOptions={required:!1,type:{name:"Composite",className:"ComputeNodeAddUserOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeDeleteUserOptions={required:!1,type:{name:"Composite",className:"ComputeNodeDeleteUserOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeUpdateUserOptions={required:!1,type:{name:"Composite",className:"ComputeNodeUpdateUserOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeGetOptions={required:!1,type:{name:"Composite",className:"ComputeNodeGetOptions",modelProperties:{select:{required:!1,type:{name:"String"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeRebootOptions={required:!1,type:{name:"Composite",className:"ComputeNodeRebootOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeReimageOptions={required:!1,type:{name:"Composite",className:"ComputeNodeReimageOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeDisableSchedulingOptions={required:!1,type:{name:"Composite",className:"ComputeNodeDisableSchedulingOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeEnableSchedulingOptions={required:!1,type:{name:"Composite",className:"ComputeNodeEnableSchedulingOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeGetRemoteLoginSettingsOptions={required:!1,type:{name:"Composite",className:"ComputeNodeGetRemoteLoginSettingsOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeGetRemoteDesktopOptions={required:!1,type:{name:"Composite",className:"ComputeNodeGetRemoteDesktopOptions",modelProperties:{timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeListOptions={required:!1,type:{name:"Composite",className:"ComputeNodeListOptions",modelProperties:{filter:{required:!1,type:{name:"String"}},select:{required:!1,type:{name:"String"}},maxResults:{required:!1,defaultValue:1e3,type:{name:"Number"}},timeout:{required:!1,defaultValue:30,type:{name:"Number"}},clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ApplicationListNextOptions={required:!1,type:{name:"Composite",className:"ApplicationListNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolListUsageMetricsNextOptions={required:!1,type:{name:"Composite",className:"PoolListUsageMetricsNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.PoolListNextOptions={required:!1,type:{name:"Composite",className:"PoolListNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.AccountListNodeAgentSkusNextOptions={required:!1,type:{name:"Composite",className:"AccountListNodeAgentSkusNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobListNextOptions={required:!1,type:{name:"Composite",className:"JobListNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobListFromJobScheduleNextOptions={required:!1,type:{name:"Composite",className:"JobListFromJobScheduleNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobListPreparationAndReleaseTaskStatusNextOptions={required:!1,type:{name:"Composite",className:"JobListPreparationAndReleaseTaskStatusNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.CertificateListNextOptions={required:!1,type:{name:"Composite",className:"CertificateListNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileListFromTaskNextOptions={required:!1,type:{name:"Composite",className:"FileListFromTaskNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.FileListFromComputeNodeNextOptions={required:!1,type:{name:"Composite",className:"FileListFromComputeNodeNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.JobScheduleListNextOptions={required:!1,type:{name:"Composite",className:"JobScheduleListNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.TaskListNextOptions={required:!1,type:{name:"Composite",className:"TaskListNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ComputeNodeListNextOptions={required:!1,type:{name:"Composite",className:"ComputeNodeListNextOptions",modelProperties:{clientRequestId:{required:!1,type:{name:"String"}},returnClientRequestId:{required:!1,defaultValue:!1,type:{name:"Boolean"}},ocpDate:{required:!1,type:{name:"DateTimeRfc1123"}}}}},t.ApplicationListOptionalParams={required:!1,serializedName:"ListOptions",type:{name:"Composite",className:"ApplicationListOptionalParams",modelProperties:{applicationListOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ApplicationListOptions"}}}}},t.ApplicationGetOptionalParams={required:!1,serializedName:"GetOptions",type:{name:"Composite",className:"ApplicationGetOptionalParams",modelProperties:{applicationGetOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ApplicationGetOptions"}}}}},t.ApplicationListNextOptionalParams={required:!1,serializedName:"ListNextOptions",type:{name:"Composite",className:"ApplicationListNextOptionalParams",modelProperties:{applicationListNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ApplicationListNextOptions"}}}}},t.PoolListUsageMetricsOptionalParams={required:!1,serializedName:"ListUsageMetricsOptions",type:{name:"Composite",className:"PoolListUsageMetricsOptionalParams",modelProperties:{poolListUsageMetricsOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolListUsageMetricsOptions"}}}}},t.PoolGetAllLifetimeStatisticsOptionalParams={required:!1,serializedName:"GetAllLifetimeStatisticsOptions",type:{name:"Composite",className:"PoolGetAllLifetimeStatisticsOptionalParams",modelProperties:{poolGetAllLifetimeStatisticsOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolGetAllLifetimeStatisticsOptions"}}}}},t.PoolAddOptionalParams={required:!1,serializedName:"AddOptions",type:{name:"Composite",className:"PoolAddOptionalParams",modelProperties:{poolAddOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolAddOptions"}}}}},t.PoolListOptionalParams={required:!1,serializedName:"ListOptions",type:{name:"Composite",className:"PoolListOptionalParams",modelProperties:{poolListOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolListOptions"}}}}},t.PoolDeleteMethodOptionalParams={required:!1,serializedName:"DeleteMethodOptions",type:{name:"Composite",className:"PoolDeleteMethodOptionalParams",modelProperties:{poolDeleteMethodOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolDeleteMethodOptions"}}}}},t.PoolExistsOptionalParams={required:!1,serializedName:"ExistsOptions",type:{name:"Composite",className:"PoolExistsOptionalParams",modelProperties:{poolExistsOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolExistsOptions"}}}}},t.PoolGetOptionalParams={required:!1,serializedName:"GetOptions",type:{name:"Composite",className:"PoolGetOptionalParams",modelProperties:{poolGetOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolGetOptions"}}}}},t.PoolPatchOptionalParams={required:!1,serializedName:"PatchOptions",type:{name:"Composite",className:"PoolPatchOptionalParams",modelProperties:{poolPatchOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolPatchOptions"}}}}},t.PoolDisableAutoScaleOptionalParams={required:!1,serializedName:"DisableAutoScaleOptions",type:{name:"Composite",className:"PoolDisableAutoScaleOptionalParams",modelProperties:{poolDisableAutoScaleOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolDisableAutoScaleOptions"}}}}},t.PoolEnableAutoScaleOptionalParams={required:!1,serializedName:"EnableAutoScaleOptions",type:{name:"Composite",className:"PoolEnableAutoScaleOptionalParams",modelProperties:{poolEnableAutoScaleOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolEnableAutoScaleOptions"}}}}},t.PoolEvaluateAutoScaleOptionalParams={required:!1,serializedName:"EvaluateAutoScaleOptions",type:{name:"Composite",className:"PoolEvaluateAutoScaleOptionalParams",modelProperties:{poolEvaluateAutoScaleOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolEvaluateAutoScaleOptions"}}}}},t.PoolResizeOptionalParams={required:!1,serializedName:"ResizeOptions",type:{name:"Composite",className:"PoolResizeOptionalParams",modelProperties:{poolResizeOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolResizeOptions"}}}}},t.PoolStopResizeOptionalParams={required:!1,serializedName:"StopResizeOptions",type:{name:"Composite",className:"PoolStopResizeOptionalParams",modelProperties:{poolStopResizeOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolStopResizeOptions"}}}}},t.PoolUpdatePropertiesOptionalParams={required:!1,serializedName:"UpdatePropertiesOptions",type:{name:"Composite",className:"PoolUpdatePropertiesOptionalParams",modelProperties:{poolUpdatePropertiesOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolUpdatePropertiesOptions"}}}}},t.PoolUpgradeOSOptionalParams={required:!1,serializedName:"UpgradeOSOptions",type:{name:"Composite",className:"PoolUpgradeOSOptionalParams",modelProperties:{poolUpgradeOSOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolUpgradeOSOptions"}}}}},t.PoolRemoveNodesOptionalParams={required:!1,serializedName:"RemoveNodesOptions",type:{name:"Composite",className:"PoolRemoveNodesOptionalParams",modelProperties:{poolRemoveNodesOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolRemoveNodesOptions"}}}}},t.PoolListUsageMetricsNextOptionalParams={required:!1,serializedName:"ListUsageMetricsNextOptions",type:{name:"Composite",className:"PoolListUsageMetricsNextOptionalParams",modelProperties:{poolListUsageMetricsNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolListUsageMetricsNextOptions"}}}}},t.PoolListNextOptionalParams={required:!1,serializedName:"ListNextOptions",type:{name:"Composite",className:"PoolListNextOptionalParams",modelProperties:{poolListNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"PoolListNextOptions"}}}}},t.AccountListNodeAgentSkusOptionalParams={required:!1,serializedName:"ListNodeAgentSkusOptions",type:{name:"Composite",className:"AccountListNodeAgentSkusOptionalParams",modelProperties:{accountListNodeAgentSkusOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"AccountListNodeAgentSkusOptions"}}}}},t.AccountListNodeAgentSkusNextOptionalParams={required:!1,serializedName:"ListNodeAgentSkusNextOptions",type:{name:"Composite",className:"AccountListNodeAgentSkusNextOptionalParams",modelProperties:{accountListNodeAgentSkusNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"AccountListNodeAgentSkusNextOptions"}}}}},t.JobGetAllLifetimeStatisticsOptionalParams={required:!1,serializedName:"GetAllLifetimeStatisticsOptions",type:{name:"Composite",className:"JobGetAllLifetimeStatisticsOptionalParams",modelProperties:{jobGetAllLifetimeStatisticsOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobGetAllLifetimeStatisticsOptions"}}}}},t.JobDeleteMethodOptionalParams={required:!1,serializedName:"DeleteMethodOptions",type:{name:"Composite",className:"JobDeleteMethodOptionalParams",modelProperties:{jobDeleteMethodOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobDeleteMethodOptions"}}}}},t.JobGetOptionalParams={required:!1,serializedName:"GetOptions",type:{name:"Composite",className:"JobGetOptionalParams",modelProperties:{jobGetOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobGetOptions"}}}}},t.JobPatchOptionalParams={required:!1,serializedName:"PatchOptions",type:{name:"Composite",className:"JobPatchOptionalParams",modelProperties:{jobPatchOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobPatchOptions"}}}}},t.JobUpdateOptionalParams={required:!1,serializedName:"UpdateOptions",type:{name:"Composite",className:"JobUpdateOptionalParams",modelProperties:{jobUpdateOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobUpdateOptions"}}}}},t.JobDisableOptionalParams={required:!1,serializedName:"DisableOptions",type:{name:"Composite",className:"JobDisableOptionalParams",modelProperties:{jobDisableOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobDisableOptions"}}}}},t.JobEnableOptionalParams={required:!1,serializedName:"EnableOptions",type:{name:"Composite",className:"JobEnableOptionalParams",modelProperties:{jobEnableOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobEnableOptions"}}}}},t.JobTerminateOptionalParams={required:!1,serializedName:"TerminateOptions",type:{name:"Composite",className:"JobTerminateOptionalParams",modelProperties:{terminateReason:{required:!1,serializedName:"terminateReason",type:{name:"String"}},jobTerminateOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobTerminateOptions"}}}}},t.JobAddOptionalParams={required:!1,serializedName:"AddOptions",type:{name:"Composite",className:"JobAddOptionalParams",modelProperties:{jobAddOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobAddOptions"}}}}},t.JobListOptionalParams={required:!1,serializedName:"ListOptions",type:{name:"Composite",className:"JobListOptionalParams",modelProperties:{jobListOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobListOptions"}}}}},t.JobListFromJobScheduleOptionalParams={required:!1,serializedName:"ListFromJobScheduleOptions",type:{name:"Composite",className:"JobListFromJobScheduleOptionalParams",modelProperties:{jobListFromJobScheduleOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobListFromJobScheduleOptions"}}}}},t.JobListPreparationAndReleaseTaskStatusOptionalParams={required:!1,serializedName:"ListPreparationAndReleaseTaskStatusOptions",type:{name:"Composite",className:"JobListPreparationAndReleaseTaskStatusOptionalParams",modelProperties:{jobListPreparationAndReleaseTaskStatusOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobListPreparationAndReleaseTaskStatusOptions"}}}}},t.JobGetTaskCountsOptionalParams={required:!1,serializedName:"GetTaskCountsOptions",type:{name:"Composite",className:"JobGetTaskCountsOptionalParams",modelProperties:{jobGetTaskCountsOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobGetTaskCountsOptions"}}}}},t.JobListNextOptionalParams={required:!1,serializedName:"ListNextOptions",type:{name:"Composite",className:"JobListNextOptionalParams",modelProperties:{jobListNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobListNextOptions"}}}}},t.JobListFromJobScheduleNextOptionalParams={required:!1,serializedName:"ListFromJobScheduleNextOptions",type:{name:"Composite",className:"JobListFromJobScheduleNextOptionalParams",modelProperties:{jobListFromJobScheduleNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobListFromJobScheduleNextOptions"}}}}},t.JobListPreparationAndReleaseTaskStatusNextOptionalParams={required:!1,serializedName:"ListPreparationAndReleaseTaskStatusNextOptions",type:{name:"Composite",className:"JobListPreparationAndReleaseTaskStatusNextOptionalParams",modelProperties:{jobListPreparationAndReleaseTaskStatusNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobListPreparationAndReleaseTaskStatusNextOptions"}}}}},t.CertificateAddOptionalParams={required:!1,serializedName:"AddOptions",type:{name:"Composite",className:"CertificateAddOptionalParams",modelProperties:{certificateAddOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"CertificateAddOptions"}}}}},t.CertificateListOptionalParams={required:!1,serializedName:"ListOptions",type:{name:"Composite",className:"CertificateListOptionalParams",modelProperties:{certificateListOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"CertificateListOptions"}}}}},t.CertificateCancelDeletionOptionalParams={required:!1,serializedName:"CancelDeletionOptions",type:{name:"Composite",className:"CertificateCancelDeletionOptionalParams",modelProperties:{certificateCancelDeletionOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"CertificateCancelDeletionOptions"}}}}},t.CertificateDeleteMethodOptionalParams={required:!1,serializedName:"DeleteMethodOptions",type:{name:"Composite",className:"CertificateDeleteMethodOptionalParams",modelProperties:{certificateDeleteMethodOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"CertificateDeleteMethodOptions"}}}}},t.CertificateGetOptionalParams={required:!1,serializedName:"GetOptions",type:{name:"Composite",className:"CertificateGetOptionalParams",modelProperties:{certificateGetOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"CertificateGetOptions"}}}}},t.CertificateListNextOptionalParams={required:!1,serializedName:"ListNextOptions",type:{name:"Composite",className:"CertificateListNextOptionalParams",modelProperties:{certificateListNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"CertificateListNextOptions"}}}}},t.FileDeleteFromTaskOptionalParams={required:!1,serializedName:"DeleteFromTaskOptions",type:{name:"Composite",className:"FileDeleteFromTaskOptionalParams",modelProperties:{recursive:{required:!1,serializedName:"recursive",type:{name:"Boolean"}},fileDeleteFromTaskOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileDeleteFromTaskOptions"}}}}},t.FileGetFromTaskOptionalParams={required:!1,serializedName:"GetFromTaskOptions",type:{name:"Composite",className:"FileGetFromTaskOptionalParams",modelProperties:{fileGetFromTaskOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileGetFromTaskOptions"}}}}},t.FileGetPropertiesFromTaskOptionalParams={required:!1,serializedName:"GetPropertiesFromTaskOptions",type:{name:"Composite",className:"FileGetPropertiesFromTaskOptionalParams",modelProperties:{fileGetPropertiesFromTaskOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileGetPropertiesFromTaskOptions"}}}}},t.FileDeleteFromComputeNodeOptionalParams={required:!1,serializedName:"DeleteFromComputeNodeOptions",type:{name:"Composite",className:"FileDeleteFromComputeNodeOptionalParams",modelProperties:{recursive:{required:!1,serializedName:"recursive",type:{name:"Boolean"}},fileDeleteFromComputeNodeOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileDeleteFromComputeNodeOptions"}}}}},t.FileGetFromComputeNodeOptionalParams={required:!1,serializedName:"GetFromComputeNodeOptions",type:{name:"Composite",className:"FileGetFromComputeNodeOptionalParams",modelProperties:{fileGetFromComputeNodeOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileGetFromComputeNodeOptions"}}}}},t.FileGetPropertiesFromComputeNodeOptionalParams={required:!1,serializedName:"GetPropertiesFromComputeNodeOptions",type:{name:"Composite",className:"FileGetPropertiesFromComputeNodeOptionalParams",modelProperties:{fileGetPropertiesFromComputeNodeOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileGetPropertiesFromComputeNodeOptions"}}}}},t.FileListFromTaskOptionalParams={required:!1,serializedName:"ListFromTaskOptions",type:{name:"Composite",className:"FileListFromTaskOptionalParams",modelProperties:{recursive:{required:!1,serializedName:"recursive",type:{name:"Boolean"}},fileListFromTaskOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileListFromTaskOptions"}}}}},t.FileListFromComputeNodeOptionalParams={required:!1,serializedName:"ListFromComputeNodeOptions",type:{name:"Composite",className:"FileListFromComputeNodeOptionalParams",modelProperties:{recursive:{required:!1,serializedName:"recursive",type:{name:"Boolean"}},fileListFromComputeNodeOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileListFromComputeNodeOptions"}}}}},t.FileListFromTaskNextOptionalParams={required:!1,serializedName:"ListFromTaskNextOptions",type:{name:"Composite",className:"FileListFromTaskNextOptionalParams",modelProperties:{fileListFromTaskNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileListFromTaskNextOptions"}}}}},t.FileListFromComputeNodeNextOptionalParams={required:!1,serializedName:"ListFromComputeNodeNextOptions",type:{name:"Composite",className:"FileListFromComputeNodeNextOptionalParams",modelProperties:{fileListFromComputeNodeNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"FileListFromComputeNodeNextOptions"}}}}},t.JobScheduleExistsOptionalParams={required:!1,serializedName:"ExistsOptions",type:{name:"Composite",className:"JobScheduleExistsOptionalParams",modelProperties:{jobScheduleExistsOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleExistsOptions"}}}}},t.JobScheduleDeleteMethodOptionalParams={required:!1,serializedName:"DeleteMethodOptions",type:{name:"Composite",className:"JobScheduleDeleteMethodOptionalParams",modelProperties:{jobScheduleDeleteMethodOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleDeleteMethodOptions"}}}}},t.JobScheduleGetOptionalParams={required:!1,serializedName:"GetOptions",type:{name:"Composite",className:"JobScheduleGetOptionalParams",modelProperties:{jobScheduleGetOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleGetOptions"}}}}},t.JobSchedulePatchOptionalParams={required:!1,serializedName:"PatchOptions",type:{name:"Composite",className:"JobSchedulePatchOptionalParams",modelProperties:{jobSchedulePatchOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobSchedulePatchOptions"}}}}},t.JobScheduleUpdateOptionalParams={required:!1,serializedName:"UpdateOptions",type:{name:"Composite",className:"JobScheduleUpdateOptionalParams",modelProperties:{jobScheduleUpdateOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleUpdateOptions"}}}}},t.JobScheduleDisableOptionalParams={required:!1,serializedName:"DisableOptions",type:{name:"Composite",className:"JobScheduleDisableOptionalParams",modelProperties:{jobScheduleDisableOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleDisableOptions"}}}}},t.JobScheduleEnableOptionalParams={required:!1,serializedName:"EnableOptions",type:{name:"Composite",className:"JobScheduleEnableOptionalParams",modelProperties:{jobScheduleEnableOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleEnableOptions"}}}}},t.JobScheduleTerminateOptionalParams={required:!1,serializedName:"TerminateOptions",type:{name:"Composite",className:"JobScheduleTerminateOptionalParams",modelProperties:{jobScheduleTerminateOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleTerminateOptions"}}}}},t.JobScheduleAddOptionalParams={required:!1,serializedName:"AddOptions",type:{name:"Composite",className:"JobScheduleAddOptionalParams",modelProperties:{jobScheduleAddOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleAddOptions"}}}}},t.JobScheduleListOptionalParams={required:!1,serializedName:"ListOptions",type:{name:"Composite",className:"JobScheduleListOptionalParams",modelProperties:{jobScheduleListOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleListOptions"}}}}},t.JobScheduleListNextOptionalParams={required:!1,serializedName:"ListNextOptions",type:{name:"Composite",className:"JobScheduleListNextOptionalParams",modelProperties:{jobScheduleListNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"JobScheduleListNextOptions"}}}}},t.TaskAddOptionalParams={required:!1,serializedName:"AddOptions",type:{name:"Composite",className:"TaskAddOptionalParams",modelProperties:{taskAddOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskAddOptions"}}}}},t.TaskListOptionalParams={required:!1,serializedName:"ListOptions",type:{name:"Composite",className:"TaskListOptionalParams",modelProperties:{taskListOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskListOptions"}}}}},t.TaskAddCollectionOptionalParams={required:!1,serializedName:"AddCollectionOptions",type:{name:"Composite",className:"TaskAddCollectionOptionalParams",modelProperties:{taskAddCollectionOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskAddCollectionOptions"}}}}},t.TaskDeleteMethodOptionalParams={required:!1,serializedName:"DeleteMethodOptions",type:{name:"Composite",className:"TaskDeleteMethodOptionalParams",modelProperties:{taskDeleteMethodOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskDeleteMethodOptions"}}}}},t.TaskGetOptionalParams={required:!1,serializedName:"GetOptions",type:{name:"Composite",className:"TaskGetOptionalParams",modelProperties:{taskGetOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskGetOptions"}}}}},t.TaskUpdateOptionalParams={required:!1,serializedName:"UpdateOptions",type:{name:"Composite",className:"TaskUpdateOptionalParams",modelProperties:{constraints:{required:!1,serializedName:"constraints",type:{name:"Composite",className:"TaskConstraints"}},taskUpdateOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskUpdateOptions"}}}}},t.TaskListSubtasksOptionalParams={required:!1,serializedName:"ListSubtasksOptions",type:{name:"Composite",className:"TaskListSubtasksOptionalParams",modelProperties:{taskListSubtasksOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskListSubtasksOptions"}}}}},t.TaskTerminateOptionalParams={required:!1,serializedName:"TerminateOptions",type:{name:"Composite",className:"TaskTerminateOptionalParams",modelProperties:{taskTerminateOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskTerminateOptions"}}}}},t.TaskReactivateOptionalParams={required:!1,serializedName:"ReactivateOptions",type:{name:"Composite",className:"TaskReactivateOptionalParams",modelProperties:{taskReactivateOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskReactivateOptions"}}}}},t.TaskListNextOptionalParams={required:!1,serializedName:"ListNextOptions",type:{name:"Composite",className:"TaskListNextOptionalParams",modelProperties:{taskListNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"TaskListNextOptions"}}}}},t.ComputeNodeAddUserOptionalParams={required:!1,serializedName:"AddUserOptions",type:{name:"Composite",className:"ComputeNodeAddUserOptionalParams",modelProperties:{computeNodeAddUserOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeAddUserOptions"}}}}},t.ComputeNodeDeleteUserOptionalParams={required:!1,serializedName:"DeleteUserOptions",type:{name:"Composite",className:"ComputeNodeDeleteUserOptionalParams",modelProperties:{computeNodeDeleteUserOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeDeleteUserOptions"}}}}},t.ComputeNodeUpdateUserOptionalParams={required:!1,serializedName:"UpdateUserOptions",type:{name:"Composite",className:"ComputeNodeUpdateUserOptionalParams",modelProperties:{computeNodeUpdateUserOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeUpdateUserOptions"}}}}},t.ComputeNodeGetOptionalParams={required:!1,serializedName:"GetOptions",type:{name:"Composite",className:"ComputeNodeGetOptionalParams",modelProperties:{computeNodeGetOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeGetOptions"}}}}},t.ComputeNodeRebootOptionalParams={required:!1,serializedName:"RebootOptions",type:{name:"Composite",className:"ComputeNodeRebootOptionalParams",modelProperties:{nodeRebootOption:{required:!1,serializedName:"nodeRebootOption",type:{name:"Enum",allowedValues:["requeue","terminate","taskCompletion","retainedData"]}},computeNodeRebootOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeRebootOptions"}}}}},t.ComputeNodeReimageOptionalParams={required:!1,serializedName:"ReimageOptions",type:{name:"Composite",className:"ComputeNodeReimageOptionalParams",modelProperties:{nodeReimageOption:{required:!1,serializedName:"nodeReimageOption",type:{name:"Enum",allowedValues:["requeue","terminate","taskCompletion","retainedData"]}},computeNodeReimageOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeReimageOptions"}}}}},t.ComputeNodeDisableSchedulingOptionalParams={required:!1,serializedName:"DisableSchedulingOptions",type:{name:"Composite",className:"ComputeNodeDisableSchedulingOptionalParams",modelProperties:{nodeDisableSchedulingOption:{required:!1,serializedName:"nodeDisableSchedulingOption",type:{name:"Enum",allowedValues:["requeue","terminate","taskCompletion"]}},computeNodeDisableSchedulingOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeDisableSchedulingOptions"}}}}},t.ComputeNodeEnableSchedulingOptionalParams={required:!1,serializedName:"EnableSchedulingOptions",type:{name:"Composite",className:"ComputeNodeEnableSchedulingOptionalParams",modelProperties:{computeNodeEnableSchedulingOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeEnableSchedulingOptions"}}}}},t.ComputeNodeGetRemoteLoginSettingsOptionalParams={required:!1,serializedName:"GetRemoteLoginSettingsOptions",type:{name:"Composite",className:"ComputeNodeGetRemoteLoginSettingsOptionalParams",modelProperties:{computeNodeGetRemoteLoginSettingsOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeGetRemoteLoginSettingsOptions"}}}}},t.ComputeNodeGetRemoteDesktopOptionalParams={required:!1,serializedName:"GetRemoteDesktopOptions",type:{name:"Composite",className:"ComputeNodeGetRemoteDesktopOptionalParams",modelProperties:{computeNodeGetRemoteDesktopOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeGetRemoteDesktopOptions"}}}}},t.ComputeNodeListOptionalParams={required:!1,serializedName:"ListOptions",type:{name:"Composite",className:"ComputeNodeListOptionalParams",modelProperties:{computeNodeListOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeListOptions"}}}}},t.ComputeNodeListNextOptionalParams={required:!1,serializedName:"ListNextOptions",type:{name:"Composite",className:"ComputeNodeListNextOptionalParams",modelProperties:{computeNodeListNextOptions:{required:!1,serializedName:"",type:{name:"Composite",className:"ComputeNodeListNextOptions"}}}}},t.ApplicationListResult={required:!1,serializedName:"ApplicationListResult",type:{name:"Composite",className:"ApplicationListResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"ApplicationSummaryElementType",type:{name:"Composite",className:"ApplicationSummary"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.PoolListUsageMetricsResult={required:!1,serializedName:"PoolListUsageMetricsResult",type:{name:"Composite",className:"PoolListUsageMetricsResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"PoolUsageMetricsElementType",type:{name:"Composite",className:"PoolUsageMetrics"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.CloudPoolListResult={required:!1,serializedName:"CloudPoolListResult",type:{name:"Composite",className:"CloudPoolListResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"CloudPoolElementType",type:{name:"Composite",className:"CloudPool"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.AccountListNodeAgentSkusResult={required:!1,serializedName:"AccountListNodeAgentSkusResult",type:{name:"Composite",className:"AccountListNodeAgentSkusResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"NodeAgentSkuElementType",type:{name:"Composite",className:"NodeAgentSku"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.CloudJobListResult={required:!1,serializedName:"CloudJobListResult",type:{name:"Composite",className:"CloudJobListResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"CloudJobElementType",type:{name:"Composite",className:"CloudJob"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.CloudJobListPreparationAndReleaseTaskStatusResult={required:!1,serializedName:"CloudJobListPreparationAndReleaseTaskStatusResult",type:{name:"Composite",className:"CloudJobListPreparationAndReleaseTaskStatusResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"JobPreparationAndReleaseTaskExecutionInformationElementType",type:{name:"Composite",className:"JobPreparationAndReleaseTaskExecutionInformation"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.CertificateListResult={required:!1,serializedName:"CertificateListResult",type:{name:"Composite",className:"CertificateListResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"CertificateElementType",type:{name:"Composite",className:"Certificate"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.NodeFileListResult={required:!1,serializedName:"NodeFileListResult",type:{name:"Composite",className:"NodeFileListResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"NodeFileElementType",type:{name:"Composite",className:"NodeFile"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.CloudJobScheduleListResult={required:!1,serializedName:"CloudJobScheduleListResult",type:{name:"Composite",className:"CloudJobScheduleListResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"CloudJobScheduleElementType",type:{name:"Composite",className:"CloudJobSchedule"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.CloudTaskListResult={required:!1,serializedName:"CloudTaskListResult",type:{name:"Composite",className:"CloudTaskListResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"CloudTaskElementType",type:{name:"Composite",className:"CloudTask"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}},t.ComputeNodeListResult={required:!1,serializedName:"ComputeNodeListResult",type:{name:"Composite",className:"ComputeNodeListResult",modelProperties:{value:{required:!1,serializedName:"",type:{name:"Sequence",element:{required:!1,serializedName:"ComputeNodeElementType",type:{name:"Composite",className:"ComputeNode"}}}},odatanextLink:{required:!1,serializedName:"odata\\.nextLink",type:{name:"String"}}}}}},function(e,t){e.exports=msRest},function(e,t){e.exports=msRestAzure},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=i(4);t.BatchServiceModels=r;const o=i(0);t.BatchServiceMappers=o;const n=i(1),s=i(2),a=i(5);class l extends s.AzureServiceClient{constructor(e,t,i){if(null===e||void 0===e)throw new Error("'credentials' cannot be null.");i||(i={}),super(e,i),this.apiVersion="2017-09-01.6.0",this.acceptLanguage="en-US",this.longRunningOperationRetryTimeout=30,this.generateClientRequestId=!0,this.baseUri=t,this.baseUri||(this.baseUri="https://batch.core.windows.net"),this.credentials=e,this.addUserAgentInfo(`azure-batch-js/0.1.0`),null!==i.acceptLanguage&&void 0!==i.acceptLanguage&&(this.acceptLanguage=i.acceptLanguage),null!==i.longRunningOperationRetryTimeout&&void 0!==i.longRunningOperationRetryTimeout&&(this.longRunningOperationRetryTimeout=i.longRunningOperationRetryTimeout),null!==i.generateClientRequestId&&void 0!==i.generateClientRequestId&&(this.generateClientRequestId=i.generateClientRequestId),this.application=new a.Application(this),this.pool=new a.Pool(this),this.account=new a.Account(this),this.job=new a.Job(this),this.certificate=new a.CertificateOperations(this),this.file=new a.File(this),this.jobSchedule=new a.JobSchedule(this),this.task=new a.Task(this),this.computeNode=new a.ComputeNodeOperations(this),this.serializer=new n.Serializer(o)}}t.BatchServiceClient=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.Linux="linux",e.Windows="windows"}(t.OSType||(t.OSType={}));!function(e){e.Job="job"}(t.AccessScope||(t.AccessScope={}));!function(e){e.Active="active",e.Deleting="deleting",e.DeleteFailed="deleteFailed"}(t.CertificateState||(t.CertificateState={}));!function(e){e.Pfx="pfx",e.Cer="cer"}(t.CertificateFormat||(t.CertificateFormat={}));!function(e){e.None="none",e.Disable="disable",e.Terminate="terminate"}(t.JobAction||(t.JobAction={}));!function(e){e.Satisfy="satisfy",e.Block="block"}(t.DependencyAction||(t.DependencyAction={}));!function(e){e.Task="task",e.Pool="pool"}(t.AutoUserScope||(t.AutoUserScope={}));!function(e){e.NonAdmin="nonAdmin",e.Admin="admin"}(t.ElevationLevel||(t.ElevationLevel={}));!function(e){e.TaskSuccess="taskSuccess",e.TaskFailure="taskFailure",e.TaskCompletion="taskCompletion"}(t.OutputFileUploadCondition||(t.OutputFileUploadCondition={}));!function(e){e.Spread="spread",e.Pack="pack"}(t.ComputeNodeFillType||(t.ComputeNodeFillType={}));!function(e){e.CurrentUser="currentUser",e.LocalMachine="localMachine"}(t.CertificateStoreLocation||(t.CertificateStoreLocation={}));!function(e){e.StartTask="startTask",e.Task="task",e.RemoteUser="remoteUser"}(t.CertificateVisibility||(t.CertificateVisibility={}));!function(e){e.None="none",e.ReadOnly="readOnly",e.ReadWrite="readWrite"}(t.CachingType||(t.CachingType={}));!function(e){e.StandardLRS="Standard_LRS",e.PremiumLRS="Premium_LRS"}(t.StorageAccountType||(t.StorageAccountType={}));!function(e){e.Tcp="tcp",e.Udp="udp"}(t.InboundEndpointProtocol||(t.InboundEndpointProtocol={}));!function(e){e.Allow="allow",e.Deny="deny"}(t.NetworkSecurityGroupRuleAccess||(t.NetworkSecurityGroupRuleAccess={}));!function(e){e.JobSchedule="jobSchedule",e.Job="job"}(t.PoolLifetimeOption||(t.PoolLifetimeOption={}));!function(e){e.NoAction="noAction",e.TerminateJob="terminateJob"}(t.OnAllTasksComplete||(t.OnAllTasksComplete={}));!function(e){e.NoAction="noAction",e.PerformExitOptionsJobAction="performExitOptionsJobAction"}(t.OnTaskFailure||(t.OnTaskFailure={}));!function(e){e.Active="active",e.Completed="completed",e.Disabled="disabled",e.Terminating="terminating",e.Deleting="deleting"}(t.JobScheduleState||(t.JobScheduleState={}));!function(e){e.UserError="userError",e.ServerError="serverError"}(t.ErrorCategory||(t.ErrorCategory={}));!function(e){e.Active="active",e.Disabling="disabling",e.Disabled="disabled",e.Enabling="enabling",e.Terminating="terminating",e.Completed="completed",e.Deleting="deleting"}(t.JobState||(t.JobState={}));!function(e){e.Running="running",e.Completed="completed"}(t.JobPreparationTaskState||(t.JobPreparationTaskState={}));!function(e){e.Success="success",e.Failure="failure"}(t.TaskExecutionResult||(t.TaskExecutionResult={}));!function(e){e.Running="running",e.Completed="completed"}(t.JobReleaseTaskState||(t.JobReleaseTaskState={}));!function(e){e.Validated="validated",e.Unvalidated="unvalidated"}(t.TaskCountValidationStatus||(t.TaskCountValidationStatus={}));!function(e){e.Active="active",e.Deleting="deleting",e.Upgrading="upgrading"}(t.PoolState||(t.PoolState={}));!function(e){e.Steady="steady",e.Resizing="resizing",e.Stopping="stopping"}(t.AllocationState||(t.AllocationState={}));!function(e){e.Active="active",e.Preparing="preparing",e.Running="running",e.Completed="completed"}(t.TaskState||(t.TaskState={}));!function(e){e.Success="success",e.ClientError="clientError",e.ServerError="serverError"}(t.TaskAddStatus||(t.TaskAddStatus={}));!function(e){e.Preparing="preparing",e.Running="running",e.Completed="completed"}(t.SubtaskState||(t.SubtaskState={}));!function(e){e.Running="running",e.Completed="completed"}(t.StartTaskState||(t.StartTaskState={}));!function(e){e.Idle="idle",e.Rebooting="rebooting",e.Reimaging="reimaging",e.Running="running",e.Unusable="unusable",e.Creating="creating",e.Starting="starting",e.WaitingForStartTask="waitingForStartTask",e.StartTaskFailed="startTaskFailed",e.Unknown="unknown",e.LeavingPool="leavingPool",e.Offline="offline",e.Preempted="preempted"}(t.ComputeNodeState||(t.ComputeNodeState={}));!function(e){e.Enabled="enabled",e.Disabled="disabled"}(t.SchedulingState||(t.SchedulingState={}));!function(e){e.Requeue="requeue",e.Terminate="terminate",e.Wait="wait"}(t.DisableJobOption||(t.DisableJobOption={}));!function(e){e.Requeue="requeue",e.Terminate="terminate",e.TaskCompletion="taskCompletion",e.RetainedData="retainedData"}(t.ComputeNodeDeallocationOption||(t.ComputeNodeDeallocationOption={}));!function(e){e.Requeue="requeue",e.Terminate="terminate",e.TaskCompletion="taskCompletion",e.RetainedData="retainedData"}(t.ComputeNodeRebootOption||(t.ComputeNodeRebootOption={}));!function(e){e.Requeue="requeue",e.Terminate="terminate",e.TaskCompletion="taskCompletion",e.RetainedData="retainedData"}(t.ComputeNodeReimageOption||(t.ComputeNodeReimageOption={}));!function(e){e.Requeue="requeue",e.Terminate="terminate",e.TaskCompletion="taskCompletion"}(t.DisableComputeNodeSchedulingOption||(t.DisableComputeNodeSchedulingOption={}))},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=i(6);t.Application=r.Application;const o=i(7);t.Pool=o.Pool;const n=i(8);t.Account=n.Account;const s=i(9);t.Job=s.Job;const a=i(10);t.CertificateOperations=a.CertificateOperations;const l=i(11);t.File=l.File;const d=i(12);t.JobSchedule=d.JobSchedule;const u=i(13);t.Task=u.Task;const p=i(14);t.ComputeNodeOperations=p.ComputeNodeOperations},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(o,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=i(1),n=i(0),s=o.WebResource;class a{constructor(e){this.client=e}listWithHttpOperationResponse(e){return r(this,void 0,void 0,function*(){let t=this.client,i=e&&void 0!==e.applicationListOptions?e.applicationListOptions:void 0;try{if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let r,a,l,d,u;try{if(null!==i&&void 0!==i&&null!==(r=i.maxResults)&&void 0!==r&&"number"!=typeof r)throw new Error("maxResults must be of type number.");if(null!==i&&void 0!==i&&null!==(a=i.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==i&&void 0!==i&&null!==(l=i.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==i&&void 0!==i&&null!==(d=i.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==i&&void 0!==i&&(u=i.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let p=this.client.baseUri,c=p+(p.endsWith("/")?"":"/")+"applications",m=[];m.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==r&&void 0!==r&&m.push("maxresults="+encodeURIComponent(r.toString())),null!==a&&void 0!==a&&m.push("timeout="+encodeURIComponent(a.toString())),m.length>0&&(c+="?"+m.join("&"));let f=new s;if(f.method="GET",f.url=c,f.headers={},f.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(f.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(f.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(f.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(f.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(f.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),e&&e.customHeaders)for(let t in e.customHeaders)e.customHeaders.hasOwnProperty(t)&&(f.headers[t]=e.customHeaders[t]);f.body=null;let h;try{let e=(h=yield t.pipeline(f)).response,i=e.status;if(200!==i){let i=new o.RestError(h.bodyAsText);i.statusCode=e.status,i.request=o.stripRequest(f),i.response=o.stripResponse(e);let r=h.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),i.code=e?e.code:r.code,i.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;i.body=t.serializer.deserialize(e,r,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${h.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}if(200===i){let i=h.bodyAsJson;try{if(null!==i&&void 0!==i){let e=n.ApplicationListResult;h.bodyAsJson=t.serializer.deserialize(e,i,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${h.bodyAsText}`);return i.request=o.stripRequest(f),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(h)})}getWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.applicationGetOptions?t.applicationGetOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("applicationId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let p=this.client.baseUri,c=p+(p.endsWith("/")?"":"/")+"applications/{applicationId}";c=c.replace("{applicationId}",encodeURIComponent(e));let m=[];m.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&m.push("timeout="+encodeURIComponent(a.toString())),m.length>0&&(c+="?"+m.join("&"));let f=new s;if(f.method="GET",f.url=c,f.headers={},f.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(f.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(f.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(f.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(f.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(f.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(f.headers[e]=t.customHeaders[e]);f.body=null;let h;try{let e=(h=yield i.pipeline(f)).response,t=e.status;if(200!==t){let t=new o.RestError(h.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(f),t.response=o.stripResponse(e);let r=h.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${h.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=h.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.ApplicationSummary;h.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${h.bodyAsText}`);return i.request=o.stripRequest(f),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(h)})}listNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.applicationListNextOptions?t.applicationListNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.ApplicationListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}list(e,t){t||"function"!=typeof e||(t=e,e=void 0);let i=t;if(!t)return this.listWithHttpOperationResponse(e).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listWithHttpOperationResponse(e))((e,t)=>{if(e)return i(e);let r=t.bodyAsJson;return i(e,r,t.request,t.response)})}get(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.getWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}listNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}}t.Application=a},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(o,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=i(1),n=i(0),s=o.WebResource;class a{constructor(e){this.client=e}listUsageMetricsWithHttpOperationResponse(e){return r(this,void 0,void 0,function*(){let t=this.client,i=e&&void 0!==e.poolListUsageMetricsOptions?e.poolListUsageMetricsOptions:void 0;try{if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let r,a,l,d,u,p,c,m;try{if(null!==i&&void 0!==i&&(r=i.startTime)&&!(r instanceof Date||"string"==typeof r.valueOf()&&!isNaN(Date.parse(r))))throw new Error("startTime must be of type date.");if(null!==i&&void 0!==i&&(a=i.endTime)&&!(a instanceof Date||"string"==typeof a.valueOf()&&!isNaN(Date.parse(a))))throw new Error("endTime must be of type date.");if(null!==i&&void 0!==i&&null!==(l=i.filter)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("filter must be of type string.");if(null!==i&&void 0!==i&&null!==(d=i.maxResults)&&void 0!==d&&"number"!=typeof d)throw new Error("maxResults must be of type number.");if(null!==i&&void 0!==i&&null!==(u=i.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==i&&void 0!==i&&null!==(p=i.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==i&&void 0!==i&&null!==(c=i.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==i&&void 0!==i&&(m=i.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"poolusagemetrics",y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==r&&void 0!==r&&y.push("starttime="+encodeURIComponent(o.serializeObject(r))),null!==a&&void 0!==a&&y.push("endtime="+encodeURIComponent(o.serializeObject(a))),null!==l&&void 0!==l&&y.push("$filter="+encodeURIComponent(l)),null!==d&&void 0!==d&&y.push("maxresults="+encodeURIComponent(d.toString())),null!==u&&void 0!==u&&y.push("timeout="+encodeURIComponent(u.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="GET",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(g.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(g.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),e&&e.customHeaders)for(let t in e.customHeaders)e.customHeaders.hasOwnProperty(t)&&(g.headers[t]=e.customHeaders[t]);g.body=null;let v;try{let e=(v=yield t.pipeline(g)).response,i=e.status;if(200!==i){let i=new o.RestError(v.bodyAsText);i.statusCode=e.status,i.request=o.stripRequest(g),i.response=o.stripResponse(e);let r=v.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),i.code=e?e.code:r.code,i.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;i.body=t.serializer.deserialize(e,r,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}if(200===i){let i=v.bodyAsJson;try{if(null!==i&&void 0!==i){let e=n.PoolListUsageMetricsResult;v.bodyAsJson=t.serializer.deserialize(e,i,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${v.bodyAsText}`);return i.request=o.stripRequest(g),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}getAllLifetimeStatisticsWithHttpOperationResponse(e){return r(this,void 0,void 0,function*(){let t=this.client,i=e&&void 0!==e.poolGetAllLifetimeStatisticsOptions?e.poolGetAllLifetimeStatisticsOptions:void 0;try{if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let r,a,l,d;try{if(null!==i&&void 0!==i&&null!==(r=i.timeout)&&void 0!==r&&"number"!=typeof r)throw new Error("timeout must be of type number.");if(null!==i&&void 0!==i&&null!==(a=i.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==i&&void 0!==i&&null!==(l=i.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==i&&void 0!==i&&(d=i.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u=this.client.baseUri,p=u+(u.endsWith("/")?"":"/")+"lifetimepoolstats",c=[];c.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==r&&void 0!==r&&c.push("timeout="+encodeURIComponent(r.toString())),c.length>0&&(p+="?"+c.join("&"));let m=new s;if(m.method="GET",m.url=p,m.headers={},m.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(m.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(m.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(m.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(m.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(m.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),e&&e.customHeaders)for(let t in e.customHeaders)e.customHeaders.hasOwnProperty(t)&&(m.headers[t]=e.customHeaders[t]);m.body=null;let f;try{let e=(f=yield t.pipeline(m)).response,i=e.status;if(200!==i){let i=new o.RestError(f.bodyAsText);i.statusCode=e.status,i.request=o.stripRequest(m),i.response=o.stripResponse(e);let r=f.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),i.code=e?e.code:r.code,i.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;i.body=t.serializer.deserialize(e,r,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${f.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}if(200===i){let i=f.bodyAsJson;try{if(null!==i&&void 0!==i){let e=n.PoolStatistics;f.bodyAsJson=t.serializer.deserialize(e,i,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${f.bodyAsText}`);return i.request=o.stripRequest(m),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(f)})}addWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.poolAddOptions?t.poolAddOptions:void 0;null!==e&&void 0!==e||(e={});try{if(null===e||void 0===e)throw new Error("pool cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let p=this.client.baseUri,c=p+(p.endsWith("/")?"":"/")+"pools",m=[];m.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&m.push("timeout="+encodeURIComponent(a.toString())),m.length>0&&(c+="?"+m.join("&"));let f=new s;if(f.method="POST",f.url=c,f.headers={},f.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(f.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(f.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(f.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(f.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(f.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(f.headers[e]=t.customHeaders[e]);let h=null,y=null;try{if(null!==e&&void 0!==e){let t=n.PoolAddParameter;y=i.serializer.serialize(t,e,"pool"),h=JSON.stringify(y)}}catch(t){let i=new Error(`Error "${t.message}" occurred in serializing the `+`payload - ${JSON.stringify(e,null,2)}.`);return Promise.reject(i)}f.body=h;let g;try{let e=(g=yield i.pipeline(f)).response;if(201!==e.status){let t=new o.RestError(g.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(f),t.response=o.stripResponse(e);let r=g.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${g.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(g)})}listWithHttpOperationResponse(e){return r(this,void 0,void 0,function*(){let t=this.client,i=e&&void 0!==e.poolListOptions?e.poolListOptions:void 0;try{if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let r,a,l,d,u,p,c,m;try{if(null!==i&&void 0!==i&&null!==(r=i.filter)&&void 0!==r&&"string"!=typeof r.valueOf())throw new Error("filter must be of type string.");if(null!==i&&void 0!==i&&null!==(a=i.select)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("select must be of type string.");if(null!==i&&void 0!==i&&null!==(l=i.expand)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("expand must be of type string.");if(null!==i&&void 0!==i&&null!==(d=i.maxResults)&&void 0!==d&&"number"!=typeof d)throw new Error("maxResults must be of type number.");if(null!==i&&void 0!==i&&null!==(u=i.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==i&&void 0!==i&&null!==(p=i.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==i&&void 0!==i&&null!==(c=i.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==i&&void 0!==i&&(m=i.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"pools",y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==r&&void 0!==r&&y.push("$filter="+encodeURIComponent(r)),null!==a&&void 0!==a&&y.push("$select="+encodeURIComponent(a)),null!==l&&void 0!==l&&y.push("$expand="+encodeURIComponent(l)),null!==d&&void 0!==d&&y.push("maxresults="+encodeURIComponent(d.toString())),null!==u&&void 0!==u&&y.push("timeout="+encodeURIComponent(u.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="GET",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(g.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(g.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),e&&e.customHeaders)for(let t in e.customHeaders)e.customHeaders.hasOwnProperty(t)&&(g.headers[t]=e.customHeaders[t]);g.body=null;let v;try{let e=(v=yield t.pipeline(g)).response,i=e.status;if(200!==i){let i=new o.RestError(v.bodyAsText);i.statusCode=e.status,i.request=o.stripRequest(g),i.response=o.stripResponse(e);let r=v.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),i.code=e?e.code:r.code,i.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;i.body=t.serializer.deserialize(e,r,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}if(200===i){let i=v.bodyAsJson;try{if(null!==i&&void 0!==i){let e=n.CloudPoolListResult;v.bodyAsJson=t.serializer.deserialize(e,i,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${v.bodyAsText}`);return i.request=o.stripRequest(g),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}deleteMethodWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.poolDeleteMethodOptions?t.poolDeleteMethodOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"pools/{poolId}";y=y.replace("{poolId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="DELETE",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response;if(202!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}existsWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.poolExistsOptions?t.poolExistsOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"pools/{poolId}";y=y.replace("{poolId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="HEAD",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response,t=e.status;if(200!==t&&404!==t){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}b.bodyAsJson=200===t}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}getWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.poolGetOptions?t.poolGetOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f,h,y;try{if(null!==r&&void 0!==r&&null!==(a=r.select)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("select must be of type string.");if(null!==r&&void 0!==r&&null!==(l=r.expand)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("expand must be of type string.");if(null!==r&&void 0!==r&&null!==(d=r.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(u=r.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(p=r.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(c=r.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(m=r.ifMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(f=r.ifNoneMatch)&&void 0!==f&&"string"!=typeof f.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(h=r.ifModifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(y=r.ifUnmodifiedSince)&&!(y instanceof Date||"string"==typeof y.valueOf()&&!isNaN(Date.parse(y))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let g=this.client.baseUri,v=g+(g.endsWith("/")?"":"/")+"pools/{poolId}";v=v.replace("{poolId}",encodeURIComponent(e));let b=[];b.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&b.push("$select="+encodeURIComponent(a)),null!==l&&void 0!==l&&b.push("$expand="+encodeURIComponent(l)),null!==d&&void 0!==d&&b.push("timeout="+encodeURIComponent(d.toString())),b.length>0&&(v+="?"+b.join("&"));let q=new s;if(q.method="GET",q.url=v,q.headers={},q.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(q.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(q.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(q.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(q.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(q.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),void 0!==m&&null!==m&&(q.headers["If-Match"]=m),void 0!==f&&null!==f&&(q.headers["If-None-Match"]=f),void 0!==h&&null!==h&&(q.headers["If-Modified-Since"]=h instanceof Date?h.toUTCString():h),void 0!==y&&null!==y&&(q.headers["If-Unmodified-Since"]=y instanceof Date?y.toUTCString():y),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(q.headers[e]=t.customHeaders[e]);q.body=null;let N;try{let e=(N=yield i.pipeline(q)).response,t=e.status;if(200!==t){let t=new o.RestError(N.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(q),t.response=o.stripResponse(e);let r=N.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${N.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=N.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudPool;N.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${N.bodyAsText}`);return i.request=o.stripRequest(q),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(N)})}patchWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.poolPatchOptions?i.poolPatchOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("poolPatchParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"pools/{poolId}";g=g.replace("{poolId}",encodeURIComponent(e));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="PATCH",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);let q=null,N=null;try{if(null!==t&&void 0!==t){let e=n.PoolPatchParameter;N=r.serializer.serialize(e,t,"poolPatchParameter"),q=JSON.stringify(N)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}b.body=q;let R;try{let e=(R=yield r.pipeline(b)).response;if(200!==e.status){let t=new o.RestError(R.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=R.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${R.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(R)})}disableAutoScaleWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.poolDisableAutoScaleOptions?t.poolDisableAutoScaleOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let p=this.client.baseUri,c=p+(p.endsWith("/")?"":"/")+"pools/{poolId}/disableautoscale";c=c.replace("{poolId}",encodeURIComponent(e));let m=[];m.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&m.push("timeout="+encodeURIComponent(a.toString())),m.length>0&&(c+="?"+m.join("&"));let f=new s;if(f.method="POST",f.url=c,f.headers={},f.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(f.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(f.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(f.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(f.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(f.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(f.headers[e]=t.customHeaders[e]);f.body=null;let h;try{let e=(h=yield i.pipeline(f)).response;if(200!==e.status){let t=new o.RestError(h.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(f),t.response=o.stripResponse(e);let r=h.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${h.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(h)})}enableAutoScaleWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.poolEnableAutoScaleOptions?i.poolEnableAutoScaleOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("poolEnableAutoScaleParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"pools/{poolId}/enableautoscale";g=g.replace("{poolId}",encodeURIComponent(e));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="POST",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);let q=null,N=null;try{if(null!==t&&void 0!==t){let e=n.PoolEnableAutoScaleParameter;N=r.serializer.serialize(e,t,"poolEnableAutoScaleParameter"),q=JSON.stringify(N)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}b.body=q;let R;try{let e=(R=yield r.pipeline(b)).response;if(200!==e.status){let t=new o.RestError(R.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=R.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${R.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(R)})}evaluateAutoScaleWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.poolEvaluateAutoScaleOptions?i.poolEvaluateAutoScaleOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("autoScaleFormula cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c={};try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");null!==t&&void 0!==t&&(c.autoScaleFormula=t)}catch(e){return Promise.reject(e)}let m=this.client.baseUri,f=m+(m.endsWith("/")?"":"/")+"pools/{poolId}/evaluateautoscale";f=f.replace("{poolId}",encodeURIComponent(e));let h=[];h.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&h.push("timeout="+encodeURIComponent(l.toString())),h.length>0&&(f+="?"+h.join("&"));let y=new s;if(y.method="POST",y.url=f,y.headers={},y.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(y.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(y.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(y.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(y.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(y.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(y.headers[e]=i.customHeaders[e]);let g=null,v=null;try{if(null!==c&&void 0!==c){let e=n.PoolEvaluateAutoScaleParameter;v=r.serializer.serialize(e,c,"poolEvaluateAutoScaleParameter"),g=JSON.stringify(v)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(c,null,2)}.`);return Promise.reject(t)}y.body=g;let b;try{let e=(b=yield r.pipeline(y)).response,t=e.status;if(200!==t){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(y),t.response=o.stripResponse(e);let i=b.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=b.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.AutoScaleRun;b.bodyAsJson=r.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${b.bodyAsText}`);return i.request=o.stripRequest(y),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}resizeWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.poolResizeOptions?i.poolResizeOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("poolResizeParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"pools/{poolId}/resize";g=g.replace("{poolId}",encodeURIComponent(e));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="POST",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);let q=null,N=null;try{if(null!==t&&void 0!==t){let e=n.PoolResizeParameter;N=r.serializer.serialize(e,t,"poolResizeParameter"),q=JSON.stringify(N)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}b.body=q;let R;try{let e=(R=yield r.pipeline(b)).response;if(202!==e.status){let t=new o.RestError(R.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=R.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${R.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(R)})}stopResizeWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.poolStopResizeOptions?t.poolStopResizeOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"pools/{poolId}/stopresize";y=y.replace("{poolId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="POST",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response;if(202!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}updatePropertiesWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.poolUpdatePropertiesOptions?i.poolUpdatePropertiesOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("poolUpdatePropertiesParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let c=this.client.baseUri,m=c+(c.endsWith("/")?"":"/")+"pools/{poolId}/updateproperties";m=m.replace("{poolId}",encodeURIComponent(e));let f=[];f.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&f.push("timeout="+encodeURIComponent(l.toString())),f.length>0&&(m+="?"+f.join("&"));let h=new s;if(h.method="POST",h.url=m,h.headers={},h.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(h.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(h.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(h.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(h.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(h.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(h.headers[e]=i.customHeaders[e]);let y=null,g=null;try{if(null!==t&&void 0!==t){let e=n.PoolUpdatePropertiesParameter;g=r.serializer.serialize(e,t,"poolUpdatePropertiesParameter"),y=JSON.stringify(g)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}h.body=y;let v;try{let e=(v=yield r.pipeline(h)).response;if(204!==e.status){let t=new o.RestError(v.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(h),t.response=o.stripResponse(e);let i=v.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}upgradeOSWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.poolUpgradeOSOptions?i.poolUpgradeOSOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("targetOSVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h,y={};try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.");null!==t&&void 0!==t&&(y.targetOSVersion=t)}catch(e){return Promise.reject(e)}let g=this.client.baseUri,v=g+(g.endsWith("/")?"":"/")+"pools/{poolId}/upgradeos";v=v.replace("{poolId}",encodeURIComponent(e));let b=[];b.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&b.push("timeout="+encodeURIComponent(l.toString())),b.length>0&&(v+="?"+b.join("&"));let q=new s;if(q.method="POST",q.url=v,q.headers={},q.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(q.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(q.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(q.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(q.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(q.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(q.headers["If-Match"]=c),void 0!==m&&null!==m&&(q.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(q.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(q.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(q.headers[e]=i.customHeaders[e]);let N=null,R=null;try{if(null!==y&&void 0!==y){let e=n.PoolUpgradeOSParameter;R=r.serializer.serialize(e,y,"poolUpgradeOSParameter"),N=JSON.stringify(R)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(y,null,2)}.`);return Promise.reject(t)}q.body=N;let C;try{let e=(C=yield r.pipeline(q)).response;if(202!==e.status){let t=new o.RestError(C.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(q),t.response=o.stripResponse(e);let i=C.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${C.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(C)})}removeNodesWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.poolRemoveNodesOptions?i.poolRemoveNodesOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("nodeRemoveParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"pools/{poolId}/removenodes";g=g.replace("{poolId}",encodeURIComponent(e));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="POST",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);let q=null,N=null;try{if(null!==t&&void 0!==t){let e=n.NodeRemoveParameter;N=r.serializer.serialize(e,t,"nodeRemoveParameter"),q=JSON.stringify(N)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}b.body=q;let R;try{let e=(R=yield r.pipeline(b)).response;if(202!==e.status){let t=new o.RestError(R.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=R.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${R.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(R)})}listUsageMetricsNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.poolListUsageMetricsNextOptions?t.poolListUsageMetricsNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.PoolListUsageMetricsResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}listNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.poolListNextOptions?t.poolListNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudPoolListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}listUsageMetrics(e,t){t||"function"!=typeof e||(t=e,e=void 0);let i=t;if(!t)return this.listUsageMetricsWithHttpOperationResponse(e).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listUsageMetricsWithHttpOperationResponse(e))((e,t)=>{if(e)return i(e);let r=t.bodyAsJson;return i(e,r,t.request,t.response)})}getAllLifetimeStatistics(e,t){t||"function"!=typeof e||(t=e,e=void 0);let i=t;if(!t)return this.getAllLifetimeStatisticsWithHttpOperationResponse(e).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getAllLifetimeStatisticsWithHttpOperationResponse(e))((e,t)=>{if(e)return i(e);let r=t.bodyAsJson;return i(e,r,t.request,t.response)})}add(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.addWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.addWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}list(e,t){t||"function"!=typeof e||(t=e,e=void 0);let i=t;if(!t)return this.listWithHttpOperationResponse(e).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listWithHttpOperationResponse(e))((e,t)=>{if(e)return i(e);let r=t.bodyAsJson;return i(e,r,t.request,t.response)})}deleteMethod(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.deleteMethodWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.deleteMethodWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}exists(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.existsWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.existsWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}get(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.getWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}patch(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.patchWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.patchWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}disableAutoScale(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.disableAutoScaleWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.disableAutoScaleWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}enableAutoScale(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.enableAutoScaleWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.enableAutoScaleWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}evaluateAutoScale(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.evaluateAutoScaleWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.evaluateAutoScaleWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}resize(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.resizeWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.resizeWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}stopResize(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.stopResizeWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.stopResizeWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}updateProperties(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.updatePropertiesWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.updatePropertiesWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}upgradeOS(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.upgradeOSWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.upgradeOSWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}removeNodes(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.removeNodesWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.removeNodesWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}listUsageMetricsNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listUsageMetricsNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listUsageMetricsNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}listNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}}t.Pool=a},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(o,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=i(1),n=i(0),s=o.WebResource;class a{constructor(e){this.client=e}listNodeAgentSkusWithHttpOperationResponse(e){return r(this,void 0,void 0,function*(){let t=this.client,i=e&&void 0!==e.accountListNodeAgentSkusOptions?e.accountListNodeAgentSkusOptions:void 0;try{if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let r,a,l,d,u,p;try{if(null!==i&&void 0!==i&&null!==(r=i.filter)&&void 0!==r&&"string"!=typeof r.valueOf())throw new Error("filter must be of type string.");if(null!==i&&void 0!==i&&null!==(a=i.maxResults)&&void 0!==a&&"number"!=typeof a)throw new Error("maxResults must be of type number.");if(null!==i&&void 0!==i&&null!==(l=i.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==i&&void 0!==i&&null!==(d=i.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==i&&void 0!==i&&null!==(u=i.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==i&&void 0!==i&&(p=i.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let c=this.client.baseUri,m=c+(c.endsWith("/")?"":"/")+"nodeagentskus",f=[];f.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==r&&void 0!==r&&f.push("$filter="+encodeURIComponent(r)),null!==a&&void 0!==a&&f.push("maxresults="+encodeURIComponent(a.toString())),null!==l&&void 0!==l&&f.push("timeout="+encodeURIComponent(l.toString())),f.length>0&&(m+="?"+f.join("&"));let h=new s;if(h.method="GET",h.url=m,h.headers={},h.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(h.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(h.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(h.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(h.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(h.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),e&&e.customHeaders)for(let t in e.customHeaders)e.customHeaders.hasOwnProperty(t)&&(h.headers[t]=e.customHeaders[t]);h.body=null;let y;try{let e=(y=yield t.pipeline(h)).response,i=e.status;if(200!==i){let i=new o.RestError(y.bodyAsText);i.statusCode=e.status,i.request=o.stripRequest(h),i.response=o.stripResponse(e);let r=y.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),i.code=e?e.code:r.code,i.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;i.body=t.serializer.deserialize(e,r,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${y.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}if(200===i){let i=y.bodyAsJson;try{if(null!==i&&void 0!==i){let e=n.AccountListNodeAgentSkusResult;y.bodyAsJson=t.serializer.deserialize(e,i,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${y.bodyAsText}`);return i.request=o.stripRequest(h),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(y)})}listNodeAgentSkusNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.accountListNodeAgentSkusNextOptions?t.accountListNodeAgentSkusNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.AccountListNodeAgentSkusResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}listNodeAgentSkus(e,t){t||"function"!=typeof e||(t=e,e=void 0);let i=t;if(!t)return this.listNodeAgentSkusWithHttpOperationResponse(e).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listNodeAgentSkusWithHttpOperationResponse(e))((e,t)=>{if(e)return i(e);let r=t.bodyAsJson;return i(e,r,t.request,t.response)})}listNodeAgentSkusNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listNodeAgentSkusNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listNodeAgentSkusNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}}t.Account=a},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(o,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=i(1),n=i(0),s=o.WebResource;class a{constructor(e){this.client=e}getAllLifetimeStatisticsWithHttpOperationResponse(e){return r(this,void 0,void 0,function*(){let t=this.client,i=e&&void 0!==e.jobGetAllLifetimeStatisticsOptions?e.jobGetAllLifetimeStatisticsOptions:void 0;try{if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let r,a,l,d;try{if(null!==i&&void 0!==i&&null!==(r=i.timeout)&&void 0!==r&&"number"!=typeof r)throw new Error("timeout must be of type number.");if(null!==i&&void 0!==i&&null!==(a=i.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==i&&void 0!==i&&null!==(l=i.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==i&&void 0!==i&&(d=i.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u=this.client.baseUri,p=u+(u.endsWith("/")?"":"/")+"lifetimejobstats",c=[];c.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==r&&void 0!==r&&c.push("timeout="+encodeURIComponent(r.toString())),c.length>0&&(p+="?"+c.join("&"));let m=new s;if(m.method="GET",m.url=p,m.headers={},m.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(m.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(m.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(m.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(m.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(m.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),e&&e.customHeaders)for(let t in e.customHeaders)e.customHeaders.hasOwnProperty(t)&&(m.headers[t]=e.customHeaders[t]);m.body=null;let f;try{let e=(f=yield t.pipeline(m)).response,i=e.status;if(200!==i){let i=new o.RestError(f.bodyAsText);i.statusCode=e.status,i.request=o.stripRequest(m),i.response=o.stripResponse(e);let r=f.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),i.code=e?e.code:r.code,i.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;i.body=t.serializer.deserialize(e,r,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${f.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}if(200===i){let i=f.bodyAsJson;try{if(null!==i&&void 0!==i){let e=n.JobStatistics;f.bodyAsJson=t.serializer.deserialize(e,i,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${f.bodyAsText}`);return i.request=o.stripRequest(m),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(f)})}deleteMethodWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobDeleteMethodOptions?t.jobDeleteMethodOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobs/{jobId}";y=y.replace("{jobId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="DELETE",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response;if(202!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}getWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobGetOptions?t.jobGetOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f,h,y;try{if(null!==r&&void 0!==r&&null!==(a=r.select)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("select must be of type string.");if(null!==r&&void 0!==r&&null!==(l=r.expand)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("expand must be of type string.");if(null!==r&&void 0!==r&&null!==(d=r.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(u=r.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(p=r.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(c=r.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(m=r.ifMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(f=r.ifNoneMatch)&&void 0!==f&&"string"!=typeof f.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(h=r.ifModifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(y=r.ifUnmodifiedSince)&&!(y instanceof Date||"string"==typeof y.valueOf()&&!isNaN(Date.parse(y))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let g=this.client.baseUri,v=g+(g.endsWith("/")?"":"/")+"jobs/{jobId}";v=v.replace("{jobId}",encodeURIComponent(e));let b=[];b.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&b.push("$select="+encodeURIComponent(a)),null!==l&&void 0!==l&&b.push("$expand="+encodeURIComponent(l)),null!==d&&void 0!==d&&b.push("timeout="+encodeURIComponent(d.toString())),b.length>0&&(v+="?"+b.join("&"));let q=new s;if(q.method="GET",q.url=v,q.headers={},q.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(q.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(q.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(q.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(q.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(q.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),void 0!==m&&null!==m&&(q.headers["If-Match"]=m),void 0!==f&&null!==f&&(q.headers["If-None-Match"]=f),void 0!==h&&null!==h&&(q.headers["If-Modified-Since"]=h instanceof Date?h.toUTCString():h),void 0!==y&&null!==y&&(q.headers["If-Unmodified-Since"]=y instanceof Date?y.toUTCString():y),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(q.headers[e]=t.customHeaders[e]);q.body=null;let N;try{let e=(N=yield i.pipeline(q)).response,t=e.status;if(200!==t){let t=new o.RestError(N.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(q),t.response=o.stripResponse(e);let r=N.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${N.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=N.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudJob;N.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${N.bodyAsText}`);return i.request=o.stripRequest(q),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(N)})}patchWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.jobPatchOptions?i.jobPatchOptions:void 0;null!==t&&void 0!==t||(t={});try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("jobPatchParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"jobs/{jobId}";g=g.replace("{jobId}",encodeURIComponent(e));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="PATCH",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);let q=null,N=null;try{if(null!==t&&void 0!==t){let e=n.JobPatchParameter;N=r.serializer.serialize(e,t,"jobPatchParameter"),q=JSON.stringify(N)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}b.body=q;let R;try{let e=(R=yield r.pipeline(b)).response;if(200!==e.status){let t=new o.RestError(R.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=R.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${R.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(R)})}updateWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.jobUpdateOptions?i.jobUpdateOptions:void 0;null!==t&&void 0!==t||(t={});try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("jobUpdateParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"jobs/{jobId}";g=g.replace("{jobId}",encodeURIComponent(e));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="PUT",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);let q=null,N=null;try{if(null!==t&&void 0!==t){let e=n.JobUpdateParameter;N=r.serializer.serialize(e,t,"jobUpdateParameter"),q=JSON.stringify(N)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}b.body=q;let R;try{let e=(R=yield r.pipeline(b)).response;if(200!==e.status){let t=new o.RestError(R.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=R.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${R.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(R)})}disableWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.jobDisableOptions?i.jobDisableOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(!t)throw new Error("disableTasks cannot be null or undefined.");{let e=["requeue","terminate","wait"];if(!e.some(function(e){return e===t}))throw new Error(t+" is not a valid value. The valid values are: "+e)}if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h,y={};try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.");null!==t&&void 0!==t&&(y.disableTasks=t)}catch(e){return Promise.reject(e)}let g=this.client.baseUri,v=g+(g.endsWith("/")?"":"/")+"jobs/{jobId}/disable";v=v.replace("{jobId}",encodeURIComponent(e));let b=[];b.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&b.push("timeout="+encodeURIComponent(l.toString())),b.length>0&&(v+="?"+b.join("&"));let q=new s;if(q.method="POST",q.url=v,q.headers={},q.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(q.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(q.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(q.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(q.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(q.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(q.headers["If-Match"]=c),void 0!==m&&null!==m&&(q.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(q.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(q.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(q.headers[e]=i.customHeaders[e]);let N=null,R=null;try{if(null!==y&&void 0!==y){let e=n.JobDisableParameter;R=r.serializer.serialize(e,y,"jobDisableParameter"),N=JSON.stringify(R)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(y,null,2)}.`);return Promise.reject(t)}q.body=N;let C;try{let e=(C=yield r.pipeline(q)).response;if(202!==e.status){let t=new o.RestError(C.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(q),t.response=o.stripResponse(e);let i=C.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${C.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(C)})}enableWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobEnableOptions?t.jobEnableOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobs/{jobId}/enable";y=y.replace("{jobId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="POST",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response;if(202!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}terminateWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.terminateReason?t.terminateReason:void 0,a=t&&void 0!==t.jobTerminateOptions?t.jobTerminateOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==r&&void 0!==r&&"string"!=typeof r.valueOf())throw new Error("terminateReason must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h,y;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.");null!==r&&void 0!==r&&((y={}).terminateReason=r)}catch(e){return Promise.reject(e)}let g=this.client.baseUri,v=g+(g.endsWith("/")?"":"/")+"jobs/{jobId}/terminate";v=v.replace("{jobId}",encodeURIComponent(e));let b=[];b.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&b.push("timeout="+encodeURIComponent(l.toString())),b.length>0&&(v+="?"+b.join("&"));let q=new s;if(q.method="POST",q.url=v,q.headers={},q.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(q.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(q.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(q.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(q.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(q.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(q.headers["If-Match"]=c),void 0!==m&&null!==m&&(q.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(q.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(q.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(q.headers[e]=t.customHeaders[e]);let N=null,R=null;try{if(null!==y&&void 0!==y){let e=n.JobTerminateParameter;R=i.serializer.serialize(e,y,"jobTerminateParameter"),N=JSON.stringify(R)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(y,null,2)}.`);return Promise.reject(t)}q.body=N;let C;try{let e=(C=yield i.pipeline(q)).response;if(202!==e.status){let t=new o.RestError(C.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(q),t.response=o.stripResponse(e);let r=C.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${C.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(C)})}addWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobAddOptions?t.jobAddOptions:void 0;null!==e&&void 0!==e||(e={});try{if(null===e||void 0===e)throw new Error("job cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let p=this.client.baseUri,c=p+(p.endsWith("/")?"":"/")+"jobs",m=[];m.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&m.push("timeout="+encodeURIComponent(a.toString())),m.length>0&&(c+="?"+m.join("&"));let f=new s;if(f.method="POST",f.url=c,f.headers={},f.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(f.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(f.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(f.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(f.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(f.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(f.headers[e]=t.customHeaders[e]);let h=null,y=null;try{if(null!==e&&void 0!==e){let t=n.JobAddParameter;y=i.serializer.serialize(t,e,"job"),h=JSON.stringify(y)}}catch(t){let i=new Error(`Error "${t.message}" occurred in serializing the `+`payload - ${JSON.stringify(e,null,2)}.`);return Promise.reject(i)}f.body=h;let g;try{let e=(g=yield i.pipeline(f)).response;if(201!==e.status){let t=new o.RestError(g.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(f),t.response=o.stripResponse(e);let r=g.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${g.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(g)})}listWithHttpOperationResponse(e){return r(this,void 0,void 0,function*(){let t=this.client,i=e&&void 0!==e.jobListOptions?e.jobListOptions:void 0;try{if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let r,a,l,d,u,p,c,m;try{if(null!==i&&void 0!==i&&null!==(r=i.filter)&&void 0!==r&&"string"!=typeof r.valueOf())throw new Error("filter must be of type string.");if(null!==i&&void 0!==i&&null!==(a=i.select)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("select must be of type string.");if(null!==i&&void 0!==i&&null!==(l=i.expand)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("expand must be of type string.");if(null!==i&&void 0!==i&&null!==(d=i.maxResults)&&void 0!==d&&"number"!=typeof d)throw new Error("maxResults must be of type number.");if(null!==i&&void 0!==i&&null!==(u=i.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==i&&void 0!==i&&null!==(p=i.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==i&&void 0!==i&&null!==(c=i.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==i&&void 0!==i&&(m=i.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"jobs",y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==r&&void 0!==r&&y.push("$filter="+encodeURIComponent(r)),null!==a&&void 0!==a&&y.push("$select="+encodeURIComponent(a)),null!==l&&void 0!==l&&y.push("$expand="+encodeURIComponent(l)),null!==d&&void 0!==d&&y.push("maxresults="+encodeURIComponent(d.toString())),null!==u&&void 0!==u&&y.push("timeout="+encodeURIComponent(u.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="GET",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(g.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(g.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),e&&e.customHeaders)for(let t in e.customHeaders)e.customHeaders.hasOwnProperty(t)&&(g.headers[t]=e.customHeaders[t]);g.body=null;let v;try{let e=(v=yield t.pipeline(g)).response,i=e.status;if(200!==i){let i=new o.RestError(v.bodyAsText);i.statusCode=e.status,i.request=o.stripRequest(g),i.response=o.stripResponse(e);let r=v.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),i.code=e?e.code:r.code,i.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;i.body=t.serializer.deserialize(e,r,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}if(200===i){let i=v.bodyAsJson;try{if(null!==i&&void 0!==i){let e=n.CloudJobListResult;v.bodyAsJson=t.serializer.deserialize(e,i,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${v.bodyAsText}`);return i.request=o.stripRequest(g),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}listFromJobScheduleWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobListFromJobScheduleOptions?t.jobListFromJobScheduleOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobScheduleId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.filter)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("filter must be of type string.");if(null!==r&&void 0!==r&&null!==(l=r.select)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("select must be of type string.");if(null!==r&&void 0!==r&&null!==(d=r.expand)&&void 0!==d&&"string"!=typeof d.valueOf())throw new Error("expand must be of type string.");if(null!==r&&void 0!==r&&null!==(u=r.maxResults)&&void 0!==u&&"number"!=typeof u)throw new Error("maxResults must be of type number.");if(null!==r&&void 0!==r&&null!==(p=r.timeout)&&void 0!==p&&"number"!=typeof p)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(c=r.clientRequestId)&&void 0!==c&&("string"!=typeof c.valueOf()||!o.isValidUuid(c)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(m=r.returnClientRequestId)&&void 0!==m&&"boolean"!=typeof m)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(f=r.ocpDate)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobschedules/{jobScheduleId}/jobs";y=y.replace("{jobScheduleId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("$filter="+encodeURIComponent(a)),null!==l&&void 0!==l&&g.push("$select="+encodeURIComponent(l)),null!==d&&void 0!==d&&g.push("$expand="+encodeURIComponent(d)),null!==u&&void 0!==u&&g.push("maxresults="+encodeURIComponent(u.toString())),null!==p&&void 0!==p&&g.push("timeout="+encodeURIComponent(p.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="GET",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==c&&null!==c&&(v.headers["client-request-id"]=c.toString()),void 0!==m&&null!==m&&(v.headers["return-client-request-id"]=m.toString()),void 0!==f&&null!==f&&(v.headers["ocp-date"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response,t=e.status;if(200!==t){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=b.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudJobListResult;b.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${b.bodyAsText}`);return i.request=o.stripRequest(v),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}listPreparationAndReleaseTaskStatusWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobListPreparationAndReleaseTaskStatusOptions?t.jobListPreparationAndReleaseTaskStatusOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m;try{if(null!==r&&void 0!==r&&null!==(a=r.filter)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("filter must be of type string.");if(null!==r&&void 0!==r&&null!==(l=r.select)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("select must be of type string.");if(null!==r&&void 0!==r&&null!==(d=r.maxResults)&&void 0!==d&&"number"!=typeof d)throw new Error("maxResults must be of type number.");if(null!==r&&void 0!==r&&null!==(u=r.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(p=r.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(c=r.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(m=r.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"jobs/{jobId}/jobpreparationandreleasetaskstatus";h=h.replace("{jobId}",encodeURIComponent(e));let y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&y.push("$filter="+encodeURIComponent(a)),null!==l&&void 0!==l&&y.push("$select="+encodeURIComponent(l)),null!==d&&void 0!==d&&y.push("maxresults="+encodeURIComponent(d.toString())),null!==u&&void 0!==u&&y.push("timeout="+encodeURIComponent(u.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="GET",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(g.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(g.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(g.headers[e]=t.customHeaders[e]);g.body=null;let v;try{let e=(v=yield i.pipeline(g)).response,t=e.status;if(200!==t){let t=new o.RestError(v.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(g),t.response=o.stripResponse(e);let r=v.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=v.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudJobListPreparationAndReleaseTaskStatusResult;v.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${v.bodyAsText}`);return i.request=o.stripRequest(g),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}getTaskCountsWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobGetTaskCountsOptions?t.jobGetTaskCountsOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let p=this.client.baseUri,c=p+(p.endsWith("/")?"":"/")+"jobs/{jobId}/taskcounts";c=c.replace("{jobId}",encodeURIComponent(e));let m=[];m.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&m.push("timeout="+encodeURIComponent(a.toString())),m.length>0&&(c+="?"+m.join("&"));let f=new s;if(f.method="GET",f.url=c,f.headers={},f.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(f.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(f.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(f.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(f.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(f.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(f.headers[e]=t.customHeaders[e]);f.body=null;let h;try{let e=(h=yield i.pipeline(f)).response,t=e.status;if(200!==t){let t=new o.RestError(h.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(f),t.response=o.stripResponse(e);let r=h.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${h.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=h.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.TaskCounts;h.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${h.bodyAsText}`);return i.request=o.stripRequest(f),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(h)})}listNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobListNextOptions?t.jobListNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudJobListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}listFromJobScheduleNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobListFromJobScheduleNextOptions?t.jobListFromJobScheduleNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudJobListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}listPreparationAndReleaseTaskStatusNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobListPreparationAndReleaseTaskStatusNextOptions?t.jobListPreparationAndReleaseTaskStatusNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudJobListPreparationAndReleaseTaskStatusResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}getAllLifetimeStatistics(e,t){t||"function"!=typeof e||(t=e,e=void 0);let i=t;if(!t)return this.getAllLifetimeStatisticsWithHttpOperationResponse(e).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getAllLifetimeStatisticsWithHttpOperationResponse(e))((e,t)=>{if(e)return i(e);let r=t.bodyAsJson;return i(e,r,t.request,t.response)})}deleteMethod(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.deleteMethodWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.deleteMethodWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}get(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.getWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}patch(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.patchWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.patchWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}update(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.updateWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.updateWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}disable(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.disableWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.disableWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}enable(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.enableWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.enableWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}terminate(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.terminateWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.terminateWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}add(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.addWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.addWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}list(e,t){t||"function"!=typeof e||(t=e,e=void 0);let i=t;if(!t)return this.listWithHttpOperationResponse(e).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listWithHttpOperationResponse(e))((e,t)=>{if(e)return i(e);let r=t.bodyAsJson;return i(e,r,t.request,t.response)})}listFromJobSchedule(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listFromJobScheduleWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listFromJobScheduleWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}listPreparationAndReleaseTaskStatus(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listPreparationAndReleaseTaskStatusWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listPreparationAndReleaseTaskStatusWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}getTaskCounts(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.getTaskCountsWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getTaskCountsWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}listNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}listFromJobScheduleNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listFromJobScheduleNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listFromJobScheduleNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}listPreparationAndReleaseTaskStatusNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listPreparationAndReleaseTaskStatusNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listPreparationAndReleaseTaskStatusNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}}t.Job=a},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(o,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=i(1),n=i(0),s=o.WebResource;class a{constructor(e){this.client=e}addWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.certificateAddOptions?t.certificateAddOptions:void 0;try{if(null===e||void 0===e)throw new Error("certificate cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let p=this.client.baseUri,c=p+(p.endsWith("/")?"":"/")+"certificates",m=[];m.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&m.push("timeout="+encodeURIComponent(a.toString())),m.length>0&&(c+="?"+m.join("&"));let f=new s;if(f.method="POST",f.url=c,f.headers={},f.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(f.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(f.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(f.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(f.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(f.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(f.headers[e]=t.customHeaders[e]);let h=null,y=null;try{if(null!==e&&void 0!==e){let t=n.CertificateAddParameter;y=i.serializer.serialize(t,e,"certificate"),h=JSON.stringify(y)}}catch(t){let i=new Error(`Error "${t.message}" occurred in serializing the `+`payload - ${JSON.stringify(e,null,2)}.`);return Promise.reject(i)}f.body=h;let g;try{let e=(g=yield i.pipeline(f)).response;if(201!==e.status){let t=new o.RestError(g.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(f),t.response=o.stripResponse(e);let r=g.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${g.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(g)})}listWithHttpOperationResponse(e){return r(this,void 0,void 0,function*(){let t=this.client,i=e&&void 0!==e.certificateListOptions?e.certificateListOptions:void 0;try{if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let r,a,l,d,u,p,c;try{if(null!==i&&void 0!==i&&null!==(r=i.filter)&&void 0!==r&&"string"!=typeof r.valueOf())throw new Error("filter must be of type string.");if(null!==i&&void 0!==i&&null!==(a=i.select)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("select must be of type string.");if(null!==i&&void 0!==i&&null!==(l=i.maxResults)&&void 0!==l&&"number"!=typeof l)throw new Error("maxResults must be of type number.");if(null!==i&&void 0!==i&&null!==(d=i.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==i&&void 0!==i&&null!==(u=i.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==i&&void 0!==i&&null!==(p=i.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==i&&void 0!==i&&(c=i.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let m=this.client.baseUri,f=m+(m.endsWith("/")?"":"/")+"certificates",h=[];h.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==r&&void 0!==r&&h.push("$filter="+encodeURIComponent(r)),null!==a&&void 0!==a&&h.push("$select="+encodeURIComponent(a)),null!==l&&void 0!==l&&h.push("maxresults="+encodeURIComponent(l.toString())),null!==d&&void 0!==d&&h.push("timeout="+encodeURIComponent(d.toString())),h.length>0&&(f+="?"+h.join("&"));let y=new s;if(y.method="GET",y.url=f,y.headers={},y.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(y.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(y.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(y.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(y.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(y.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),e&&e.customHeaders)for(let t in e.customHeaders)e.customHeaders.hasOwnProperty(t)&&(y.headers[t]=e.customHeaders[t]);y.body=null;let g;try{let e=(g=yield t.pipeline(y)).response,i=e.status;if(200!==i){let i=new o.RestError(g.bodyAsText);i.statusCode=e.status,i.request=o.stripRequest(y),i.response=o.stripResponse(e);let r=g.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),i.code=e?e.code:r.code,i.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;i.body=t.serializer.deserialize(e,r,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${g.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}if(200===i){let i=g.bodyAsJson;try{if(null!==i&&void 0!==i){let e=n.CertificateListResult;g.bodyAsJson=t.serializer.deserialize(e,i,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${g.bodyAsText}`);return i.request=o.stripRequest(y),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(g)})}cancelDeletionWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.certificateCancelDeletionOptions?i.certificateCancelDeletionOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("thumbprintAlgorithm cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("thumbprint cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let c=this.client.baseUri,m=c+(c.endsWith("/")?"":"/")+"certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})/canceldelete";m=(m=m.replace("{thumbprintAlgorithm}",encodeURIComponent(e))).replace("{thumbprint}",encodeURIComponent(t));let f=[];f.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&f.push("timeout="+encodeURIComponent(l.toString())),f.length>0&&(m+="?"+f.join("&"));let h=new s;if(h.method="POST",h.url=m,h.headers={},h.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(h.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(h.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(h.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(h.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(h.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(h.headers[e]=i.customHeaders[e]);h.body=null;let y;try{let e=(y=yield r.pipeline(h)).response;if(204!==e.status){let t=new o.RestError(y.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(h),t.response=o.stripResponse(e);let i=y.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${y.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(y)})}deleteMethodWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.certificateDeleteMethodOptions?i.certificateDeleteMethodOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("thumbprintAlgorithm cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("thumbprint cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let c=this.client.baseUri,m=c+(c.endsWith("/")?"":"/")+"certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})";m=(m=m.replace("{thumbprintAlgorithm}",encodeURIComponent(e))).replace("{thumbprint}",encodeURIComponent(t));let f=[];f.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&f.push("timeout="+encodeURIComponent(l.toString())),f.length>0&&(m+="?"+f.join("&"));let h=new s;if(h.method="DELETE",h.url=m,h.headers={},h.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(h.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(h.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(h.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(h.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(h.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(h.headers[e]=i.customHeaders[e]);h.body=null;let y;try{let e=(y=yield r.pipeline(h)).response;if(202!==e.status){let t=new o.RestError(y.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(h),t.response=o.stripResponse(e);let i=y.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${y.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(y)})}getWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.certificateGetOptions?i.certificateGetOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("thumbprintAlgorithm cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("thumbprint cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c;try{if(null!==a&&void 0!==a&&null!==(l=a.select)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("select must be of type string.");if(null!==a&&void 0!==a&&null!==(d=a.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(u=a.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(p=a.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(c=a.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let m=this.client.baseUri,f=m+(m.endsWith("/")?"":"/")+"certificates(thumbprintAlgorithm={thumbprintAlgorithm},thumbprint={thumbprint})";f=(f=f.replace("{thumbprintAlgorithm}",encodeURIComponent(e))).replace("{thumbprint}",encodeURIComponent(t));let h=[];h.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&h.push("$select="+encodeURIComponent(l)),null!==d&&void 0!==d&&h.push("timeout="+encodeURIComponent(d.toString())),h.length>0&&(f+="?"+h.join("&"));let y=new s;if(y.method="GET",y.url=f,y.headers={},y.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(y.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(y.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(y.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(y.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(y.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(y.headers[e]=i.customHeaders[e]);y.body=null;let g;try{let e=(g=yield r.pipeline(y)).response,t=e.status;if(200!==t){let t=new o.RestError(g.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(y),t.response=o.stripResponse(e);let i=g.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${g.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=g.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.Certificate;g.bodyAsJson=r.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${g.bodyAsText}`);return i.request=o.stripRequest(y),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(g)})}listNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.certificateListNextOptions?t.certificateListNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CertificateListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}add(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.addWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.addWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}list(e,t){t||"function"!=typeof e||(t=e,e=void 0);let i=t;if(!t)return this.listWithHttpOperationResponse(e).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listWithHttpOperationResponse(e))((e,t)=>{if(e)return i(e);let r=t.bodyAsJson;return i(e,r,t.request,t.response)})}cancelDeletion(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.cancelDeletionWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.cancelDeletionWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}deleteMethod(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.deleteMethodWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.deleteMethodWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}get(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.getWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}listNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}}t.CertificateOperations=a},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(o,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=i(1),n=i(0),s=o.WebResource;class a{constructor(e){this.client=e}deleteFromTaskWithHttpOperationResponse(e,t,i,a){return r(this,void 0,void 0,function*(){let r=this.client,l=a&&void 0!==a.recursive?a.recursive:void 0,d=a&&void 0!==a.fileDeleteFromTaskOptions?a.fileDeleteFromTaskOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null===i||void 0===i||"string"!=typeof i.valueOf())throw new Error("filePath cannot be null or undefined and it must be of type string.");if(null!==l&&void 0!==l&&"boolean"!=typeof l)throw new Error("recursive must be of type boolean.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let u,p,c,m;try{if(null!==d&&void 0!==d&&null!==(u=d.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==d&&void 0!==d&&null!==(p=d.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==d&&void 0!==d&&null!==(c=d.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==d&&void 0!==d&&(m=d.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}/files/{filePath}";h=(h=(h=h.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t))).replace("{filePath}",encodeURIComponent(i));let y=[];null!==l&&void 0!==l&&y.push("recursive="+encodeURIComponent(l.toString())),y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==u&&void 0!==u&&y.push("timeout="+encodeURIComponent(u.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="DELETE",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(g.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(g.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),a&&a.customHeaders)for(let e in a.customHeaders)a.customHeaders.hasOwnProperty(e)&&(g.headers[e]=a.customHeaders[e]);g.body=null;let v;try{let e=(v=yield r.pipeline(g)).response;if(200!==e.status){let t=new o.RestError(v.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(g),t.response=o.stripResponse(e);let i=v.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}getFromTaskWithHttpOperationResponse(e,t,i,a){return r(this,void 0,void 0,function*(){let r=this.client,l=a&&void 0!==a.fileGetFromTaskOptions?a.fileGetFromTaskOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null===i||void 0===i||"string"!=typeof i.valueOf())throw new Error("filePath cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m,f,h;try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");if(null!==l&&void 0!==l&&null!==(m=l.ocpRange)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ocpRange must be of type string.");if(null!==l&&void 0!==l&&(f=l.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==l&&void 0!==l&&(h=l.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}/files/{filePath}";g=(g=(g=g.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t))).replace("{filePath}",encodeURIComponent(i));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&v.push("timeout="+encodeURIComponent(d.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="GET",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(b.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(b.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),void 0!==m&&null!==m&&(b.headers["ocp-range"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),a&&a.customHeaders)for(let e in a.customHeaders)a.customHeaders.hasOwnProperty(e)&&(b.headers[e]=a.customHeaders[e]);b.body=null,b.rawResponse=!0;let q;try{let e=(q=yield r.pipeline(b)).response,t=e.status;if(200!==t){let i=new o.RestError(`Unexpected status code: ${t}`);i.statusCode=e.status,i.request=o.stripRequest(b),i.response=o.stripResponse(e);let s=q.bodyAsJson;try{if(s){let e=null;s.error&&(e=s.error),i.code=e?e.code:s.code,i.message=e?e.message:s.message}if(null!==s&&void 0!==s){let e=n.BatchError;i.body=r.serializer.deserialize(e,s,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${q.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}}catch(e){return Promise.reject(e)}return Promise.resolve(q)})}getPropertiesFromTaskWithHttpOperationResponse(e,t,i,a){return r(this,void 0,void 0,function*(){let r=this.client,l=a&&void 0!==a.fileGetPropertiesFromTaskOptions?a.fileGetPropertiesFromTaskOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null===i||void 0===i||"string"!=typeof i.valueOf())throw new Error("filePath cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m,f;try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");if(null!==l&&void 0!==l&&(m=l.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==l&&void 0!==l&&(f=l.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}/files/{filePath}";y=(y=(y=y.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t))).replace("{filePath}",encodeURIComponent(i));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&g.push("timeout="+encodeURIComponent(d.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="HEAD",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(v.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(v.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(v.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),a&&a.customHeaders)for(let e in a.customHeaders)a.customHeaders.hasOwnProperty(e)&&(v.headers[e]=a.customHeaders[e]);v.body=null;let b;try{let e=(b=yield r.pipeline(v)).response;if(200!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let i=b.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}deleteFromComputeNodeWithHttpOperationResponse(e,t,i,a){return r(this,void 0,void 0,function*(){let r=this.client,l=a&&void 0!==a.recursive?a.recursive:void 0,d=a&&void 0!==a.fileDeleteFromComputeNodeOptions?a.fileDeleteFromComputeNodeOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===i||void 0===i||"string"!=typeof i.valueOf())throw new Error("filePath cannot be null or undefined and it must be of type string.");if(null!==l&&void 0!==l&&"boolean"!=typeof l)throw new Error("recursive must be of type boolean.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let u,p,c,m;try{if(null!==d&&void 0!==d&&null!==(u=d.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==d&&void 0!==d&&null!==(p=d.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==d&&void 0!==d&&null!==(c=d.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==d&&void 0!==d&&(m=d.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/files/{filePath}";h=(h=(h=h.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t))).replace("{filePath}",encodeURIComponent(i));let y=[];null!==l&&void 0!==l&&y.push("recursive="+encodeURIComponent(l.toString())),y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==u&&void 0!==u&&y.push("timeout="+encodeURIComponent(u.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="DELETE",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(g.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(g.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),a&&a.customHeaders)for(let e in a.customHeaders)a.customHeaders.hasOwnProperty(e)&&(g.headers[e]=a.customHeaders[e]);g.body=null;let v;try{let e=(v=yield r.pipeline(g)).response;if(200!==e.status){let t=new o.RestError(v.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(g),t.response=o.stripResponse(e);let i=v.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}getFromComputeNodeWithHttpOperationResponse(e,t,i,a){return r(this,void 0,void 0,function*(){let r=this.client,l=a&&void 0!==a.fileGetFromComputeNodeOptions?a.fileGetFromComputeNodeOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===i||void 0===i||"string"!=typeof i.valueOf())throw new Error("filePath cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m,f,h;try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");if(null!==l&&void 0!==l&&null!==(m=l.ocpRange)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ocpRange must be of type string.");if(null!==l&&void 0!==l&&(f=l.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==l&&void 0!==l&&(h=l.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/files/{filePath}";g=(g=(g=g.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t))).replace("{filePath}",encodeURIComponent(i));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&v.push("timeout="+encodeURIComponent(d.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="GET",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(b.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(b.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),void 0!==m&&null!==m&&(b.headers["ocp-range"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),a&&a.customHeaders)for(let e in a.customHeaders)a.customHeaders.hasOwnProperty(e)&&(b.headers[e]=a.customHeaders[e]);b.body=null,b.rawResponse=!0;let q;try{let e=(q=yield r.pipeline(b)).response,t=e.status;if(200!==t){let i=new o.RestError(`Unexpected status code: ${t}`);i.statusCode=e.status,i.request=o.stripRequest(b),i.response=o.stripResponse(e);let s=q.bodyAsJson;try{if(s){let e=null;s.error&&(e=s.error),i.code=e?e.code:s.code,i.message=e?e.message:s.message}if(null!==s&&void 0!==s){let e=n.BatchError;i.body=r.serializer.deserialize(e,s,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${q.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}}catch(e){return Promise.reject(e)}return Promise.resolve(q)})}getPropertiesFromComputeNodeWithHttpOperationResponse(e,t,i,a){return r(this,void 0,void 0,function*(){let r=this.client,l=a&&void 0!==a.fileGetPropertiesFromComputeNodeOptions?a.fileGetPropertiesFromComputeNodeOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===i||void 0===i||"string"!=typeof i.valueOf())throw new Error("filePath cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m,f;try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");if(null!==l&&void 0!==l&&(m=l.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==l&&void 0!==l&&(f=l.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/files/{filePath}";y=(y=(y=y.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t))).replace("{filePath}",encodeURIComponent(i));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&g.push("timeout="+encodeURIComponent(d.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="HEAD",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(v.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(v.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(v.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),a&&a.customHeaders)for(let e in a.customHeaders)a.customHeaders.hasOwnProperty(e)&&(v.headers[e]=a.customHeaders[e]);v.body=null;let b;try{let e=(b=yield r.pipeline(v)).response;if(200!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let i=b.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}listFromTaskWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.recursive?i.recursive:void 0,l=i&&void 0!==i.fileListFromTaskOptions?i.fileListFromTaskOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null!==a&&void 0!==a&&"boolean"!=typeof a)throw new Error("recursive must be of type boolean.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m,f;try{if(null!==l&&void 0!==l&&null!==(d=l.filter)&&void 0!==d&&"string"!=typeof d.valueOf())throw new Error("filter must be of type string.");if(null!==l&&void 0!==l&&null!==(u=l.maxResults)&&void 0!==u&&"number"!=typeof u)throw new Error("maxResults must be of type number.");if(null!==l&&void 0!==l&&null!==(p=l.timeout)&&void 0!==p&&"number"!=typeof p)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(c=l.clientRequestId)&&void 0!==c&&("string"!=typeof c.valueOf()||!o.isValidUuid(c)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(m=l.returnClientRequestId)&&void 0!==m&&"boolean"!=typeof m)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(f=l.ocpDate)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}/files";y=(y=y.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t));let g=[];null!==a&&void 0!==a&&g.push("recursive="+encodeURIComponent(a.toString())),g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&g.push("$filter="+encodeURIComponent(d)),null!==u&&void 0!==u&&g.push("maxresults="+encodeURIComponent(u.toString())),null!==p&&void 0!==p&&g.push("timeout="+encodeURIComponent(p.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="GET",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==c&&null!==c&&(v.headers["client-request-id"]=c.toString()),void 0!==m&&null!==m&&(v.headers["return-client-request-id"]=m.toString()),void 0!==f&&null!==f&&(v.headers["ocp-date"]=f instanceof Date?f.toUTCString():f),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(v.headers[e]=i.customHeaders[e]);v.body=null;let b;try{let e=(b=yield r.pipeline(v)).response,t=e.status;if(200!==t){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let i=b.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=b.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.NodeFileListResult;b.bodyAsJson=r.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${b.bodyAsText}`);return i.request=o.stripRequest(v),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}listFromComputeNodeWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.recursive?i.recursive:void 0,l=i&&void 0!==i.fileListFromComputeNodeOptions?i.fileListFromComputeNodeOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null!==a&&void 0!==a&&"boolean"!=typeof a)throw new Error("recursive must be of type boolean.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m,f;try{if(null!==l&&void 0!==l&&null!==(d=l.filter)&&void 0!==d&&"string"!=typeof d.valueOf())throw new Error("filter must be of type string.");if(null!==l&&void 0!==l&&null!==(u=l.maxResults)&&void 0!==u&&"number"!=typeof u)throw new Error("maxResults must be of type number.");if(null!==l&&void 0!==l&&null!==(p=l.timeout)&&void 0!==p&&"number"!=typeof p)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(c=l.clientRequestId)&&void 0!==c&&("string"!=typeof c.valueOf()||!o.isValidUuid(c)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(m=l.returnClientRequestId)&&void 0!==m&&"boolean"!=typeof m)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(f=l.ocpDate)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/files";y=(y=y.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t));let g=[];null!==a&&void 0!==a&&g.push("recursive="+encodeURIComponent(a.toString())),g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&g.push("$filter="+encodeURIComponent(d)),null!==u&&void 0!==u&&g.push("maxresults="+encodeURIComponent(u.toString())),null!==p&&void 0!==p&&g.push("timeout="+encodeURIComponent(p.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="GET",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==c&&null!==c&&(v.headers["client-request-id"]=c.toString()),void 0!==m&&null!==m&&(v.headers["return-client-request-id"]=m.toString()),void 0!==f&&null!==f&&(v.headers["ocp-date"]=f instanceof Date?f.toUTCString():f),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(v.headers[e]=i.customHeaders[e]);v.body=null;let b;try{let e=(b=yield r.pipeline(v)).response,t=e.status;if(200!==t){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let i=b.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=b.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.NodeFileListResult;b.bodyAsJson=r.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${b.bodyAsText}`);return i.request=o.stripRequest(v),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}listFromTaskNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.fileListFromTaskNextOptions?t.fileListFromTaskNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.NodeFileListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}listFromComputeNodeNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.fileListFromComputeNodeNextOptions?t.fileListFromComputeNodeNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.NodeFileListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}deleteFromTask(e,t,i,r,n){n||"function"!=typeof r||(n=r,r=void 0);let s=n;if(!n)return this.deleteFromTaskWithHttpOperationResponse(e,t,i,r).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.deleteFromTaskWithHttpOperationResponse(e,t,i,r))((e,t)=>{if(e)return s(e);let i=t.bodyAsJson;return s(e,i,t.request,t.response)})}getFromTask(e,t,i,r,n){n||"function"!=typeof r||(n=r,r=void 0);let s=n;if(!n)return this.getFromTaskWithHttpOperationResponse(e,t,i,r).then(e=>Promise.resolve(e.response)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getFromTaskWithHttpOperationResponse(e,t,i,r))((e,t)=>{if(e)return s(e);let i=t.response;return s(e,i,t.request,t.response)})}getPropertiesFromTask(e,t,i,r,n){n||"function"!=typeof r||(n=r,r=void 0);let s=n;if(!n)return this.getPropertiesFromTaskWithHttpOperationResponse(e,t,i,r).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getPropertiesFromTaskWithHttpOperationResponse(e,t,i,r))((e,t)=>{if(e)return s(e);let i=t.bodyAsJson;return s(e,i,t.request,t.response)})}deleteFromComputeNode(e,t,i,r,n){n||"function"!=typeof r||(n=r,r=void 0);let s=n;if(!n)return this.deleteFromComputeNodeWithHttpOperationResponse(e,t,i,r).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.deleteFromComputeNodeWithHttpOperationResponse(e,t,i,r))((e,t)=>{if(e)return s(e);let i=t.bodyAsJson;return s(e,i,t.request,t.response)})}getFromComputeNode(e,t,i,r,n){n||"function"!=typeof r||(n=r,r=void 0);let s=n;if(!n)return this.getFromComputeNodeWithHttpOperationResponse(e,t,i,r).then(e=>Promise.resolve(e.response)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getFromComputeNodeWithHttpOperationResponse(e,t,i,r))((e,t)=>{if(e)return s(e);let i=t.response;return s(e,i,t.request,t.response)})}getPropertiesFromComputeNode(e,t,i,r,n){n||"function"!=typeof r||(n=r,r=void 0);let s=n;if(!n)return this.getPropertiesFromComputeNodeWithHttpOperationResponse(e,t,i,r).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getPropertiesFromComputeNodeWithHttpOperationResponse(e,t,i,r))((e,t)=>{if(e)return s(e);let i=t.bodyAsJson;return s(e,i,t.request,t.response)})}listFromTask(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.listFromTaskWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listFromTaskWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}listFromComputeNode(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.listFromComputeNodeWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listFromComputeNodeWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}listFromTaskNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listFromTaskNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listFromTaskNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}listFromComputeNodeNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listFromComputeNodeNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listFromComputeNodeNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}}t.File=a},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(o,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=i(1),n=i(0),s=o.WebResource;class a{constructor(e){this.client=e}existsWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobScheduleExistsOptions?t.jobScheduleExistsOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobScheduleId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobschedules/{jobScheduleId}";y=y.replace("{jobScheduleId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="HEAD",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response,t=e.status;if(200!==t&&404!==t){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}b.bodyAsJson=200===t}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}deleteMethodWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobScheduleDeleteMethodOptions?t.jobScheduleDeleteMethodOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobScheduleId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobschedules/{jobScheduleId}";y=y.replace("{jobScheduleId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="DELETE",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response;if(202!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}getWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobScheduleGetOptions?t.jobScheduleGetOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobScheduleId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f,h,y;try{if(null!==r&&void 0!==r&&null!==(a=r.select)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("select must be of type string.");if(null!==r&&void 0!==r&&null!==(l=r.expand)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("expand must be of type string.");if(null!==r&&void 0!==r&&null!==(d=r.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(u=r.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(p=r.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(c=r.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(m=r.ifMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(f=r.ifNoneMatch)&&void 0!==f&&"string"!=typeof f.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(h=r.ifModifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(y=r.ifUnmodifiedSince)&&!(y instanceof Date||"string"==typeof y.valueOf()&&!isNaN(Date.parse(y))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let g=this.client.baseUri,v=g+(g.endsWith("/")?"":"/")+"jobschedules/{jobScheduleId}";v=v.replace("{jobScheduleId}",encodeURIComponent(e));let b=[];b.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&b.push("$select="+encodeURIComponent(a)),null!==l&&void 0!==l&&b.push("$expand="+encodeURIComponent(l)),null!==d&&void 0!==d&&b.push("timeout="+encodeURIComponent(d.toString())),b.length>0&&(v+="?"+b.join("&"));let q=new s;if(q.method="GET",q.url=v,q.headers={},q.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(q.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(q.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(q.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(q.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(q.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),void 0!==m&&null!==m&&(q.headers["If-Match"]=m),void 0!==f&&null!==f&&(q.headers["If-None-Match"]=f),void 0!==h&&null!==h&&(q.headers["If-Modified-Since"]=h instanceof Date?h.toUTCString():h),void 0!==y&&null!==y&&(q.headers["If-Unmodified-Since"]=y instanceof Date?y.toUTCString():y),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(q.headers[e]=t.customHeaders[e]);q.body=null;let N;try{let e=(N=yield i.pipeline(q)).response,t=e.status;if(200!==t){let t=new o.RestError(N.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(q),t.response=o.stripResponse(e);let r=N.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${N.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=N.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudJobSchedule;N.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${N.bodyAsText}`);return i.request=o.stripRequest(q),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(N)})}patchWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.jobSchedulePatchOptions?i.jobSchedulePatchOptions:void 0;null!==t&&void 0!==t||(t={});try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobScheduleId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("jobSchedulePatchParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"jobschedules/{jobScheduleId}";g=g.replace("{jobScheduleId}",encodeURIComponent(e));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="PATCH",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);let q=null,N=null;try{if(null!==t&&void 0!==t){let e=n.JobSchedulePatchParameter;N=r.serializer.serialize(e,t,"jobSchedulePatchParameter"),q=JSON.stringify(N)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}b.body=q;let R;try{let e=(R=yield r.pipeline(b)).response;if(200!==e.status){let t=new o.RestError(R.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=R.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${R.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(R)})}updateWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.jobScheduleUpdateOptions?i.jobScheduleUpdateOptions:void 0;null!==t&&void 0!==t||(t={});try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobScheduleId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("jobScheduleUpdateParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"jobschedules/{jobScheduleId}";g=g.replace("{jobScheduleId}",encodeURIComponent(e));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="PUT",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);let q=null,N=null;try{if(null!==t&&void 0!==t){let e=n.JobScheduleUpdateParameter;N=r.serializer.serialize(e,t,"jobScheduleUpdateParameter"),q=JSON.stringify(N)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}b.body=q;let R;try{let e=(R=yield r.pipeline(b)).response;if(200!==e.status){let t=new o.RestError(R.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=R.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${R.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(R)})}disableWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobScheduleDisableOptions?t.jobScheduleDisableOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobScheduleId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobschedules/{jobScheduleId}/disable";y=y.replace("{jobScheduleId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="POST",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response;if(204!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}enableWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobScheduleEnableOptions?t.jobScheduleEnableOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobScheduleId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobschedules/{jobScheduleId}/enable";y=y.replace("{jobScheduleId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="POST",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response;if(204!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}terminateWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobScheduleTerminateOptions?t.jobScheduleTerminateOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobScheduleId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.");if(null!==r&&void 0!==r&&null!==(p=r.ifMatch)&&void 0!==p&&"string"!=typeof p.valueOf())throw new Error("ifMatch must be of type string.");if(null!==r&&void 0!==r&&null!==(c=r.ifNoneMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==r&&void 0!==r&&(m=r.ifModifiedSince)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ifModifiedSince must be of type date.");if(null!==r&&void 0!==r&&(f=r.ifUnmodifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobschedules/{jobScheduleId}/terminate";y=y.replace("{jobScheduleId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("timeout="+encodeURIComponent(a.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="POST",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(v.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(v.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(v.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),void 0!==p&&null!==p&&(v.headers["If-Match"]=p),void 0!==c&&null!==c&&(v.headers["If-None-Match"]=c),void 0!==m&&null!==m&&(v.headers["If-Modified-Since"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(v.headers["If-Unmodified-Since"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response;if(202!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}addWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobScheduleAddOptions?t.jobScheduleAddOptions:void 0;null!==e&&void 0!==e||(e={});try{if(null===e||void 0===e)throw new Error("cloudJobSchedule cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u;try{if(null!==r&&void 0!==r&&null!==(a=r.timeout)&&void 0!==a&&"number"!=typeof a)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(l=r.clientRequestId)&&void 0!==l&&("string"!=typeof l.valueOf()||!o.isValidUuid(l)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(d=r.returnClientRequestId)&&void 0!==d&&"boolean"!=typeof d)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(u=r.ocpDate)&&!(u instanceof Date||"string"==typeof u.valueOf()&&!isNaN(Date.parse(u))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let p=this.client.baseUri,c=p+(p.endsWith("/")?"":"/")+"jobschedules",m=[];m.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&m.push("timeout="+encodeURIComponent(a.toString())),m.length>0&&(c+="?"+m.join("&"));let f=new s;if(f.method="POST",f.url=c,f.headers={},f.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(f.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(f.headers["accept-language"]=this.client.acceptLanguage),void 0!==l&&null!==l&&(f.headers["client-request-id"]=l.toString()),void 0!==d&&null!==d&&(f.headers["return-client-request-id"]=d.toString()),void 0!==u&&null!==u&&(f.headers["ocp-date"]=u instanceof Date?u.toUTCString():u),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(f.headers[e]=t.customHeaders[e]);let h=null,y=null;try{if(null!==e&&void 0!==e){let t=n.JobScheduleAddParameter;y=i.serializer.serialize(t,e,"cloudJobSchedule"),h=JSON.stringify(y)}}catch(t){let i=new Error(`Error "${t.message}" occurred in serializing the `+`payload - ${JSON.stringify(e,null,2)}.`);return Promise.reject(i)}f.body=h;let g;try{let e=(g=yield i.pipeline(f)).response;if(201!==e.status){let t=new o.RestError(g.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(f),t.response=o.stripResponse(e);let r=g.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${g.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(g)})}listWithHttpOperationResponse(e){return r(this,void 0,void 0,function*(){let t=this.client,i=e&&void 0!==e.jobScheduleListOptions?e.jobScheduleListOptions:void 0;try{if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let r,a,l,d,u,p,c,m;try{if(null!==i&&void 0!==i&&null!==(r=i.filter)&&void 0!==r&&"string"!=typeof r.valueOf())throw new Error("filter must be of type string.");if(null!==i&&void 0!==i&&null!==(a=i.select)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("select must be of type string.");if(null!==i&&void 0!==i&&null!==(l=i.expand)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("expand must be of type string.");if(null!==i&&void 0!==i&&null!==(d=i.maxResults)&&void 0!==d&&"number"!=typeof d)throw new Error("maxResults must be of type number.");if(null!==i&&void 0!==i&&null!==(u=i.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==i&&void 0!==i&&null!==(p=i.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==i&&void 0!==i&&null!==(c=i.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==i&&void 0!==i&&(m=i.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"jobschedules",y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==r&&void 0!==r&&y.push("$filter="+encodeURIComponent(r)),null!==a&&void 0!==a&&y.push("$select="+encodeURIComponent(a)),null!==l&&void 0!==l&&y.push("$expand="+encodeURIComponent(l)),null!==d&&void 0!==d&&y.push("maxresults="+encodeURIComponent(d.toString())),null!==u&&void 0!==u&&y.push("timeout="+encodeURIComponent(u.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="GET",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(g.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(g.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),e&&e.customHeaders)for(let t in e.customHeaders)e.customHeaders.hasOwnProperty(t)&&(g.headers[t]=e.customHeaders[t]);g.body=null;let v;try{let e=(v=yield t.pipeline(g)).response,i=e.status;if(200!==i){let i=new o.RestError(v.bodyAsText);i.statusCode=e.status,i.request=o.stripRequest(g),i.response=o.stripResponse(e);let r=v.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),i.code=e?e.code:r.code,i.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;i.body=t.serializer.deserialize(e,r,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}if(200===i){let i=v.bodyAsJson;try{if(null!==i&&void 0!==i){let e=n.CloudJobScheduleListResult;v.bodyAsJson=t.serializer.deserialize(e,i,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${v.bodyAsText}`);return i.request=o.stripRequest(g),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}listNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.jobScheduleListNextOptions?t.jobScheduleListNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudJobScheduleListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}exists(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.existsWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.existsWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}deleteMethod(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.deleteMethodWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.deleteMethodWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}get(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.getWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}patch(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.patchWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.patchWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}update(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.updateWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.updateWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}disable(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.disableWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.disableWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}enable(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.enableWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.enableWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}terminate(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.terminateWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.terminateWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}add(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.addWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.addWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}list(e,t){t||"function"!=typeof e||(t=e,e=void 0);let i=t;if(!t)return this.listWithHttpOperationResponse(e).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listWithHttpOperationResponse(e))((e,t)=>{if(e)return i(e);let r=t.bodyAsJson;return i(e,r,t.request,t.response)})}listNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}}t.JobSchedule=a},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(o,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=i(1),n=i(0),s=o.WebResource;class a{constructor(e){this.client=e}addWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.taskAddOptions?i.taskAddOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t)throw new Error("task cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let c=this.client.baseUri,m=c+(c.endsWith("/")?"":"/")+"jobs/{jobId}/tasks";m=m.replace("{jobId}",encodeURIComponent(e));let f=[];f.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&f.push("timeout="+encodeURIComponent(l.toString())),f.length>0&&(m+="?"+f.join("&"));let h=new s;if(h.method="POST",h.url=m,h.headers={},h.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(h.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(h.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(h.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(h.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(h.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(h.headers[e]=i.customHeaders[e]);let y=null,g=null;try{if(null!==t&&void 0!==t){let e=n.TaskAddParameter;g=r.serializer.serialize(e,t,"task"),y=JSON.stringify(g)}}catch(e){let i=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(t,null,2)}.`);return Promise.reject(i)}h.body=y;let v;try{let e=(v=yield r.pipeline(h)).response;if(201!==e.status){let t=new o.RestError(v.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(h),t.response=o.stripResponse(e);let i=v.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}listWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.taskListOptions?t.taskListOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m,f;try{if(null!==r&&void 0!==r&&null!==(a=r.filter)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("filter must be of type string.");if(null!==r&&void 0!==r&&null!==(l=r.select)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("select must be of type string.");if(null!==r&&void 0!==r&&null!==(d=r.expand)&&void 0!==d&&"string"!=typeof d.valueOf())throw new Error("expand must be of type string.");if(null!==r&&void 0!==r&&null!==(u=r.maxResults)&&void 0!==u&&"number"!=typeof u)throw new Error("maxResults must be of type number.");if(null!==r&&void 0!==r&&null!==(p=r.timeout)&&void 0!==p&&"number"!=typeof p)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(c=r.clientRequestId)&&void 0!==c&&("string"!=typeof c.valueOf()||!o.isValidUuid(c)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(m=r.returnClientRequestId)&&void 0!==m&&"boolean"!=typeof m)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(f=r.ocpDate)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let h=this.client.baseUri,y=h+(h.endsWith("/")?"":"/")+"jobs/{jobId}/tasks";y=y.replace("{jobId}",encodeURIComponent(e));let g=[];g.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&g.push("$filter="+encodeURIComponent(a)),null!==l&&void 0!==l&&g.push("$select="+encodeURIComponent(l)),null!==d&&void 0!==d&&g.push("$expand="+encodeURIComponent(d)),null!==u&&void 0!==u&&g.push("maxresults="+encodeURIComponent(u.toString())),null!==p&&void 0!==p&&g.push("timeout="+encodeURIComponent(p.toString())),g.length>0&&(y+="?"+g.join("&"));let v=new s;if(v.method="GET",v.url=y,v.headers={},v.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(v.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(v.headers["accept-language"]=this.client.acceptLanguage),void 0!==c&&null!==c&&(v.headers["client-request-id"]=c.toString()),void 0!==m&&null!==m&&(v.headers["return-client-request-id"]=m.toString()),void 0!==f&&null!==f&&(v.headers["ocp-date"]=f instanceof Date?f.toUTCString():f),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(v.headers[e]=t.customHeaders[e]);v.body=null;let b;try{let e=(b=yield i.pipeline(v)).response,t=e.status;if(200!==t){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(v),t.response=o.stripResponse(e);let r=b.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=b.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudTaskListResult;b.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${b.bodyAsText}`);return i.request=o.stripRequest(v),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}addCollectionWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.taskAddCollectionOptions?i.taskAddCollectionOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==t&&void 0!==t&&t.length>100)throw new Error('"value" should satisfy the constraint - "MaxItems": 100');if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c={};try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");null!==t&&void 0!==t&&(c.value=t)}catch(e){return Promise.reject(e)}let m=this.client.baseUri,f=m+(m.endsWith("/")?"":"/")+"jobs/{jobId}/addtaskcollection";f=f.replace("{jobId}",encodeURIComponent(e));let h=[];h.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&h.push("timeout="+encodeURIComponent(l.toString())),h.length>0&&(f+="?"+h.join("&"));let y=new s;if(y.method="POST",y.url=f,y.headers={},y.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(y.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(y.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(y.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(y.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(y.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(y.headers[e]=i.customHeaders[e]);let g=null,v=null;try{if(null!==c&&void 0!==c){let e=n.TaskAddCollectionParameter;v=r.serializer.serialize(e,c,"taskCollection"),g=JSON.stringify(v)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(c,null,2)}.`);return Promise.reject(t)}y.body=g;let b;try{let e=(b=yield r.pipeline(y)).response,t=e.status;if(200!==t){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(y),t.response=o.stripResponse(e);let i=b.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=b.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.TaskAddCollectionResult;b.bodyAsJson=r.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${b.bodyAsText}`);return i.request=o.stripRequest(y),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}deleteMethodWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.taskDeleteMethodOptions?i.taskDeleteMethodOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}";g=(g=g.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="DELETE",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);b.body=null;let q;try{let e=(q=yield r.pipeline(b)).response;if(200!==e.status){let t=new o.RestError(q.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=q.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${q.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(q)})}getWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.taskGetOptions?i.taskGetOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h,y,g;try{if(null!==a&&void 0!==a&&null!==(l=a.select)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("select must be of type string.");if(null!==a&&void 0!==a&&null!==(d=a.expand)&&void 0!==d&&"string"!=typeof d.valueOf())throw new Error("expand must be of type string.");if(null!==a&&void 0!==a&&null!==(u=a.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(p=a.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(c=a.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(m=a.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(f=a.ifMatch)&&void 0!==f&&"string"!=typeof f.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(h=a.ifNoneMatch)&&void 0!==h&&"string"!=typeof h.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(y=a.ifModifiedSince)&&!(y instanceof Date||"string"==typeof y.valueOf()&&!isNaN(Date.parse(y))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(g=a.ifUnmodifiedSince)&&!(g instanceof Date||"string"==typeof g.valueOf()&&!isNaN(Date.parse(g))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let v=this.client.baseUri,b=v+(v.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}";b=(b=b.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t));let q=[];q.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&q.push("$select="+encodeURIComponent(l)),null!==d&&void 0!==d&&q.push("$expand="+encodeURIComponent(d)),null!==u&&void 0!==u&&q.push("timeout="+encodeURIComponent(u.toString())),q.length>0&&(b+="?"+q.join("&"));let N=new s;if(N.method="GET",N.url=b,N.headers={},N.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(N.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(N.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(N.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(N.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(N.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),void 0!==f&&null!==f&&(N.headers["If-Match"]=f),void 0!==h&&null!==h&&(N.headers["If-None-Match"]=h),void 0!==y&&null!==y&&(N.headers["If-Modified-Since"]=y instanceof Date?y.toUTCString():y),void 0!==g&&null!==g&&(N.headers["If-Unmodified-Since"]=g instanceof Date?g.toUTCString():g),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(N.headers[e]=i.customHeaders[e]);N.body=null;let R;try{let e=(R=yield r.pipeline(N)).response,t=e.status;if(200!==t){let t=new o.RestError(R.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(N),t.response=o.stripResponse(e);let i=R.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${R.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=R.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudTask;R.bodyAsJson=r.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${R.bodyAsText}`);return i.request=o.stripRequest(N),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(R)})}updateWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.constraints?i.constraints:void 0,l=i&&void 0!==i.taskUpdateOptions?i.taskUpdateOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m,f,h,y,g={};try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");if(null!==l&&void 0!==l&&null!==(m=l.ifMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifMatch must be of type string.");if(null!==l&&void 0!==l&&null!==(f=l.ifNoneMatch)&&void 0!==f&&"string"!=typeof f.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==l&&void 0!==l&&(h=l.ifModifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifModifiedSince must be of type date.");if(null!==l&&void 0!==l&&(y=l.ifUnmodifiedSince)&&!(y instanceof Date||"string"==typeof y.valueOf()&&!isNaN(Date.parse(y))))throw new Error("ifUnmodifiedSince must be of type date.");null!==a&&void 0!==a&&(g.constraints=a)}catch(e){return Promise.reject(e)}let v=this.client.baseUri,b=v+(v.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}";b=(b=b.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t));let q=[];q.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&q.push("timeout="+encodeURIComponent(d.toString())),q.length>0&&(b+="?"+q.join("&"));let N=new s;if(N.method="PUT",N.url=b,N.headers={},N.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(N.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(N.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(N.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(N.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(N.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),void 0!==m&&null!==m&&(N.headers["If-Match"]=m),void 0!==f&&null!==f&&(N.headers["If-None-Match"]=f),void 0!==h&&null!==h&&(N.headers["If-Modified-Since"]=h instanceof Date?h.toUTCString():h),void 0!==y&&null!==y&&(N.headers["If-Unmodified-Since"]=y instanceof Date?y.toUTCString():y),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(N.headers[e]=i.customHeaders[e]);let R=null,C=null;try{if(null!==g&&void 0!==g){let e=n.TaskUpdateParameter;C=r.serializer.serialize(e,g,"taskUpdateParameter"),R=JSON.stringify(C)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(g,null,2)}.`);return Promise.reject(t)}N.body=R;let w;try{let e=(w=yield r.pipeline(N)).response;if(200!==e.status){let t=new o.RestError(w.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(N),t.response=o.stripResponse(e);let i=w.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${w.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(w)})}listSubtasksWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.taskListSubtasksOptions?i.taskListSubtasksOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c;try{if(null!==a&&void 0!==a&&null!==(l=a.select)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("select must be of type string.");if(null!==a&&void 0!==a&&null!==(d=a.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(u=a.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(p=a.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(c=a.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let m=this.client.baseUri,f=m+(m.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}/subtasksinfo";f=(f=f.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t));let h=[];h.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&h.push("$select="+encodeURIComponent(l)),null!==d&&void 0!==d&&h.push("timeout="+encodeURIComponent(d.toString())),h.length>0&&(f+="?"+h.join("&"));let y=new s;if(y.method="GET",y.url=f,y.headers={},y.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(y.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(y.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(y.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(y.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(y.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(y.headers[e]=i.customHeaders[e]);y.body=null;let g;try{let e=(g=yield r.pipeline(y)).response,t=e.status;if(200!==t){let t=new o.RestError(g.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(y),t.response=o.stripResponse(e);let i=g.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${g.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=g.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudTaskListSubtasksResult;g.bodyAsJson=r.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${g.bodyAsText}`);return i.request=o.stripRequest(y),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(g)})}terminateWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.taskTerminateOptions?i.taskTerminateOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}/terminate";g=(g=g.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="POST",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);b.body=null;let q;try{let e=(q=yield r.pipeline(b)).response;if(204!==e.status){let t=new o.RestError(q.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=q.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${q.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(q)})}reactivateWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.taskReactivateOptions?i.taskReactivateOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("jobId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("taskId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c,m,f,h;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.");if(null!==a&&void 0!==a&&null!==(c=a.ifMatch)&&void 0!==c&&"string"!=typeof c.valueOf())throw new Error("ifMatch must be of type string.");if(null!==a&&void 0!==a&&null!==(m=a.ifNoneMatch)&&void 0!==m&&"string"!=typeof m.valueOf())throw new Error("ifNoneMatch must be of type string.");if(null!==a&&void 0!==a&&(f=a.ifModifiedSince)&&!(f instanceof Date||"string"==typeof f.valueOf()&&!isNaN(Date.parse(f))))throw new Error("ifModifiedSince must be of type date.");if(null!==a&&void 0!==a&&(h=a.ifUnmodifiedSince)&&!(h instanceof Date||"string"==typeof h.valueOf()&&!isNaN(Date.parse(h))))throw new Error("ifUnmodifiedSince must be of type date.")}catch(e){return Promise.reject(e)}let y=this.client.baseUri,g=y+(y.endsWith("/")?"":"/")+"jobs/{jobId}/tasks/{taskId}/reactivate";g=(g=g.replace("{jobId}",encodeURIComponent(e))).replace("{taskId}",encodeURIComponent(t));let v=[];v.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&v.push("timeout="+encodeURIComponent(l.toString())),v.length>0&&(g+="?"+v.join("&"));let b=new s;if(b.method="POST",b.url=g,b.headers={},b.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(b.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(b.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(b.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(b.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(b.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),void 0!==c&&null!==c&&(b.headers["If-Match"]=c),void 0!==m&&null!==m&&(b.headers["If-None-Match"]=m),void 0!==f&&null!==f&&(b.headers["If-Modified-Since"]=f instanceof Date?f.toUTCString():f),void 0!==h&&null!==h&&(b.headers["If-Unmodified-Since"]=h instanceof Date?h.toUTCString():h),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(b.headers[e]=i.customHeaders[e]);b.body=null;let q;try{let e=(q=yield r.pipeline(b)).response;if(204!==e.status){let t=new o.RestError(q.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(b),t.response=o.stripResponse(e);let i=q.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${q.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(q)})}listNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.taskListNextOptions?t.taskListNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.CloudTaskListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}add(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.addWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.addWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}list(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}addCollection(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.addCollectionWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.addCollectionWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}deleteMethod(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.deleteMethodWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.deleteMethodWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}get(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.getWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}update(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.updateWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.updateWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}listSubtasks(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.listSubtasksWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listSubtasksWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}terminate(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.terminateWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.terminateWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}reactivate(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.reactivateWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.reactivateWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}listNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}}t.Task=a},function(e,t,i){"use strict";var r=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(o,n){function s(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r.throw(e))}catch(e){n(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(s,a)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const o=i(1),n=i(0),s=o.WebResource;class a{constructor(e){this.client=e}addUserWithHttpOperationResponse(e,t,i,a){return r(this,void 0,void 0,function*(){let r=this.client,l=a&&void 0!==a.computeNodeAddUserOptions?a.computeNodeAddUserOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===i||void 0===i)throw new Error("user cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c;try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let m=this.client.baseUri,f=m+(m.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/users";f=(f=f.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t));let h=[];h.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&h.push("timeout="+encodeURIComponent(d.toString())),h.length>0&&(f+="?"+h.join("&"));let y=new s;if(y.method="POST",y.url=f,y.headers={},y.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(y.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(y.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(y.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(y.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(y.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),a&&a.customHeaders)for(let e in a.customHeaders)a.customHeaders.hasOwnProperty(e)&&(y.headers[e]=a.customHeaders[e]);let g=null,v=null;try{if(null!==i&&void 0!==i){let e=n.ComputeNodeUser;v=r.serializer.serialize(e,i,"user"),g=JSON.stringify(v)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(i,null,2)}.`);return Promise.reject(t)}y.body=g;let b;try{let e=(b=yield r.pipeline(y)).response;if(201!==e.status){let t=new o.RestError(b.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(y),t.response=o.stripResponse(e);let i=b.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${b.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(b)})}deleteUserWithHttpOperationResponse(e,t,i,a){return r(this,void 0,void 0,function*(){let r=this.client,l=a&&void 0!==a.computeNodeDeleteUserOptions?a.computeNodeDeleteUserOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===i||void 0===i||"string"!=typeof i.valueOf())throw new Error("userName cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c;try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let m=this.client.baseUri,f=m+(m.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/users/{userName}";f=(f=(f=f.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t))).replace("{userName}",encodeURIComponent(i));let h=[];h.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&h.push("timeout="+encodeURIComponent(d.toString())),h.length>0&&(f+="?"+h.join("&"));let y=new s;if(y.method="DELETE",y.url=f,y.headers={},y.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(y.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(y.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(y.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(y.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(y.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),a&&a.customHeaders)for(let e in a.customHeaders)a.customHeaders.hasOwnProperty(e)&&(y.headers[e]=a.customHeaders[e]);y.body=null;let g;try{let e=(g=yield r.pipeline(y)).response;if(200!==e.status){let t=new o.RestError(g.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(y),t.response=o.stripResponse(e);let i=g.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${g.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(g)})}updateUserWithHttpOperationResponse(e,t,i,a,l){return r(this,void 0,void 0,function*(){let r=this.client,d=l&&void 0!==l.computeNodeUpdateUserOptions?l.computeNodeUpdateUserOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===i||void 0===i||"string"!=typeof i.valueOf())throw new Error("userName cannot be null or undefined and it must be of type string.");if(null===a||void 0===a)throw new Error("nodeUpdateUserParameter cannot be null or undefined.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let u,p,c,m;try{if(null!==d&&void 0!==d&&null!==(u=d.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==d&&void 0!==d&&null!==(p=d.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==d&&void 0!==d&&null!==(c=d.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==d&&void 0!==d&&(m=d.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/users/{userName}";h=(h=(h=h.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t))).replace("{userName}",encodeURIComponent(i));let y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==u&&void 0!==u&&y.push("timeout="+encodeURIComponent(u.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="PUT",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(g.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(g.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),l&&l.customHeaders)for(let e in l.customHeaders)l.customHeaders.hasOwnProperty(e)&&(g.headers[e]=l.customHeaders[e]);let v=null,b=null;try{if(null!==a&&void 0!==a){let e=n.NodeUpdateUserParameter;b=r.serializer.serialize(e,a,"nodeUpdateUserParameter"),v=JSON.stringify(b)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(a,null,2)}.`);return Promise.reject(t)}g.body=v;let q;try{let e=(q=yield r.pipeline(g)).response;if(200!==e.status){let t=new o.RestError(q.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(g),t.response=o.stripResponse(e);let i=q.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${q.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(q)})}getWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.computeNodeGetOptions?i.computeNodeGetOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p,c;try{if(null!==a&&void 0!==a&&null!==(l=a.select)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("select must be of type string.");if(null!==a&&void 0!==a&&null!==(d=a.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(u=a.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(p=a.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(c=a.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let m=this.client.baseUri,f=m+(m.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}";f=(f=f.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t));let h=[];h.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&h.push("$select="+encodeURIComponent(l)),null!==d&&void 0!==d&&h.push("timeout="+encodeURIComponent(d.toString())),h.length>0&&(f+="?"+h.join("&"));let y=new s;if(y.method="GET",y.url=f,y.headers={},y.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(y.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(y.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(y.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(y.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(y.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(y.headers[e]=i.customHeaders[e]);y.body=null;let g;try{let e=(g=yield r.pipeline(y)).response,t=e.status;if(200!==t){let t=new o.RestError(g.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(y),t.response=o.stripResponse(e);let i=g.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${g.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=g.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.ComputeNode;g.bodyAsJson=r.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${g.bodyAsText}`);return i.request=o.stripRequest(y),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(g)})}rebootWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.nodeRebootOption?i.nodeRebootOption:void 0,l=i&&void 0!==i.computeNodeRebootOptions?i.computeNodeRebootOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(a){let e=["requeue","terminate","taskCompletion","retainedData"];if(!e.some(function(e){return e===a}))throw new Error(a+" is not a valid value. The valid values are: "+e)}if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m;try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");null!==a&&void 0!==a&&((m={}).nodeRebootOption=a)}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/reboot";h=(h=h.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t));let y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&y.push("timeout="+encodeURIComponent(d.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="POST",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(g.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(g.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(g.headers[e]=i.customHeaders[e]);let v=null,b=null;try{if(null!==m&&void 0!==m){let e=n.NodeRebootParameter;b=r.serializer.serialize(e,m,"nodeRebootParameter"),v=JSON.stringify(b)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(m,null,2)}.`);return Promise.reject(t)}g.body=v;let q;try{let e=(q=yield r.pipeline(g)).response;if(202!==e.status){let t=new o.RestError(q.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(g),t.response=o.stripResponse(e);let i=q.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${q.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(q)})}reimageWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.nodeReimageOption?i.nodeReimageOption:void 0,l=i&&void 0!==i.computeNodeReimageOptions?i.computeNodeReimageOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(a){let e=["requeue","terminate","taskCompletion","retainedData"];if(!e.some(function(e){return e===a}))throw new Error(a+" is not a valid value. The valid values are: "+e)}if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m;try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");null!==a&&void 0!==a&&((m={}).nodeReimageOption=a)}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/reimage";h=(h=h.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t));let y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&y.push("timeout="+encodeURIComponent(d.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="POST",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(g.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(g.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(g.headers[e]=i.customHeaders[e]);let v=null,b=null;try{if(null!==m&&void 0!==m){let e=n.NodeReimageParameter;b=r.serializer.serialize(e,m,"nodeReimageParameter"),v=JSON.stringify(b)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(m,null,2)}.`);return Promise.reject(t)}g.body=v;let q;try{let e=(q=yield r.pipeline(g)).response;if(202!==e.status){let t=new o.RestError(q.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(g),t.response=o.stripResponse(e);let i=q.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${q.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(q)})}disableSchedulingWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.nodeDisableSchedulingOption?i.nodeDisableSchedulingOption:void 0,l=i&&void 0!==i.computeNodeDisableSchedulingOptions?i.computeNodeDisableSchedulingOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(a){let e=["requeue","terminate","taskCompletion"];if(!e.some(function(e){return e===a}))throw new Error(a+" is not a valid value. The valid values are: "+e)}if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let d,u,p,c,m;try{if(null!==l&&void 0!==l&&null!==(d=l.timeout)&&void 0!==d&&"number"!=typeof d)throw new Error("timeout must be of type number.");if(null!==l&&void 0!==l&&null!==(u=l.clientRequestId)&&void 0!==u&&("string"!=typeof u.valueOf()||!o.isValidUuid(u)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==l&&void 0!==l&&null!==(p=l.returnClientRequestId)&&void 0!==p&&"boolean"!=typeof p)throw new Error("returnClientRequestId must be of type boolean.");if(null!==l&&void 0!==l&&(c=l.ocpDate)&&!(c instanceof Date||"string"==typeof c.valueOf()&&!isNaN(Date.parse(c))))throw new Error("ocpDate must be of type date.");null!==a&&void 0!==a&&((m={}).nodeDisableSchedulingOption=a)}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/disablescheduling";h=(h=h.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t));let y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==d&&void 0!==d&&y.push("timeout="+encodeURIComponent(d.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="POST",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==u&&null!==u&&(g.headers["client-request-id"]=u.toString()),void 0!==p&&null!==p&&(g.headers["return-client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["ocp-date"]=c instanceof Date?c.toUTCString():c),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(g.headers[e]=i.customHeaders[e]);let v=null,b=null;try{if(null!==m&&void 0!==m){let e=n.NodeDisableSchedulingParameter;b=r.serializer.serialize(e,m,"nodeDisableSchedulingParameter"),v=JSON.stringify(b)}}catch(e){let t=new Error(`Error "${e.message}" occurred in serializing the `+`payload - ${JSON.stringify(m,null,2)}.`);return Promise.reject(t)}g.body=v;let q;try{let e=(q=yield r.pipeline(g)).response;if(200!==e.status){let t=new o.RestError(q.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(g),t.response=o.stripResponse(e);let i=q.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${q.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(q)})}enableSchedulingWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.computeNodeEnableSchedulingOptions?i.computeNodeEnableSchedulingOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let c=this.client.baseUri,m=c+(c.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/enablescheduling";m=(m=m.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t));let f=[];f.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&f.push("timeout="+encodeURIComponent(l.toString())),f.length>0&&(m+="?"+f.join("&"));let h=new s;if(h.method="POST",h.url=m,h.headers={},h.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(h.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(h.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(h.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(h.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(h.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(h.headers[e]=i.customHeaders[e]);h.body=null;let y;try{let e=(y=yield r.pipeline(h)).response;if(200!==e.status){let t=new o.RestError(y.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(h),t.response=o.stripResponse(e);let i=y.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${y.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}}catch(e){return Promise.reject(e)}return Promise.resolve(y)})}getRemoteLoginSettingsWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.computeNodeGetRemoteLoginSettingsOptions?i.computeNodeGetRemoteLoginSettingsOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let c=this.client.baseUri,m=c+(c.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/remoteloginsettings";m=(m=m.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t));let f=[];f.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&f.push("timeout="+encodeURIComponent(l.toString())),f.length>0&&(m+="?"+f.join("&"));let h=new s;if(h.method="GET",h.url=m,h.headers={},h.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(h.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(h.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(h.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(h.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(h.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(h.headers[e]=i.customHeaders[e]);h.body=null;let y;try{let e=(y=yield r.pipeline(h)).response,t=e.status;if(200!==t){let t=new o.RestError(y.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(h),t.response=o.stripResponse(e);let i=y.bodyAsJson;try{if(i){let e=null;i.error&&(e=i.error),t.code=e?e.code:i.code,t.message=e?e.message:i.message}if(null!==i&&void 0!==i){let e=n.BatchError;t.body=r.serializer.deserialize(e,i,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${y.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=y.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.ComputeNodeGetRemoteLoginSettingsResult;y.bodyAsJson=r.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${y.bodyAsText}`);return i.request=o.stripRequest(h),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(y)})}getRemoteDesktopWithHttpOperationResponse(e,t,i){return r(this,void 0,void 0,function*(){let r=this.client,a=i&&void 0!==i.computeNodeGetRemoteDesktopOptions?i.computeNodeGetRemoteDesktopOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===t||void 0===t||"string"!=typeof t.valueOf())throw new Error("nodeId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let l,d,u,p;try{if(null!==a&&void 0!==a&&null!==(l=a.timeout)&&void 0!==l&&"number"!=typeof l)throw new Error("timeout must be of type number.");if(null!==a&&void 0!==a&&null!==(d=a.clientRequestId)&&void 0!==d&&("string"!=typeof d.valueOf()||!o.isValidUuid(d)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==a&&void 0!==a&&null!==(u=a.returnClientRequestId)&&void 0!==u&&"boolean"!=typeof u)throw new Error("returnClientRequestId must be of type boolean.");if(null!==a&&void 0!==a&&(p=a.ocpDate)&&!(p instanceof Date||"string"==typeof p.valueOf()&&!isNaN(Date.parse(p))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let c=this.client.baseUri,m=c+(c.endsWith("/")?"":"/")+"pools/{poolId}/nodes/{nodeId}/rdp";m=(m=m.replace("{poolId}",encodeURIComponent(e))).replace("{nodeId}",encodeURIComponent(t));let f=[];f.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==l&&void 0!==l&&f.push("timeout="+encodeURIComponent(l.toString())),f.length>0&&(m+="?"+f.join("&"));let h=new s;if(h.method="GET",h.url=m,h.headers={},h.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(h.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(h.headers["accept-language"]=this.client.acceptLanguage),void 0!==d&&null!==d&&(h.headers["client-request-id"]=d.toString()),void 0!==u&&null!==u&&(h.headers["return-client-request-id"]=u.toString()),void 0!==p&&null!==p&&(h.headers["ocp-date"]=p instanceof Date?p.toUTCString():p),i&&i.customHeaders)for(let e in i.customHeaders)i.customHeaders.hasOwnProperty(e)&&(h.headers[e]=i.customHeaders[e]);h.body=null,h.rawResponse=!0;let y;try{let e=(y=yield r.pipeline(h)).response,t=e.status;if(200!==t){let i=new o.RestError(`Unexpected status code: ${t}`);i.statusCode=e.status,i.request=o.stripRequest(h),i.response=o.stripResponse(e);let s=y.bodyAsJson;try{if(s){let e=null;s.error&&(e=s.error),i.code=e?e.code:s.code,i.message=e?e.message:s.message}if(null!==s&&void 0!==s){let e=n.BatchError;i.body=r.serializer.deserialize(e,s,"error.body")}}catch(e){return i.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${y.bodyAsText}" for the default response.`,Promise.reject(i)}return Promise.reject(i)}}catch(e){return Promise.reject(e)}return Promise.resolve(y)})}listWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.computeNodeListOptions?t.computeNodeListOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("poolId cannot be null or undefined and it must be of type string.");if(null===this.client.apiVersion||void 0===this.client.apiVersion||"string"!=typeof this.client.apiVersion.valueOf())throw new Error("this.client.apiVersion cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d,u,p,c,m;try{if(null!==r&&void 0!==r&&null!==(a=r.filter)&&void 0!==a&&"string"!=typeof a.valueOf())throw new Error("filter must be of type string.");if(null!==r&&void 0!==r&&null!==(l=r.select)&&void 0!==l&&"string"!=typeof l.valueOf())throw new Error("select must be of type string.");if(null!==r&&void 0!==r&&null!==(d=r.maxResults)&&void 0!==d&&"number"!=typeof d)throw new Error("maxResults must be of type number.");if(null!==r&&void 0!==r&&null!==(u=r.timeout)&&void 0!==u&&"number"!=typeof u)throw new Error("timeout must be of type number.");if(null!==r&&void 0!==r&&null!==(p=r.clientRequestId)&&void 0!==p&&("string"!=typeof p.valueOf()||!o.isValidUuid(p)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(c=r.returnClientRequestId)&&void 0!==c&&"boolean"!=typeof c)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(m=r.ocpDate)&&!(m instanceof Date||"string"==typeof m.valueOf()&&!isNaN(Date.parse(m))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let f=this.client.baseUri,h=f+(f.endsWith("/")?"":"/")+"pools/{poolId}/nodes";h=h.replace("{poolId}",encodeURIComponent(e));let y=[];y.push("api-version="+encodeURIComponent(this.client.apiVersion)),null!==a&&void 0!==a&&y.push("$filter="+encodeURIComponent(a)),null!==l&&void 0!==l&&y.push("$select="+encodeURIComponent(l)),null!==d&&void 0!==d&&y.push("maxresults="+encodeURIComponent(d.toString())),null!==u&&void 0!==u&&y.push("timeout="+encodeURIComponent(u.toString())),y.length>0&&(h+="?"+y.join("&"));let g=new s;if(g.method="GET",g.url=h,g.headers={},g.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(g.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(g.headers["accept-language"]=this.client.acceptLanguage),void 0!==p&&null!==p&&(g.headers["client-request-id"]=p.toString()),void 0!==c&&null!==c&&(g.headers["return-client-request-id"]=c.toString()),void 0!==m&&null!==m&&(g.headers["ocp-date"]=m instanceof Date?m.toUTCString():m),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(g.headers[e]=t.customHeaders[e]);g.body=null;let v;try{let e=(v=yield i.pipeline(g)).response,t=e.status;if(200!==t){let t=new o.RestError(v.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(g),t.response=o.stripResponse(e);let r=v.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${v.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=v.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.ComputeNodeListResult;v.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${v.bodyAsText}`);return i.request=o.stripRequest(g),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(v)})}listNextWithHttpOperationResponse(e,t){return r(this,void 0,void 0,function*(){let i=this.client,r=t&&void 0!==t.computeNodeListNextOptions?t.computeNodeListNextOptions:void 0;try{if(null===e||void 0===e||"string"!=typeof e.valueOf())throw new Error("nextPageLink cannot be null or undefined and it must be of type string.");if(null!==this.client.acceptLanguage&&void 0!==this.client.acceptLanguage&&"string"!=typeof this.client.acceptLanguage.valueOf())throw new Error("this.client.acceptLanguage must be of type string.")}catch(e){return Promise.reject(e)}let a,l,d;try{if(null!==r&&void 0!==r&&null!==(a=r.clientRequestId)&&void 0!==a&&("string"!=typeof a.valueOf()||!o.isValidUuid(a)))throw new Error("clientRequestId must be of type string and must be a valid string.");if(null!==r&&void 0!==r&&null!==(l=r.returnClientRequestId)&&void 0!==l&&"boolean"!=typeof l)throw new Error("returnClientRequestId must be of type boolean.");if(null!==r&&void 0!==r&&(d=r.ocpDate)&&!(d instanceof Date||"string"==typeof d.valueOf()&&!isNaN(Date.parse(d))))throw new Error("ocpDate must be of type date.")}catch(e){return Promise.reject(e)}let u="{nextLink}";u=u.replace("{nextLink}",e);let p=new s;if(p.method="GET",p.url=u,p.headers={},p.headers["Content-Type"]="application/json; odata=minimalmetadata; charset=utf-8",this.client.generateClientRequestId&&(p.headers["client-request-id"]=o.generateUuid()),void 0!==this.client.acceptLanguage&&null!==this.client.acceptLanguage&&(p.headers["accept-language"]=this.client.acceptLanguage),void 0!==a&&null!==a&&(p.headers["client-request-id"]=a.toString()),void 0!==l&&null!==l&&(p.headers["return-client-request-id"]=l.toString()),void 0!==d&&null!==d&&(p.headers["ocp-date"]=d instanceof Date?d.toUTCString():d),t&&t.customHeaders)for(let e in t.customHeaders)t.customHeaders.hasOwnProperty(e)&&(p.headers[e]=t.customHeaders[e]);p.body=null;let c;try{let e=(c=yield i.pipeline(p)).response,t=e.status;if(200!==t){let t=new o.RestError(c.bodyAsText);t.statusCode=e.status,t.request=o.stripRequest(p),t.response=o.stripResponse(e);let r=c.bodyAsJson;try{if(r){let e=null;r.error&&(e=r.error),t.code=e?e.code:r.code,t.message=e?e.message:r.message}if(null!==r&&void 0!==r){let e=n.BatchError;t.body=i.serializer.deserialize(e,r,"error.body")}}catch(e){return t.message=`Error "${e.message}" occurred in deserializing the responseBody `+`- "${c.bodyAsText}" for the default response.`,Promise.reject(t)}return Promise.reject(t)}if(200===t){let t=c.bodyAsJson;try{if(null!==t&&void 0!==t){let e=n.ComputeNodeListResult;c.bodyAsJson=i.serializer.deserialize(e,t,"operationRes.bodyAsJson")}}catch(t){let i=new o.RestError(`Error ${t} occurred in deserializing the responseBody - ${c.bodyAsText}`);return i.request=o.stripRequest(p),i.response=o.stripResponse(e),Promise.reject(i)}}}catch(e){return Promise.reject(e)}return Promise.resolve(c)})}addUser(e,t,i,r,n){n||"function"!=typeof r||(n=r,r=void 0);let s=n;if(!n)return this.addUserWithHttpOperationResponse(e,t,i,r).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.addUserWithHttpOperationResponse(e,t,i,r))((e,t)=>{if(e)return s(e);let i=t.bodyAsJson;return s(e,i,t.request,t.response)})}deleteUser(e,t,i,r,n){n||"function"!=typeof r||(n=r,r=void 0);let s=n;if(!n)return this.deleteUserWithHttpOperationResponse(e,t,i,r).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.deleteUserWithHttpOperationResponse(e,t,i,r))((e,t)=>{if(e)return s(e);let i=t.bodyAsJson;return s(e,i,t.request,t.response)})}updateUser(e,t,i,r,n,s){s||"function"!=typeof n||(s=n,n=void 0);let a=s;if(!s)return this.updateUserWithHttpOperationResponse(e,t,i,r,n).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.updateUserWithHttpOperationResponse(e,t,i,r,n))((e,t)=>{if(e)return a(e);let i=t.bodyAsJson;return a(e,i,t.request,t.response)})}get(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.getWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}reboot(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.rebootWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.rebootWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}reimage(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.reimageWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.reimageWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}disableScheduling(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.disableSchedulingWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.disableSchedulingWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}enableScheduling(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.enableSchedulingWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.enableSchedulingWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}getRemoteLoginSettings(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.getRemoteLoginSettingsWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getRemoteLoginSettingsWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.bodyAsJson;return n(e,i,t.request,t.response)})}getRemoteDesktop(e,t,i,r){r||"function"!=typeof i||(r=i,i=void 0);let n=r;if(!r)return this.getRemoteDesktopWithHttpOperationResponse(e,t,i).then(e=>Promise.resolve(e.response)).catch(e=>Promise.reject(e));o.promiseToCallback(this.getRemoteDesktopWithHttpOperationResponse(e,t,i))((e,t)=>{if(e)return n(e);let i=t.response;return n(e,i,t.request,t.response)})}list(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}listNext(e,t,i){i||"function"!=typeof t||(i=t,t=void 0);let r=i;if(!i)return this.listNextWithHttpOperationResponse(e,t).then(e=>Promise.resolve(e.bodyAsJson)).catch(e=>Promise.reject(e));o.promiseToCallback(this.listNextWithHttpOperationResponse(e,t))((e,t)=>{if(e)return r(e);let i=t.bodyAsJson;return r(e,i,t.request,t.response)})}}t.ComputeNodeOperations=a}]);