@azure/arm-digitaltwins 3.2.1-alpha.20230303.1 → 3.3.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 +14 -10
- package/LICENSE +1 -1
- package/dist/index.js +171 -101
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsCheckNameAvailabilitySample.js +11 -3
- package/dist-esm/samples-dev/digitalTwinsCheckNameAvailabilitySample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsCreateOrUpdateSample.js +22 -12
- package/dist-esm/samples-dev/digitalTwinsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsDeleteSample.js +17 -8
- package/dist-esm/samples-dev/digitalTwinsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsEndpointCreateOrUpdateSample.js +22 -12
- package/dist-esm/samples-dev/digitalTwinsEndpointCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsEndpointDeleteSample.js +17 -8
- package/dist-esm/samples-dev/digitalTwinsEndpointDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsEndpointGetSample.js +17 -8
- package/dist-esm/samples-dev/digitalTwinsEndpointGetSample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsEndpointListSample.js +17 -8
- package/dist-esm/samples-dev/digitalTwinsEndpointListSample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsGetSample.js +22 -12
- package/dist-esm/samples-dev/digitalTwinsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsListByResourceGroupSample.js +12 -4
- package/dist-esm/samples-dev/digitalTwinsListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsListSample.js +11 -3
- package/dist-esm/samples-dev/digitalTwinsListSample.js.map +1 -1
- package/dist-esm/samples-dev/digitalTwinsUpdateSample.js +22 -12
- package/dist-esm/samples-dev/digitalTwinsUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +11 -3
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.js +12 -4
- package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js +12 -4
- package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js +12 -4
- package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/privateEndpointConnectionsListSample.js +12 -4
- package/dist-esm/samples-dev/privateEndpointConnectionsListSample.js.map +1 -1
- package/dist-esm/samples-dev/privateLinkResourcesGetSample.js +12 -4
- package/dist-esm/samples-dev/privateLinkResourcesGetSample.js.map +1 -1
- package/dist-esm/samples-dev/privateLinkResourcesListSample.js +12 -4
- package/dist-esm/samples-dev/privateLinkResourcesListSample.js.map +1 -1
- package/dist-esm/samples-dev/timeSeriesDatabaseConnectionsCreateOrUpdateSample.js +22 -10
- package/dist-esm/samples-dev/timeSeriesDatabaseConnectionsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/timeSeriesDatabaseConnectionsDeleteSample.js +12 -4
- package/dist-esm/samples-dev/timeSeriesDatabaseConnectionsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/timeSeriesDatabaseConnectionsGetSample.js +12 -4
- package/dist-esm/samples-dev/timeSeriesDatabaseConnectionsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/timeSeriesDatabaseConnectionsListSample.js +12 -4
- package/dist-esm/samples-dev/timeSeriesDatabaseConnectionsListSample.js.map +1 -1
- package/dist-esm/src/azureDigitalTwinsManagementClient.js +2 -2
- package/dist-esm/src/lroImpl.d.ts +6 -11
- package/dist-esm/src/lroImpl.d.ts.map +1 -1
- package/dist-esm/src/lroImpl.js +12 -20
- package/dist-esm/src/lroImpl.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +41 -1
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +16 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +19 -0
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/models/parameters.d.ts +1 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -1
- package/dist-esm/src/models/parameters.js +10 -1
- package/dist-esm/src/models/parameters.js.map +1 -1
- package/dist-esm/src/operations/digitalTwins.d.ts +4 -4
- package/dist-esm/src/operations/digitalTwins.d.ts.map +1 -1
- package/dist-esm/src/operations/digitalTwins.js +31 -21
- package/dist-esm/src/operations/digitalTwins.js.map +1 -1
- package/dist-esm/src/operations/digitalTwinsEndpoint.d.ts +3 -3
- package/dist-esm/src/operations/digitalTwinsEndpoint.d.ts.map +1 -1
- package/dist-esm/src/operations/digitalTwinsEndpoint.js +24 -17
- package/dist-esm/src/operations/digitalTwinsEndpoint.js.map +1 -1
- package/dist-esm/src/operations/operations.js +0 -1
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operations/privateEndpointConnections.d.ts +3 -3
- package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
- package/dist-esm/src/operations/privateEndpointConnections.js +29 -21
- package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
- package/dist-esm/src/operations/timeSeriesDatabaseConnections.d.ts +3 -3
- package/dist-esm/src/operations/timeSeriesDatabaseConnections.d.ts.map +1 -1
- package/dist-esm/src/operations/timeSeriesDatabaseConnections.js +33 -23
- package/dist-esm/src/operations/timeSeriesDatabaseConnections.js.map +1 -1
- package/dist-esm/src/operationsInterfaces/digitalTwins.d.ts +4 -4
- package/dist-esm/src/operationsInterfaces/digitalTwins.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/digitalTwinsEndpoint.d.ts +3 -3
- package/dist-esm/src/operationsInterfaces/digitalTwinsEndpoint.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +3 -3
- package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -1
- package/dist-esm/src/operationsInterfaces/timeSeriesDatabaseConnections.d.ts +3 -3
- package/dist-esm/src/operationsInterfaces/timeSeriesDatabaseConnections.d.ts.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +4 -4
- package/dist-esm/src/pagingHelper.js +4 -4
- package/package.json +9 -8
- package/review/arm-digitaltwins.api.md +33 -11
- package/src/azureDigitalTwinsManagementClient.ts +2 -2
- package/src/lroImpl.ts +31 -23
- package/src/models/index.ts +45 -1
- package/src/models/mappers.ts +22 -0
- package/src/models/parameters.ts +11 -1
- package/src/operations/digitalTwins.ts +45 -34
- package/src/operations/digitalTwinsEndpoint.ts +32 -23
- package/src/operations/operations.ts +0 -1
- package/src/operations/privateEndpointConnections.ts +28 -21
- package/src/operations/timeSeriesDatabaseConnections.ts +36 -24
- package/src/operationsInterfaces/digitalTwins.ts +7 -7
- package/src/operationsInterfaces/digitalTwinsEndpoint.ts +5 -5
- package/src/operationsInterfaces/privateEndpointConnections.ts +4 -4
- package/src/operationsInterfaces/timeSeriesDatabaseConnections.ts +5 -5
- package/src/pagingHelper.ts +4 -4
- package/types/arm-digitaltwins.d.ts +60 -16
package/src/lroImpl.ts
CHANGED
|
@@ -6,29 +6,37 @@
|
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
// Copyright (c) Microsoft Corporation.
|
|
10
|
+
// Licensed under the MIT license.
|
|
11
|
+
|
|
12
|
+
import { AbortSignalLike } from "@azure/abort-controller";
|
|
9
13
|
import { LongRunningOperation, LroResponse } from "@azure/core-lro";
|
|
10
14
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
...restSpec
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
export function createLroSpec<T>(inputs: {
|
|
16
|
+
sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
|
|
17
|
+
args: Record<string, unknown>;
|
|
18
|
+
spec: {
|
|
19
|
+
readonly requestBody?: unknown;
|
|
20
|
+
readonly path?: string;
|
|
21
|
+
readonly httpMethod: string;
|
|
22
|
+
} & Record<string, any>;
|
|
23
|
+
}): LongRunningOperation<T> {
|
|
24
|
+
const { args, spec, sendOperationFn } = inputs;
|
|
25
|
+
return {
|
|
26
|
+
requestMethod: spec.httpMethod,
|
|
27
|
+
requestPath: spec.path!,
|
|
28
|
+
sendInitialRequest: () => sendOperationFn(args, spec),
|
|
29
|
+
sendPollRequest: (
|
|
30
|
+
path: string,
|
|
31
|
+
options?: { abortSignal?: AbortSignalLike }
|
|
32
|
+
) => {
|
|
33
|
+
const { requestBody, ...restSpec } = spec;
|
|
34
|
+
return sendOperationFn(args, {
|
|
35
|
+
...restSpec,
|
|
36
|
+
httpMethod: "GET",
|
|
37
|
+
path,
|
|
38
|
+
abortSignal: options?.abortSignal
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
34
42
|
}
|
package/src/models/index.ts
CHANGED
|
@@ -507,8 +507,12 @@ export interface AzureDataExplorerConnectionProperties
|
|
|
507
507
|
adxEndpointUri: string;
|
|
508
508
|
/** The name of the Azure Data Explorer database. */
|
|
509
509
|
adxDatabaseName: string;
|
|
510
|
-
/** The name of the Azure Data Explorer table. Defaults to AdtPropertyEvents. */
|
|
510
|
+
/** The name of the Azure Data Explorer table used for storing updates to properties of twins and relationships. Defaults to AdtPropertyEvents. */
|
|
511
511
|
adxTableName?: string;
|
|
512
|
+
/** The name of the Azure Data Explorer table used for recording twin lifecycle events. The table will not be created if this property is left unspecified. */
|
|
513
|
+
adxTwinLifecycleEventsTableName?: string;
|
|
514
|
+
/** The name of the Azure Data Explorer table used for recording relationship lifecycle events. The table will not be created if this property is left unspecified. */
|
|
515
|
+
adxRelationshipLifecycleEventsTableName?: string;
|
|
512
516
|
/** The URL of the EventHub namespace for identity-based authentication. It must include the protocol sb:// */
|
|
513
517
|
eventHubEndpointUri: string;
|
|
514
518
|
/** The EventHub name in the EventHub namespace for identity-based authentication. */
|
|
@@ -517,6 +521,8 @@ export interface AzureDataExplorerConnectionProperties
|
|
|
517
521
|
eventHubNamespaceResourceId: string;
|
|
518
522
|
/** The EventHub consumer group to use when ADX reads from EventHub. Defaults to $Default. */
|
|
519
523
|
eventHubConsumerGroup?: string;
|
|
524
|
+
/** Specifies whether or not to record twin / relationship property and item removals, including removals of indexed or keyed values (such as map entries, array elements, etc.). This feature is de-activated unless explicitly set to 'true'. Setting this property to 'true' will generate an additional column in the property events table in ADX. */
|
|
525
|
+
recordPropertyAndItemRemovals?: RecordPropertyAndItemRemovals;
|
|
520
526
|
}
|
|
521
527
|
|
|
522
528
|
/** Known values of {@link ProvisioningState} that the service accepts. */
|
|
@@ -864,6 +870,42 @@ export enum KnownTimeSeriesDatabaseConnectionState {
|
|
|
864
870
|
*/
|
|
865
871
|
export type TimeSeriesDatabaseConnectionState = string;
|
|
866
872
|
|
|
873
|
+
/** Known values of {@link CleanupConnectionArtifacts} that the service accepts. */
|
|
874
|
+
export enum KnownCleanupConnectionArtifacts {
|
|
875
|
+
/** True */
|
|
876
|
+
True = "true",
|
|
877
|
+
/** False */
|
|
878
|
+
False = "false"
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
/**
|
|
882
|
+
* Defines values for CleanupConnectionArtifacts. \
|
|
883
|
+
* {@link KnownCleanupConnectionArtifacts} can be used interchangeably with CleanupConnectionArtifacts,
|
|
884
|
+
* this enum contains the known values that the service supports.
|
|
885
|
+
* ### Known values supported by the service
|
|
886
|
+
* **true** \
|
|
887
|
+
* **false**
|
|
888
|
+
*/
|
|
889
|
+
export type CleanupConnectionArtifacts = string;
|
|
890
|
+
|
|
891
|
+
/** Known values of {@link RecordPropertyAndItemRemovals} that the service accepts. */
|
|
892
|
+
export enum KnownRecordPropertyAndItemRemovals {
|
|
893
|
+
/** True */
|
|
894
|
+
True = "true",
|
|
895
|
+
/** False */
|
|
896
|
+
False = "false"
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
/**
|
|
900
|
+
* Defines values for RecordPropertyAndItemRemovals. \
|
|
901
|
+
* {@link KnownRecordPropertyAndItemRemovals} can be used interchangeably with RecordPropertyAndItemRemovals,
|
|
902
|
+
* this enum contains the known values that the service supports.
|
|
903
|
+
* ### Known values supported by the service
|
|
904
|
+
* **true** \
|
|
905
|
+
* **false**
|
|
906
|
+
*/
|
|
907
|
+
export type RecordPropertyAndItemRemovals = string;
|
|
908
|
+
|
|
867
909
|
/** Optional parameters. */
|
|
868
910
|
export interface DigitalTwinsGetOptionalParams
|
|
869
911
|
extends coreClient.OperationOptions {}
|
|
@@ -1079,6 +1121,8 @@ export type TimeSeriesDatabaseConnectionsCreateOrUpdateResponse = TimeSeriesData
|
|
|
1079
1121
|
/** Optional parameters. */
|
|
1080
1122
|
export interface TimeSeriesDatabaseConnectionsDeleteOptionalParams
|
|
1081
1123
|
extends coreClient.OperationOptions {
|
|
1124
|
+
/** Specifies whether or not to attempt to clean up artifacts that were created in order to establish a connection to the time series database. This is a best-effort attempt that will fail if appropriate permissions are not in place. Setting this to 'true' does not delete any recorded data. */
|
|
1125
|
+
cleanupConnectionArtifacts?: CleanupConnectionArtifacts;
|
|
1082
1126
|
/** Delay to wait until next poll, in milliseconds. */
|
|
1083
1127
|
updateIntervalInMs?: number;
|
|
1084
1128
|
/** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */
|
package/src/models/mappers.ts
CHANGED
|
@@ -1212,6 +1212,20 @@ export const AzureDataExplorerConnectionProperties: coreClient.CompositeMapper =
|
|
|
1212
1212
|
name: "String"
|
|
1213
1213
|
}
|
|
1214
1214
|
},
|
|
1215
|
+
adxTwinLifecycleEventsTableName: {
|
|
1216
|
+
serializedName: "adxTwinLifecycleEventsTableName",
|
|
1217
|
+
nullable: true,
|
|
1218
|
+
type: {
|
|
1219
|
+
name: "String"
|
|
1220
|
+
}
|
|
1221
|
+
},
|
|
1222
|
+
adxRelationshipLifecycleEventsTableName: {
|
|
1223
|
+
serializedName: "adxRelationshipLifecycleEventsTableName",
|
|
1224
|
+
nullable: true,
|
|
1225
|
+
type: {
|
|
1226
|
+
name: "String"
|
|
1227
|
+
}
|
|
1228
|
+
},
|
|
1215
1229
|
eventHubEndpointUri: {
|
|
1216
1230
|
serializedName: "eventHubEndpointUri",
|
|
1217
1231
|
required: true,
|
|
@@ -1240,6 +1254,14 @@ export const AzureDataExplorerConnectionProperties: coreClient.CompositeMapper =
|
|
|
1240
1254
|
type: {
|
|
1241
1255
|
name: "String"
|
|
1242
1256
|
}
|
|
1257
|
+
},
|
|
1258
|
+
recordPropertyAndItemRemovals: {
|
|
1259
|
+
defaultValue: "false",
|
|
1260
|
+
serializedName: "recordPropertyAndItemRemovals",
|
|
1261
|
+
nullable: true,
|
|
1262
|
+
type: {
|
|
1263
|
+
name: "String"
|
|
1264
|
+
}
|
|
1243
1265
|
}
|
|
1244
1266
|
}
|
|
1245
1267
|
}
|
package/src/models/parameters.ts
CHANGED
|
@@ -47,7 +47,7 @@ export const $host: OperationURLParameter = {
|
|
|
47
47
|
export const apiVersion: OperationQueryParameter = {
|
|
48
48
|
parameterPath: "apiVersion",
|
|
49
49
|
mapper: {
|
|
50
|
-
defaultValue: "
|
|
50
|
+
defaultValue: "2023-01-31",
|
|
51
51
|
isConstant: true,
|
|
52
52
|
serializedName: "api-version",
|
|
53
53
|
type: {
|
|
@@ -219,3 +219,13 @@ export const timeSeriesDatabaseConnectionDescription: OperationParameter = {
|
|
|
219
219
|
parameterPath: "timeSeriesDatabaseConnectionDescription",
|
|
220
220
|
mapper: TimeSeriesDatabaseConnectionMapper
|
|
221
221
|
};
|
|
222
|
+
|
|
223
|
+
export const cleanupConnectionArtifacts: OperationQueryParameter = {
|
|
224
|
+
parameterPath: ["options", "cleanupConnectionArtifacts"],
|
|
225
|
+
mapper: {
|
|
226
|
+
serializedName: "cleanupConnectionArtifacts",
|
|
227
|
+
type: {
|
|
228
|
+
name: "String"
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
};
|
|
@@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
|
|
|
13
13
|
import * as Mappers from "../models/mappers";
|
|
14
14
|
import * as Parameters from "../models/parameters";
|
|
15
15
|
import { AzureDigitalTwinsManagementClient } from "../azureDigitalTwinsManagementClient";
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
SimplePollerLike,
|
|
18
|
+
OperationState,
|
|
19
|
+
createHttpPoller
|
|
20
|
+
} from "@azure/core-lro";
|
|
21
|
+
import { createLroSpec } from "../lroImpl";
|
|
18
22
|
import {
|
|
19
23
|
DigitalTwinsDescription,
|
|
20
24
|
DigitalTwinsListNextOptionalParams,
|
|
@@ -207,8 +211,8 @@ export class DigitalTwinsImpl implements DigitalTwins {
|
|
|
207
211
|
digitalTwinsCreate: DigitalTwinsDescription,
|
|
208
212
|
options?: DigitalTwinsCreateOrUpdateOptionalParams
|
|
209
213
|
): Promise<
|
|
210
|
-
|
|
211
|
-
|
|
214
|
+
SimplePollerLike<
|
|
215
|
+
OperationState<DigitalTwinsCreateOrUpdateResponse>,
|
|
212
216
|
DigitalTwinsCreateOrUpdateResponse
|
|
213
217
|
>
|
|
214
218
|
> {
|
|
@@ -218,7 +222,7 @@ export class DigitalTwinsImpl implements DigitalTwins {
|
|
|
218
222
|
): Promise<DigitalTwinsCreateOrUpdateResponse> => {
|
|
219
223
|
return this.client.sendOperationRequest(args, spec);
|
|
220
224
|
};
|
|
221
|
-
const
|
|
225
|
+
const sendOperationFn = async (
|
|
222
226
|
args: coreClient.OperationArguments,
|
|
223
227
|
spec: coreClient.OperationSpec
|
|
224
228
|
) => {
|
|
@@ -251,13 +255,16 @@ export class DigitalTwinsImpl implements DigitalTwins {
|
|
|
251
255
|
};
|
|
252
256
|
};
|
|
253
257
|
|
|
254
|
-
const lro =
|
|
255
|
-
|
|
256
|
-
{ resourceGroupName, resourceName, digitalTwinsCreate, options },
|
|
257
|
-
createOrUpdateOperationSpec
|
|
258
|
-
);
|
|
259
|
-
const poller =
|
|
260
|
-
|
|
258
|
+
const lro = createLroSpec({
|
|
259
|
+
sendOperationFn,
|
|
260
|
+
args: { resourceGroupName, resourceName, digitalTwinsCreate, options },
|
|
261
|
+
spec: createOrUpdateOperationSpec
|
|
262
|
+
});
|
|
263
|
+
const poller = await createHttpPoller<
|
|
264
|
+
DigitalTwinsCreateOrUpdateResponse,
|
|
265
|
+
OperationState<DigitalTwinsCreateOrUpdateResponse>
|
|
266
|
+
>(lro, {
|
|
267
|
+
restoreFrom: options?.resumeFrom,
|
|
261
268
|
intervalInMs: options?.updateIntervalInMs
|
|
262
269
|
});
|
|
263
270
|
await poller.poll();
|
|
@@ -301,8 +308,8 @@ export class DigitalTwinsImpl implements DigitalTwins {
|
|
|
301
308
|
digitalTwinsPatchDescription: DigitalTwinsPatchDescription,
|
|
302
309
|
options?: DigitalTwinsUpdateOptionalParams
|
|
303
310
|
): Promise<
|
|
304
|
-
|
|
305
|
-
|
|
311
|
+
SimplePollerLike<
|
|
312
|
+
OperationState<DigitalTwinsUpdateResponse>,
|
|
306
313
|
DigitalTwinsUpdateResponse
|
|
307
314
|
>
|
|
308
315
|
> {
|
|
@@ -312,7 +319,7 @@ export class DigitalTwinsImpl implements DigitalTwins {
|
|
|
312
319
|
): Promise<DigitalTwinsUpdateResponse> => {
|
|
313
320
|
return this.client.sendOperationRequest(args, spec);
|
|
314
321
|
};
|
|
315
|
-
const
|
|
322
|
+
const sendOperationFn = async (
|
|
316
323
|
args: coreClient.OperationArguments,
|
|
317
324
|
spec: coreClient.OperationSpec
|
|
318
325
|
) => {
|
|
@@ -345,18 +352,21 @@ export class DigitalTwinsImpl implements DigitalTwins {
|
|
|
345
352
|
};
|
|
346
353
|
};
|
|
347
354
|
|
|
348
|
-
const lro =
|
|
349
|
-
|
|
350
|
-
{
|
|
355
|
+
const lro = createLroSpec({
|
|
356
|
+
sendOperationFn,
|
|
357
|
+
args: {
|
|
351
358
|
resourceGroupName,
|
|
352
359
|
resourceName,
|
|
353
360
|
digitalTwinsPatchDescription,
|
|
354
361
|
options
|
|
355
362
|
},
|
|
356
|
-
updateOperationSpec
|
|
357
|
-
);
|
|
358
|
-
const poller =
|
|
359
|
-
|
|
363
|
+
spec: updateOperationSpec
|
|
364
|
+
});
|
|
365
|
+
const poller = await createHttpPoller<
|
|
366
|
+
DigitalTwinsUpdateResponse,
|
|
367
|
+
OperationState<DigitalTwinsUpdateResponse>
|
|
368
|
+
>(lro, {
|
|
369
|
+
restoreFrom: options?.resumeFrom,
|
|
360
370
|
intervalInMs: options?.updateIntervalInMs
|
|
361
371
|
});
|
|
362
372
|
await poller.poll();
|
|
@@ -396,8 +406,8 @@ export class DigitalTwinsImpl implements DigitalTwins {
|
|
|
396
406
|
resourceName: string,
|
|
397
407
|
options?: DigitalTwinsDeleteOptionalParams
|
|
398
408
|
): Promise<
|
|
399
|
-
|
|
400
|
-
|
|
409
|
+
SimplePollerLike<
|
|
410
|
+
OperationState<DigitalTwinsDeleteResponse>,
|
|
401
411
|
DigitalTwinsDeleteResponse
|
|
402
412
|
>
|
|
403
413
|
> {
|
|
@@ -407,7 +417,7 @@ export class DigitalTwinsImpl implements DigitalTwins {
|
|
|
407
417
|
): Promise<DigitalTwinsDeleteResponse> => {
|
|
408
418
|
return this.client.sendOperationRequest(args, spec);
|
|
409
419
|
};
|
|
410
|
-
const
|
|
420
|
+
const sendOperationFn = async (
|
|
411
421
|
args: coreClient.OperationArguments,
|
|
412
422
|
spec: coreClient.OperationSpec
|
|
413
423
|
) => {
|
|
@@ -440,13 +450,16 @@ export class DigitalTwinsImpl implements DigitalTwins {
|
|
|
440
450
|
};
|
|
441
451
|
};
|
|
442
452
|
|
|
443
|
-
const lro =
|
|
444
|
-
|
|
445
|
-
{ resourceGroupName, resourceName, options },
|
|
446
|
-
deleteOperationSpec
|
|
447
|
-
);
|
|
448
|
-
const poller =
|
|
449
|
-
|
|
453
|
+
const lro = createLroSpec({
|
|
454
|
+
sendOperationFn,
|
|
455
|
+
args: { resourceGroupName, resourceName, options },
|
|
456
|
+
spec: deleteOperationSpec
|
|
457
|
+
});
|
|
458
|
+
const poller = await createHttpPoller<
|
|
459
|
+
DigitalTwinsDeleteResponse,
|
|
460
|
+
OperationState<DigitalTwinsDeleteResponse>
|
|
461
|
+
>(lro, {
|
|
462
|
+
restoreFrom: options?.resumeFrom,
|
|
450
463
|
intervalInMs: options?.updateIntervalInMs
|
|
451
464
|
});
|
|
452
465
|
await poller.poll();
|
|
@@ -741,7 +754,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
741
754
|
bodyMapper: Mappers.ErrorResponse
|
|
742
755
|
}
|
|
743
756
|
},
|
|
744
|
-
queryParameters: [Parameters.apiVersion],
|
|
745
757
|
urlParameters: [
|
|
746
758
|
Parameters.$host,
|
|
747
759
|
Parameters.subscriptionId,
|
|
@@ -761,7 +773,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
|
761
773
|
bodyMapper: Mappers.ErrorResponse
|
|
762
774
|
}
|
|
763
775
|
},
|
|
764
|
-
queryParameters: [Parameters.apiVersion],
|
|
765
776
|
urlParameters: [
|
|
766
777
|
Parameters.$host,
|
|
767
778
|
Parameters.subscriptionId,
|
|
@@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
|
|
|
13
13
|
import * as Mappers from "../models/mappers";
|
|
14
14
|
import * as Parameters from "../models/parameters";
|
|
15
15
|
import { AzureDigitalTwinsManagementClient } from "../azureDigitalTwinsManagementClient";
|
|
16
|
-
import {
|
|
17
|
-
|
|
16
|
+
import {
|
|
17
|
+
SimplePollerLike,
|
|
18
|
+
OperationState,
|
|
19
|
+
createHttpPoller
|
|
20
|
+
} from "@azure/core-lro";
|
|
21
|
+
import { createLroSpec } from "../lroImpl";
|
|
18
22
|
import {
|
|
19
23
|
DigitalTwinsEndpointResource,
|
|
20
24
|
DigitalTwinsEndpointListNextOptionalParams,
|
|
@@ -169,8 +173,8 @@ export class DigitalTwinsEndpointImpl implements DigitalTwinsEndpoint {
|
|
|
169
173
|
endpointDescription: DigitalTwinsEndpointResource,
|
|
170
174
|
options?: DigitalTwinsEndpointCreateOrUpdateOptionalParams
|
|
171
175
|
): Promise<
|
|
172
|
-
|
|
173
|
-
|
|
176
|
+
SimplePollerLike<
|
|
177
|
+
OperationState<DigitalTwinsEndpointCreateOrUpdateResponse>,
|
|
174
178
|
DigitalTwinsEndpointCreateOrUpdateResponse
|
|
175
179
|
>
|
|
176
180
|
> {
|
|
@@ -180,7 +184,7 @@ export class DigitalTwinsEndpointImpl implements DigitalTwinsEndpoint {
|
|
|
180
184
|
): Promise<DigitalTwinsEndpointCreateOrUpdateResponse> => {
|
|
181
185
|
return this.client.sendOperationRequest(args, spec);
|
|
182
186
|
};
|
|
183
|
-
const
|
|
187
|
+
const sendOperationFn = async (
|
|
184
188
|
args: coreClient.OperationArguments,
|
|
185
189
|
spec: coreClient.OperationSpec
|
|
186
190
|
) => {
|
|
@@ -213,19 +217,22 @@ export class DigitalTwinsEndpointImpl implements DigitalTwinsEndpoint {
|
|
|
213
217
|
};
|
|
214
218
|
};
|
|
215
219
|
|
|
216
|
-
const lro =
|
|
217
|
-
|
|
218
|
-
{
|
|
220
|
+
const lro = createLroSpec({
|
|
221
|
+
sendOperationFn,
|
|
222
|
+
args: {
|
|
219
223
|
resourceGroupName,
|
|
220
224
|
resourceName,
|
|
221
225
|
endpointName,
|
|
222
226
|
endpointDescription,
|
|
223
227
|
options
|
|
224
228
|
},
|
|
225
|
-
createOrUpdateOperationSpec
|
|
226
|
-
);
|
|
227
|
-
const poller =
|
|
228
|
-
|
|
229
|
+
spec: createOrUpdateOperationSpec
|
|
230
|
+
});
|
|
231
|
+
const poller = await createHttpPoller<
|
|
232
|
+
DigitalTwinsEndpointCreateOrUpdateResponse,
|
|
233
|
+
OperationState<DigitalTwinsEndpointCreateOrUpdateResponse>
|
|
234
|
+
>(lro, {
|
|
235
|
+
restoreFrom: options?.resumeFrom,
|
|
229
236
|
intervalInMs: options?.updateIntervalInMs
|
|
230
237
|
});
|
|
231
238
|
await poller.poll();
|
|
@@ -270,8 +277,8 @@ export class DigitalTwinsEndpointImpl implements DigitalTwinsEndpoint {
|
|
|
270
277
|
endpointName: string,
|
|
271
278
|
options?: DigitalTwinsEndpointDeleteOptionalParams
|
|
272
279
|
): Promise<
|
|
273
|
-
|
|
274
|
-
|
|
280
|
+
SimplePollerLike<
|
|
281
|
+
OperationState<DigitalTwinsEndpointDeleteResponse>,
|
|
275
282
|
DigitalTwinsEndpointDeleteResponse
|
|
276
283
|
>
|
|
277
284
|
> {
|
|
@@ -281,7 +288,7 @@ export class DigitalTwinsEndpointImpl implements DigitalTwinsEndpoint {
|
|
|
281
288
|
): Promise<DigitalTwinsEndpointDeleteResponse> => {
|
|
282
289
|
return this.client.sendOperationRequest(args, spec);
|
|
283
290
|
};
|
|
284
|
-
const
|
|
291
|
+
const sendOperationFn = async (
|
|
285
292
|
args: coreClient.OperationArguments,
|
|
286
293
|
spec: coreClient.OperationSpec
|
|
287
294
|
) => {
|
|
@@ -314,13 +321,16 @@ export class DigitalTwinsEndpointImpl implements DigitalTwinsEndpoint {
|
|
|
314
321
|
};
|
|
315
322
|
};
|
|
316
323
|
|
|
317
|
-
const lro =
|
|
318
|
-
|
|
319
|
-
{ resourceGroupName, resourceName, endpointName, options },
|
|
320
|
-
deleteOperationSpec
|
|
321
|
-
);
|
|
322
|
-
const poller =
|
|
323
|
-
|
|
324
|
+
const lro = createLroSpec({
|
|
325
|
+
sendOperationFn,
|
|
326
|
+
args: { resourceGroupName, resourceName, endpointName, options },
|
|
327
|
+
spec: deleteOperationSpec
|
|
328
|
+
});
|
|
329
|
+
const poller = await createHttpPoller<
|
|
330
|
+
DigitalTwinsEndpointDeleteResponse,
|
|
331
|
+
OperationState<DigitalTwinsEndpointDeleteResponse>
|
|
332
|
+
>(lro, {
|
|
333
|
+
restoreFrom: options?.resumeFrom,
|
|
324
334
|
intervalInMs: options?.updateIntervalInMs
|
|
325
335
|
});
|
|
326
336
|
await poller.poll();
|
|
@@ -493,7 +503,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
493
503
|
bodyMapper: Mappers.ErrorResponse
|
|
494
504
|
}
|
|
495
505
|
},
|
|
496
|
-
queryParameters: [Parameters.apiVersion],
|
|
497
506
|
urlParameters: [
|
|
498
507
|
Parameters.$host,
|
|
499
508
|
Parameters.subscriptionId,
|
|
@@ -143,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
|
|
|
143
143
|
bodyMapper: Mappers.ErrorResponse
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
|
-
queryParameters: [Parameters.apiVersion],
|
|
147
146
|
urlParameters: [Parameters.$host, Parameters.nextLink],
|
|
148
147
|
headerParameters: [Parameters.accept],
|
|
149
148
|
serializer
|
|
@@ -11,8 +11,12 @@ import * as coreClient from "@azure/core-client";
|
|
|
11
11
|
import * as Mappers from "../models/mappers";
|
|
12
12
|
import * as Parameters from "../models/parameters";
|
|
13
13
|
import { AzureDigitalTwinsManagementClient } from "../azureDigitalTwinsManagementClient";
|
|
14
|
-
import {
|
|
15
|
-
|
|
14
|
+
import {
|
|
15
|
+
SimplePollerLike,
|
|
16
|
+
OperationState,
|
|
17
|
+
createHttpPoller
|
|
18
|
+
} from "@azure/core-lro";
|
|
19
|
+
import { createLroSpec } from "../lroImpl";
|
|
16
20
|
import {
|
|
17
21
|
PrivateEndpointConnectionsListOptionalParams,
|
|
18
22
|
PrivateEndpointConnectionsListResponse,
|
|
@@ -90,14 +94,14 @@ export class PrivateEndpointConnectionsImpl
|
|
|
90
94
|
resourceName: string,
|
|
91
95
|
privateEndpointConnectionName: string,
|
|
92
96
|
options?: PrivateEndpointConnectionsDeleteOptionalParams
|
|
93
|
-
): Promise<
|
|
97
|
+
): Promise<SimplePollerLike<OperationState<void>, void>> {
|
|
94
98
|
const directSendOperation = async (
|
|
95
99
|
args: coreClient.OperationArguments,
|
|
96
100
|
spec: coreClient.OperationSpec
|
|
97
101
|
): Promise<void> => {
|
|
98
102
|
return this.client.sendOperationRequest(args, spec);
|
|
99
103
|
};
|
|
100
|
-
const
|
|
104
|
+
const sendOperationFn = async (
|
|
101
105
|
args: coreClient.OperationArguments,
|
|
102
106
|
spec: coreClient.OperationSpec
|
|
103
107
|
) => {
|
|
@@ -130,18 +134,18 @@ export class PrivateEndpointConnectionsImpl
|
|
|
130
134
|
};
|
|
131
135
|
};
|
|
132
136
|
|
|
133
|
-
const lro =
|
|
134
|
-
|
|
135
|
-
{
|
|
137
|
+
const lro = createLroSpec({
|
|
138
|
+
sendOperationFn,
|
|
139
|
+
args: {
|
|
136
140
|
resourceGroupName,
|
|
137
141
|
resourceName,
|
|
138
142
|
privateEndpointConnectionName,
|
|
139
143
|
options
|
|
140
144
|
},
|
|
141
|
-
deleteOperationSpec
|
|
142
|
-
);
|
|
143
|
-
const poller =
|
|
144
|
-
|
|
145
|
+
spec: deleteOperationSpec
|
|
146
|
+
});
|
|
147
|
+
const poller = await createHttpPoller<void, OperationState<void>>(lro, {
|
|
148
|
+
restoreFrom: options?.resumeFrom,
|
|
145
149
|
intervalInMs: options?.updateIntervalInMs
|
|
146
150
|
});
|
|
147
151
|
await poller.poll();
|
|
@@ -185,8 +189,8 @@ export class PrivateEndpointConnectionsImpl
|
|
|
185
189
|
privateEndpointConnection: PrivateEndpointConnection,
|
|
186
190
|
options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams
|
|
187
191
|
): Promise<
|
|
188
|
-
|
|
189
|
-
|
|
192
|
+
SimplePollerLike<
|
|
193
|
+
OperationState<PrivateEndpointConnectionsCreateOrUpdateResponse>,
|
|
190
194
|
PrivateEndpointConnectionsCreateOrUpdateResponse
|
|
191
195
|
>
|
|
192
196
|
> {
|
|
@@ -196,7 +200,7 @@ export class PrivateEndpointConnectionsImpl
|
|
|
196
200
|
): Promise<PrivateEndpointConnectionsCreateOrUpdateResponse> => {
|
|
197
201
|
return this.client.sendOperationRequest(args, spec);
|
|
198
202
|
};
|
|
199
|
-
const
|
|
203
|
+
const sendOperationFn = async (
|
|
200
204
|
args: coreClient.OperationArguments,
|
|
201
205
|
spec: coreClient.OperationSpec
|
|
202
206
|
) => {
|
|
@@ -229,19 +233,22 @@ export class PrivateEndpointConnectionsImpl
|
|
|
229
233
|
};
|
|
230
234
|
};
|
|
231
235
|
|
|
232
|
-
const lro =
|
|
233
|
-
|
|
234
|
-
{
|
|
236
|
+
const lro = createLroSpec({
|
|
237
|
+
sendOperationFn,
|
|
238
|
+
args: {
|
|
235
239
|
resourceGroupName,
|
|
236
240
|
resourceName,
|
|
237
241
|
privateEndpointConnectionName,
|
|
238
242
|
privateEndpointConnection,
|
|
239
243
|
options
|
|
240
244
|
},
|
|
241
|
-
createOrUpdateOperationSpec
|
|
242
|
-
);
|
|
243
|
-
const poller =
|
|
244
|
-
|
|
245
|
+
spec: createOrUpdateOperationSpec
|
|
246
|
+
});
|
|
247
|
+
const poller = await createHttpPoller<
|
|
248
|
+
PrivateEndpointConnectionsCreateOrUpdateResponse,
|
|
249
|
+
OperationState<PrivateEndpointConnectionsCreateOrUpdateResponse>
|
|
250
|
+
>(lro, {
|
|
251
|
+
restoreFrom: options?.resumeFrom,
|
|
245
252
|
intervalInMs: options?.updateIntervalInMs
|
|
246
253
|
});
|
|
247
254
|
await poller.poll();
|