@azure/arm-deviceprovisioningservices 2.1.0 → 4.0.0
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/LICENSE.txt +21 -21
- package/README.md +98 -96
- package/dist/index.js +3108 -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/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/iotDpsClient.d.ts +20 -0
- package/dist-esm/src/iotDpsClient.d.ts.map +1 -0
- package/dist-esm/src/iotDpsClient.js +53 -0
- package/dist-esm/src/iotDpsClient.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 +825 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +72 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +36 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +565 -322
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +34 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +293 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/dpsCertificate.d.ts +70 -0
- package/dist-esm/src/operations/dpsCertificate.d.ts.map +1 -0
- package/dist-esm/src/operations/dpsCertificate.js +289 -0
- package/dist-esm/src/operations/dpsCertificate.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/{esm → dist-esm/src}/operations/index.js +3 -5
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/iotDpsResource.d.ts +253 -0
- package/dist-esm/src/operations/iotDpsResource.d.ts.map +1 -0
- package/dist-esm/src/operations/iotDpsResource.js +1154 -0
- package/dist-esm/src/operations/iotDpsResource.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/operationsInterfaces/dpsCertificate.d.ts +62 -0
- package/dist-esm/src/operationsInterfaces/dpsCertificate.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/dpsCertificate.js +9 -0
- package/dist-esm/src/operationsInterfaces/dpsCertificate.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/iotDpsResource.d.ts +183 -0
- package/dist-esm/src/operationsInterfaces/iotDpsResource.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/iotDpsResource.js +9 -0
- package/dist-esm/src/operationsInterfaces/iotDpsResource.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/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 +70 -34
- package/review/arm-deviceprovisioningservices.api.md +690 -0
- package/rollup.config.js +184 -27
- package/src/index.ts +12 -0
- package/src/iotDpsClient.ts +87 -0
- package/src/lroImpl.ts +34 -0
- package/src/models/index.ts +946 -0
- package/{lib → src}/models/mappers.ts +576 -323
- package/src/models/parameters.ts +337 -0
- package/src/operations/dpsCertificate.ts +374 -0
- package/{lib → src}/operations/index.ts +3 -5
- package/src/operations/iotDpsResource.ts +1595 -0
- package/src/operations/operations.ts +137 -0
- package/src/operationsInterfaces/dpsCertificate.ts +118 -0
- package/src/operationsInterfaces/index.ts +11 -0
- package/src/operationsInterfaces/iotDpsResource.ts +351 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/tsconfig.json +4 -4
- package/types/arm-deviceprovisioningservices.d.ts +1205 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-deviceprovisioningservices.js +0 -2251
- package/dist/arm-deviceprovisioningservices.js.map +0 -1
- package/dist/arm-deviceprovisioningservices.min.js +0 -1
- package/dist/arm-deviceprovisioningservices.min.js.map +0 -1
- package/esm/iotDpsClient.d.ts +0 -20
- package/esm/iotDpsClient.d.ts.map +0 -1
- package/esm/iotDpsClient.js +0 -35
- package/esm/iotDpsClient.js.map +0 -1
- package/esm/iotDpsClientContext.d.ts +0 -16
- package/esm/iotDpsClientContext.d.ts.map +0 -1
- package/esm/iotDpsClientContext.js +0 -56
- package/esm/iotDpsClientContext.js.map +0 -1
- package/esm/models/dpsCertificateMappers.d.ts +0 -2
- package/esm/models/dpsCertificateMappers.d.ts.map +0 -1
- package/esm/models/dpsCertificateMappers.js +0 -11
- package/esm/models/dpsCertificateMappers.js.map +0 -1
- package/esm/models/index.d.ts +0 -1273
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js +0 -10
- package/esm/models/index.js.map +0 -1
- package/esm/models/iotDpsResourceMappers.d.ts +0 -2
- package/esm/models/iotDpsResourceMappers.d.ts.map +0 -1
- package/esm/models/iotDpsResourceMappers.js +0 -11
- package/esm/models/iotDpsResourceMappers.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -30
- package/esm/models/mappers.d.ts.map +0 -1
- 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 -11
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -23
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js +0 -243
- package/esm/models/parameters.js.map +0 -1
- package/esm/operations/dpsCertificate.d.ts +0 -188
- package/esm/operations/dpsCertificate.d.ts.map +0 -1
- package/esm/operations/dpsCertificate.js +0 -265
- package/esm/operations/dpsCertificate.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/iotDpsResource.d.ts +0 -337
- package/esm/operations/iotDpsResource.d.ts.map +0 -1
- package/esm/operations/iotDpsResource.js +0 -560
- package/esm/operations/iotDpsResource.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/lib/iotDpsClient.ts +0 -46
- package/lib/iotDpsClientContext.ts +0 -62
- package/lib/models/dpsCertificateMappers.ts +0 -28
- package/lib/models/index.ts +0 -1342
- package/lib/models/iotDpsResourceMappers.ts +0 -35
- package/lib/models/operationsMappers.ts +0 -17
- package/lib/models/parameters.ts +0 -245
- package/lib/operations/dpsCertificate.ts +0 -478
- package/lib/operations/iotDpsResource.ts +0 -907
- package/lib/operations/operations.ts +0 -123
|
@@ -0,0 +1,337 @@
|
|
|
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
|
+
|
|
9
|
+
import {
|
|
10
|
+
OperationParameter,
|
|
11
|
+
OperationURLParameter,
|
|
12
|
+
OperationQueryParameter
|
|
13
|
+
} from "@azure/core-client";
|
|
14
|
+
import {
|
|
15
|
+
CertificateBodyDescription as CertificateBodyDescriptionMapper,
|
|
16
|
+
VerificationCodeRequest as VerificationCodeRequestMapper,
|
|
17
|
+
ProvisioningServiceDescription as ProvisioningServiceDescriptionMapper,
|
|
18
|
+
TagsResource as TagsResourceMapper,
|
|
19
|
+
OperationInputs as OperationInputsMapper,
|
|
20
|
+
PrivateEndpointConnection as PrivateEndpointConnectionMapper
|
|
21
|
+
} from "../models/mappers";
|
|
22
|
+
|
|
23
|
+
export const accept: OperationParameter = {
|
|
24
|
+
parameterPath: "accept",
|
|
25
|
+
mapper: {
|
|
26
|
+
defaultValue: "application/json",
|
|
27
|
+
isConstant: true,
|
|
28
|
+
serializedName: "Accept",
|
|
29
|
+
type: {
|
|
30
|
+
name: "String"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const $host: OperationURLParameter = {
|
|
36
|
+
parameterPath: "$host",
|
|
37
|
+
mapper: {
|
|
38
|
+
serializedName: "$host",
|
|
39
|
+
required: true,
|
|
40
|
+
type: {
|
|
41
|
+
name: "String"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
skipEncoding: true
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const apiVersion: OperationQueryParameter = {
|
|
48
|
+
parameterPath: "apiVersion",
|
|
49
|
+
mapper: {
|
|
50
|
+
defaultValue: "2020-03-01",
|
|
51
|
+
isConstant: true,
|
|
52
|
+
serializedName: "api-version",
|
|
53
|
+
type: {
|
|
54
|
+
name: "String"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const nextLink: OperationURLParameter = {
|
|
60
|
+
parameterPath: "nextLink",
|
|
61
|
+
mapper: {
|
|
62
|
+
serializedName: "nextLink",
|
|
63
|
+
required: true,
|
|
64
|
+
type: {
|
|
65
|
+
name: "String"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
skipEncoding: true
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const certificateName: OperationURLParameter = {
|
|
72
|
+
parameterPath: "certificateName",
|
|
73
|
+
mapper: {
|
|
74
|
+
serializedName: "certificateName",
|
|
75
|
+
required: true,
|
|
76
|
+
type: {
|
|
77
|
+
name: "String"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const subscriptionId: OperationURLParameter = {
|
|
83
|
+
parameterPath: "subscriptionId",
|
|
84
|
+
mapper: {
|
|
85
|
+
serializedName: "subscriptionId",
|
|
86
|
+
required: true,
|
|
87
|
+
type: {
|
|
88
|
+
name: "String"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export const resourceGroupName: OperationURLParameter = {
|
|
94
|
+
parameterPath: "resourceGroupName",
|
|
95
|
+
mapper: {
|
|
96
|
+
serializedName: "resourceGroupName",
|
|
97
|
+
required: true,
|
|
98
|
+
type: {
|
|
99
|
+
name: "String"
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const provisioningServiceName: OperationURLParameter = {
|
|
105
|
+
parameterPath: "provisioningServiceName",
|
|
106
|
+
mapper: {
|
|
107
|
+
serializedName: "provisioningServiceName",
|
|
108
|
+
required: true,
|
|
109
|
+
type: {
|
|
110
|
+
name: "String"
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export const ifMatch: OperationParameter = {
|
|
116
|
+
parameterPath: ["options", "ifMatch"],
|
|
117
|
+
mapper: {
|
|
118
|
+
serializedName: "If-Match",
|
|
119
|
+
type: {
|
|
120
|
+
name: "String"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export const contentType: OperationParameter = {
|
|
126
|
+
parameterPath: ["options", "contentType"],
|
|
127
|
+
mapper: {
|
|
128
|
+
defaultValue: "application/json",
|
|
129
|
+
isConstant: true,
|
|
130
|
+
serializedName: "Content-Type",
|
|
131
|
+
type: {
|
|
132
|
+
name: "String"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export const certificateDescription: OperationParameter = {
|
|
138
|
+
parameterPath: "certificateDescription",
|
|
139
|
+
mapper: CertificateBodyDescriptionMapper
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const certificateName1: OperationURLParameter = {
|
|
143
|
+
parameterPath: "certificateName",
|
|
144
|
+
mapper: {
|
|
145
|
+
constraints: {
|
|
146
|
+
MaxLength: 256
|
|
147
|
+
},
|
|
148
|
+
serializedName: "certificateName",
|
|
149
|
+
required: true,
|
|
150
|
+
type: {
|
|
151
|
+
name: "String"
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const ifMatch1: OperationParameter = {
|
|
157
|
+
parameterPath: "ifMatch",
|
|
158
|
+
mapper: {
|
|
159
|
+
serializedName: "If-Match",
|
|
160
|
+
required: true,
|
|
161
|
+
type: {
|
|
162
|
+
name: "String"
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const certificateName11: OperationQueryParameter = {
|
|
168
|
+
parameterPath: ["options", "certificateName1"],
|
|
169
|
+
mapper: {
|
|
170
|
+
serializedName: "certificate.name",
|
|
171
|
+
type: {
|
|
172
|
+
name: "String"
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const certificateRawBytes: OperationQueryParameter = {
|
|
178
|
+
parameterPath: ["options", "certificateRawBytes"],
|
|
179
|
+
mapper: {
|
|
180
|
+
serializedName: "certificate.rawBytes",
|
|
181
|
+
type: {
|
|
182
|
+
name: "ByteArray"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export const certificateIsVerified: OperationQueryParameter = {
|
|
188
|
+
parameterPath: ["options", "certificateIsVerified"],
|
|
189
|
+
mapper: {
|
|
190
|
+
serializedName: "certificate.isVerified",
|
|
191
|
+
type: {
|
|
192
|
+
name: "Boolean"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export const certificatePurpose: OperationQueryParameter = {
|
|
198
|
+
parameterPath: ["options", "certificatePurpose"],
|
|
199
|
+
mapper: {
|
|
200
|
+
serializedName: "certificate.purpose",
|
|
201
|
+
type: {
|
|
202
|
+
name: "String"
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
export const certificateCreated: OperationQueryParameter = {
|
|
208
|
+
parameterPath: ["options", "certificateCreated"],
|
|
209
|
+
mapper: {
|
|
210
|
+
serializedName: "certificate.created",
|
|
211
|
+
type: {
|
|
212
|
+
name: "DateTime"
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
export const certificateLastUpdated: OperationQueryParameter = {
|
|
218
|
+
parameterPath: ["options", "certificateLastUpdated"],
|
|
219
|
+
mapper: {
|
|
220
|
+
serializedName: "certificate.lastUpdated",
|
|
221
|
+
type: {
|
|
222
|
+
name: "DateTime"
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
export const certificateHasPrivateKey: OperationQueryParameter = {
|
|
228
|
+
parameterPath: ["options", "certificateHasPrivateKey"],
|
|
229
|
+
mapper: {
|
|
230
|
+
serializedName: "certificate.hasPrivateKey",
|
|
231
|
+
type: {
|
|
232
|
+
name: "Boolean"
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
export const certificateNonce: OperationQueryParameter = {
|
|
238
|
+
parameterPath: ["options", "certificateNonce"],
|
|
239
|
+
mapper: {
|
|
240
|
+
serializedName: "certificate.nonce",
|
|
241
|
+
type: {
|
|
242
|
+
name: "String"
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
export const request: OperationParameter = {
|
|
248
|
+
parameterPath: "request",
|
|
249
|
+
mapper: VerificationCodeRequestMapper
|
|
250
|
+
};
|
|
251
|
+
|
|
252
|
+
export const iotDpsDescription: OperationParameter = {
|
|
253
|
+
parameterPath: "iotDpsDescription",
|
|
254
|
+
mapper: ProvisioningServiceDescriptionMapper
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
export const provisioningServiceTags: OperationParameter = {
|
|
258
|
+
parameterPath: "provisioningServiceTags",
|
|
259
|
+
mapper: TagsResourceMapper
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
export const operationId: OperationURLParameter = {
|
|
263
|
+
parameterPath: "operationId",
|
|
264
|
+
mapper: {
|
|
265
|
+
serializedName: "operationId",
|
|
266
|
+
required: true,
|
|
267
|
+
type: {
|
|
268
|
+
name: "String"
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
export const asyncinfo: OperationQueryParameter = {
|
|
274
|
+
parameterPath: "asyncinfo",
|
|
275
|
+
mapper: {
|
|
276
|
+
defaultValue: "true",
|
|
277
|
+
serializedName: "asyncinfo",
|
|
278
|
+
required: true,
|
|
279
|
+
type: {
|
|
280
|
+
name: "String"
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
export const argumentsParam: OperationParameter = {
|
|
286
|
+
parameterPath: "argumentsParam",
|
|
287
|
+
mapper: OperationInputsMapper
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export const keyName: OperationURLParameter = {
|
|
291
|
+
parameterPath: "keyName",
|
|
292
|
+
mapper: {
|
|
293
|
+
serializedName: "keyName",
|
|
294
|
+
required: true,
|
|
295
|
+
type: {
|
|
296
|
+
name: "String"
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export const resourceName: OperationURLParameter = {
|
|
302
|
+
parameterPath: "resourceName",
|
|
303
|
+
mapper: {
|
|
304
|
+
serializedName: "resourceName",
|
|
305
|
+
required: true,
|
|
306
|
+
type: {
|
|
307
|
+
name: "String"
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
export const groupId: OperationURLParameter = {
|
|
313
|
+
parameterPath: "groupId",
|
|
314
|
+
mapper: {
|
|
315
|
+
serializedName: "groupId",
|
|
316
|
+
required: true,
|
|
317
|
+
type: {
|
|
318
|
+
name: "String"
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
|
|
323
|
+
export const privateEndpointConnectionName: OperationURLParameter = {
|
|
324
|
+
parameterPath: "privateEndpointConnectionName",
|
|
325
|
+
mapper: {
|
|
326
|
+
serializedName: "privateEndpointConnectionName",
|
|
327
|
+
required: true,
|
|
328
|
+
type: {
|
|
329
|
+
name: "String"
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
export const privateEndpointConnection: OperationParameter = {
|
|
335
|
+
parameterPath: "privateEndpointConnection",
|
|
336
|
+
mapper: PrivateEndpointConnectionMapper
|
|
337
|
+
};
|
|
@@ -0,0 +1,374 @@
|
|
|
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
|
+
|
|
9
|
+
import { DpsCertificate } from "../operationsInterfaces";
|
|
10
|
+
import * as coreClient from "@azure/core-client";
|
|
11
|
+
import * as Mappers from "../models/mappers";
|
|
12
|
+
import * as Parameters from "../models/parameters";
|
|
13
|
+
import { IotDpsClient } from "../iotDpsClient";
|
|
14
|
+
import {
|
|
15
|
+
DpsCertificateGetOptionalParams,
|
|
16
|
+
DpsCertificateGetResponse,
|
|
17
|
+
CertificateBodyDescription,
|
|
18
|
+
DpsCertificateCreateOrUpdateOptionalParams,
|
|
19
|
+
DpsCertificateCreateOrUpdateResponse,
|
|
20
|
+
DpsCertificateDeleteOptionalParams,
|
|
21
|
+
DpsCertificateListOptionalParams,
|
|
22
|
+
DpsCertificateListResponse,
|
|
23
|
+
DpsCertificateGenerateVerificationCodeOptionalParams,
|
|
24
|
+
DpsCertificateGenerateVerificationCodeResponse,
|
|
25
|
+
VerificationCodeRequest,
|
|
26
|
+
DpsCertificateVerifyCertificateOptionalParams,
|
|
27
|
+
DpsCertificateVerifyCertificateResponse
|
|
28
|
+
} from "../models";
|
|
29
|
+
|
|
30
|
+
/** Class containing DpsCertificate operations. */
|
|
31
|
+
export class DpsCertificateImpl implements DpsCertificate {
|
|
32
|
+
private readonly client: IotDpsClient;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Initialize a new instance of the class DpsCertificate class.
|
|
36
|
+
* @param client Reference to the service client
|
|
37
|
+
*/
|
|
38
|
+
constructor(client: IotDpsClient) {
|
|
39
|
+
this.client = client;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Get the certificate from the provisioning service.
|
|
44
|
+
* @param certificateName Name of the certificate to retrieve.
|
|
45
|
+
* @param resourceGroupName Resource group identifier.
|
|
46
|
+
* @param provisioningServiceName Name of the provisioning service the certificate is associated with.
|
|
47
|
+
* @param options The options parameters.
|
|
48
|
+
*/
|
|
49
|
+
get(
|
|
50
|
+
certificateName: string,
|
|
51
|
+
resourceGroupName: string,
|
|
52
|
+
provisioningServiceName: string,
|
|
53
|
+
options?: DpsCertificateGetOptionalParams
|
|
54
|
+
): Promise<DpsCertificateGetResponse> {
|
|
55
|
+
return this.client.sendOperationRequest(
|
|
56
|
+
{ certificateName, resourceGroupName, provisioningServiceName, options },
|
|
57
|
+
getOperationSpec
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Add new certificate or update an existing certificate.
|
|
63
|
+
* @param resourceGroupName Resource group identifier.
|
|
64
|
+
* @param provisioningServiceName The name of the provisioning service.
|
|
65
|
+
* @param certificateName The name of the certificate create or update.
|
|
66
|
+
* @param certificateDescription The certificate body.
|
|
67
|
+
* @param options The options parameters.
|
|
68
|
+
*/
|
|
69
|
+
createOrUpdate(
|
|
70
|
+
resourceGroupName: string,
|
|
71
|
+
provisioningServiceName: string,
|
|
72
|
+
certificateName: string,
|
|
73
|
+
certificateDescription: CertificateBodyDescription,
|
|
74
|
+
options?: DpsCertificateCreateOrUpdateOptionalParams
|
|
75
|
+
): Promise<DpsCertificateCreateOrUpdateResponse> {
|
|
76
|
+
return this.client.sendOperationRequest(
|
|
77
|
+
{
|
|
78
|
+
resourceGroupName,
|
|
79
|
+
provisioningServiceName,
|
|
80
|
+
certificateName,
|
|
81
|
+
certificateDescription,
|
|
82
|
+
options
|
|
83
|
+
},
|
|
84
|
+
createOrUpdateOperationSpec
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Deletes the specified certificate associated with the Provisioning Service
|
|
90
|
+
* @param resourceGroupName Resource group identifier.
|
|
91
|
+
* @param ifMatch ETag of the certificate
|
|
92
|
+
* @param provisioningServiceName The name of the provisioning service.
|
|
93
|
+
* @param certificateName This is a mandatory field, and is the logical name of the certificate that
|
|
94
|
+
* the provisioning service will access by.
|
|
95
|
+
* @param options The options parameters.
|
|
96
|
+
*/
|
|
97
|
+
delete(
|
|
98
|
+
resourceGroupName: string,
|
|
99
|
+
ifMatch: string,
|
|
100
|
+
provisioningServiceName: string,
|
|
101
|
+
certificateName: string,
|
|
102
|
+
options?: DpsCertificateDeleteOptionalParams
|
|
103
|
+
): Promise<void> {
|
|
104
|
+
return this.client.sendOperationRequest(
|
|
105
|
+
{
|
|
106
|
+
resourceGroupName,
|
|
107
|
+
ifMatch,
|
|
108
|
+
provisioningServiceName,
|
|
109
|
+
certificateName,
|
|
110
|
+
options
|
|
111
|
+
},
|
|
112
|
+
deleteOperationSpec
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Get all the certificates tied to the provisioning service.
|
|
118
|
+
* @param resourceGroupName Name of resource group.
|
|
119
|
+
* @param provisioningServiceName Name of provisioning service to retrieve certificates for.
|
|
120
|
+
* @param options The options parameters.
|
|
121
|
+
*/
|
|
122
|
+
list(
|
|
123
|
+
resourceGroupName: string,
|
|
124
|
+
provisioningServiceName: string,
|
|
125
|
+
options?: DpsCertificateListOptionalParams
|
|
126
|
+
): Promise<DpsCertificateListResponse> {
|
|
127
|
+
return this.client.sendOperationRequest(
|
|
128
|
+
{ resourceGroupName, provisioningServiceName, options },
|
|
129
|
+
listOperationSpec
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Generate verification code for Proof of Possession.
|
|
135
|
+
* @param certificateName The mandatory logical name of the certificate, that the provisioning service
|
|
136
|
+
* uses to access.
|
|
137
|
+
* @param ifMatch ETag of the certificate. This is required to update an existing certificate, and
|
|
138
|
+
* ignored while creating a brand new certificate.
|
|
139
|
+
* @param resourceGroupName name of resource group.
|
|
140
|
+
* @param provisioningServiceName Name of provisioning service.
|
|
141
|
+
* @param options The options parameters.
|
|
142
|
+
*/
|
|
143
|
+
generateVerificationCode(
|
|
144
|
+
certificateName: string,
|
|
145
|
+
ifMatch: string,
|
|
146
|
+
resourceGroupName: string,
|
|
147
|
+
provisioningServiceName: string,
|
|
148
|
+
options?: DpsCertificateGenerateVerificationCodeOptionalParams
|
|
149
|
+
): Promise<DpsCertificateGenerateVerificationCodeResponse> {
|
|
150
|
+
return this.client.sendOperationRequest(
|
|
151
|
+
{
|
|
152
|
+
certificateName,
|
|
153
|
+
ifMatch,
|
|
154
|
+
resourceGroupName,
|
|
155
|
+
provisioningServiceName,
|
|
156
|
+
options
|
|
157
|
+
},
|
|
158
|
+
generateVerificationCodeOperationSpec
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Verifies the certificate's private key possession by providing the leaf cert issued by the verifying
|
|
164
|
+
* pre uploaded certificate.
|
|
165
|
+
* @param certificateName The mandatory logical name of the certificate, that the provisioning service
|
|
166
|
+
* uses to access.
|
|
167
|
+
* @param ifMatch ETag of the certificate.
|
|
168
|
+
* @param resourceGroupName Resource group name.
|
|
169
|
+
* @param provisioningServiceName Provisioning service name.
|
|
170
|
+
* @param request The name of the certificate
|
|
171
|
+
* @param options The options parameters.
|
|
172
|
+
*/
|
|
173
|
+
verifyCertificate(
|
|
174
|
+
certificateName: string,
|
|
175
|
+
ifMatch: string,
|
|
176
|
+
resourceGroupName: string,
|
|
177
|
+
provisioningServiceName: string,
|
|
178
|
+
request: VerificationCodeRequest,
|
|
179
|
+
options?: DpsCertificateVerifyCertificateOptionalParams
|
|
180
|
+
): Promise<DpsCertificateVerifyCertificateResponse> {
|
|
181
|
+
return this.client.sendOperationRequest(
|
|
182
|
+
{
|
|
183
|
+
certificateName,
|
|
184
|
+
ifMatch,
|
|
185
|
+
resourceGroupName,
|
|
186
|
+
provisioningServiceName,
|
|
187
|
+
request,
|
|
188
|
+
options
|
|
189
|
+
},
|
|
190
|
+
verifyCertificateOperationSpec
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// Operation Specifications
|
|
195
|
+
const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
|
|
196
|
+
|
|
197
|
+
const getOperationSpec: coreClient.OperationSpec = {
|
|
198
|
+
path:
|
|
199
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}",
|
|
200
|
+
httpMethod: "GET",
|
|
201
|
+
responses: {
|
|
202
|
+
200: {
|
|
203
|
+
bodyMapper: Mappers.CertificateResponse
|
|
204
|
+
},
|
|
205
|
+
default: {
|
|
206
|
+
bodyMapper: Mappers.ErrorDetails
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
queryParameters: [Parameters.apiVersion],
|
|
210
|
+
urlParameters: [
|
|
211
|
+
Parameters.$host,
|
|
212
|
+
Parameters.certificateName,
|
|
213
|
+
Parameters.subscriptionId,
|
|
214
|
+
Parameters.resourceGroupName,
|
|
215
|
+
Parameters.provisioningServiceName
|
|
216
|
+
],
|
|
217
|
+
headerParameters: [Parameters.accept, Parameters.ifMatch],
|
|
218
|
+
serializer
|
|
219
|
+
};
|
|
220
|
+
const createOrUpdateOperationSpec: coreClient.OperationSpec = {
|
|
221
|
+
path:
|
|
222
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}",
|
|
223
|
+
httpMethod: "PUT",
|
|
224
|
+
responses: {
|
|
225
|
+
200: {
|
|
226
|
+
bodyMapper: Mappers.CertificateResponse
|
|
227
|
+
},
|
|
228
|
+
default: {
|
|
229
|
+
bodyMapper: Mappers.ErrorDetails
|
|
230
|
+
}
|
|
231
|
+
},
|
|
232
|
+
requestBody: Parameters.certificateDescription,
|
|
233
|
+
queryParameters: [Parameters.apiVersion],
|
|
234
|
+
urlParameters: [
|
|
235
|
+
Parameters.$host,
|
|
236
|
+
Parameters.subscriptionId,
|
|
237
|
+
Parameters.resourceGroupName,
|
|
238
|
+
Parameters.provisioningServiceName,
|
|
239
|
+
Parameters.certificateName1
|
|
240
|
+
],
|
|
241
|
+
headerParameters: [
|
|
242
|
+
Parameters.accept,
|
|
243
|
+
Parameters.ifMatch,
|
|
244
|
+
Parameters.contentType
|
|
245
|
+
],
|
|
246
|
+
mediaType: "json",
|
|
247
|
+
serializer
|
|
248
|
+
};
|
|
249
|
+
const deleteOperationSpec: coreClient.OperationSpec = {
|
|
250
|
+
path:
|
|
251
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}",
|
|
252
|
+
httpMethod: "DELETE",
|
|
253
|
+
responses: {
|
|
254
|
+
200: {},
|
|
255
|
+
204: {},
|
|
256
|
+
default: {
|
|
257
|
+
bodyMapper: Mappers.ErrorDetails
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
queryParameters: [
|
|
261
|
+
Parameters.apiVersion,
|
|
262
|
+
Parameters.certificateName11,
|
|
263
|
+
Parameters.certificateRawBytes,
|
|
264
|
+
Parameters.certificateIsVerified,
|
|
265
|
+
Parameters.certificatePurpose,
|
|
266
|
+
Parameters.certificateCreated,
|
|
267
|
+
Parameters.certificateLastUpdated,
|
|
268
|
+
Parameters.certificateHasPrivateKey,
|
|
269
|
+
Parameters.certificateNonce
|
|
270
|
+
],
|
|
271
|
+
urlParameters: [
|
|
272
|
+
Parameters.$host,
|
|
273
|
+
Parameters.certificateName,
|
|
274
|
+
Parameters.subscriptionId,
|
|
275
|
+
Parameters.resourceGroupName,
|
|
276
|
+
Parameters.provisioningServiceName
|
|
277
|
+
],
|
|
278
|
+
headerParameters: [Parameters.accept, Parameters.ifMatch1],
|
|
279
|
+
serializer
|
|
280
|
+
};
|
|
281
|
+
const listOperationSpec: coreClient.OperationSpec = {
|
|
282
|
+
path:
|
|
283
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates",
|
|
284
|
+
httpMethod: "GET",
|
|
285
|
+
responses: {
|
|
286
|
+
200: {
|
|
287
|
+
bodyMapper: Mappers.CertificateListDescription
|
|
288
|
+
},
|
|
289
|
+
default: {
|
|
290
|
+
bodyMapper: Mappers.ErrorDetails
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
queryParameters: [Parameters.apiVersion],
|
|
294
|
+
urlParameters: [
|
|
295
|
+
Parameters.$host,
|
|
296
|
+
Parameters.subscriptionId,
|
|
297
|
+
Parameters.resourceGroupName,
|
|
298
|
+
Parameters.provisioningServiceName
|
|
299
|
+
],
|
|
300
|
+
headerParameters: [Parameters.accept],
|
|
301
|
+
serializer
|
|
302
|
+
};
|
|
303
|
+
const generateVerificationCodeOperationSpec: coreClient.OperationSpec = {
|
|
304
|
+
path:
|
|
305
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/generateVerificationCode",
|
|
306
|
+
httpMethod: "POST",
|
|
307
|
+
responses: {
|
|
308
|
+
200: {
|
|
309
|
+
bodyMapper: Mappers.VerificationCodeResponse
|
|
310
|
+
},
|
|
311
|
+
default: {
|
|
312
|
+
bodyMapper: Mappers.ErrorDetails
|
|
313
|
+
}
|
|
314
|
+
},
|
|
315
|
+
queryParameters: [
|
|
316
|
+
Parameters.apiVersion,
|
|
317
|
+
Parameters.certificateName11,
|
|
318
|
+
Parameters.certificateRawBytes,
|
|
319
|
+
Parameters.certificateIsVerified,
|
|
320
|
+
Parameters.certificatePurpose,
|
|
321
|
+
Parameters.certificateCreated,
|
|
322
|
+
Parameters.certificateLastUpdated,
|
|
323
|
+
Parameters.certificateHasPrivateKey,
|
|
324
|
+
Parameters.certificateNonce
|
|
325
|
+
],
|
|
326
|
+
urlParameters: [
|
|
327
|
+
Parameters.$host,
|
|
328
|
+
Parameters.certificateName,
|
|
329
|
+
Parameters.subscriptionId,
|
|
330
|
+
Parameters.resourceGroupName,
|
|
331
|
+
Parameters.provisioningServiceName
|
|
332
|
+
],
|
|
333
|
+
headerParameters: [Parameters.accept, Parameters.ifMatch1],
|
|
334
|
+
serializer
|
|
335
|
+
};
|
|
336
|
+
const verifyCertificateOperationSpec: coreClient.OperationSpec = {
|
|
337
|
+
path:
|
|
338
|
+
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/provisioningServices/{provisioningServiceName}/certificates/{certificateName}/verify",
|
|
339
|
+
httpMethod: "POST",
|
|
340
|
+
responses: {
|
|
341
|
+
200: {
|
|
342
|
+
bodyMapper: Mappers.CertificateResponse
|
|
343
|
+
},
|
|
344
|
+
default: {
|
|
345
|
+
bodyMapper: Mappers.ErrorDetails
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
requestBody: Parameters.request,
|
|
349
|
+
queryParameters: [
|
|
350
|
+
Parameters.apiVersion,
|
|
351
|
+
Parameters.certificateName11,
|
|
352
|
+
Parameters.certificateRawBytes,
|
|
353
|
+
Parameters.certificateIsVerified,
|
|
354
|
+
Parameters.certificatePurpose,
|
|
355
|
+
Parameters.certificateCreated,
|
|
356
|
+
Parameters.certificateLastUpdated,
|
|
357
|
+
Parameters.certificateHasPrivateKey,
|
|
358
|
+
Parameters.certificateNonce
|
|
359
|
+
],
|
|
360
|
+
urlParameters: [
|
|
361
|
+
Parameters.$host,
|
|
362
|
+
Parameters.certificateName,
|
|
363
|
+
Parameters.subscriptionId,
|
|
364
|
+
Parameters.resourceGroupName,
|
|
365
|
+
Parameters.provisioningServiceName
|
|
366
|
+
],
|
|
367
|
+
headerParameters: [
|
|
368
|
+
Parameters.accept,
|
|
369
|
+
Parameters.contentType,
|
|
370
|
+
Parameters.ifMatch1
|
|
371
|
+
],
|
|
372
|
+
mediaType: "json",
|
|
373
|
+
serializer
|
|
374
|
+
};
|