@azure/arm-databox 3.0.0 → 5.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +72 -73
  4. package/dist/index.js +5592 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/dataBoxManagementClient.d.ts +29 -0
  9. package/dist-esm/src/dataBoxManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/dataBoxManagementClient.js +89 -0
  11. package/dist-esm/src/dataBoxManagementClient.js.map +1 -0
  12. package/dist-esm/src/index.d.ts +5 -0
  13. package/dist-esm/src/index.d.ts.map +1 -0
  14. package/dist-esm/src/index.js +12 -0
  15. package/dist-esm/src/index.js.map +1 -0
  16. package/dist-esm/src/lroImpl.d.ts +16 -0
  17. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  18. package/dist-esm/src/lroImpl.js +29 -0
  19. package/dist-esm/src/lroImpl.js.map +1 -0
  20. package/dist-esm/src/models/index.d.ts +2157 -0
  21. package/dist-esm/src/models/index.d.ts.map +1 -0
  22. package/dist-esm/src/models/index.js +168 -0
  23. package/dist-esm/src/models/index.js.map +1 -0
  24. package/dist-esm/src/models/mappers.d.ts +163 -0
  25. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  26. package/dist-esm/src/models/mappers.js +3911 -0
  27. package/dist-esm/src/models/mappers.js.map +1 -0
  28. package/dist-esm/src/models/parameters.d.ts +24 -0
  29. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  30. package/dist-esm/src/models/parameters.js +176 -0
  31. package/dist-esm/src/models/parameters.js.map +1 -0
  32. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  33. package/dist-esm/src/operations/index.d.ts.map +1 -0
  34. package/dist-esm/src/operations/index.js +11 -0
  35. package/dist-esm/src/operations/index.js.map +1 -0
  36. package/dist-esm/src/operations/jobs.d.ts +161 -0
  37. package/dist-esm/src/operations/jobs.d.ts.map +1 -0
  38. package/dist-esm/src/operations/jobs.js +687 -0
  39. package/dist-esm/src/operations/jobs.js.map +1 -0
  40. package/dist-esm/src/operations/operations.d.ts +32 -0
  41. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  42. package/dist-esm/src/operations/operations.js +120 -0
  43. package/dist-esm/src/operations/operations.js.map +1 -0
  44. package/dist-esm/src/operations/service.d.ts +83 -0
  45. package/dist-esm/src/operations/service.d.ts.map +1 -0
  46. package/dist-esm/src/operations/service.js +307 -0
  47. package/dist-esm/src/operations/service.js.map +1 -0
  48. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  49. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  50. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  51. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  52. package/dist-esm/src/operationsInterfaces/jobs.d.ts +115 -0
  53. package/dist-esm/src/operationsInterfaces/jobs.d.ts.map +1 -0
  54. package/dist-esm/src/operationsInterfaces/jobs.js +9 -0
  55. package/dist-esm/src/operationsInterfaces/jobs.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  57. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  58. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  59. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/service.d.ts +54 -0
  61. package/dist-esm/src/operationsInterfaces/service.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/service.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/service.js.map +1 -0
  64. package/dist-esm/test/sampleTest.d.ts +2 -0
  65. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  66. package/dist-esm/test/sampleTest.js +40 -0
  67. package/dist-esm/test/sampleTest.js.map +1 -0
  68. package/package.json +65 -31
  69. package/review/arm-databox.api.md +1376 -0
  70. package/rollup.config.js +181 -30
  71. package/src/dataBoxManagementClient.ts +113 -29
  72. package/src/index.ts +12 -0
  73. package/src/lroImpl.ts +34 -0
  74. package/src/models/index.ts +1924 -1354
  75. package/src/models/mappers.ts +3160 -1086
  76. package/src/models/parameters.ts +144 -54
  77. package/src/operations/index.ts +3 -5
  78. package/src/operations/jobs.ts +702 -480
  79. package/src/operations/operations.ts +89 -75
  80. package/src/operations/service.ts +342 -127
  81. package/src/operationsInterfaces/index.ts +11 -0
  82. package/src/operationsInterfaces/jobs.ts +205 -0
  83. package/src/operationsInterfaces/operations.ts +22 -0
  84. package/src/operationsInterfaces/service.ts +107 -0
  85. package/tsconfig.json +3 -3
  86. package/types/arm-databox.d.ts +2558 -0
  87. package/types/tsdoc-metadata.json +11 -0
  88. package/dist/arm-databox.js +0 -3090
  89. package/dist/arm-databox.js.map +0 -1
  90. package/dist/arm-databox.min.js +0 -1
  91. package/dist/arm-databox.min.js.map +0 -1
  92. package/esm/dataBoxManagementClient.d.ts +0 -20
  93. package/esm/dataBoxManagementClient.d.ts.map +0 -1
  94. package/esm/dataBoxManagementClient.js +0 -35
  95. package/esm/dataBoxManagementClient.js.map +0 -1
  96. package/esm/dataBoxManagementClientContext.d.ts +0 -16
  97. package/esm/dataBoxManagementClientContext.d.ts.map +0 -1
  98. package/esm/dataBoxManagementClientContext.js +0 -57
  99. package/esm/dataBoxManagementClientContext.js.map +0 -1
  100. package/esm/models/index.d.ts +0 -1754
  101. package/esm/models/index.d.ts.map +0 -1
  102. package/esm/models/index.js +0 -8
  103. package/esm/models/index.js.map +0 -1
  104. package/esm/models/jobsMappers.d.ts +0 -2
  105. package/esm/models/jobsMappers.d.ts.map +0 -1
  106. package/esm/models/jobsMappers.js +0 -9
  107. package/esm/models/jobsMappers.js.map +0 -1
  108. package/esm/models/mappers.d.ts +0 -75
  109. package/esm/models/mappers.d.ts.map +0 -1
  110. package/esm/models/mappers.js +0 -2020
  111. package/esm/models/mappers.js.map +0 -1
  112. package/esm/models/operationsMappers.d.ts +0 -2
  113. package/esm/models/operationsMappers.d.ts.map +0 -1
  114. package/esm/models/operationsMappers.js +0 -9
  115. package/esm/models/operationsMappers.js.map +0 -1
  116. package/esm/models/parameters.d.ts +0 -12
  117. package/esm/models/parameters.d.ts.map +0 -1
  118. package/esm/models/parameters.js +0 -122
  119. package/esm/models/parameters.js.map +0 -1
  120. package/esm/models/serviceMappers.d.ts +0 -2
  121. package/esm/models/serviceMappers.d.ts.map +0 -1
  122. package/esm/models/serviceMappers.js +0 -9
  123. package/esm/models/serviceMappers.js.map +0 -1
  124. package/esm/operations/index.d.ts.map +0 -1
  125. package/esm/operations/index.js +0 -13
  126. package/esm/operations/index.js.map +0 -1
  127. package/esm/operations/jobs.d.ts +0 -245
  128. package/esm/operations/jobs.d.ts.map +0 -1
  129. package/esm/operations/jobs.js +0 -444
  130. package/esm/operations/jobs.js.map +0 -1
  131. package/esm/operations/operations.d.ts +0 -46
  132. package/esm/operations/operations.d.ts.map +0 -1
  133. package/esm/operations/operations.js +0 -77
  134. package/esm/operations/operations.js.map +0 -1
  135. package/esm/operations/service.d.ts +0 -79
  136. package/esm/operations/service.d.ts.map +0 -1
  137. package/esm/operations/service.js +0 -126
  138. package/esm/operations/service.js.map +0 -1
  139. package/src/dataBoxManagementClientContext.ts +0 -69
  140. package/src/models/jobsMappers.ts +0 -55
  141. package/src/models/operationsMappers.ts +0 -15
  142. package/src/models/serviceMappers.ts +0 -22
@@ -1,688 +1,910 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as msRestAzure from "@azure/ms-rest-azure-js";
13
- import * as Models from "../models";
14
- import * as Mappers from "../models/jobsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Jobs } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
15
13
  import * as Parameters from "../models/parameters";
16
- import { DataBoxManagementClientContext } from "../dataBoxManagementClientContext";
14
+ import { DataBoxManagementClient } from "../dataBoxManagementClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ JobResource,
19
+ JobsListNextOptionalParams,
20
+ JobsListOptionalParams,
21
+ JobsListByResourceGroupNextOptionalParams,
22
+ JobsListByResourceGroupOptionalParams,
23
+ UnencryptedCredentials,
24
+ JobsListCredentialsOptionalParams,
25
+ JobsListResponse,
26
+ MarkDevicesShippedRequest,
27
+ JobsMarkDevicesShippedOptionalParams,
28
+ JobsListByResourceGroupResponse,
29
+ JobsGetOptionalParams,
30
+ JobsGetResponse,
31
+ JobsCreateOptionalParams,
32
+ JobsCreateResponse,
33
+ JobsDeleteOptionalParams,
34
+ JobResourceUpdateParameter,
35
+ JobsUpdateOptionalParams,
36
+ JobsUpdateResponse,
37
+ ShipmentPickUpRequest,
38
+ JobsBookShipmentPickUpOptionalParams,
39
+ JobsBookShipmentPickUpResponse,
40
+ CancellationReason,
41
+ JobsCancelOptionalParams,
42
+ JobsListCredentialsResponse,
43
+ JobsListNextResponse,
44
+ JobsListByResourceGroupNextResponse
45
+ } from "../models";
17
46
 
18
- /** Class representing a Jobs. */
19
- export class Jobs {
20
- private readonly client: DataBoxManagementClientContext;
47
+ /// <reference lib="esnext.asynciterable" />
48
+ /** Class containing Jobs operations. */
49
+ export class JobsImpl implements Jobs {
50
+ private readonly client: DataBoxManagementClient;
21
51
 
22
52
  /**
23
- * Create a Jobs.
24
- * @param {DataBoxManagementClientContext} client Reference to the service client.
53
+ * Initialize a new instance of the class Jobs class.
54
+ * @param client Reference to the service client
25
55
  */
26
- constructor(client: DataBoxManagementClientContext) {
56
+ constructor(client: DataBoxManagementClient) {
27
57
  this.client = client;
28
58
  }
29
59
 
30
60
  /**
31
61
  * Lists all the jobs available under the subscription.
32
- * @param [options] The optional parameters
33
- * @returns Promise<Models.JobsListResponse>
62
+ * @param options The options parameters.
34
63
  */
35
- list(options?: Models.JobsListOptionalParams): Promise<Models.JobsListResponse>;
36
- /**
37
- * @param callback The callback
38
- */
39
- list(callback: msRest.ServiceCallback<Models.JobResourceList>): void;
40
- /**
41
- * @param options The optional parameters
42
- * @param callback The callback
43
- */
44
- list(options: Models.JobsListOptionalParams, callback: msRest.ServiceCallback<Models.JobResourceList>): void;
45
- list(options?: Models.JobsListOptionalParams | msRest.ServiceCallback<Models.JobResourceList>, callback?: msRest.ServiceCallback<Models.JobResourceList>): Promise<Models.JobsListResponse> {
46
- return this.client.sendOperationRequest(
47
- {
48
- options
64
+ public list(
65
+ options?: JobsListOptionalParams
66
+ ): PagedAsyncIterableIterator<JobResource> {
67
+ const iter = this.listPagingAll(options);
68
+ return {
69
+ next() {
70
+ return iter.next();
71
+ },
72
+ [Symbol.asyncIterator]() {
73
+ return this;
49
74
  },
50
- listOperationSpec,
51
- callback) as Promise<Models.JobsListResponse>;
75
+ byPage: () => {
76
+ return this.listPagingPage(options);
77
+ }
78
+ };
79
+ }
80
+
81
+ private async *listPagingPage(
82
+ options?: JobsListOptionalParams
83
+ ): AsyncIterableIterator<JobResource[]> {
84
+ let result = await this._list(options);
85
+ yield result.value || [];
86
+ let continuationToken = result.nextLink;
87
+ while (continuationToken) {
88
+ result = await this._listNext(continuationToken, options);
89
+ continuationToken = result.nextLink;
90
+ yield result.value || [];
91
+ }
92
+ }
93
+
94
+ private async *listPagingAll(
95
+ options?: JobsListOptionalParams
96
+ ): AsyncIterableIterator<JobResource> {
97
+ for await (const page of this.listPagingPage(options)) {
98
+ yield* page;
99
+ }
52
100
  }
53
101
 
54
102
  /**
55
103
  * Lists all the jobs available under the given resource group.
56
104
  * @param resourceGroupName The Resource Group Name
57
- * @param [options] The optional parameters
58
- * @returns Promise<Models.JobsListByResourceGroupResponse>
59
- */
60
- listByResourceGroup(resourceGroupName: string, options?: Models.JobsListByResourceGroupOptionalParams): Promise<Models.JobsListByResourceGroupResponse>;
61
- /**
62
- * @param resourceGroupName The Resource Group Name
63
- * @param callback The callback
64
- */
65
- listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback<Models.JobResourceList>): void;
66
- /**
67
- * @param resourceGroupName The Resource Group Name
68
- * @param options The optional parameters
69
- * @param callback The callback
105
+ * @param options The options parameters.
70
106
  */
71
- listByResourceGroup(resourceGroupName: string, options: Models.JobsListByResourceGroupOptionalParams, callback: msRest.ServiceCallback<Models.JobResourceList>): void;
72
- listByResourceGroup(resourceGroupName: string, options?: Models.JobsListByResourceGroupOptionalParams | msRest.ServiceCallback<Models.JobResourceList>, callback?: msRest.ServiceCallback<Models.JobResourceList>): Promise<Models.JobsListByResourceGroupResponse> {
73
- return this.client.sendOperationRequest(
74
- {
75
- resourceGroupName,
76
- options
107
+ public listByResourceGroup(
108
+ resourceGroupName: string,
109
+ options?: JobsListByResourceGroupOptionalParams
110
+ ): PagedAsyncIterableIterator<JobResource> {
111
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
112
+ return {
113
+ next() {
114
+ return iter.next();
115
+ },
116
+ [Symbol.asyncIterator]() {
117
+ return this;
77
118
  },
78
- listByResourceGroupOperationSpec,
79
- callback) as Promise<Models.JobsListByResourceGroupResponse>;
119
+ byPage: () => {
120
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
121
+ }
122
+ };
80
123
  }
81
124
 
82
- /**
83
- * Gets information about the specified job.
84
- * @param resourceGroupName The Resource Group Name
85
- * @param jobName The name of the job Resource within the specified resource group. job names must
86
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
87
- * @param [options] The optional parameters
88
- * @returns Promise<Models.JobsGetResponse>
89
- */
90
- get(resourceGroupName: string, jobName: string, options?: Models.JobsGetOptionalParams): Promise<Models.JobsGetResponse>;
91
- /**
92
- * @param resourceGroupName The Resource Group Name
93
- * @param jobName The name of the job Resource within the specified resource group. job names must
94
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
95
- * @param callback The callback
96
- */
97
- get(resourceGroupName: string, jobName: string, callback: msRest.ServiceCallback<Models.JobResource>): void;
98
- /**
99
- * @param resourceGroupName The Resource Group Name
100
- * @param jobName The name of the job Resource within the specified resource group. job names must
101
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
102
- * @param options The optional parameters
103
- * @param callback The callback
104
- */
105
- get(resourceGroupName: string, jobName: string, options: Models.JobsGetOptionalParams, callback: msRest.ServiceCallback<Models.JobResource>): void;
106
- get(resourceGroupName: string, jobName: string, options?: Models.JobsGetOptionalParams | msRest.ServiceCallback<Models.JobResource>, callback?: msRest.ServiceCallback<Models.JobResource>): Promise<Models.JobsGetResponse> {
107
- return this.client.sendOperationRequest(
108
- {
125
+ private async *listByResourceGroupPagingPage(
126
+ resourceGroupName: string,
127
+ options?: JobsListByResourceGroupOptionalParams
128
+ ): AsyncIterableIterator<JobResource[]> {
129
+ let result = await this._listByResourceGroup(resourceGroupName, options);
130
+ yield result.value || [];
131
+ let continuationToken = result.nextLink;
132
+ while (continuationToken) {
133
+ result = await this._listByResourceGroupNext(
109
134
  resourceGroupName,
110
- jobName,
135
+ continuationToken,
111
136
  options
112
- },
113
- getOperationSpec,
114
- callback) as Promise<Models.JobsGetResponse>;
137
+ );
138
+ continuationToken = result.nextLink;
139
+ yield result.value || [];
140
+ }
115
141
  }
116
142
 
117
- /**
118
- * Creates a new job with the specified parameters. Existing job cannot be updated with this API
119
- * and should instead be updated with the Update job API.
120
- * @param resourceGroupName The Resource Group Name
121
- * @param jobName The name of the job Resource within the specified resource group. job names must
122
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
123
- * @param jobResource Job details from request body.
124
- * @param [options] The optional parameters
125
- * @returns Promise<Models.JobsCreateResponse>
126
- */
127
- create(resourceGroupName: string, jobName: string, jobResource: Models.JobResource, options?: msRest.RequestOptionsBase): Promise<Models.JobsCreateResponse> {
128
- return this.beginCreate(resourceGroupName,jobName,jobResource,options)
129
- .then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.JobsCreateResponse>;
143
+ private async *listByResourceGroupPagingAll(
144
+ resourceGroupName: string,
145
+ options?: JobsListByResourceGroupOptionalParams
146
+ ): AsyncIterableIterator<JobResource> {
147
+ for await (const page of this.listByResourceGroupPagingPage(
148
+ resourceGroupName,
149
+ options
150
+ )) {
151
+ yield* page;
152
+ }
130
153
  }
131
154
 
132
155
  /**
133
- * Deletes a job.
156
+ * This method gets the unencrypted secrets related to the job.
134
157
  * @param resourceGroupName The Resource Group Name
135
- * @param jobName The name of the job Resource within the specified resource group. job names must
136
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
137
- * @param [options] The optional parameters
138
- * @returns Promise<msRest.RestResponse>
158
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
159
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
160
+ * @param options The options parameters.
139
161
  */
140
- deleteMethod(resourceGroupName: string, jobName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse> {
141
- return this.beginDeleteMethod(resourceGroupName,jobName,options)
142
- .then(lroPoller => lroPoller.pollUntilFinished());
162
+ public listCredentials(
163
+ resourceGroupName: string,
164
+ jobName: string,
165
+ options?: JobsListCredentialsOptionalParams
166
+ ): PagedAsyncIterableIterator<UnencryptedCredentials> {
167
+ const iter = this.listCredentialsPagingAll(
168
+ resourceGroupName,
169
+ jobName,
170
+ options
171
+ );
172
+ return {
173
+ next() {
174
+ return iter.next();
175
+ },
176
+ [Symbol.asyncIterator]() {
177
+ return this;
178
+ },
179
+ byPage: () => {
180
+ return this.listCredentialsPagingPage(
181
+ resourceGroupName,
182
+ jobName,
183
+ options
184
+ );
185
+ }
186
+ };
143
187
  }
144
188
 
145
- /**
146
- * Updates the properties of an existing job.
147
- * @param resourceGroupName The Resource Group Name
148
- * @param jobName The name of the job Resource within the specified resource group. job names must
149
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
150
- * @param jobResourceUpdateParameter Job update parameters from request body.
151
- * @param [options] The optional parameters
152
- * @returns Promise<Models.JobsUpdateResponse>
153
- */
154
- update(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: Models.JobResourceUpdateParameter, options?: Models.JobsUpdateOptionalParams): Promise<Models.JobsUpdateResponse> {
155
- return this.beginUpdate(resourceGroupName,jobName,jobResourceUpdateParameter,options)
156
- .then(lroPoller => lroPoller.pollUntilFinished()) as Promise<Models.JobsUpdateResponse>;
189
+ private async *listCredentialsPagingPage(
190
+ resourceGroupName: string,
191
+ jobName: string,
192
+ options?: JobsListCredentialsOptionalParams
193
+ ): AsyncIterableIterator<UnencryptedCredentials[]> {
194
+ let result = await this._listCredentials(
195
+ resourceGroupName,
196
+ jobName,
197
+ options
198
+ );
199
+ yield result.value || [];
200
+ }
201
+
202
+ private async *listCredentialsPagingAll(
203
+ resourceGroupName: string,
204
+ jobName: string,
205
+ options?: JobsListCredentialsOptionalParams
206
+ ): AsyncIterableIterator<UnencryptedCredentials> {
207
+ for await (const page of this.listCredentialsPagingPage(
208
+ resourceGroupName,
209
+ jobName,
210
+ options
211
+ )) {
212
+ yield* page;
213
+ }
157
214
  }
158
215
 
159
216
  /**
160
- * Book shipment pick up.
161
- * @param resourceGroupName The Resource Group Name
162
- * @param jobName The name of the job Resource within the specified resource group. job names must
163
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
164
- * @param shipmentPickUpRequest Details of shipment pick up request.
165
- * @param [options] The optional parameters
166
- * @returns Promise<Models.JobsBookShipmentPickUpResponse>
167
- */
168
- bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: Models.ShipmentPickUpRequest, options?: msRest.RequestOptionsBase): Promise<Models.JobsBookShipmentPickUpResponse>;
169
- /**
170
- * @param resourceGroupName The Resource Group Name
171
- * @param jobName The name of the job Resource within the specified resource group. job names must
172
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
173
- * @param shipmentPickUpRequest Details of shipment pick up request.
174
- * @param callback The callback
217
+ * Lists all the jobs available under the subscription.
218
+ * @param options The options parameters.
175
219
  */
176
- bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: Models.ShipmentPickUpRequest, callback: msRest.ServiceCallback<Models.ShipmentPickUpResponse>): void;
220
+ private _list(options?: JobsListOptionalParams): Promise<JobsListResponse> {
221
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
222
+ }
223
+
177
224
  /**
225
+ * Request to mark devices for a given job as shipped
226
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
227
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
178
228
  * @param resourceGroupName The Resource Group Name
179
- * @param jobName The name of the job Resource within the specified resource group. job names must
180
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
181
- * @param shipmentPickUpRequest Details of shipment pick up request.
182
- * @param options The optional parameters
183
- * @param callback The callback
229
+ * @param markDevicesShippedRequest Mark Devices Shipped Request
230
+ * @param options The options parameters.
184
231
  */
185
- bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: Models.ShipmentPickUpRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ShipmentPickUpResponse>): void;
186
- bookShipmentPickUp(resourceGroupName: string, jobName: string, shipmentPickUpRequest: Models.ShipmentPickUpRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ShipmentPickUpResponse>, callback?: msRest.ServiceCallback<Models.ShipmentPickUpResponse>): Promise<Models.JobsBookShipmentPickUpResponse> {
232
+ markDevicesShipped(
233
+ jobName: string,
234
+ resourceGroupName: string,
235
+ markDevicesShippedRequest: MarkDevicesShippedRequest,
236
+ options?: JobsMarkDevicesShippedOptionalParams
237
+ ): Promise<void> {
187
238
  return this.client.sendOperationRequest(
188
- {
189
- resourceGroupName,
190
- jobName,
191
- shipmentPickUpRequest,
192
- options
193
- },
194
- bookShipmentPickUpOperationSpec,
195
- callback) as Promise<Models.JobsBookShipmentPickUpResponse>;
239
+ { jobName, resourceGroupName, markDevicesShippedRequest, options },
240
+ markDevicesShippedOperationSpec
241
+ );
196
242
  }
197
243
 
198
244
  /**
199
- * CancelJob.
200
- * @param resourceGroupName The Resource Group Name
201
- * @param jobName The name of the job Resource within the specified resource group. job names must
202
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
203
- * @param reason Reason for cancellation.
204
- * @param [options] The optional parameters
205
- * @returns Promise<msRest.RestResponse>
206
- */
207
- cancel(resourceGroupName: string, jobName: string, reason: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
208
- /**
209
- * @param resourceGroupName The Resource Group Name
210
- * @param jobName The name of the job Resource within the specified resource group. job names must
211
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
212
- * @param reason Reason for cancellation.
213
- * @param callback The callback
214
- */
215
- cancel(resourceGroupName: string, jobName: string, reason: string, callback: msRest.ServiceCallback<void>): void;
216
- /**
245
+ * Lists all the jobs available under the given resource group.
217
246
  * @param resourceGroupName The Resource Group Name
218
- * @param jobName The name of the job Resource within the specified resource group. job names must
219
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
220
- * @param reason Reason for cancellation.
221
- * @param options The optional parameters
222
- * @param callback The callback
247
+ * @param options The options parameters.
223
248
  */
224
- cancel(resourceGroupName: string, jobName: string, reason: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
225
- cancel(resourceGroupName: string, jobName: string, reason: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
249
+ private _listByResourceGroup(
250
+ resourceGroupName: string,
251
+ options?: JobsListByResourceGroupOptionalParams
252
+ ): Promise<JobsListByResourceGroupResponse> {
226
253
  return this.client.sendOperationRequest(
227
- {
228
- resourceGroupName,
229
- jobName,
230
- reason,
231
- options
232
- },
233
- cancelOperationSpec,
234
- callback);
254
+ { resourceGroupName, options },
255
+ listByResourceGroupOperationSpec
256
+ );
235
257
  }
236
258
 
237
259
  /**
238
- * This method gets the unencrypted secrets related to the job.
260
+ * Gets information about the specified job.
239
261
  * @param resourceGroupName The Resource Group Name
240
- * @param jobName The name of the job Resource within the specified resource group. job names must
241
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
242
- * @param [options] The optional parameters
243
- * @returns Promise<Models.JobsListCredentialsResponse>
262
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
263
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
264
+ * @param options The options parameters.
244
265
  */
245
- listCredentials(resourceGroupName: string, jobName: string, options?: msRest.RequestOptionsBase): Promise<Models.JobsListCredentialsResponse>;
266
+ get(
267
+ resourceGroupName: string,
268
+ jobName: string,
269
+ options?: JobsGetOptionalParams
270
+ ): Promise<JobsGetResponse> {
271
+ return this.client.sendOperationRequest(
272
+ { resourceGroupName, jobName, options },
273
+ getOperationSpec
274
+ );
275
+ }
276
+
246
277
  /**
278
+ * Creates a new job with the specified parameters. Existing job cannot be updated with this API and
279
+ * should instead be updated with the Update job API.
247
280
  * @param resourceGroupName The Resource Group Name
248
- * @param jobName The name of the job Resource within the specified resource group. job names must
249
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
250
- * @param callback The callback
281
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
282
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
283
+ * @param jobResource Job details from request body.
284
+ * @param options The options parameters.
251
285
  */
252
- listCredentials(resourceGroupName: string, jobName: string, callback: msRest.ServiceCallback<Models.UnencryptedCredentialsList>): void;
286
+ async beginCreate(
287
+ resourceGroupName: string,
288
+ jobName: string,
289
+ jobResource: JobResource,
290
+ options?: JobsCreateOptionalParams
291
+ ): Promise<
292
+ PollerLike<PollOperationState<JobsCreateResponse>, JobsCreateResponse>
293
+ > {
294
+ const directSendOperation = async (
295
+ args: coreClient.OperationArguments,
296
+ spec: coreClient.OperationSpec
297
+ ): Promise<JobsCreateResponse> => {
298
+ return this.client.sendOperationRequest(args, spec);
299
+ };
300
+ const sendOperation = async (
301
+ args: coreClient.OperationArguments,
302
+ spec: coreClient.OperationSpec
303
+ ) => {
304
+ let currentRawResponse:
305
+ | coreClient.FullOperationResponse
306
+ | undefined = undefined;
307
+ const providedCallback = args.options?.onResponse;
308
+ const callback: coreClient.RawResponseCallback = (
309
+ rawResponse: coreClient.FullOperationResponse,
310
+ flatResponse: unknown
311
+ ) => {
312
+ currentRawResponse = rawResponse;
313
+ providedCallback?.(rawResponse, flatResponse);
314
+ };
315
+ const updatedArgs = {
316
+ ...args,
317
+ options: {
318
+ ...args.options,
319
+ onResponse: callback
320
+ }
321
+ };
322
+ const flatResponse = await directSendOperation(updatedArgs, spec);
323
+ return {
324
+ flatResponse,
325
+ rawResponse: {
326
+ statusCode: currentRawResponse!.status,
327
+ body: currentRawResponse!.parsedBody,
328
+ headers: currentRawResponse!.headers.toJSON()
329
+ }
330
+ };
331
+ };
332
+
333
+ const lro = new LroImpl(
334
+ sendOperation,
335
+ { resourceGroupName, jobName, jobResource, options },
336
+ createOperationSpec
337
+ );
338
+ return new LroEngine(lro, {
339
+ resumeFrom: options?.resumeFrom,
340
+ intervalInMs: options?.updateIntervalInMs
341
+ });
342
+ }
343
+
253
344
  /**
345
+ * Creates a new job with the specified parameters. Existing job cannot be updated with this API and
346
+ * should instead be updated with the Update job API.
254
347
  * @param resourceGroupName The Resource Group Name
255
- * @param jobName The name of the job Resource within the specified resource group. job names must
256
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
257
- * @param options The optional parameters
258
- * @param callback The callback
348
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
349
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
350
+ * @param jobResource Job details from request body.
351
+ * @param options The options parameters.
259
352
  */
260
- listCredentials(resourceGroupName: string, jobName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.UnencryptedCredentialsList>): void;
261
- listCredentials(resourceGroupName: string, jobName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.UnencryptedCredentialsList>, callback?: msRest.ServiceCallback<Models.UnencryptedCredentialsList>): Promise<Models.JobsListCredentialsResponse> {
262
- return this.client.sendOperationRequest(
263
- {
264
- resourceGroupName,
265
- jobName,
266
- options
267
- },
268
- listCredentialsOperationSpec,
269
- callback) as Promise<Models.JobsListCredentialsResponse>;
353
+ async beginCreateAndWait(
354
+ resourceGroupName: string,
355
+ jobName: string,
356
+ jobResource: JobResource,
357
+ options?: JobsCreateOptionalParams
358
+ ): Promise<JobsCreateResponse> {
359
+ const poller = await this.beginCreate(
360
+ resourceGroupName,
361
+ jobName,
362
+ jobResource,
363
+ options
364
+ );
365
+ return poller.pollUntilDone();
270
366
  }
271
367
 
272
368
  /**
273
- * Creates a new job with the specified parameters. Existing job cannot be updated with this API
274
- * and should instead be updated with the Update job API.
369
+ * Deletes a job.
275
370
  * @param resourceGroupName The Resource Group Name
276
- * @param jobName The name of the job Resource within the specified resource group. job names must
277
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
278
- * @param jobResource Job details from request body.
279
- * @param [options] The optional parameters
280
- * @returns Promise<msRestAzure.LROPoller>
371
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
372
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
373
+ * @param options The options parameters.
281
374
  */
282
- beginCreate(resourceGroupName: string, jobName: string, jobResource: Models.JobResource, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
283
- return this.client.sendLRORequest(
284
- {
285
- resourceGroupName,
286
- jobName,
287
- jobResource,
288
- options
289
- },
290
- beginCreateOperationSpec,
291
- options);
375
+ async beginDelete(
376
+ resourceGroupName: string,
377
+ jobName: string,
378
+ options?: JobsDeleteOptionalParams
379
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
380
+ const directSendOperation = async (
381
+ args: coreClient.OperationArguments,
382
+ spec: coreClient.OperationSpec
383
+ ): Promise<void> => {
384
+ return this.client.sendOperationRequest(args, spec);
385
+ };
386
+ const sendOperation = async (
387
+ args: coreClient.OperationArguments,
388
+ spec: coreClient.OperationSpec
389
+ ) => {
390
+ let currentRawResponse:
391
+ | coreClient.FullOperationResponse
392
+ | undefined = undefined;
393
+ const providedCallback = args.options?.onResponse;
394
+ const callback: coreClient.RawResponseCallback = (
395
+ rawResponse: coreClient.FullOperationResponse,
396
+ flatResponse: unknown
397
+ ) => {
398
+ currentRawResponse = rawResponse;
399
+ providedCallback?.(rawResponse, flatResponse);
400
+ };
401
+ const updatedArgs = {
402
+ ...args,
403
+ options: {
404
+ ...args.options,
405
+ onResponse: callback
406
+ }
407
+ };
408
+ const flatResponse = await directSendOperation(updatedArgs, spec);
409
+ return {
410
+ flatResponse,
411
+ rawResponse: {
412
+ statusCode: currentRawResponse!.status,
413
+ body: currentRawResponse!.parsedBody,
414
+ headers: currentRawResponse!.headers.toJSON()
415
+ }
416
+ };
417
+ };
418
+
419
+ const lro = new LroImpl(
420
+ sendOperation,
421
+ { resourceGroupName, jobName, options },
422
+ deleteOperationSpec
423
+ );
424
+ return new LroEngine(lro, {
425
+ resumeFrom: options?.resumeFrom,
426
+ intervalInMs: options?.updateIntervalInMs
427
+ });
292
428
  }
293
429
 
294
430
  /**
295
431
  * Deletes a job.
296
432
  * @param resourceGroupName The Resource Group Name
297
- * @param jobName The name of the job Resource within the specified resource group. job names must
298
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
299
- * @param [options] The optional parameters
300
- * @returns Promise<msRestAzure.LROPoller>
433
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
434
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
435
+ * @param options The options parameters.
301
436
  */
302
- beginDeleteMethod(resourceGroupName: string, jobName: string, options?: msRest.RequestOptionsBase): Promise<msRestAzure.LROPoller> {
303
- return this.client.sendLRORequest(
304
- {
305
- resourceGroupName,
306
- jobName,
307
- options
308
- },
309
- beginDeleteMethodOperationSpec,
310
- options);
437
+ async beginDeleteAndWait(
438
+ resourceGroupName: string,
439
+ jobName: string,
440
+ options?: JobsDeleteOptionalParams
441
+ ): Promise<void> {
442
+ const poller = await this.beginDelete(resourceGroupName, jobName, options);
443
+ return poller.pollUntilDone();
311
444
  }
312
445
 
313
446
  /**
314
447
  * Updates the properties of an existing job.
315
448
  * @param resourceGroupName The Resource Group Name
316
- * @param jobName The name of the job Resource within the specified resource group. job names must
317
- * be between 3 and 24 characters in length and use any alphanumeric and underscore only
449
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
450
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
318
451
  * @param jobResourceUpdateParameter Job update parameters from request body.
319
- * @param [options] The optional parameters
320
- * @returns Promise<msRestAzure.LROPoller>
452
+ * @param options The options parameters.
321
453
  */
322
- beginUpdate(resourceGroupName: string, jobName: string, jobResourceUpdateParameter: Models.JobResourceUpdateParameter, options?: Models.JobsBeginUpdateOptionalParams): Promise<msRestAzure.LROPoller> {
323
- return this.client.sendLRORequest(
324
- {
325
- resourceGroupName,
326
- jobName,
327
- jobResourceUpdateParameter,
328
- options
329
- },
330
- beginUpdateOperationSpec,
331
- options);
454
+ async beginUpdate(
455
+ resourceGroupName: string,
456
+ jobName: string,
457
+ jobResourceUpdateParameter: JobResourceUpdateParameter,
458
+ options?: JobsUpdateOptionalParams
459
+ ): Promise<
460
+ PollerLike<PollOperationState<JobsUpdateResponse>, JobsUpdateResponse>
461
+ > {
462
+ const directSendOperation = async (
463
+ args: coreClient.OperationArguments,
464
+ spec: coreClient.OperationSpec
465
+ ): Promise<JobsUpdateResponse> => {
466
+ return this.client.sendOperationRequest(args, spec);
467
+ };
468
+ const sendOperation = async (
469
+ args: coreClient.OperationArguments,
470
+ spec: coreClient.OperationSpec
471
+ ) => {
472
+ let currentRawResponse:
473
+ | coreClient.FullOperationResponse
474
+ | undefined = undefined;
475
+ const providedCallback = args.options?.onResponse;
476
+ const callback: coreClient.RawResponseCallback = (
477
+ rawResponse: coreClient.FullOperationResponse,
478
+ flatResponse: unknown
479
+ ) => {
480
+ currentRawResponse = rawResponse;
481
+ providedCallback?.(rawResponse, flatResponse);
482
+ };
483
+ const updatedArgs = {
484
+ ...args,
485
+ options: {
486
+ ...args.options,
487
+ onResponse: callback
488
+ }
489
+ };
490
+ const flatResponse = await directSendOperation(updatedArgs, spec);
491
+ return {
492
+ flatResponse,
493
+ rawResponse: {
494
+ statusCode: currentRawResponse!.status,
495
+ body: currentRawResponse!.parsedBody,
496
+ headers: currentRawResponse!.headers.toJSON()
497
+ }
498
+ };
499
+ };
500
+
501
+ const lro = new LroImpl(
502
+ sendOperation,
503
+ { resourceGroupName, jobName, jobResourceUpdateParameter, options },
504
+ updateOperationSpec
505
+ );
506
+ return new LroEngine(lro, {
507
+ resumeFrom: options?.resumeFrom,
508
+ intervalInMs: options?.updateIntervalInMs
509
+ });
332
510
  }
333
511
 
334
512
  /**
335
- * Lists all the jobs available under the subscription.
336
- * @param nextPageLink The NextLink from the previous successful call to List operation.
337
- * @param [options] The optional parameters
338
- * @returns Promise<Models.JobsListNextResponse>
513
+ * Updates the properties of an existing job.
514
+ * @param resourceGroupName The Resource Group Name
515
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
516
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
517
+ * @param jobResourceUpdateParameter Job update parameters from request body.
518
+ * @param options The options parameters.
339
519
  */
340
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.JobsListNextResponse>;
520
+ async beginUpdateAndWait(
521
+ resourceGroupName: string,
522
+ jobName: string,
523
+ jobResourceUpdateParameter: JobResourceUpdateParameter,
524
+ options?: JobsUpdateOptionalParams
525
+ ): Promise<JobsUpdateResponse> {
526
+ const poller = await this.beginUpdate(
527
+ resourceGroupName,
528
+ jobName,
529
+ jobResourceUpdateParameter,
530
+ options
531
+ );
532
+ return poller.pollUntilDone();
533
+ }
534
+
341
535
  /**
342
- * @param nextPageLink The NextLink from the previous successful call to List operation.
343
- * @param callback The callback
536
+ * Book shipment pick up.
537
+ * @param resourceGroupName The Resource Group Name
538
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
539
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
540
+ * @param shipmentPickUpRequest Details of shipment pick up request.
541
+ * @param options The options parameters.
344
542
  */
345
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.JobResourceList>): void;
543
+ bookShipmentPickUp(
544
+ resourceGroupName: string,
545
+ jobName: string,
546
+ shipmentPickUpRequest: ShipmentPickUpRequest,
547
+ options?: JobsBookShipmentPickUpOptionalParams
548
+ ): Promise<JobsBookShipmentPickUpResponse> {
549
+ return this.client.sendOperationRequest(
550
+ { resourceGroupName, jobName, shipmentPickUpRequest, options },
551
+ bookShipmentPickUpOperationSpec
552
+ );
553
+ }
554
+
346
555
  /**
347
- * @param nextPageLink The NextLink from the previous successful call to List operation.
348
- * @param options The optional parameters
349
- * @param callback The callback
556
+ * CancelJob.
557
+ * @param resourceGroupName The Resource Group Name
558
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
559
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
560
+ * @param cancellationReason Reason for cancellation.
561
+ * @param options The options parameters.
350
562
  */
351
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.JobResourceList>): void;
352
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.JobResourceList>, callback?: msRest.ServiceCallback<Models.JobResourceList>): Promise<Models.JobsListNextResponse> {
563
+ cancel(
564
+ resourceGroupName: string,
565
+ jobName: string,
566
+ cancellationReason: CancellationReason,
567
+ options?: JobsCancelOptionalParams
568
+ ): Promise<void> {
353
569
  return this.client.sendOperationRequest(
354
- {
355
- nextPageLink,
356
- options
357
- },
358
- listNextOperationSpec,
359
- callback) as Promise<Models.JobsListNextResponse>;
570
+ { resourceGroupName, jobName, cancellationReason, options },
571
+ cancelOperationSpec
572
+ );
360
573
  }
361
574
 
362
575
  /**
363
- * Lists all the jobs available under the given resource group.
364
- * @param nextPageLink The NextLink from the previous successful call to List operation.
365
- * @param [options] The optional parameters
366
- * @returns Promise<Models.JobsListByResourceGroupNextResponse>
576
+ * This method gets the unencrypted secrets related to the job.
577
+ * @param resourceGroupName The Resource Group Name
578
+ * @param jobName The name of the job Resource within the specified resource group. job names must be
579
+ * between 3 and 24 characters in length and use any alphanumeric and underscore only
580
+ * @param options The options parameters.
367
581
  */
368
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.JobsListByResourceGroupNextResponse>;
582
+ private _listCredentials(
583
+ resourceGroupName: string,
584
+ jobName: string,
585
+ options?: JobsListCredentialsOptionalParams
586
+ ): Promise<JobsListCredentialsResponse> {
587
+ return this.client.sendOperationRequest(
588
+ { resourceGroupName, jobName, options },
589
+ listCredentialsOperationSpec
590
+ );
591
+ }
592
+
369
593
  /**
370
- * @param nextPageLink The NextLink from the previous successful call to List operation.
371
- * @param callback The callback
594
+ * ListNext
595
+ * @param nextLink The nextLink from the previous successful call to the List method.
596
+ * @param options The options parameters.
372
597
  */
373
- listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.JobResourceList>): void;
598
+ private _listNext(
599
+ nextLink: string,
600
+ options?: JobsListNextOptionalParams
601
+ ): Promise<JobsListNextResponse> {
602
+ return this.client.sendOperationRequest(
603
+ { nextLink, options },
604
+ listNextOperationSpec
605
+ );
606
+ }
607
+
374
608
  /**
375
- * @param nextPageLink The NextLink from the previous successful call to List operation.
376
- * @param options The optional parameters
377
- * @param callback The callback
609
+ * ListByResourceGroupNext
610
+ * @param resourceGroupName The Resource Group Name
611
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
612
+ * @param options The options parameters.
378
613
  */
379
- listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.JobResourceList>): void;
380
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.JobResourceList>, callback?: msRest.ServiceCallback<Models.JobResourceList>): Promise<Models.JobsListByResourceGroupNextResponse> {
614
+ private _listByResourceGroupNext(
615
+ resourceGroupName: string,
616
+ nextLink: string,
617
+ options?: JobsListByResourceGroupNextOptionalParams
618
+ ): Promise<JobsListByResourceGroupNextResponse> {
381
619
  return this.client.sendOperationRequest(
382
- {
383
- nextPageLink,
384
- options
385
- },
386
- listByResourceGroupNextOperationSpec,
387
- callback) as Promise<Models.JobsListByResourceGroupNextResponse>;
620
+ { resourceGroupName, nextLink, options },
621
+ listByResourceGroupNextOperationSpec
622
+ );
388
623
  }
389
624
  }
390
-
391
625
  // Operation Specifications
392
- const serializer = new msRest.Serializer(Mappers);
393
- const listOperationSpec: msRest.OperationSpec = {
626
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
627
+
628
+ const listOperationSpec: coreClient.OperationSpec = {
629
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs",
394
630
  httpMethod: "GET",
395
- path: "subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs",
396
- urlParameters: [
397
- Parameters.subscriptionId
398
- ],
399
- queryParameters: [
400
- Parameters.apiVersion,
401
- Parameters.skipToken
402
- ],
403
- headerParameters: [
404
- Parameters.acceptLanguage
405
- ],
406
631
  responses: {
407
632
  200: {
408
633
  bodyMapper: Mappers.JobResourceList
409
634
  },
410
635
  default: {
411
- bodyMapper: Mappers.CloudError
636
+ bodyMapper: Mappers.ApiError
412
637
  }
413
638
  },
639
+ queryParameters: [Parameters.apiVersion, Parameters.skipToken],
640
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
641
+ headerParameters: [Parameters.accept],
414
642
  serializer
415
643
  };
416
-
417
- const listByResourceGroupOperationSpec: msRest.OperationSpec = {
418
- httpMethod: "GET",
419
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs",
644
+ const markDevicesShippedOperationSpec: coreClient.OperationSpec = {
645
+ path:
646
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped",
647
+ httpMethod: "POST",
648
+ responses: {
649
+ 204: {},
650
+ default: {
651
+ bodyMapper: Mappers.ApiError
652
+ }
653
+ },
654
+ requestBody: Parameters.markDevicesShippedRequest,
655
+ queryParameters: [Parameters.apiVersion],
420
656
  urlParameters: [
657
+ Parameters.$host,
421
658
  Parameters.subscriptionId,
659
+ Parameters.jobName,
422
660
  Parameters.resourceGroupName
423
661
  ],
424
- queryParameters: [
425
- Parameters.apiVersion,
426
- Parameters.skipToken
427
- ],
428
- headerParameters: [
429
- Parameters.acceptLanguage
430
- ],
662
+ headerParameters: [Parameters.accept, Parameters.contentType],
663
+ mediaType: "json",
664
+ serializer
665
+ };
666
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
667
+ path:
668
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs",
669
+ httpMethod: "GET",
431
670
  responses: {
432
671
  200: {
433
672
  bodyMapper: Mappers.JobResourceList
434
673
  },
435
674
  default: {
436
- bodyMapper: Mappers.CloudError
675
+ bodyMapper: Mappers.ApiError
437
676
  }
438
677
  },
439
- serializer
440
- };
441
-
442
- const getOperationSpec: msRest.OperationSpec = {
443
- httpMethod: "GET",
444
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
678
+ queryParameters: [Parameters.apiVersion, Parameters.skipToken],
445
679
  urlParameters: [
680
+ Parameters.$host,
446
681
  Parameters.subscriptionId,
447
- Parameters.resourceGroupName,
448
- Parameters.jobName
449
- ],
450
- queryParameters: [
451
- Parameters.apiVersion,
452
- Parameters.expand
453
- ],
454
- headerParameters: [
455
- Parameters.acceptLanguage
682
+ Parameters.resourceGroupName
456
683
  ],
684
+ headerParameters: [Parameters.accept],
685
+ serializer
686
+ };
687
+ const getOperationSpec: coreClient.OperationSpec = {
688
+ path:
689
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
690
+ httpMethod: "GET",
457
691
  responses: {
458
692
  200: {
459
693
  bodyMapper: Mappers.JobResource
460
694
  },
461
695
  default: {
462
- bodyMapper: Mappers.CloudError
696
+ bodyMapper: Mappers.ApiError
463
697
  }
464
698
  },
465
- serializer
466
- };
467
-
468
- const bookShipmentPickUpOperationSpec: msRest.OperationSpec = {
469
- httpMethod: "POST",
470
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp",
699
+ queryParameters: [Parameters.apiVersion, Parameters.expand],
471
700
  urlParameters: [
701
+ Parameters.$host,
472
702
  Parameters.subscriptionId,
473
- Parameters.resourceGroupName,
474
- Parameters.jobName
475
- ],
476
- queryParameters: [
477
- Parameters.apiVersion
478
- ],
479
- headerParameters: [
480
- Parameters.acceptLanguage
703
+ Parameters.jobName,
704
+ Parameters.resourceGroupName
481
705
  ],
482
- requestBody: {
483
- parameterPath: "shipmentPickUpRequest",
484
- mapper: {
485
- ...Mappers.ShipmentPickUpRequest,
486
- required: true
487
- }
488
- },
706
+ headerParameters: [Parameters.accept],
707
+ serializer
708
+ };
709
+ const createOperationSpec: coreClient.OperationSpec = {
710
+ path:
711
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
712
+ httpMethod: "PUT",
489
713
  responses: {
490
714
  200: {
491
- bodyMapper: Mappers.ShipmentPickUpResponse
715
+ bodyMapper: Mappers.JobResource
716
+ },
717
+ 201: {
718
+ bodyMapper: Mappers.JobResource
719
+ },
720
+ 202: {
721
+ bodyMapper: Mappers.JobResource
722
+ },
723
+ 204: {
724
+ bodyMapper: Mappers.JobResource
492
725
  },
493
726
  default: {
494
- bodyMapper: Mappers.CloudError
727
+ bodyMapper: Mappers.ApiError
495
728
  }
496
729
  },
497
- serializer
498
- };
499
-
500
- const cancelOperationSpec: msRest.OperationSpec = {
501
- httpMethod: "POST",
502
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel",
730
+ requestBody: Parameters.jobResource,
731
+ queryParameters: [Parameters.apiVersion],
503
732
  urlParameters: [
733
+ Parameters.$host,
504
734
  Parameters.subscriptionId,
505
- Parameters.resourceGroupName,
506
- Parameters.jobName
507
- ],
508
- queryParameters: [
509
- Parameters.apiVersion
510
- ],
511
- headerParameters: [
512
- Parameters.acceptLanguage
735
+ Parameters.jobName,
736
+ Parameters.resourceGroupName
513
737
  ],
514
- requestBody: {
515
- parameterPath: {
516
- reason: "reason"
517
- },
518
- mapper: {
519
- ...Mappers.CancellationReason,
520
- required: true
521
- }
522
- },
738
+ headerParameters: [Parameters.accept, Parameters.contentType],
739
+ mediaType: "json",
740
+ serializer
741
+ };
742
+ const deleteOperationSpec: coreClient.OperationSpec = {
743
+ path:
744
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
745
+ httpMethod: "DELETE",
523
746
  responses: {
747
+ 200: {},
748
+ 201: {},
749
+ 202: {},
524
750
  204: {},
525
751
  default: {
526
- bodyMapper: Mappers.CloudError
752
+ bodyMapper: Mappers.ApiError
527
753
  }
528
754
  },
529
- serializer
530
- };
531
-
532
- const listCredentialsOperationSpec: msRest.OperationSpec = {
533
- httpMethod: "POST",
534
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials",
755
+ queryParameters: [Parameters.apiVersion],
535
756
  urlParameters: [
757
+ Parameters.$host,
536
758
  Parameters.subscriptionId,
537
- Parameters.resourceGroupName,
538
- Parameters.jobName
539
- ],
540
- queryParameters: [
541
- Parameters.apiVersion
542
- ],
543
- headerParameters: [
544
- Parameters.acceptLanguage
759
+ Parameters.jobName,
760
+ Parameters.resourceGroupName
545
761
  ],
762
+ headerParameters: [Parameters.accept],
763
+ serializer
764
+ };
765
+ const updateOperationSpec: coreClient.OperationSpec = {
766
+ path:
767
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
768
+ httpMethod: "PATCH",
546
769
  responses: {
547
770
  200: {
548
- bodyMapper: Mappers.UnencryptedCredentialsList
771
+ bodyMapper: Mappers.JobResource
772
+ },
773
+ 201: {
774
+ bodyMapper: Mappers.JobResource
775
+ },
776
+ 202: {
777
+ bodyMapper: Mappers.JobResource
778
+ },
779
+ 204: {
780
+ bodyMapper: Mappers.JobResource
549
781
  },
550
782
  default: {
551
- bodyMapper: Mappers.CloudError
783
+ bodyMapper: Mappers.ApiError
552
784
  }
553
785
  },
554
- serializer
555
- };
556
-
557
- const beginCreateOperationSpec: msRest.OperationSpec = {
558
- httpMethod: "PUT",
559
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
786
+ requestBody: Parameters.jobResourceUpdateParameter,
787
+ queryParameters: [Parameters.apiVersion],
560
788
  urlParameters: [
789
+ Parameters.$host,
561
790
  Parameters.subscriptionId,
562
- Parameters.resourceGroupName,
563
- Parameters.jobName
564
- ],
565
- queryParameters: [
566
- Parameters.apiVersion
791
+ Parameters.jobName,
792
+ Parameters.resourceGroupName
567
793
  ],
568
794
  headerParameters: [
569
- Parameters.acceptLanguage
795
+ Parameters.accept,
796
+ Parameters.contentType,
797
+ Parameters.ifMatch
570
798
  ],
571
- requestBody: {
572
- parameterPath: "jobResource",
573
- mapper: {
574
- ...Mappers.JobResource,
575
- required: true
576
- }
577
- },
799
+ mediaType: "json",
800
+ serializer
801
+ };
802
+ const bookShipmentPickUpOperationSpec: coreClient.OperationSpec = {
803
+ path:
804
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp",
805
+ httpMethod: "POST",
578
806
  responses: {
579
807
  200: {
580
- bodyMapper: Mappers.JobResource
808
+ bodyMapper: Mappers.ShipmentPickUpResponse
581
809
  },
582
- 202: {},
583
810
  default: {
584
- bodyMapper: Mappers.CloudError
811
+ bodyMapper: Mappers.ApiError
585
812
  }
586
813
  },
587
- serializer
588
- };
589
-
590
- const beginDeleteMethodOperationSpec: msRest.OperationSpec = {
591
- httpMethod: "DELETE",
592
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
814
+ requestBody: Parameters.shipmentPickUpRequest,
815
+ queryParameters: [Parameters.apiVersion],
593
816
  urlParameters: [
817
+ Parameters.$host,
594
818
  Parameters.subscriptionId,
595
- Parameters.resourceGroupName,
596
- Parameters.jobName
597
- ],
598
- queryParameters: [
599
- Parameters.apiVersion
600
- ],
601
- headerParameters: [
602
- Parameters.acceptLanguage
819
+ Parameters.jobName,
820
+ Parameters.resourceGroupName
603
821
  ],
822
+ headerParameters: [Parameters.accept, Parameters.contentType],
823
+ mediaType: "json",
824
+ serializer
825
+ };
826
+ const cancelOperationSpec: coreClient.OperationSpec = {
827
+ path:
828
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel",
829
+ httpMethod: "POST",
604
830
  responses: {
605
- 202: {},
606
831
  204: {},
607
832
  default: {
608
- bodyMapper: Mappers.CloudError
833
+ bodyMapper: Mappers.ApiError
609
834
  }
610
835
  },
611
- serializer
612
- };
613
-
614
- const beginUpdateOperationSpec: msRest.OperationSpec = {
615
- httpMethod: "PATCH",
616
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
836
+ requestBody: Parameters.cancellationReason,
837
+ queryParameters: [Parameters.apiVersion],
617
838
  urlParameters: [
839
+ Parameters.$host,
618
840
  Parameters.subscriptionId,
619
- Parameters.resourceGroupName,
620
- Parameters.jobName
621
- ],
622
- queryParameters: [
623
- Parameters.apiVersion
624
- ],
625
- headerParameters: [
626
- Parameters.ifMatch,
627
- Parameters.acceptLanguage
841
+ Parameters.jobName,
842
+ Parameters.resourceGroupName
628
843
  ],
629
- requestBody: {
630
- parameterPath: "jobResourceUpdateParameter",
631
- mapper: {
632
- ...Mappers.JobResourceUpdateParameter,
633
- required: true
634
- }
635
- },
844
+ headerParameters: [Parameters.accept, Parameters.contentType],
845
+ mediaType: "json",
846
+ serializer
847
+ };
848
+ const listCredentialsOperationSpec: coreClient.OperationSpec = {
849
+ path:
850
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials",
851
+ httpMethod: "POST",
636
852
  responses: {
637
853
  200: {
638
- bodyMapper: Mappers.JobResource
854
+ bodyMapper: Mappers.UnencryptedCredentialsList
639
855
  },
640
- 202: {},
641
856
  default: {
642
- bodyMapper: Mappers.CloudError
857
+ bodyMapper: Mappers.ApiError
643
858
  }
644
859
  },
860
+ queryParameters: [Parameters.apiVersion],
861
+ urlParameters: [
862
+ Parameters.$host,
863
+ Parameters.subscriptionId,
864
+ Parameters.jobName,
865
+ Parameters.resourceGroupName
866
+ ],
867
+ headerParameters: [Parameters.accept],
645
868
  serializer
646
869
  };
647
-
648
- const listNextOperationSpec: msRest.OperationSpec = {
649
- httpMethod: "GET",
650
- baseUrl: "https://management.azure.com",
870
+ const listNextOperationSpec: coreClient.OperationSpec = {
651
871
  path: "{nextLink}",
652
- urlParameters: [
653
- Parameters.nextPageLink
654
- ],
655
- headerParameters: [
656
- Parameters.acceptLanguage
657
- ],
872
+ httpMethod: "GET",
658
873
  responses: {
659
874
  200: {
660
875
  bodyMapper: Mappers.JobResourceList
661
876
  },
662
877
  default: {
663
- bodyMapper: Mappers.CloudError
878
+ bodyMapper: Mappers.ApiError
664
879
  }
665
880
  },
881
+ queryParameters: [Parameters.apiVersion, Parameters.skipToken],
882
+ urlParameters: [
883
+ Parameters.$host,
884
+ Parameters.nextLink,
885
+ Parameters.subscriptionId
886
+ ],
887
+ headerParameters: [Parameters.accept],
666
888
  serializer
667
889
  };
668
-
669
- const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
670
- httpMethod: "GET",
671
- baseUrl: "https://management.azure.com",
890
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
672
891
  path: "{nextLink}",
673
- urlParameters: [
674
- Parameters.nextPageLink
675
- ],
676
- headerParameters: [
677
- Parameters.acceptLanguage
678
- ],
892
+ httpMethod: "GET",
679
893
  responses: {
680
894
  200: {
681
895
  bodyMapper: Mappers.JobResourceList
682
896
  },
683
897
  default: {
684
- bodyMapper: Mappers.CloudError
898
+ bodyMapper: Mappers.ApiError
685
899
  }
686
900
  },
901
+ queryParameters: [Parameters.apiVersion, Parameters.skipToken],
902
+ urlParameters: [
903
+ Parameters.$host,
904
+ Parameters.nextLink,
905
+ Parameters.subscriptionId,
906
+ Parameters.resourceGroupName
907
+ ],
908
+ headerParameters: [Parameters.accept],
687
909
  serializer
688
910
  };