@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.
- package/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +72 -73
- package/dist/index.js +5592 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/src/dataBoxManagementClient.d.ts +29 -0
- package/dist-esm/src/dataBoxManagementClient.d.ts.map +1 -0
- package/dist-esm/src/dataBoxManagementClient.js +89 -0
- package/dist-esm/src/dataBoxManagementClient.js.map +1 -0
- package/dist-esm/src/index.d.ts +5 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +12 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/lroImpl.d.ts +16 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +29 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +2157 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +168 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +163 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/dist-esm/src/models/mappers.js +3911 -0
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +24 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +176 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +11 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/jobs.d.ts +161 -0
- package/dist-esm/src/operations/jobs.d.ts.map +1 -0
- package/dist-esm/src/operations/jobs.js +687 -0
- package/dist-esm/src/operations/jobs.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +32 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +120 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operations/service.d.ts +83 -0
- package/dist-esm/src/operations/service.d.ts.map +1 -0
- package/dist-esm/src/operations/service.js +307 -0
- package/dist-esm/src/operations/service.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +11 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/jobs.d.ts +115 -0
- package/dist-esm/src/operationsInterfaces/jobs.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/jobs.js +9 -0
- package/dist-esm/src/operationsInterfaces/jobs.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/service.d.ts +54 -0
- package/dist-esm/src/operationsInterfaces/service.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/service.js +9 -0
- package/dist-esm/src/operationsInterfaces/service.js.map +1 -0
- package/dist-esm/test/sampleTest.d.ts +2 -0
- package/dist-esm/test/sampleTest.d.ts.map +1 -0
- package/dist-esm/test/sampleTest.js +40 -0
- package/dist-esm/test/sampleTest.js.map +1 -0
- package/package.json +65 -31
- package/review/arm-databox.api.md +1376 -0
- package/rollup.config.js +181 -30
- package/src/dataBoxManagementClient.ts +113 -29
- package/src/index.ts +12 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +1924 -1354
- package/src/models/mappers.ts +3160 -1086
- package/src/models/parameters.ts +144 -54
- package/src/operations/index.ts +3 -5
- package/src/operations/jobs.ts +702 -480
- package/src/operations/operations.ts +89 -75
- package/src/operations/service.ts +342 -127
- package/src/operationsInterfaces/index.ts +11 -0
- package/src/operationsInterfaces/jobs.ts +205 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/src/operationsInterfaces/service.ts +107 -0
- package/tsconfig.json +3 -3
- package/types/arm-databox.d.ts +2558 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-databox.js +0 -3090
- package/dist/arm-databox.js.map +0 -1
- package/dist/arm-databox.min.js +0 -1
- package/dist/arm-databox.min.js.map +0 -1
- package/esm/dataBoxManagementClient.d.ts +0 -20
- package/esm/dataBoxManagementClient.d.ts.map +0 -1
- package/esm/dataBoxManagementClient.js +0 -35
- package/esm/dataBoxManagementClient.js.map +0 -1
- package/esm/dataBoxManagementClientContext.d.ts +0 -16
- package/esm/dataBoxManagementClientContext.d.ts.map +0 -1
- package/esm/dataBoxManagementClientContext.js +0 -57
- package/esm/dataBoxManagementClientContext.js.map +0 -1
- package/esm/models/index.d.ts +0 -1754
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js +0 -8
- package/esm/models/index.js.map +0 -1
- package/esm/models/jobsMappers.d.ts +0 -2
- package/esm/models/jobsMappers.d.ts.map +0 -1
- package/esm/models/jobsMappers.js +0 -9
- package/esm/models/jobsMappers.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -75
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js +0 -2020
- package/esm/models/mappers.js.map +0 -1
- package/esm/models/operationsMappers.d.ts +0 -2
- package/esm/models/operationsMappers.d.ts.map +0 -1
- package/esm/models/operationsMappers.js +0 -9
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -12
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js +0 -122
- package/esm/models/parameters.js.map +0 -1
- package/esm/models/serviceMappers.d.ts +0 -2
- package/esm/models/serviceMappers.d.ts.map +0 -1
- package/esm/models/serviceMappers.js +0 -9
- package/esm/models/serviceMappers.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js +0 -13
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/jobs.d.ts +0 -245
- package/esm/operations/jobs.d.ts.map +0 -1
- package/esm/operations/jobs.js +0 -444
- package/esm/operations/jobs.js.map +0 -1
- package/esm/operations/operations.d.ts +0 -46
- package/esm/operations/operations.d.ts.map +0 -1
- package/esm/operations/operations.js +0 -77
- package/esm/operations/operations.js.map +0 -1
- package/esm/operations/service.d.ts +0 -79
- package/esm/operations/service.d.ts.map +0 -1
- package/esm/operations/service.js +0 -126
- package/esm/operations/service.js.map +0 -1
- package/src/dataBoxManagementClientContext.ts +0 -69
- package/src/models/jobsMappers.ts +0 -55
- package/src/models/operationsMappers.ts +0 -15
- package/src/models/serviceMappers.ts +0 -22
|
@@ -0,0 +1,687 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*
|
|
5
|
+
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
+
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
+
*/
|
|
8
|
+
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await, __awaiter } from "tslib";
|
|
9
|
+
import * as coreClient from "@azure/core-client";
|
|
10
|
+
import * as Mappers from "../models/mappers";
|
|
11
|
+
import * as Parameters from "../models/parameters";
|
|
12
|
+
import { LroEngine } from "@azure/core-lro";
|
|
13
|
+
import { LroImpl } from "../lroImpl";
|
|
14
|
+
/// <reference lib="esnext.asynciterable" />
|
|
15
|
+
/** Class containing Jobs operations. */
|
|
16
|
+
export class JobsImpl {
|
|
17
|
+
/**
|
|
18
|
+
* Initialize a new instance of the class Jobs class.
|
|
19
|
+
* @param client Reference to the service client
|
|
20
|
+
*/
|
|
21
|
+
constructor(client) {
|
|
22
|
+
this.client = client;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Lists all the jobs available under the subscription.
|
|
26
|
+
* @param options The options parameters.
|
|
27
|
+
*/
|
|
28
|
+
list(options) {
|
|
29
|
+
const iter = this.listPagingAll(options);
|
|
30
|
+
return {
|
|
31
|
+
next() {
|
|
32
|
+
return iter.next();
|
|
33
|
+
},
|
|
34
|
+
[Symbol.asyncIterator]() {
|
|
35
|
+
return this;
|
|
36
|
+
},
|
|
37
|
+
byPage: () => {
|
|
38
|
+
return this.listPagingPage(options);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
listPagingPage(options) {
|
|
43
|
+
return __asyncGenerator(this, arguments, function* listPagingPage_1() {
|
|
44
|
+
let result = yield __await(this._list(options));
|
|
45
|
+
yield yield __await(result.value || []);
|
|
46
|
+
let continuationToken = result.nextLink;
|
|
47
|
+
while (continuationToken) {
|
|
48
|
+
result = yield __await(this._listNext(continuationToken, options));
|
|
49
|
+
continuationToken = result.nextLink;
|
|
50
|
+
yield yield __await(result.value || []);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
listPagingAll(options) {
|
|
55
|
+
return __asyncGenerator(this, arguments, function* listPagingAll_1() {
|
|
56
|
+
var e_1, _a;
|
|
57
|
+
try {
|
|
58
|
+
for (var _b = __asyncValues(this.listPagingPage(options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
59
|
+
const page = _c.value;
|
|
60
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
64
|
+
finally {
|
|
65
|
+
try {
|
|
66
|
+
if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
|
|
67
|
+
}
|
|
68
|
+
finally { if (e_1) throw e_1.error; }
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Lists all the jobs available under the given resource group.
|
|
74
|
+
* @param resourceGroupName The Resource Group Name
|
|
75
|
+
* @param options The options parameters.
|
|
76
|
+
*/
|
|
77
|
+
listByResourceGroup(resourceGroupName, options) {
|
|
78
|
+
const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
|
|
79
|
+
return {
|
|
80
|
+
next() {
|
|
81
|
+
return iter.next();
|
|
82
|
+
},
|
|
83
|
+
[Symbol.asyncIterator]() {
|
|
84
|
+
return this;
|
|
85
|
+
},
|
|
86
|
+
byPage: () => {
|
|
87
|
+
return this.listByResourceGroupPagingPage(resourceGroupName, options);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
listByResourceGroupPagingPage(resourceGroupName, options) {
|
|
92
|
+
return __asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
|
|
93
|
+
let result = yield __await(this._listByResourceGroup(resourceGroupName, options));
|
|
94
|
+
yield yield __await(result.value || []);
|
|
95
|
+
let continuationToken = result.nextLink;
|
|
96
|
+
while (continuationToken) {
|
|
97
|
+
result = yield __await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
|
|
98
|
+
continuationToken = result.nextLink;
|
|
99
|
+
yield yield __await(result.value || []);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
listByResourceGroupPagingAll(resourceGroupName, options) {
|
|
104
|
+
return __asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
|
|
105
|
+
var e_2, _a;
|
|
106
|
+
try {
|
|
107
|
+
for (var _b = __asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
108
|
+
const page = _c.value;
|
|
109
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
113
|
+
finally {
|
|
114
|
+
try {
|
|
115
|
+
if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
|
|
116
|
+
}
|
|
117
|
+
finally { if (e_2) throw e_2.error; }
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* This method gets the unencrypted secrets related to the job.
|
|
123
|
+
* @param resourceGroupName The Resource Group Name
|
|
124
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
125
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
126
|
+
* @param options The options parameters.
|
|
127
|
+
*/
|
|
128
|
+
listCredentials(resourceGroupName, jobName, options) {
|
|
129
|
+
const iter = this.listCredentialsPagingAll(resourceGroupName, jobName, options);
|
|
130
|
+
return {
|
|
131
|
+
next() {
|
|
132
|
+
return iter.next();
|
|
133
|
+
},
|
|
134
|
+
[Symbol.asyncIterator]() {
|
|
135
|
+
return this;
|
|
136
|
+
},
|
|
137
|
+
byPage: () => {
|
|
138
|
+
return this.listCredentialsPagingPage(resourceGroupName, jobName, options);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
listCredentialsPagingPage(resourceGroupName, jobName, options) {
|
|
143
|
+
return __asyncGenerator(this, arguments, function* listCredentialsPagingPage_1() {
|
|
144
|
+
let result = yield __await(this._listCredentials(resourceGroupName, jobName, options));
|
|
145
|
+
yield yield __await(result.value || []);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
listCredentialsPagingAll(resourceGroupName, jobName, options) {
|
|
149
|
+
return __asyncGenerator(this, arguments, function* listCredentialsPagingAll_1() {
|
|
150
|
+
var e_3, _a;
|
|
151
|
+
try {
|
|
152
|
+
for (var _b = __asyncValues(this.listCredentialsPagingPage(resourceGroupName, jobName, options)), _c; _c = yield __await(_b.next()), !_c.done;) {
|
|
153
|
+
const page = _c.value;
|
|
154
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
158
|
+
finally {
|
|
159
|
+
try {
|
|
160
|
+
if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
|
|
161
|
+
}
|
|
162
|
+
finally { if (e_3) throw e_3.error; }
|
|
163
|
+
}
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Lists all the jobs available under the subscription.
|
|
168
|
+
* @param options The options parameters.
|
|
169
|
+
*/
|
|
170
|
+
_list(options) {
|
|
171
|
+
return this.client.sendOperationRequest({ options }, listOperationSpec);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Request to mark devices for a given job as shipped
|
|
175
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
176
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
177
|
+
* @param resourceGroupName The Resource Group Name
|
|
178
|
+
* @param markDevicesShippedRequest Mark Devices Shipped Request
|
|
179
|
+
* @param options The options parameters.
|
|
180
|
+
*/
|
|
181
|
+
markDevicesShipped(jobName, resourceGroupName, markDevicesShippedRequest, options) {
|
|
182
|
+
return this.client.sendOperationRequest({ jobName, resourceGroupName, markDevicesShippedRequest, options }, markDevicesShippedOperationSpec);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Lists all the jobs available under the given resource group.
|
|
186
|
+
* @param resourceGroupName The Resource Group Name
|
|
187
|
+
* @param options The options parameters.
|
|
188
|
+
*/
|
|
189
|
+
_listByResourceGroup(resourceGroupName, options) {
|
|
190
|
+
return this.client.sendOperationRequest({ resourceGroupName, options }, listByResourceGroupOperationSpec);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Gets information about the specified job.
|
|
194
|
+
* @param resourceGroupName The Resource Group Name
|
|
195
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
196
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
197
|
+
* @param options The options parameters.
|
|
198
|
+
*/
|
|
199
|
+
get(resourceGroupName, jobName, options) {
|
|
200
|
+
return this.client.sendOperationRequest({ resourceGroupName, jobName, options }, getOperationSpec);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Creates a new job with the specified parameters. Existing job cannot be updated with this API and
|
|
204
|
+
* should instead be updated with the Update job API.
|
|
205
|
+
* @param resourceGroupName The Resource Group Name
|
|
206
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
207
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
208
|
+
* @param jobResource Job details from request body.
|
|
209
|
+
* @param options The options parameters.
|
|
210
|
+
*/
|
|
211
|
+
beginCreate(resourceGroupName, jobName, jobResource, options) {
|
|
212
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
const directSendOperation = (args, spec) => __awaiter(this, void 0, void 0, function* () {
|
|
214
|
+
return this.client.sendOperationRequest(args, spec);
|
|
215
|
+
});
|
|
216
|
+
const sendOperation = (args, spec) => __awaiter(this, void 0, void 0, function* () {
|
|
217
|
+
var _a;
|
|
218
|
+
let currentRawResponse = undefined;
|
|
219
|
+
const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
|
|
220
|
+
const callback = (rawResponse, flatResponse) => {
|
|
221
|
+
currentRawResponse = rawResponse;
|
|
222
|
+
providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
|
|
223
|
+
};
|
|
224
|
+
const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
|
|
225
|
+
const flatResponse = yield directSendOperation(updatedArgs, spec);
|
|
226
|
+
return {
|
|
227
|
+
flatResponse,
|
|
228
|
+
rawResponse: {
|
|
229
|
+
statusCode: currentRawResponse.status,
|
|
230
|
+
body: currentRawResponse.parsedBody,
|
|
231
|
+
headers: currentRawResponse.headers.toJSON()
|
|
232
|
+
}
|
|
233
|
+
};
|
|
234
|
+
});
|
|
235
|
+
const lro = new LroImpl(sendOperation, { resourceGroupName, jobName, jobResource, options }, createOperationSpec);
|
|
236
|
+
return new LroEngine(lro, {
|
|
237
|
+
resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
|
|
238
|
+
intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
|
|
239
|
+
});
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Creates a new job with the specified parameters. Existing job cannot be updated with this API and
|
|
244
|
+
* should instead be updated with the Update job API.
|
|
245
|
+
* @param resourceGroupName The Resource Group Name
|
|
246
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
247
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
248
|
+
* @param jobResource Job details from request body.
|
|
249
|
+
* @param options The options parameters.
|
|
250
|
+
*/
|
|
251
|
+
beginCreateAndWait(resourceGroupName, jobName, jobResource, options) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
253
|
+
const poller = yield this.beginCreate(resourceGroupName, jobName, jobResource, options);
|
|
254
|
+
return poller.pollUntilDone();
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Deletes a job.
|
|
259
|
+
* @param resourceGroupName The Resource Group Name
|
|
260
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
261
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
262
|
+
* @param options The options parameters.
|
|
263
|
+
*/
|
|
264
|
+
beginDelete(resourceGroupName, jobName, options) {
|
|
265
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
266
|
+
const directSendOperation = (args, spec) => __awaiter(this, void 0, void 0, function* () {
|
|
267
|
+
return this.client.sendOperationRequest(args, spec);
|
|
268
|
+
});
|
|
269
|
+
const sendOperation = (args, spec) => __awaiter(this, void 0, void 0, function* () {
|
|
270
|
+
var _a;
|
|
271
|
+
let currentRawResponse = undefined;
|
|
272
|
+
const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
|
|
273
|
+
const callback = (rawResponse, flatResponse) => {
|
|
274
|
+
currentRawResponse = rawResponse;
|
|
275
|
+
providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
|
|
276
|
+
};
|
|
277
|
+
const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
|
|
278
|
+
const flatResponse = yield directSendOperation(updatedArgs, spec);
|
|
279
|
+
return {
|
|
280
|
+
flatResponse,
|
|
281
|
+
rawResponse: {
|
|
282
|
+
statusCode: currentRawResponse.status,
|
|
283
|
+
body: currentRawResponse.parsedBody,
|
|
284
|
+
headers: currentRawResponse.headers.toJSON()
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
});
|
|
288
|
+
const lro = new LroImpl(sendOperation, { resourceGroupName, jobName, options }, deleteOperationSpec);
|
|
289
|
+
return new LroEngine(lro, {
|
|
290
|
+
resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
|
|
291
|
+
intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
|
|
292
|
+
});
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Deletes a job.
|
|
297
|
+
* @param resourceGroupName The Resource Group Name
|
|
298
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
299
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
300
|
+
* @param options The options parameters.
|
|
301
|
+
*/
|
|
302
|
+
beginDeleteAndWait(resourceGroupName, jobName, options) {
|
|
303
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
304
|
+
const poller = yield this.beginDelete(resourceGroupName, jobName, options);
|
|
305
|
+
return poller.pollUntilDone();
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Updates the properties of an existing job.
|
|
310
|
+
* @param resourceGroupName The Resource Group Name
|
|
311
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
312
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
313
|
+
* @param jobResourceUpdateParameter Job update parameters from request body.
|
|
314
|
+
* @param options The options parameters.
|
|
315
|
+
*/
|
|
316
|
+
beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options) {
|
|
317
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
318
|
+
const directSendOperation = (args, spec) => __awaiter(this, void 0, void 0, function* () {
|
|
319
|
+
return this.client.sendOperationRequest(args, spec);
|
|
320
|
+
});
|
|
321
|
+
const sendOperation = (args, spec) => __awaiter(this, void 0, void 0, function* () {
|
|
322
|
+
var _a;
|
|
323
|
+
let currentRawResponse = undefined;
|
|
324
|
+
const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
|
|
325
|
+
const callback = (rawResponse, flatResponse) => {
|
|
326
|
+
currentRawResponse = rawResponse;
|
|
327
|
+
providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
|
|
328
|
+
};
|
|
329
|
+
const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
|
|
330
|
+
const flatResponse = yield directSendOperation(updatedArgs, spec);
|
|
331
|
+
return {
|
|
332
|
+
flatResponse,
|
|
333
|
+
rawResponse: {
|
|
334
|
+
statusCode: currentRawResponse.status,
|
|
335
|
+
body: currentRawResponse.parsedBody,
|
|
336
|
+
headers: currentRawResponse.headers.toJSON()
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
});
|
|
340
|
+
const lro = new LroImpl(sendOperation, { resourceGroupName, jobName, jobResourceUpdateParameter, options }, updateOperationSpec);
|
|
341
|
+
return new LroEngine(lro, {
|
|
342
|
+
resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
|
|
343
|
+
intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
|
|
344
|
+
});
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Updates the properties of an existing job.
|
|
349
|
+
* @param resourceGroupName The Resource Group Name
|
|
350
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
351
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
352
|
+
* @param jobResourceUpdateParameter Job update parameters from request body.
|
|
353
|
+
* @param options The options parameters.
|
|
354
|
+
*/
|
|
355
|
+
beginUpdateAndWait(resourceGroupName, jobName, jobResourceUpdateParameter, options) {
|
|
356
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
357
|
+
const poller = yield this.beginUpdate(resourceGroupName, jobName, jobResourceUpdateParameter, options);
|
|
358
|
+
return poller.pollUntilDone();
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Book shipment pick up.
|
|
363
|
+
* @param resourceGroupName The Resource Group Name
|
|
364
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
365
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
366
|
+
* @param shipmentPickUpRequest Details of shipment pick up request.
|
|
367
|
+
* @param options The options parameters.
|
|
368
|
+
*/
|
|
369
|
+
bookShipmentPickUp(resourceGroupName, jobName, shipmentPickUpRequest, options) {
|
|
370
|
+
return this.client.sendOperationRequest({ resourceGroupName, jobName, shipmentPickUpRequest, options }, bookShipmentPickUpOperationSpec);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* CancelJob.
|
|
374
|
+
* @param resourceGroupName The Resource Group Name
|
|
375
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
376
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
377
|
+
* @param cancellationReason Reason for cancellation.
|
|
378
|
+
* @param options The options parameters.
|
|
379
|
+
*/
|
|
380
|
+
cancel(resourceGroupName, jobName, cancellationReason, options) {
|
|
381
|
+
return this.client.sendOperationRequest({ resourceGroupName, jobName, cancellationReason, options }, cancelOperationSpec);
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* This method gets the unencrypted secrets related to the job.
|
|
385
|
+
* @param resourceGroupName The Resource Group Name
|
|
386
|
+
* @param jobName The name of the job Resource within the specified resource group. job names must be
|
|
387
|
+
* between 3 and 24 characters in length and use any alphanumeric and underscore only
|
|
388
|
+
* @param options The options parameters.
|
|
389
|
+
*/
|
|
390
|
+
_listCredentials(resourceGroupName, jobName, options) {
|
|
391
|
+
return this.client.sendOperationRequest({ resourceGroupName, jobName, options }, listCredentialsOperationSpec);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* ListNext
|
|
395
|
+
* @param nextLink The nextLink from the previous successful call to the List method.
|
|
396
|
+
* @param options The options parameters.
|
|
397
|
+
*/
|
|
398
|
+
_listNext(nextLink, options) {
|
|
399
|
+
return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* ListByResourceGroupNext
|
|
403
|
+
* @param resourceGroupName The Resource Group Name
|
|
404
|
+
* @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
|
|
405
|
+
* @param options The options parameters.
|
|
406
|
+
*/
|
|
407
|
+
_listByResourceGroupNext(resourceGroupName, nextLink, options) {
|
|
408
|
+
return this.client.sendOperationRequest({ resourceGroupName, nextLink, options }, listByResourceGroupNextOperationSpec);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
// Operation Specifications
|
|
412
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
413
|
+
const listOperationSpec = {
|
|
414
|
+
path: "/subscriptions/{subscriptionId}/providers/Microsoft.DataBox/jobs",
|
|
415
|
+
httpMethod: "GET",
|
|
416
|
+
responses: {
|
|
417
|
+
200: {
|
|
418
|
+
bodyMapper: Mappers.JobResourceList
|
|
419
|
+
},
|
|
420
|
+
default: {
|
|
421
|
+
bodyMapper: Mappers.ApiError
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
queryParameters: [Parameters.apiVersion, Parameters.skipToken],
|
|
425
|
+
urlParameters: [Parameters.$host, Parameters.subscriptionId],
|
|
426
|
+
headerParameters: [Parameters.accept],
|
|
427
|
+
serializer
|
|
428
|
+
};
|
|
429
|
+
const markDevicesShippedOperationSpec = {
|
|
430
|
+
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/markDevicesShipped",
|
|
431
|
+
httpMethod: "POST",
|
|
432
|
+
responses: {
|
|
433
|
+
204: {},
|
|
434
|
+
default: {
|
|
435
|
+
bodyMapper: Mappers.ApiError
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
requestBody: Parameters.markDevicesShippedRequest,
|
|
439
|
+
queryParameters: [Parameters.apiVersion],
|
|
440
|
+
urlParameters: [
|
|
441
|
+
Parameters.$host,
|
|
442
|
+
Parameters.subscriptionId,
|
|
443
|
+
Parameters.jobName,
|
|
444
|
+
Parameters.resourceGroupName
|
|
445
|
+
],
|
|
446
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
447
|
+
mediaType: "json",
|
|
448
|
+
serializer
|
|
449
|
+
};
|
|
450
|
+
const listByResourceGroupOperationSpec = {
|
|
451
|
+
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs",
|
|
452
|
+
httpMethod: "GET",
|
|
453
|
+
responses: {
|
|
454
|
+
200: {
|
|
455
|
+
bodyMapper: Mappers.JobResourceList
|
|
456
|
+
},
|
|
457
|
+
default: {
|
|
458
|
+
bodyMapper: Mappers.ApiError
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
queryParameters: [Parameters.apiVersion, Parameters.skipToken],
|
|
462
|
+
urlParameters: [
|
|
463
|
+
Parameters.$host,
|
|
464
|
+
Parameters.subscriptionId,
|
|
465
|
+
Parameters.resourceGroupName
|
|
466
|
+
],
|
|
467
|
+
headerParameters: [Parameters.accept],
|
|
468
|
+
serializer
|
|
469
|
+
};
|
|
470
|
+
const getOperationSpec = {
|
|
471
|
+
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
|
|
472
|
+
httpMethod: "GET",
|
|
473
|
+
responses: {
|
|
474
|
+
200: {
|
|
475
|
+
bodyMapper: Mappers.JobResource
|
|
476
|
+
},
|
|
477
|
+
default: {
|
|
478
|
+
bodyMapper: Mappers.ApiError
|
|
479
|
+
}
|
|
480
|
+
},
|
|
481
|
+
queryParameters: [Parameters.apiVersion, Parameters.expand],
|
|
482
|
+
urlParameters: [
|
|
483
|
+
Parameters.$host,
|
|
484
|
+
Parameters.subscriptionId,
|
|
485
|
+
Parameters.jobName,
|
|
486
|
+
Parameters.resourceGroupName
|
|
487
|
+
],
|
|
488
|
+
headerParameters: [Parameters.accept],
|
|
489
|
+
serializer
|
|
490
|
+
};
|
|
491
|
+
const createOperationSpec = {
|
|
492
|
+
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
|
|
493
|
+
httpMethod: "PUT",
|
|
494
|
+
responses: {
|
|
495
|
+
200: {
|
|
496
|
+
bodyMapper: Mappers.JobResource
|
|
497
|
+
},
|
|
498
|
+
201: {
|
|
499
|
+
bodyMapper: Mappers.JobResource
|
|
500
|
+
},
|
|
501
|
+
202: {
|
|
502
|
+
bodyMapper: Mappers.JobResource
|
|
503
|
+
},
|
|
504
|
+
204: {
|
|
505
|
+
bodyMapper: Mappers.JobResource
|
|
506
|
+
},
|
|
507
|
+
default: {
|
|
508
|
+
bodyMapper: Mappers.ApiError
|
|
509
|
+
}
|
|
510
|
+
},
|
|
511
|
+
requestBody: Parameters.jobResource,
|
|
512
|
+
queryParameters: [Parameters.apiVersion],
|
|
513
|
+
urlParameters: [
|
|
514
|
+
Parameters.$host,
|
|
515
|
+
Parameters.subscriptionId,
|
|
516
|
+
Parameters.jobName,
|
|
517
|
+
Parameters.resourceGroupName
|
|
518
|
+
],
|
|
519
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
520
|
+
mediaType: "json",
|
|
521
|
+
serializer
|
|
522
|
+
};
|
|
523
|
+
const deleteOperationSpec = {
|
|
524
|
+
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
|
|
525
|
+
httpMethod: "DELETE",
|
|
526
|
+
responses: {
|
|
527
|
+
200: {},
|
|
528
|
+
201: {},
|
|
529
|
+
202: {},
|
|
530
|
+
204: {},
|
|
531
|
+
default: {
|
|
532
|
+
bodyMapper: Mappers.ApiError
|
|
533
|
+
}
|
|
534
|
+
},
|
|
535
|
+
queryParameters: [Parameters.apiVersion],
|
|
536
|
+
urlParameters: [
|
|
537
|
+
Parameters.$host,
|
|
538
|
+
Parameters.subscriptionId,
|
|
539
|
+
Parameters.jobName,
|
|
540
|
+
Parameters.resourceGroupName
|
|
541
|
+
],
|
|
542
|
+
headerParameters: [Parameters.accept],
|
|
543
|
+
serializer
|
|
544
|
+
};
|
|
545
|
+
const updateOperationSpec = {
|
|
546
|
+
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}",
|
|
547
|
+
httpMethod: "PATCH",
|
|
548
|
+
responses: {
|
|
549
|
+
200: {
|
|
550
|
+
bodyMapper: Mappers.JobResource
|
|
551
|
+
},
|
|
552
|
+
201: {
|
|
553
|
+
bodyMapper: Mappers.JobResource
|
|
554
|
+
},
|
|
555
|
+
202: {
|
|
556
|
+
bodyMapper: Mappers.JobResource
|
|
557
|
+
},
|
|
558
|
+
204: {
|
|
559
|
+
bodyMapper: Mappers.JobResource
|
|
560
|
+
},
|
|
561
|
+
default: {
|
|
562
|
+
bodyMapper: Mappers.ApiError
|
|
563
|
+
}
|
|
564
|
+
},
|
|
565
|
+
requestBody: Parameters.jobResourceUpdateParameter,
|
|
566
|
+
queryParameters: [Parameters.apiVersion],
|
|
567
|
+
urlParameters: [
|
|
568
|
+
Parameters.$host,
|
|
569
|
+
Parameters.subscriptionId,
|
|
570
|
+
Parameters.jobName,
|
|
571
|
+
Parameters.resourceGroupName
|
|
572
|
+
],
|
|
573
|
+
headerParameters: [
|
|
574
|
+
Parameters.accept,
|
|
575
|
+
Parameters.contentType,
|
|
576
|
+
Parameters.ifMatch
|
|
577
|
+
],
|
|
578
|
+
mediaType: "json",
|
|
579
|
+
serializer
|
|
580
|
+
};
|
|
581
|
+
const bookShipmentPickUpOperationSpec = {
|
|
582
|
+
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/bookShipmentPickUp",
|
|
583
|
+
httpMethod: "POST",
|
|
584
|
+
responses: {
|
|
585
|
+
200: {
|
|
586
|
+
bodyMapper: Mappers.ShipmentPickUpResponse
|
|
587
|
+
},
|
|
588
|
+
default: {
|
|
589
|
+
bodyMapper: Mappers.ApiError
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
requestBody: Parameters.shipmentPickUpRequest,
|
|
593
|
+
queryParameters: [Parameters.apiVersion],
|
|
594
|
+
urlParameters: [
|
|
595
|
+
Parameters.$host,
|
|
596
|
+
Parameters.subscriptionId,
|
|
597
|
+
Parameters.jobName,
|
|
598
|
+
Parameters.resourceGroupName
|
|
599
|
+
],
|
|
600
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
601
|
+
mediaType: "json",
|
|
602
|
+
serializer
|
|
603
|
+
};
|
|
604
|
+
const cancelOperationSpec = {
|
|
605
|
+
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/cancel",
|
|
606
|
+
httpMethod: "POST",
|
|
607
|
+
responses: {
|
|
608
|
+
204: {},
|
|
609
|
+
default: {
|
|
610
|
+
bodyMapper: Mappers.ApiError
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
requestBody: Parameters.cancellationReason,
|
|
614
|
+
queryParameters: [Parameters.apiVersion],
|
|
615
|
+
urlParameters: [
|
|
616
|
+
Parameters.$host,
|
|
617
|
+
Parameters.subscriptionId,
|
|
618
|
+
Parameters.jobName,
|
|
619
|
+
Parameters.resourceGroupName
|
|
620
|
+
],
|
|
621
|
+
headerParameters: [Parameters.accept, Parameters.contentType],
|
|
622
|
+
mediaType: "json",
|
|
623
|
+
serializer
|
|
624
|
+
};
|
|
625
|
+
const listCredentialsOperationSpec = {
|
|
626
|
+
path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/jobs/{jobName}/listCredentials",
|
|
627
|
+
httpMethod: "POST",
|
|
628
|
+
responses: {
|
|
629
|
+
200: {
|
|
630
|
+
bodyMapper: Mappers.UnencryptedCredentialsList
|
|
631
|
+
},
|
|
632
|
+
default: {
|
|
633
|
+
bodyMapper: Mappers.ApiError
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
queryParameters: [Parameters.apiVersion],
|
|
637
|
+
urlParameters: [
|
|
638
|
+
Parameters.$host,
|
|
639
|
+
Parameters.subscriptionId,
|
|
640
|
+
Parameters.jobName,
|
|
641
|
+
Parameters.resourceGroupName
|
|
642
|
+
],
|
|
643
|
+
headerParameters: [Parameters.accept],
|
|
644
|
+
serializer
|
|
645
|
+
};
|
|
646
|
+
const listNextOperationSpec = {
|
|
647
|
+
path: "{nextLink}",
|
|
648
|
+
httpMethod: "GET",
|
|
649
|
+
responses: {
|
|
650
|
+
200: {
|
|
651
|
+
bodyMapper: Mappers.JobResourceList
|
|
652
|
+
},
|
|
653
|
+
default: {
|
|
654
|
+
bodyMapper: Mappers.ApiError
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
queryParameters: [Parameters.apiVersion, Parameters.skipToken],
|
|
658
|
+
urlParameters: [
|
|
659
|
+
Parameters.$host,
|
|
660
|
+
Parameters.nextLink,
|
|
661
|
+
Parameters.subscriptionId
|
|
662
|
+
],
|
|
663
|
+
headerParameters: [Parameters.accept],
|
|
664
|
+
serializer
|
|
665
|
+
};
|
|
666
|
+
const listByResourceGroupNextOperationSpec = {
|
|
667
|
+
path: "{nextLink}",
|
|
668
|
+
httpMethod: "GET",
|
|
669
|
+
responses: {
|
|
670
|
+
200: {
|
|
671
|
+
bodyMapper: Mappers.JobResourceList
|
|
672
|
+
},
|
|
673
|
+
default: {
|
|
674
|
+
bodyMapper: Mappers.ApiError
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
queryParameters: [Parameters.apiVersion, Parameters.skipToken],
|
|
678
|
+
urlParameters: [
|
|
679
|
+
Parameters.$host,
|
|
680
|
+
Parameters.nextLink,
|
|
681
|
+
Parameters.subscriptionId,
|
|
682
|
+
Parameters.resourceGroupName
|
|
683
|
+
],
|
|
684
|
+
headerParameters: [Parameters.accept],
|
|
685
|
+
serializer
|
|
686
|
+
};
|
|
687
|
+
//# sourceMappingURL=jobs.js.map
|