@azure/arm-resourcemover 2.0.2-alpha.20221128.1 → 2.1.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +31 -10
  2. package/dist/index.js +195 -56
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist-esm/src/index.d.ts +1 -0
  7. package/dist-esm/src/index.d.ts.map +1 -1
  8. package/dist-esm/src/index.js +1 -0
  9. package/dist-esm/src/index.js.map +1 -1
  10. package/dist-esm/src/models/index.d.ts +86 -45
  11. package/dist-esm/src/models/index.d.ts.map +1 -1
  12. package/dist-esm/src/models/index.js +41 -0
  13. package/dist-esm/src/models/index.js.map +1 -1
  14. package/dist-esm/src/operations/moveCollections.d.ts.map +1 -1
  15. package/dist-esm/src/operations/moveCollections.js +37 -16
  16. package/dist-esm/src/operations/moveCollections.js.map +1 -1
  17. package/dist-esm/src/operations/moveResources.d.ts.map +1 -1
  18. package/dist-esm/src/operations/moveResources.js +19 -8
  19. package/dist-esm/src/operations/moveResources.js.map +1 -1
  20. package/dist-esm/src/operations/unresolvedDependencies.d.ts.map +1 -1
  21. package/dist-esm/src/operations/unresolvedDependencies.js +19 -13
  22. package/dist-esm/src/operations/unresolvedDependencies.js.map +1 -1
  23. package/dist-esm/src/pagingHelper.d.ts +13 -0
  24. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  25. package/dist-esm/src/pagingHelper.js +32 -0
  26. package/dist-esm/src/pagingHelper.js.map +1 -0
  27. package/dist-esm/src/resourceMoverServiceAPI.d.ts +2 -0
  28. package/dist-esm/src/resourceMoverServiceAPI.d.ts.map +1 -1
  29. package/dist-esm/src/resourceMoverServiceAPI.js +49 -18
  30. package/dist-esm/src/resourceMoverServiceAPI.js.map +1 -1
  31. package/dist-esm/test/sampleTest.js +11 -13
  32. package/dist-esm/test/sampleTest.js.map +1 -1
  33. package/package.json +12 -8
  34. package/review/arm-resourcemover.api.md +64 -98
  35. package/src/index.ts +1 -0
  36. package/src/models/index.ts +81 -49
  37. package/src/operations/moveCollections.ts +49 -22
  38. package/src/operations/moveResources.ts +22 -13
  39. package/src/operations/unresolvedDependencies.ts +22 -18
  40. package/src/pagingHelper.ts +39 -0
  41. package/src/resourceMoverServiceAPI.ts +60 -20
  42. package/types/arm-resourcemover.d.ts +97 -45
package/CHANGELOG.md CHANGED
@@ -1,15 +1,36 @@
1
1
  # Release History
2
+
3
+ ## 2.1.0 (2022-12-12)
4
+
5
+ **Features**
2
6
 
3
- ## 2.0.2 (Unreleased)
4
-
5
- ### Features Added
6
-
7
- ### Breaking Changes
8
-
9
- ### Bugs Fixed
10
-
11
- ### Other Changes
12
-
7
+ - Added Interface AvailabilitySetResourceSettings
8
+ - Added Interface DiskEncryptionSetResourceSettings
9
+ - Added Interface KeyVaultResourceSettings
10
+ - Added Interface LoadBalancerBackendAddressPoolReference
11
+ - Added Interface LoadBalancerNatRuleReference
12
+ - Added Interface LoadBalancerResourceSettings
13
+ - Added Interface MoveCollectionPropertiesErrors
14
+ - Added Interface MoveResourcePropertiesErrors
15
+ - Added Interface MoveResourcePropertiesMoveStatus
16
+ - Added Interface NetworkInterfaceResourceSettings
17
+ - Added Interface NetworkSecurityGroupResourceSettings
18
+ - Added Interface NsgReference
19
+ - Added Interface ProxyResourceReference
20
+ - Added Interface PublicIPAddressResourceSettings
21
+ - Added Interface PublicIpReference
22
+ - Added Interface ResourceGroupResourceSettings
23
+ - Added Interface SqlDatabaseResourceSettings
24
+ - Added Interface SqlElasticPoolResourceSettings
25
+ - Added Interface SqlServerResourceSettings
26
+ - Added Interface SubnetReference
27
+ - Added Interface VirtualMachineResourceSettings
28
+ - Added Interface VirtualNetworkResourceSettings
29
+ - Interface MoveResourcesListNextOptionalParams no longer has parameter filter
30
+ - Interface UnresolvedDependenciesGetNextOptionalParams no longer has parameter dependencyLevel
31
+ - Interface UnresolvedDependenciesGetNextOptionalParams no longer has parameter filter
32
+ - Interface UnresolvedDependenciesGetNextOptionalParams no longer has parameter orderby
33
+
13
34
  ## 2.0.1 (2022-04-29)
14
35
 
15
36
  **Features**
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var tslib = require('tslib');
5
6
  var coreClient = require('@azure/core-client');
6
7
  var coreRestPipeline = require('@azure/core-rest-pipeline');
7
- var tslib = require('tslib');
8
8
  var coreLro = require('@azure/core-lro');
9
9
 
10
10
  function _interopNamespace(e) {
@@ -28,6 +28,38 @@ function _interopNamespace(e) {
28
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
29
  var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
30
30
 
31
+ /*
32
+ * Copyright (c) Microsoft Corporation.
33
+ * Licensed under the MIT License.
34
+ *
35
+ * Code generated by Microsoft (R) AutoRest Code Generator.
36
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
37
+ */
38
+ const pageMap = new WeakMap();
39
+ /**
40
+ * Given the last `.value` produced by the `byPage` iterator,
41
+ * returns a continuation token that can be used to begin paging from
42
+ * that point later.
43
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
44
+ * @returns The continuation token that can be passed into byPage() during future calls.
45
+ */
46
+ function getContinuationToken(page) {
47
+ var _a;
48
+ if (typeof page !== "object" || page === null) {
49
+ return undefined;
50
+ }
51
+ return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
52
+ }
53
+ function setContinuationToken(page, continuationToken) {
54
+ var _a;
55
+ if (typeof page !== "object" || page === null || !continuationToken) {
56
+ return;
57
+ }
58
+ const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
59
+ pageInfo.continuationToken = continuationToken;
60
+ pageMap.set(page, pageInfo);
61
+ }
62
+
31
63
  /*
32
64
  * Copyright (c) Microsoft Corporation.
33
65
  * Licensed under the MIT License.
@@ -38,86 +70,127 @@ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipelin
38
70
  /** Known values of {@link ResourceIdentityType} that the service accepts. */
39
71
  exports.KnownResourceIdentityType = void 0;
40
72
  (function (KnownResourceIdentityType) {
73
+ /** None */
41
74
  KnownResourceIdentityType["None"] = "None";
75
+ /** SystemAssigned */
42
76
  KnownResourceIdentityType["SystemAssigned"] = "SystemAssigned";
77
+ /** UserAssigned */
43
78
  KnownResourceIdentityType["UserAssigned"] = "UserAssigned";
44
79
  })(exports.KnownResourceIdentityType || (exports.KnownResourceIdentityType = {}));
45
80
  /** Known values of {@link ProvisioningState} that the service accepts. */
46
81
  exports.KnownProvisioningState = void 0;
47
82
  (function (KnownProvisioningState) {
83
+ /** Succeeded */
48
84
  KnownProvisioningState["Succeeded"] = "Succeeded";
85
+ /** Updating */
49
86
  KnownProvisioningState["Updating"] = "Updating";
87
+ /** Creating */
50
88
  KnownProvisioningState["Creating"] = "Creating";
89
+ /** Failed */
51
90
  KnownProvisioningState["Failed"] = "Failed";
52
91
  })(exports.KnownProvisioningState || (exports.KnownProvisioningState = {}));
53
92
  /** Known values of {@link CreatedByType} that the service accepts. */
54
93
  exports.KnownCreatedByType = void 0;
55
94
  (function (KnownCreatedByType) {
95
+ /** User */
56
96
  KnownCreatedByType["User"] = "User";
97
+ /** Application */
57
98
  KnownCreatedByType["Application"] = "Application";
99
+ /** ManagedIdentity */
58
100
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
101
+ /** Key */
59
102
  KnownCreatedByType["Key"] = "Key";
60
103
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
61
104
  /** Known values of {@link MoveResourceInputType} that the service accepts. */
62
105
  exports.KnownMoveResourceInputType = void 0;
63
106
  (function (KnownMoveResourceInputType) {
107
+ /** MoveResourceId */
64
108
  KnownMoveResourceInputType["MoveResourceId"] = "MoveResourceId";
109
+ /** MoveResourceSourceId */
65
110
  KnownMoveResourceInputType["MoveResourceSourceId"] = "MoveResourceSourceId";
66
111
  })(exports.KnownMoveResourceInputType || (exports.KnownMoveResourceInputType = {}));
67
112
  /** Known values of {@link MoveState} that the service accepts. */
68
113
  exports.KnownMoveState = void 0;
69
114
  (function (KnownMoveState) {
115
+ /** AssignmentPending */
70
116
  KnownMoveState["AssignmentPending"] = "AssignmentPending";
117
+ /** PreparePending */
71
118
  KnownMoveState["PreparePending"] = "PreparePending";
119
+ /** PrepareInProgress */
72
120
  KnownMoveState["PrepareInProgress"] = "PrepareInProgress";
121
+ /** PrepareFailed */
73
122
  KnownMoveState["PrepareFailed"] = "PrepareFailed";
123
+ /** MovePending */
74
124
  KnownMoveState["MovePending"] = "MovePending";
125
+ /** MoveInProgress */
75
126
  KnownMoveState["MoveInProgress"] = "MoveInProgress";
127
+ /** MoveFailed */
76
128
  KnownMoveState["MoveFailed"] = "MoveFailed";
129
+ /** DiscardInProgress */
77
130
  KnownMoveState["DiscardInProgress"] = "DiscardInProgress";
131
+ /** DiscardFailed */
78
132
  KnownMoveState["DiscardFailed"] = "DiscardFailed";
133
+ /** CommitPending */
79
134
  KnownMoveState["CommitPending"] = "CommitPending";
135
+ /** CommitInProgress */
80
136
  KnownMoveState["CommitInProgress"] = "CommitInProgress";
137
+ /** CommitFailed */
81
138
  KnownMoveState["CommitFailed"] = "CommitFailed";
139
+ /** Committed */
82
140
  KnownMoveState["Committed"] = "Committed";
141
+ /** DeleteSourcePending */
83
142
  KnownMoveState["DeleteSourcePending"] = "DeleteSourcePending";
143
+ /** ResourceMoveCompleted */
84
144
  KnownMoveState["ResourceMoveCompleted"] = "ResourceMoveCompleted";
85
145
  })(exports.KnownMoveState || (exports.KnownMoveState = {}));
86
146
  /** Known values of {@link JobName} that the service accepts. */
87
147
  exports.KnownJobName = void 0;
88
148
  (function (KnownJobName) {
149
+ /** InitialSync */
89
150
  KnownJobName["InitialSync"] = "InitialSync";
90
151
  })(exports.KnownJobName || (exports.KnownJobName = {}));
91
152
  /** Known values of {@link ResolutionType} that the service accepts. */
92
153
  exports.KnownResolutionType = void 0;
93
154
  (function (KnownResolutionType) {
155
+ /** Manual */
94
156
  KnownResolutionType["Manual"] = "Manual";
157
+ /** Automatic */
95
158
  KnownResolutionType["Automatic"] = "Automatic";
96
159
  })(exports.KnownResolutionType || (exports.KnownResolutionType = {}));
97
160
  /** Known values of {@link DependencyType} that the service accepts. */
98
161
  exports.KnownDependencyType = void 0;
99
162
  (function (KnownDependencyType) {
163
+ /** RequiredForPrepare */
100
164
  KnownDependencyType["RequiredForPrepare"] = "RequiredForPrepare";
165
+ /** RequiredForMove */
101
166
  KnownDependencyType["RequiredForMove"] = "RequiredForMove";
102
167
  })(exports.KnownDependencyType || (exports.KnownDependencyType = {}));
103
168
  /** Known values of {@link DependencyLevel} that the service accepts. */
104
169
  exports.KnownDependencyLevel = void 0;
105
170
  (function (KnownDependencyLevel) {
171
+ /** Direct */
106
172
  KnownDependencyLevel["Direct"] = "Direct";
173
+ /** Descendant */
107
174
  KnownDependencyLevel["Descendant"] = "Descendant";
108
175
  })(exports.KnownDependencyLevel || (exports.KnownDependencyLevel = {}));
109
176
  /** Known values of {@link TargetAvailabilityZone} that the service accepts. */
110
177
  exports.KnownTargetAvailabilityZone = void 0;
111
178
  (function (KnownTargetAvailabilityZone) {
179
+ /** One */
112
180
  KnownTargetAvailabilityZone["One"] = "1";
181
+ /** Two */
113
182
  KnownTargetAvailabilityZone["Two"] = "2";
183
+ /** Three */
114
184
  KnownTargetAvailabilityZone["Three"] = "3";
185
+ /** NA */
115
186
  KnownTargetAvailabilityZone["NA"] = "NA";
116
187
  })(exports.KnownTargetAvailabilityZone || (exports.KnownTargetAvailabilityZone = {}));
117
188
  /** Known values of {@link ZoneRedundant} that the service accepts. */
118
189
  exports.KnownZoneRedundant = void 0;
119
190
  (function (KnownZoneRedundant) {
191
+ /** Enable */
120
192
  KnownZoneRedundant["Enable"] = "Enable";
193
+ /** Disable */
121
194
  KnownZoneRedundant["Disable"] = "Disable";
122
195
  })(exports.KnownZoneRedundant || (exports.KnownZoneRedundant = {}));
123
196
 
@@ -2425,20 +2498,31 @@ class MoveCollectionsImpl {
2425
2498
  [Symbol.asyncIterator]() {
2426
2499
  return this;
2427
2500
  },
2428
- byPage: () => {
2429
- return this.listMoveCollectionsBySubscriptionPagingPage(options);
2501
+ byPage: (settings) => {
2502
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2503
+ throw new Error("maxPageSize is not supported by this operation.");
2504
+ }
2505
+ return this.listMoveCollectionsBySubscriptionPagingPage(options, settings);
2430
2506
  }
2431
2507
  };
2432
2508
  }
2433
- listMoveCollectionsBySubscriptionPagingPage(options) {
2509
+ listMoveCollectionsBySubscriptionPagingPage(options, settings) {
2434
2510
  return tslib.__asyncGenerator(this, arguments, function* listMoveCollectionsBySubscriptionPagingPage_1() {
2435
- let result = yield tslib.__await(this._listMoveCollectionsBySubscription(options));
2436
- yield yield tslib.__await(result.value || []);
2437
- let continuationToken = result.nextLink;
2511
+ let result;
2512
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2513
+ if (!continuationToken) {
2514
+ result = yield tslib.__await(this._listMoveCollectionsBySubscription(options));
2515
+ let page = result.value || [];
2516
+ continuationToken = result.nextLink;
2517
+ setContinuationToken(page, continuationToken);
2518
+ yield yield tslib.__await(page);
2519
+ }
2438
2520
  while (continuationToken) {
2439
2521
  result = yield tslib.__await(this._listMoveCollectionsBySubscriptionNext(continuationToken, options));
2440
2522
  continuationToken = result.nextLink;
2441
- yield yield tslib.__await(result.value || []);
2523
+ let page = result.value || [];
2524
+ setContinuationToken(page, continuationToken);
2525
+ yield yield tslib.__await(page);
2442
2526
  }
2443
2527
  });
2444
2528
  }
@@ -2474,20 +2558,31 @@ class MoveCollectionsImpl {
2474
2558
  [Symbol.asyncIterator]() {
2475
2559
  return this;
2476
2560
  },
2477
- byPage: () => {
2478
- return this.listMoveCollectionsByResourceGroupPagingPage(resourceGroupName, options);
2561
+ byPage: (settings) => {
2562
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
2563
+ throw new Error("maxPageSize is not supported by this operation.");
2564
+ }
2565
+ return this.listMoveCollectionsByResourceGroupPagingPage(resourceGroupName, options, settings);
2479
2566
  }
2480
2567
  };
2481
2568
  }
2482
- listMoveCollectionsByResourceGroupPagingPage(resourceGroupName, options) {
2569
+ listMoveCollectionsByResourceGroupPagingPage(resourceGroupName, options, settings) {
2483
2570
  return tslib.__asyncGenerator(this, arguments, function* listMoveCollectionsByResourceGroupPagingPage_1() {
2484
- let result = yield tslib.__await(this._listMoveCollectionsByResourceGroup(resourceGroupName, options));
2485
- yield yield tslib.__await(result.value || []);
2486
- let continuationToken = result.nextLink;
2571
+ let result;
2572
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
2573
+ if (!continuationToken) {
2574
+ result = yield tslib.__await(this._listMoveCollectionsByResourceGroup(resourceGroupName, options));
2575
+ let page = result.value || [];
2576
+ continuationToken = result.nextLink;
2577
+ setContinuationToken(page, continuationToken);
2578
+ yield yield tslib.__await(page);
2579
+ }
2487
2580
  while (continuationToken) {
2488
2581
  result = yield tslib.__await(this._listMoveCollectionsByResourceGroupNext(resourceGroupName, continuationToken, options));
2489
2582
  continuationToken = result.nextLink;
2490
- yield yield tslib.__await(result.value || []);
2583
+ let page = result.value || [];
2584
+ setContinuationToken(page, continuationToken);
2585
+ yield yield tslib.__await(page);
2491
2586
  }
2492
2587
  });
2493
2588
  }
@@ -3333,7 +3428,6 @@ const listMoveCollectionsBySubscriptionNextOperationSpec = {
3333
3428
  bodyMapper: CloudError
3334
3429
  }
3335
3430
  },
3336
- queryParameters: [apiVersion],
3337
3431
  urlParameters: [
3338
3432
  $host,
3339
3433
  subscriptionId,
@@ -3353,7 +3447,6 @@ const listMoveCollectionsByResourceGroupNextOperationSpec = {
3353
3447
  bodyMapper: CloudError
3354
3448
  }
3355
3449
  },
3356
- queryParameters: [apiVersion],
3357
3450
  urlParameters: [
3358
3451
  $host,
3359
3452
  subscriptionId,
@@ -3396,20 +3489,31 @@ class MoveResourcesImpl {
3396
3489
  [Symbol.asyncIterator]() {
3397
3490
  return this;
3398
3491
  },
3399
- byPage: () => {
3400
- return this.listPagingPage(resourceGroupName, moveCollectionName, options);
3492
+ byPage: (settings) => {
3493
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
3494
+ throw new Error("maxPageSize is not supported by this operation.");
3495
+ }
3496
+ return this.listPagingPage(resourceGroupName, moveCollectionName, options, settings);
3401
3497
  }
3402
3498
  };
3403
3499
  }
3404
- listPagingPage(resourceGroupName, moveCollectionName, options) {
3500
+ listPagingPage(resourceGroupName, moveCollectionName, options, settings) {
3405
3501
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
3406
- let result = yield tslib.__await(this._list(resourceGroupName, moveCollectionName, options));
3407
- yield yield tslib.__await(result.value || []);
3408
- let continuationToken = result.nextLink;
3502
+ let result;
3503
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
3504
+ if (!continuationToken) {
3505
+ result = yield tslib.__await(this._list(resourceGroupName, moveCollectionName, options));
3506
+ let page = result.value || [];
3507
+ continuationToken = result.nextLink;
3508
+ setContinuationToken(page, continuationToken);
3509
+ yield yield tslib.__await(page);
3510
+ }
3409
3511
  while (continuationToken) {
3410
3512
  result = yield tslib.__await(this._listNext(resourceGroupName, moveCollectionName, continuationToken, options));
3411
3513
  continuationToken = result.nextLink;
3412
- yield yield tslib.__await(result.value || []);
3514
+ let page = result.value || [];
3515
+ setContinuationToken(page, continuationToken);
3516
+ yield yield tslib.__await(page);
3413
3517
  }
3414
3518
  });
3415
3519
  }
@@ -3689,7 +3793,6 @@ const listNextOperationSpec = {
3689
3793
  bodyMapper: CloudError
3690
3794
  }
3691
3795
  },
3692
- queryParameters: [apiVersion, filter],
3693
3796
  urlParameters: [
3694
3797
  $host,
3695
3798
  subscriptionId,
@@ -3733,20 +3836,31 @@ class UnresolvedDependenciesImpl {
3733
3836
  [Symbol.asyncIterator]() {
3734
3837
  return this;
3735
3838
  },
3736
- byPage: () => {
3737
- return this.getPagingPage(resourceGroupName, moveCollectionName, options);
3839
+ byPage: (settings) => {
3840
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
3841
+ throw new Error("maxPageSize is not supported by this operation.");
3842
+ }
3843
+ return this.getPagingPage(resourceGroupName, moveCollectionName, options, settings);
3738
3844
  }
3739
3845
  };
3740
3846
  }
3741
- getPagingPage(resourceGroupName, moveCollectionName, options) {
3847
+ getPagingPage(resourceGroupName, moveCollectionName, options, settings) {
3742
3848
  return tslib.__asyncGenerator(this, arguments, function* getPagingPage_1() {
3743
- let result = yield tslib.__await(this._get(resourceGroupName, moveCollectionName, options));
3744
- yield yield tslib.__await(result.value || []);
3745
- let continuationToken = result.nextLink;
3849
+ let result;
3850
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
3851
+ if (!continuationToken) {
3852
+ result = yield tslib.__await(this._get(resourceGroupName, moveCollectionName, options));
3853
+ let page = result.value || [];
3854
+ continuationToken = result.nextLink;
3855
+ setContinuationToken(page, continuationToken);
3856
+ yield yield tslib.__await(page);
3857
+ }
3746
3858
  while (continuationToken) {
3747
3859
  result = yield tslib.__await(this._getNext(resourceGroupName, moveCollectionName, continuationToken, options));
3748
3860
  continuationToken = result.nextLink;
3749
- yield yield tslib.__await(result.value || []);
3861
+ let page = result.value || [];
3862
+ setContinuationToken(page, continuationToken);
3863
+ yield yield tslib.__await(page);
3750
3864
  }
3751
3865
  });
3752
3866
  }
@@ -3827,12 +3941,6 @@ const getNextOperationSpec = {
3827
3941
  bodyMapper: CloudError
3828
3942
  }
3829
3943
  },
3830
- queryParameters: [
3831
- apiVersion,
3832
- filter,
3833
- dependencyLevel,
3834
- orderby
3835
- ],
3836
3944
  urlParameters: [
3837
3945
  $host,
3838
3946
  subscriptionId,
@@ -3899,7 +4007,7 @@ class ResourceMoverServiceAPI extends coreClient__namespace.ServiceClient {
3899
4007
  * @param options The parameter options
3900
4008
  */
3901
4009
  constructor(credentials, subscriptionId, options) {
3902
- var _a, _b;
4010
+ var _a, _b, _c;
3903
4011
  if (credentials === undefined) {
3904
4012
  throw new Error("'credentials' cannot be null");
3905
4013
  }
@@ -3914,32 +4022,34 @@ class ResourceMoverServiceAPI extends coreClient__namespace.ServiceClient {
3914
4022
  requestContentType: "application/json; charset=utf-8",
3915
4023
  credential: credentials
3916
4024
  };
3917
- const packageDetails = `azsdk-js-arm-resourcemover/2.0.2`;
4025
+ const packageDetails = `azsdk-js-arm-resourcemover/2.1.0`;
3918
4026
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
3919
4027
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
3920
4028
  : `${packageDetails}`;
3921
- if (!options.credentialScopes) {
3922
- options.credentialScopes = ["https://management.azure.com/.default"];
3923
- }
3924
4029
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
3925
4030
  userAgentPrefix
3926
- }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
4031
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
3927
4032
  super(optionsWithDefaults);
4033
+ let bearerTokenAuthenticationPolicyFound = false;
3928
4034
  if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
3929
4035
  const pipelinePolicies = options.pipeline.getOrderedPolicies();
3930
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
4036
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
3931
4037
  coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
3932
- if (!bearerTokenAuthenticationPolicyFound) {
3933
- this.pipeline.removePolicy({
3934
- name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
3935
- });
3936
- this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
3937
- scopes: `${optionsWithDefaults.baseUri}/.default`,
3938
- challengeCallbacks: {
3939
- authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
3940
- }
3941
- }));
3942
- }
4038
+ }
4039
+ if (!options ||
4040
+ !options.pipeline ||
4041
+ options.pipeline.getOrderedPolicies().length == 0 ||
4042
+ !bearerTokenAuthenticationPolicyFound) {
4043
+ this.pipeline.removePolicy({
4044
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
4045
+ });
4046
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
4047
+ credential: credentials,
4048
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
4049
+ challengeCallbacks: {
4050
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
4051
+ }
4052
+ }));
3943
4053
  }
3944
4054
  // Parameter assignments
3945
4055
  this.subscriptionId = subscriptionId;
@@ -3950,8 +4060,37 @@ class ResourceMoverServiceAPI extends coreClient__namespace.ServiceClient {
3950
4060
  this.moveResources = new MoveResourcesImpl(this);
3951
4061
  this.unresolvedDependencies = new UnresolvedDependenciesImpl(this);
3952
4062
  this.operationsDiscoveryOperations = new OperationsDiscoveryOperationsImpl(this);
4063
+ this.addCustomApiVersionPolicy(options.apiVersion);
4064
+ }
4065
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
4066
+ addCustomApiVersionPolicy(apiVersion) {
4067
+ if (!apiVersion) {
4068
+ return;
4069
+ }
4070
+ const apiVersionPolicy = {
4071
+ name: "CustomApiVersionPolicy",
4072
+ sendRequest(request, next) {
4073
+ return tslib.__awaiter(this, void 0, void 0, function* () {
4074
+ const param = request.url.split("?");
4075
+ if (param.length > 1) {
4076
+ const newParams = param[1].split("&").map((item) => {
4077
+ if (item.indexOf("api-version") > -1) {
4078
+ return "api-version=" + apiVersion;
4079
+ }
4080
+ else {
4081
+ return item;
4082
+ }
4083
+ });
4084
+ request.url = param[0] + "?" + newParams.join("&");
4085
+ }
4086
+ return next(request);
4087
+ });
4088
+ }
4089
+ };
4090
+ this.pipeline.addPolicy(apiVersionPolicy);
3953
4091
  }
3954
4092
  }
3955
4093
 
3956
4094
  exports.ResourceMoverServiceAPI = ResourceMoverServiceAPI;
4095
+ exports.getContinuationToken = getContinuationToken;
3957
4096
  //# sourceMappingURL=index.js.map