@azure/arm-extendedlocation 1.0.0-alpha.20220414.1 → 1.0.0-beta.2

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 (129) hide show
  1. package/CHANGELOG.md +39 -10
  2. package/LICENSE +1 -1
  3. package/README.md +23 -8
  4. package/dist/index.js +783 -86
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.js +42 -0
  11. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/customLocationsDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/customLocationsDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/customLocationsDeleteSample.js +31 -0
  15. package/dist-esm/samples-dev/customLocationsDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.js +34 -0
  19. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.js.map +1 -0
  20. package/dist-esm/samples-dev/customLocationsGetSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/customLocationsGetSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/customLocationsGetSample.js +31 -0
  23. package/dist-esm/samples-dev/customLocationsGetSample.js.map +1 -0
  24. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.js +44 -0
  27. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.js.map +1 -0
  28. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.js +43 -0
  31. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.js.map +1 -0
  32. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.js +45 -0
  35. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.js.map +1 -0
  36. package/dist-esm/samples-dev/customLocationsListOperationsSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/customLocationsListOperationsSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/customLocationsListOperationsSample.js +43 -0
  39. package/dist-esm/samples-dev/customLocationsListOperationsSample.js.map +1 -0
  40. package/dist-esm/samples-dev/customLocationsUpdateSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/customLocationsUpdateSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/customLocationsUpdateSample.js +34 -0
  43. package/dist-esm/samples-dev/customLocationsUpdateSample.js.map +1 -0
  44. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.js +41 -0
  47. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.js.map +1 -0
  48. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.js +32 -0
  51. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.js.map +1 -0
  52. package/dist-esm/samples-dev/resourceSyncRulesGetSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/resourceSyncRulesGetSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/resourceSyncRulesGetSample.js +32 -0
  55. package/dist-esm/samples-dev/resourceSyncRulesGetSample.js.map +1 -0
  56. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.js +45 -0
  59. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.js.map +1 -0
  60. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.d.ts +2 -0
  61. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.js +34 -0
  63. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.js.map +1 -0
  64. package/dist-esm/src/customLocationsManagementClient.d.ts +9 -3
  65. package/dist-esm/src/customLocationsManagementClient.d.ts.map +1 -1
  66. package/dist-esm/src/customLocationsManagementClient.js +81 -4
  67. package/dist-esm/src/customLocationsManagementClient.js.map +1 -1
  68. package/dist-esm/src/index.d.ts +0 -1
  69. package/dist-esm/src/index.d.ts.map +1 -1
  70. package/dist-esm/src/index.js +0 -1
  71. package/dist-esm/src/index.js.map +1 -1
  72. package/dist-esm/src/models/index.d.ts +172 -25
  73. package/dist-esm/src/models/index.d.ts.map +1 -1
  74. package/dist-esm/src/models/index.js +7 -0
  75. package/dist-esm/src/models/index.js.map +1 -1
  76. package/dist-esm/src/models/mappers.d.ts +8 -1
  77. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  78. package/dist-esm/src/models/mappers.js +228 -29
  79. package/dist-esm/src/models/mappers.js.map +1 -1
  80. package/dist-esm/src/models/parameters.d.ts +7 -0
  81. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  82. package/dist-esm/src/models/parameters.js +41 -2
  83. package/dist-esm/src/models/parameters.js.map +1 -1
  84. package/dist-esm/src/operations/customLocations.d.ts +12 -3
  85. package/dist-esm/src/operations/customLocations.d.ts.map +1 -1
  86. package/dist-esm/src/operations/customLocations.js +41 -2
  87. package/dist-esm/src/operations/customLocations.js.map +1 -1
  88. package/dist-esm/src/operations/index.d.ts +1 -0
  89. package/dist-esm/src/operations/index.d.ts.map +1 -1
  90. package/dist-esm/src/operations/index.js +1 -0
  91. package/dist-esm/src/operations/index.js.map +1 -1
  92. package/dist-esm/src/operations/resourceSyncRules.d.ts +97 -0
  93. package/dist-esm/src/operations/resourceSyncRules.d.ts.map +1 -0
  94. package/dist-esm/src/operations/resourceSyncRules.js +400 -0
  95. package/dist-esm/src/operations/resourceSyncRules.js.map +1 -0
  96. package/dist-esm/src/operationsInterfaces/customLocations.d.ts +10 -1
  97. package/dist-esm/src/operationsInterfaces/customLocations.d.ts.map +1 -1
  98. package/dist-esm/src/operationsInterfaces/index.d.ts +1 -0
  99. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  100. package/dist-esm/src/operationsInterfaces/index.js +1 -0
  101. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  102. package/dist-esm/src/operationsInterfaces/resourceSyncRules.d.ts +71 -0
  103. package/dist-esm/src/operationsInterfaces/resourceSyncRules.d.ts.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/resourceSyncRules.js +9 -0
  105. package/dist-esm/src/operationsInterfaces/resourceSyncRules.js.map +1 -0
  106. package/dist-esm/test/sampleTest.js +11 -13
  107. package/dist-esm/test/sampleTest.js.map +1 -1
  108. package/package.json +39 -20
  109. package/review/arm-extendedlocation.api.md +139 -27
  110. package/rollup.config.js +6 -72
  111. package/src/customLocationsManagementClient.ts +109 -5
  112. package/src/index.ts +0 -1
  113. package/src/models/index.ts +186 -26
  114. package/src/models/mappers.ts +243 -30
  115. package/src/models/parameters.ts +53 -2
  116. package/src/operations/customLocations.ts +57 -5
  117. package/src/operations/index.ts +1 -0
  118. package/src/operations/resourceSyncRules.ts +562 -0
  119. package/src/operationsInterfaces/customLocations.ts +18 -1
  120. package/src/operationsInterfaces/index.ts +1 -0
  121. package/src/operationsInterfaces/resourceSyncRules.ts +136 -0
  122. package/tsconfig.json +19 -5
  123. package/types/arm-extendedlocation.d.ts +257 -20
  124. package/types/tsdoc-metadata.json +1 -1
  125. package/dist-esm/src/customLocationsManagementClientContext.d.ts +0 -16
  126. package/dist-esm/src/customLocationsManagementClientContext.d.ts.map +0 -1
  127. package/dist-esm/src/customLocationsManagementClientContext.js +0 -49
  128. package/dist-esm/src/customLocationsManagementClientContext.js.map +0 -1
  129. package/src/customLocationsManagementClientContext.ts +0 -70
package/package.json CHANGED
@@ -3,17 +3,17 @@
3
3
  "sdk-type": "mgmt",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "A generated SDK for CustomLocationsManagementClient.",
6
- "version": "1.0.0-alpha.20220414.1",
6
+ "version": "1.0.0-beta.2",
7
7
  "engines": {
8
8
  "node": ">=12.0.0"
9
9
  },
10
10
  "dependencies": {
11
11
  "@azure/core-lro": "^2.2.0",
12
12
  "@azure/abort-controller": "^1.0.0",
13
- "@azure/core-paging": "^1.1.1",
14
- "@azure/core-client": "^1.0.0",
13
+ "@azure/core-paging": "^1.2.0",
14
+ "@azure/core-client": "^1.5.0",
15
15
  "@azure/core-auth": "^1.3.0",
16
- "@azure/core-rest-pipeline": "^1.1.0",
16
+ "@azure/core-rest-pipeline": "^1.8.0",
17
17
  "tslib": "^2.2.0"
18
18
  },
19
19
  "keywords": [
@@ -28,20 +28,25 @@
28
28
  "module": "./dist-esm/src/index.js",
29
29
  "types": "./types/arm-extendedlocation.d.ts",
30
30
  "devDependencies": {
31
- "@microsoft/api-extractor": "^7.18.11",
31
+ "@microsoft/api-extractor": "7.18.11",
32
32
  "@rollup/plugin-commonjs": "^21.0.1",
33
- "@rollup/plugin-json": "^4.0.0",
34
- "@rollup/plugin-multi-entry": "^3.0.0",
35
- "@rollup/plugin-node-resolve": "^8.0.0",
33
+ "@rollup/plugin-json": "^4.1.0",
34
+ "@rollup/plugin-multi-entry": "^4.1.0",
35
+ "@rollup/plugin-node-resolve": "^13.1.3",
36
36
  "mkdirp": "^1.0.4",
37
- "rollup": "^2.0.0",
38
- "rollup-plugin-sourcemaps": "^0.4.2",
37
+ "rollup": "^2.66.1",
38
+ "rollup-plugin-sourcemaps": "^0.6.3",
39
39
  "typescript": "~4.2.0",
40
40
  "uglify-js": "^3.4.9",
41
+ "rimraf": "^3.0.0",
41
42
  "@azure/identity": "^2.0.1",
42
- "@azure-tools/test-recorder": "^1.0.0",
43
+ "@azure-tools/test-recorder": "^2.0.0",
44
+ "@azure-tools/test-credential": "^1.0.0",
43
45
  "mocha": "^7.1.1",
44
- "cross-env": "^7.0.2"
46
+ "@types/chai": "^4.2.8",
47
+ "chai": "^4.2.0",
48
+ "cross-env": "^7.0.2",
49
+ "@azure/dev-tool": "^1.0.0"
45
50
  },
46
51
  "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/extendedlocation/arm-extendedlocation",
47
52
  "repository": {
@@ -70,14 +75,14 @@
70
75
  "types/*"
71
76
  ],
72
77
  "scripts": {
73
- "build": "tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
78
+ "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
74
79
  "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js",
75
80
  "prepack": "npm run build",
76
81
  "pack": "npm pack 2>&1",
77
82
  "extract-api": "api-extractor run --local",
78
83
  "lint": "echo skipped",
79
84
  "audit": "echo skipped",
80
- "clean": "echo skipped",
85
+ "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
81
86
  "build:node": "echo skipped",
82
87
  "build:browser": "echo skipped",
83
88
  "build:test": "echo skipped",
@@ -86,17 +91,31 @@
86
91
  "execute:samples": "echo skipped",
87
92
  "format": "echo skipped",
88
93
  "test": "npm run integration-test",
89
- "prebuild": "echo skipped",
90
94
  "test:node": "echo skipped",
91
95
  "test:browser": "echo skipped",
92
96
  "unit-test": "npm run unit-test:node && npm run unit-test:browser",
93
97
  "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node",
94
98
  "unit-test:browser": "echo skipped",
95
99
  "integration-test": "npm run integration-test:node && npm run integration-test:browser",
96
- "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts",
97
- "integration-test:browser": "echo skipped",
98
- "docs": "echo skipped"
100
+ "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'",
101
+ "integration-test:browser": "echo skipped"
99
102
  },
100
103
  "sideEffects": false,
101
- "autoPublish": true
102
- }
104
+ "//metadata": {
105
+ "constantPaths": [
106
+ {
107
+ "path": "src/customLocationsManagementClient.ts",
108
+ "prefix": "packageDetails"
109
+ }
110
+ ]
111
+ },
112
+ "autoPublish": true,
113
+ "//sampleConfiguration": {
114
+ "productName": "",
115
+ "productSlugs": [
116
+ "azure"
117
+ ],
118
+ "disableDocsMs": true,
119
+ "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-extendedlocation?view=azure-node-preview"
120
+ }
121
+ }
@@ -14,17 +14,30 @@ import { PollOperationState } from '@azure/core-lro';
14
14
  export type CreatedByType = string;
15
15
 
16
16
  // @public
17
- export type CustomLocation = TrackedResource & {
18
- identity?: Identity;
19
- readonly systemData?: SystemData;
17
+ export interface CustomLocation extends TrackedResource {
20
18
  authentication?: CustomLocationPropertiesAuthentication;
21
19
  clusterExtensionIds?: string[];
22
20
  displayName?: string;
23
21
  hostResourceId?: string;
24
22
  hostType?: HostType;
23
+ identity?: Identity;
25
24
  namespace?: string;
26
25
  provisioningState?: string;
27
- };
26
+ readonly systemData?: SystemData;
27
+ }
28
+
29
+ // @public
30
+ export interface CustomLocationFindTargetResourceGroupProperties {
31
+ labels?: {
32
+ [propertyName: string]: string;
33
+ };
34
+ }
35
+
36
+ // @public
37
+ export interface CustomLocationFindTargetResourceGroupResult {
38
+ readonly matchedResourceSyncRule?: string;
39
+ readonly targetResourceGroup?: string;
40
+ }
28
41
 
29
42
  // @public
30
43
  export interface CustomLocationListResult {
@@ -61,6 +74,7 @@ export interface CustomLocations {
61
74
  beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, parameters: CustomLocation, options?: CustomLocationsCreateOrUpdateOptionalParams): Promise<CustomLocationsCreateOrUpdateResponse>;
62
75
  beginDelete(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
63
76
  beginDeleteAndWait(resourceGroupName: string, resourceName: string, options?: CustomLocationsDeleteOptionalParams): Promise<void>;
77
+ findTargetResourceGroup(resourceGroupName: string, resourceName: string, parameters: CustomLocationFindTargetResourceGroupProperties, options?: CustomLocationsFindTargetResourceGroupOptionalParams): Promise<CustomLocationsFindTargetResourceGroupResponse>;
64
78
  get(resourceGroupName: string, resourceName: string, options?: CustomLocationsGetOptionalParams): Promise<CustomLocationsGetResponse>;
65
79
  listByResourceGroup(resourceGroupName: string, options?: CustomLocationsListByResourceGroupOptionalParams): PagedAsyncIterableIterator<CustomLocation>;
66
80
  listBySubscription(options?: CustomLocationsListBySubscriptionOptionalParams): PagedAsyncIterableIterator<CustomLocation>;
@@ -84,6 +98,13 @@ export interface CustomLocationsDeleteOptionalParams extends coreClient.Operatio
84
98
  updateIntervalInMs?: number;
85
99
  }
86
100
 
101
+ // @public
102
+ export interface CustomLocationsFindTargetResourceGroupOptionalParams extends coreClient.OperationOptions {
103
+ }
104
+
105
+ // @public
106
+ export type CustomLocationsFindTargetResourceGroupResponse = CustomLocationFindTargetResourceGroupResult;
107
+
87
108
  // @public
88
109
  export interface CustomLocationsGetOptionalParams extends coreClient.OperationOptions {
89
110
  }
@@ -148,20 +169,17 @@ export interface CustomLocationsListOperationsOptionalParams extends coreClient.
148
169
  export type CustomLocationsListOperationsResponse = CustomLocationOperationsList;
149
170
 
150
171
  // @public (undocumented)
151
- export class CustomLocationsManagementClient extends CustomLocationsManagementClientContext {
152
- constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CustomLocationsManagementClientOptionalParams);
153
- // (undocumented)
154
- customLocations: CustomLocations;
155
- }
156
-
157
- // @public (undocumented)
158
- export class CustomLocationsManagementClientContext extends coreClient.ServiceClient {
172
+ export class CustomLocationsManagementClient extends coreClient.ServiceClient {
159
173
  // (undocumented)
160
174
  $host: string;
161
175
  constructor(credentials: coreAuth.TokenCredential, subscriptionId: string, options?: CustomLocationsManagementClientOptionalParams);
162
176
  // (undocumented)
163
177
  apiVersion: string;
164
178
  // (undocumented)
179
+ customLocations: CustomLocations;
180
+ // (undocumented)
181
+ resourceSyncRules: ResourceSyncRules;
182
+ // (undocumented)
165
183
  subscriptionId: string;
166
184
  }
167
185
 
@@ -191,12 +209,12 @@ export interface CustomLocationsUpdateOptionalParams extends coreClient.Operatio
191
209
  export type CustomLocationsUpdateResponse = CustomLocation;
192
210
 
193
211
  // @public
194
- export type EnabledResourceType = ProxyResource & {
195
- readonly systemData?: SystemData;
212
+ export interface EnabledResourceType extends ProxyResource {
196
213
  clusterExtensionId?: string;
197
214
  extensionType?: string;
215
+ readonly systemData?: SystemData;
198
216
  typesMetadata?: EnabledResourceTypePropertiesTypesMetadataItem[];
199
- };
217
+ }
200
218
 
201
219
  // @public
202
220
  export interface EnabledResourceTypePropertiesTypesMetadataItem {
@@ -243,30 +261,30 @@ export interface Identity {
243
261
 
244
262
  // @public
245
263
  export enum KnownCreatedByType {
246
- // (undocumented)
247
264
  Application = "Application",
248
- // (undocumented)
249
265
  Key = "Key",
250
- // (undocumented)
251
266
  ManagedIdentity = "ManagedIdentity",
252
- // (undocumented)
253
267
  User = "User"
254
268
  }
255
269
 
256
270
  // @public
257
271
  export enum KnownHostType {
258
- // (undocumented)
259
272
  Kubernetes = "Kubernetes"
260
273
  }
261
274
 
262
275
  // @public
263
276
  export enum KnownResourceIdentityType {
264
- // (undocumented)
265
277
  None = "None",
266
- // (undocumented)
267
278
  SystemAssigned = "SystemAssigned"
268
279
  }
269
280
 
281
+ // @public
282
+ export interface MatchExpressionsProperties {
283
+ key?: string;
284
+ operator?: string;
285
+ values?: string[];
286
+ }
287
+
270
288
  // @public
271
289
  export interface PatchableCustomLocations {
272
290
  authentication?: CustomLocationPropertiesAuthentication;
@@ -283,7 +301,19 @@ export interface PatchableCustomLocations {
283
301
  }
284
302
 
285
303
  // @public
286
- export type ProxyResource = Resource & {};
304
+ export interface PatchableResourceSyncRule {
305
+ priority?: number;
306
+ readonly provisioningState?: string;
307
+ selector?: ResourceSyncRulePropertiesSelector;
308
+ tags?: {
309
+ [propertyName: string]: string;
310
+ };
311
+ targetResourceGroup?: string;
312
+ }
313
+
314
+ // @public
315
+ export interface ProxyResource extends Resource {
316
+ }
287
317
 
288
318
  // @public
289
319
  export interface Resource {
@@ -295,6 +325,89 @@ export interface Resource {
295
325
  // @public
296
326
  export type ResourceIdentityType = string;
297
327
 
328
+ // @public
329
+ export interface ResourceSyncRule extends TrackedResource {
330
+ priority?: number;
331
+ readonly provisioningState?: string;
332
+ selector?: ResourceSyncRulePropertiesSelector;
333
+ readonly systemData?: SystemData;
334
+ targetResourceGroup?: string;
335
+ }
336
+
337
+ // @public
338
+ export interface ResourceSyncRuleListResult {
339
+ readonly nextLink?: string;
340
+ readonly value?: ResourceSyncRule[];
341
+ }
342
+
343
+ // @public
344
+ export interface ResourceSyncRulePropertiesSelector {
345
+ matchExpressions?: MatchExpressionsProperties[];
346
+ matchLabels?: {
347
+ [propertyName: string]: string;
348
+ };
349
+ }
350
+
351
+ // @public
352
+ export interface ResourceSyncRules {
353
+ beginCreateOrUpdate(resourceGroupName: string, resourceName: string, childResourceName: string, parameters: ResourceSyncRule, options?: ResourceSyncRulesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<ResourceSyncRulesCreateOrUpdateResponse>, ResourceSyncRulesCreateOrUpdateResponse>>;
354
+ beginCreateOrUpdateAndWait(resourceGroupName: string, resourceName: string, childResourceName: string, parameters: ResourceSyncRule, options?: ResourceSyncRulesCreateOrUpdateOptionalParams): Promise<ResourceSyncRulesCreateOrUpdateResponse>;
355
+ beginUpdate(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesUpdateOptionalParams): Promise<PollerLike<PollOperationState<ResourceSyncRulesUpdateResponse>, ResourceSyncRulesUpdateResponse>>;
356
+ beginUpdateAndWait(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesUpdateOptionalParams): Promise<ResourceSyncRulesUpdateResponse>;
357
+ delete(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesDeleteOptionalParams): Promise<void>;
358
+ get(resourceGroupName: string, resourceName: string, childResourceName: string, options?: ResourceSyncRulesGetOptionalParams): Promise<ResourceSyncRulesGetResponse>;
359
+ listByCustomLocationID(resourceGroupName: string, resourceName: string, options?: ResourceSyncRulesListByCustomLocationIDOptionalParams): PagedAsyncIterableIterator<ResourceSyncRule>;
360
+ }
361
+
362
+ // @public
363
+ export interface ResourceSyncRulesCreateOrUpdateOptionalParams extends coreClient.OperationOptions {
364
+ resumeFrom?: string;
365
+ updateIntervalInMs?: number;
366
+ }
367
+
368
+ // @public
369
+ export type ResourceSyncRulesCreateOrUpdateResponse = ResourceSyncRule;
370
+
371
+ // @public
372
+ export interface ResourceSyncRulesDeleteOptionalParams extends coreClient.OperationOptions {
373
+ }
374
+
375
+ // @public
376
+ export interface ResourceSyncRulesGetOptionalParams extends coreClient.OperationOptions {
377
+ }
378
+
379
+ // @public
380
+ export type ResourceSyncRulesGetResponse = ResourceSyncRule;
381
+
382
+ // @public
383
+ export interface ResourceSyncRulesListByCustomLocationIDNextOptionalParams extends coreClient.OperationOptions {
384
+ }
385
+
386
+ // @public
387
+ export type ResourceSyncRulesListByCustomLocationIDNextResponse = ResourceSyncRuleListResult;
388
+
389
+ // @public
390
+ export interface ResourceSyncRulesListByCustomLocationIDOptionalParams extends coreClient.OperationOptions {
391
+ }
392
+
393
+ // @public
394
+ export type ResourceSyncRulesListByCustomLocationIDResponse = ResourceSyncRuleListResult;
395
+
396
+ // @public
397
+ export interface ResourceSyncRulesUpdateOptionalParams extends coreClient.OperationOptions {
398
+ priority?: number;
399
+ resumeFrom?: string;
400
+ selector?: ResourceSyncRulePropertiesSelector;
401
+ tags?: {
402
+ [propertyName: string]: string;
403
+ };
404
+ targetResourceGroup?: string;
405
+ updateIntervalInMs?: number;
406
+ }
407
+
408
+ // @public
409
+ export type ResourceSyncRulesUpdateResponse = ResourceSyncRule;
410
+
298
411
  // @public
299
412
  export interface SystemData {
300
413
  createdAt?: Date;
@@ -306,13 +419,12 @@ export interface SystemData {
306
419
  }
307
420
 
308
421
  // @public
309
- export type TrackedResource = Resource & {
422
+ export interface TrackedResource extends Resource {
423
+ location: string;
310
424
  tags?: {
311
425
  [propertyName: string]: string;
312
426
  };
313
- location: string;
314
- };
315
-
427
+ }
316
428
 
317
429
  // (No @packageDocumentation comment for this package)
318
430
 
package/rollup.config.js CHANGED
@@ -14,62 +14,14 @@ import json from "@rollup/plugin-json";
14
14
 
15
15
  import nodeBuiltins from "builtin-modules";
16
16
 
17
- /**
18
- * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
19
- *
20
- * NOTE: this manual configuration is only needed because OpenTelemetry uses an
21
- * __exportStar downleveled helper function to declare its exports which confuses
22
- * rollup's automatic discovery mechanism.
23
- *
24
- * @returns an object reference that can be `...`'d into your cjs() configuration.
25
- */
26
- export function openTelemetryCommonJs() {
27
- const namedExports = {};
28
-
29
- for (const key of [
30
- "@opentelemetry/api",
31
- "@azure/core-tracing/node_modules/@opentelemetry/api"
32
- ]) {
33
- namedExports[key] = [
34
- "SpanKind",
35
- "TraceFlags",
36
- "getSpan",
37
- "setSpan",
38
- "SpanStatusCode",
39
- "getSpanContext",
40
- "setSpanContext"
41
- ];
42
- }
43
-
44
- const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
45
-
46
- for (const version of releasedOpenTelemetryVersions) {
47
- namedExports[
48
- // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
49
- `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
50
- ] = [
51
- "SpanKind",
52
- "TraceFlags",
53
- "getSpan",
54
- "setSpan",
55
- "StatusCode",
56
- "CanonicalCode",
57
- "getSpanContext",
58
- "setSpanContext"
59
- ];
60
- }
61
-
62
- return namedExports;
63
- }
64
-
65
17
  // #region Warning Handler
66
18
 
67
19
  /**
68
- * A function that can determine whether a rollupwarning should be ignored. If
20
+ * A function that can determine whether a rollup warning should be ignored. If
69
21
  * the function returns `true`, then the warning will not be displayed.
70
22
  */
71
23
 
72
- function ignoreNiseSinonEvalWarnings(warning) {
24
+ function ignoreNiseSinonEval(warning) {
73
25
  return (
74
26
  warning.code === "EVAL" &&
75
27
  warning.id &&
@@ -78,17 +30,14 @@ function ignoreNiseSinonEvalWarnings(warning) {
78
30
  );
79
31
  }
80
32
 
81
- function ignoreChaiCircularDependencyWarnings(warning) {
33
+ function ignoreChaiCircularDependency(warning) {
82
34
  return (
83
35
  warning.code === "CIRCULAR_DEPENDENCY" &&
84
36
  warning.importer && warning.importer.includes("node_modules/chai") === true
85
37
  );
86
38
  }
87
39
 
88
- const warningInhibitors = [
89
- ignoreChaiCircularDependencyWarnings,
90
- ignoreNiseSinonEvalWarnings
91
- ];
40
+ const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
92
41
 
93
42
  /**
94
43
  * Construct a warning handler for the shared rollup configuration
@@ -122,22 +71,7 @@ function makeBrowserTestConfig() {
122
71
  nodeResolve({
123
72
  mainFields: ["module", "browser"]
124
73
  }),
125
- cjs({
126
- namedExports: {
127
- // Chai's strange internal architecture makes it impossible to statically
128
- // analyze its exports.
129
- chai: [
130
- "version",
131
- "use",
132
- "util",
133
- "config",
134
- "expect",
135
- "should",
136
- "assert"
137
- ],
138
- ...openTelemetryCommonJs()
139
- }
140
- }),
74
+ cjs(),
141
75
  json(),
142
76
  sourcemaps()
143
77
  //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
@@ -173,7 +107,7 @@ export function makeConfig(pkg, options) {
173
107
  ],
174
108
  output: { file: "dist/index.js", format: "cjs", sourcemap: true },
175
109
  preserveSymlinks: false,
176
- plugins: [sourcemaps(), nodeResolve(), cjs()]
110
+ plugins: [sourcemaps(), nodeResolve()]
177
111
  };
178
112
 
179
113
  const config = [baseConfig];
@@ -6,13 +6,23 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreRestPipeline from "@azure/core-rest-pipeline";
11
+ import {
12
+ PipelineRequest,
13
+ PipelineResponse,
14
+ SendRequest
15
+ } from "@azure/core-rest-pipeline";
9
16
  import * as coreAuth from "@azure/core-auth";
10
- import { CustomLocationsImpl } from "./operations";
11
- import { CustomLocations } from "./operationsInterfaces";
12
- import { CustomLocationsManagementClientContext } from "./customLocationsManagementClientContext";
17
+ import { CustomLocationsImpl, ResourceSyncRulesImpl } from "./operations";
18
+ import { CustomLocations, ResourceSyncRules } from "./operationsInterfaces";
13
19
  import { CustomLocationsManagementClientOptionalParams } from "./models";
14
20
 
15
- export class CustomLocationsManagementClient extends CustomLocationsManagementClientContext {
21
+ export class CustomLocationsManagementClient extends coreClient.ServiceClient {
22
+ $host: string;
23
+ apiVersion: string;
24
+ subscriptionId: string;
25
+
16
26
  /**
17
27
  * Initializes a new instance of the CustomLocationsManagementClient class.
18
28
  * @param credentials Subscription credentials which uniquely identify client subscription.
@@ -24,9 +34,103 @@ export class CustomLocationsManagementClient extends CustomLocationsManagementCl
24
34
  subscriptionId: string,
25
35
  options?: CustomLocationsManagementClientOptionalParams
26
36
  ) {
27
- super(credentials, subscriptionId, options);
37
+ if (credentials === undefined) {
38
+ throw new Error("'credentials' cannot be null");
39
+ }
40
+ if (subscriptionId === undefined) {
41
+ throw new Error("'subscriptionId' cannot be null");
42
+ }
43
+
44
+ // Initializing default values for options
45
+ if (!options) {
46
+ options = {};
47
+ }
48
+ const defaults: CustomLocationsManagementClientOptionalParams = {
49
+ requestContentType: "application/json; charset=utf-8",
50
+ credential: credentials
51
+ };
52
+
53
+ const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0-beta.2`;
54
+ const userAgentPrefix =
55
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
56
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
57
+ : `${packageDetails}`;
58
+
59
+ if (!options.credentialScopes) {
60
+ options.credentialScopes = ["https://management.azure.com/.default"];
61
+ }
62
+ const optionsWithDefaults = {
63
+ ...defaults,
64
+ ...options,
65
+ userAgentOptions: {
66
+ userAgentPrefix
67
+ },
68
+ baseUri:
69
+ options.endpoint ?? options.baseUri ?? "https://management.azure.com"
70
+ };
71
+ super(optionsWithDefaults);
72
+
73
+ if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
74
+ const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
75
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
76
+ (pipelinePolicy) =>
77
+ pipelinePolicy.name ===
78
+ coreRestPipeline.bearerTokenAuthenticationPolicyName
79
+ );
80
+ if (!bearerTokenAuthenticationPolicyFound) {
81
+ this.pipeline.removePolicy({
82
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
83
+ });
84
+ this.pipeline.addPolicy(
85
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
86
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
87
+ challengeCallbacks: {
88
+ authorizeRequestOnChallenge:
89
+ coreClient.authorizeRequestOnClaimChallenge
90
+ }
91
+ })
92
+ );
93
+ }
94
+ }
95
+ // Parameter assignments
96
+ this.subscriptionId = subscriptionId;
97
+
98
+ // Assigning values to Constant parameters
99
+ this.$host = options.$host || "https://management.azure.com";
100
+ this.apiVersion = options.apiVersion || "2021-08-31-preview";
28
101
  this.customLocations = new CustomLocationsImpl(this);
102
+ this.resourceSyncRules = new ResourceSyncRulesImpl(this);
103
+ this.addCustomApiVersionPolicy(options.apiVersion);
104
+ }
105
+
106
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
107
+ private addCustomApiVersionPolicy(apiVersion?: string) {
108
+ if (!apiVersion) {
109
+ return;
110
+ }
111
+ const apiVersionPolicy = {
112
+ name: "CustomApiVersionPolicy",
113
+ async sendRequest(
114
+ request: PipelineRequest,
115
+ next: SendRequest
116
+ ): Promise<PipelineResponse> {
117
+ const param = request.url.split("?");
118
+ if (param.length > 1) {
119
+ const newParams = param[1].split("&").map((item) => {
120
+ if (item.indexOf("api-version") > -1) {
121
+ return "api-version=" + apiVersion;
122
+ } else {
123
+ return item;
124
+ }
125
+ });
126
+ request.url = param[0] + "?" + newParams.join("&");
127
+ }
128
+ return next(request);
129
+ }
130
+ };
131
+ this.pipeline.addPolicy(apiVersionPolicy);
29
132
  }
30
133
 
31
134
  customLocations: CustomLocations;
135
+ resourceSyncRules: ResourceSyncRules;
32
136
  }
package/src/index.ts CHANGED
@@ -9,5 +9,4 @@
9
9
  /// <reference lib="esnext.asynciterable" />
10
10
  export * from "./models";
11
11
  export { CustomLocationsManagementClient } from "./customLocationsManagementClient";
12
- export { CustomLocationsManagementClientContext } from "./customLocationsManagementClientContext";
13
12
  export * from "./operationsInterfaces";