@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/dist/index.js CHANGED
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var coreClient = require('@azure/core-client');
6
5
  var tslib = require('tslib');
6
+ var coreClient = require('@azure/core-client');
7
+ var coreRestPipeline = require('@azure/core-rest-pipeline');
7
8
  var coreLro = require('@azure/core-lro');
8
9
 
9
10
  function _interopNamespace(e) {
@@ -25,6 +26,7 @@ function _interopNamespace(e) {
25
26
  }
26
27
 
27
28
  var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
28
30
 
29
31
  /*
30
32
  * Copyright (c) Microsoft Corporation.
@@ -36,20 +38,27 @@ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
36
38
  /** Known values of {@link ResourceIdentityType} that the service accepts. */
37
39
  exports.KnownResourceIdentityType = void 0;
38
40
  (function (KnownResourceIdentityType) {
41
+ /** SystemAssigned */
39
42
  KnownResourceIdentityType["SystemAssigned"] = "SystemAssigned";
43
+ /** None */
40
44
  KnownResourceIdentityType["None"] = "None";
41
45
  })(exports.KnownResourceIdentityType || (exports.KnownResourceIdentityType = {}));
42
46
  /** Known values of {@link HostType} that the service accepts. */
43
47
  exports.KnownHostType = void 0;
44
48
  (function (KnownHostType) {
49
+ /** Kubernetes */
45
50
  KnownHostType["Kubernetes"] = "Kubernetes";
46
51
  })(exports.KnownHostType || (exports.KnownHostType = {}));
47
52
  /** Known values of {@link CreatedByType} that the service accepts. */
48
53
  exports.KnownCreatedByType = void 0;
49
54
  (function (KnownCreatedByType) {
55
+ /** User */
50
56
  KnownCreatedByType["User"] = "User";
57
+ /** Application */
51
58
  KnownCreatedByType["Application"] = "Application";
59
+ /** ManagedIdentity */
52
60
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
61
+ /** Key */
53
62
  KnownCreatedByType["Key"] = "Key";
54
63
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
55
64
 
@@ -265,35 +274,6 @@ const CustomLocationListResult = {
265
274
  }
266
275
  }
267
276
  };
268
- const Resource = {
269
- type: {
270
- name: "Composite",
271
- className: "Resource",
272
- modelProperties: {
273
- id: {
274
- serializedName: "id",
275
- readOnly: true,
276
- type: {
277
- name: "String"
278
- }
279
- },
280
- name: {
281
- serializedName: "name",
282
- readOnly: true,
283
- type: {
284
- name: "String"
285
- }
286
- },
287
- type: {
288
- serializedName: "type",
289
- readOnly: true,
290
- type: {
291
- name: "String"
292
- }
293
- }
294
- }
295
- }
296
- };
297
277
  const Identity = {
298
278
  type: {
299
279
  name: "Composite",
@@ -386,6 +366,35 @@ const SystemData = {
386
366
  }
387
367
  }
388
368
  };
369
+ const Resource = {
370
+ type: {
371
+ name: "Composite",
372
+ className: "Resource",
373
+ modelProperties: {
374
+ id: {
375
+ serializedName: "id",
376
+ readOnly: true,
377
+ type: {
378
+ name: "String"
379
+ }
380
+ },
381
+ name: {
382
+ serializedName: "name",
383
+ readOnly: true,
384
+ type: {
385
+ name: "String"
386
+ }
387
+ },
388
+ type: {
389
+ serializedName: "type",
390
+ readOnly: true,
391
+ type: {
392
+ name: "String"
393
+ }
394
+ }
395
+ }
396
+ }
397
+ };
389
398
  const PatchableCustomLocations = {
390
399
  type: {
391
400
  name: "Composite",
@@ -510,6 +519,170 @@ const EnabledResourceTypePropertiesTypesMetadataItem = {
510
519
  }
511
520
  }
512
521
  };
522
+ const CustomLocationFindTargetResourceGroupProperties = {
523
+ type: {
524
+ name: "Composite",
525
+ className: "CustomLocationFindTargetResourceGroupProperties",
526
+ modelProperties: {
527
+ labels: {
528
+ serializedName: "labels",
529
+ type: {
530
+ name: "Dictionary",
531
+ value: { type: { name: "String" } }
532
+ }
533
+ }
534
+ }
535
+ }
536
+ };
537
+ const CustomLocationFindTargetResourceGroupResult = {
538
+ type: {
539
+ name: "Composite",
540
+ className: "CustomLocationFindTargetResourceGroupResult",
541
+ modelProperties: {
542
+ matchedResourceSyncRule: {
543
+ serializedName: "matchedResourceSyncRule",
544
+ readOnly: true,
545
+ type: {
546
+ name: "String"
547
+ }
548
+ },
549
+ targetResourceGroup: {
550
+ serializedName: "targetResourceGroup",
551
+ readOnly: true,
552
+ type: {
553
+ name: "String"
554
+ }
555
+ }
556
+ }
557
+ }
558
+ };
559
+ const ResourceSyncRuleListResult = {
560
+ type: {
561
+ name: "Composite",
562
+ className: "ResourceSyncRuleListResult",
563
+ modelProperties: {
564
+ nextLink: {
565
+ serializedName: "nextLink",
566
+ readOnly: true,
567
+ type: {
568
+ name: "String"
569
+ }
570
+ },
571
+ value: {
572
+ serializedName: "value",
573
+ readOnly: true,
574
+ type: {
575
+ name: "Sequence",
576
+ element: {
577
+ type: {
578
+ name: "Composite",
579
+ className: "ResourceSyncRule"
580
+ }
581
+ }
582
+ }
583
+ }
584
+ }
585
+ }
586
+ };
587
+ const ResourceSyncRulePropertiesSelector = {
588
+ type: {
589
+ name: "Composite",
590
+ className: "ResourceSyncRulePropertiesSelector",
591
+ modelProperties: {
592
+ matchExpressions: {
593
+ serializedName: "matchExpressions",
594
+ type: {
595
+ name: "Sequence",
596
+ element: {
597
+ type: {
598
+ name: "Composite",
599
+ className: "MatchExpressionsProperties"
600
+ }
601
+ }
602
+ }
603
+ },
604
+ matchLabels: {
605
+ serializedName: "matchLabels",
606
+ type: {
607
+ name: "Dictionary",
608
+ value: { type: { name: "String" } }
609
+ }
610
+ }
611
+ }
612
+ }
613
+ };
614
+ const MatchExpressionsProperties = {
615
+ type: {
616
+ name: "Composite",
617
+ className: "MatchExpressionsProperties",
618
+ modelProperties: {
619
+ key: {
620
+ serializedName: "key",
621
+ type: {
622
+ name: "String"
623
+ }
624
+ },
625
+ operator: {
626
+ serializedName: "operator",
627
+ type: {
628
+ name: "String"
629
+ }
630
+ },
631
+ values: {
632
+ serializedName: "values",
633
+ type: {
634
+ name: "Sequence",
635
+ element: {
636
+ type: {
637
+ name: "String"
638
+ }
639
+ }
640
+ }
641
+ }
642
+ }
643
+ }
644
+ };
645
+ const PatchableResourceSyncRule = {
646
+ type: {
647
+ name: "Composite",
648
+ className: "PatchableResourceSyncRule",
649
+ modelProperties: {
650
+ tags: {
651
+ serializedName: "tags",
652
+ type: {
653
+ name: "Dictionary",
654
+ value: { type: { name: "String" } }
655
+ }
656
+ },
657
+ priority: {
658
+ serializedName: "properties.priority",
659
+ type: {
660
+ name: "Number"
661
+ }
662
+ },
663
+ provisioningState: {
664
+ serializedName: "properties.provisioningState",
665
+ readOnly: true,
666
+ type: {
667
+ name: "String"
668
+ }
669
+ },
670
+ selector: {
671
+ serializedName: "properties.selector",
672
+ type: {
673
+ name: "Composite",
674
+ className: "ResourceSyncRulePropertiesSelector"
675
+ }
676
+ },
677
+ targetResourceGroup: {
678
+ serializedName: "properties.targetResourceGroup",
679
+ type: {
680
+ name: "String"
681
+ }
682
+ }
683
+ }
684
+ }
685
+ };
513
686
  const TrackedResource = {
514
687
  type: {
515
688
  name: "Composite",
@@ -596,6 +769,41 @@ const CustomLocation = {
596
769
  } })
597
770
  }
598
771
  };
772
+ const ResourceSyncRule = {
773
+ type: {
774
+ name: "Composite",
775
+ className: "ResourceSyncRule",
776
+ modelProperties: Object.assign(Object.assign({}, TrackedResource.type.modelProperties), { systemData: {
777
+ serializedName: "systemData",
778
+ type: {
779
+ name: "Composite",
780
+ className: "SystemData"
781
+ }
782
+ }, priority: {
783
+ serializedName: "properties.priority",
784
+ type: {
785
+ name: "Number"
786
+ }
787
+ }, provisioningState: {
788
+ serializedName: "properties.provisioningState",
789
+ readOnly: true,
790
+ type: {
791
+ name: "String"
792
+ }
793
+ }, selector: {
794
+ serializedName: "properties.selector",
795
+ type: {
796
+ name: "Composite",
797
+ className: "ResourceSyncRulePropertiesSelector"
798
+ }
799
+ }, targetResourceGroup: {
800
+ serializedName: "properties.targetResourceGroup",
801
+ type: {
802
+ name: "String"
803
+ }
804
+ } })
805
+ }
806
+ };
599
807
  const EnabledResourceType = {
600
808
  type: {
601
809
  name: "Composite",
@@ -639,16 +847,23 @@ var Mappers = /*#__PURE__*/Object.freeze({
639
847
  ErrorDetail: ErrorDetail,
640
848
  ErrorAdditionalInfo: ErrorAdditionalInfo,
641
849
  CustomLocationListResult: CustomLocationListResult,
642
- Resource: Resource,
643
850
  Identity: Identity,
644
851
  CustomLocationPropertiesAuthentication: CustomLocationPropertiesAuthentication,
645
852
  SystemData: SystemData,
853
+ Resource: Resource,
646
854
  PatchableCustomLocations: PatchableCustomLocations,
647
855
  EnabledResourceTypesListResult: EnabledResourceTypesListResult,
648
856
  EnabledResourceTypePropertiesTypesMetadataItem: EnabledResourceTypePropertiesTypesMetadataItem,
857
+ CustomLocationFindTargetResourceGroupProperties: CustomLocationFindTargetResourceGroupProperties,
858
+ CustomLocationFindTargetResourceGroupResult: CustomLocationFindTargetResourceGroupResult,
859
+ ResourceSyncRuleListResult: ResourceSyncRuleListResult,
860
+ ResourceSyncRulePropertiesSelector: ResourceSyncRulePropertiesSelector,
861
+ MatchExpressionsProperties: MatchExpressionsProperties,
862
+ PatchableResourceSyncRule: PatchableResourceSyncRule,
649
863
  TrackedResource: TrackedResource,
650
864
  ProxyResource: ProxyResource,
651
865
  CustomLocation: CustomLocation,
866
+ ResourceSyncRule: ResourceSyncRule,
652
867
  EnabledResourceType: EnabledResourceType
653
868
  });
654
869
 
@@ -684,7 +899,7 @@ const $host = {
684
899
  const apiVersion = {
685
900
  parameterPath: "apiVersion",
686
901
  mapper: {
687
- defaultValue: "2021-08-15",
902
+ defaultValue: "2021-08-31-preview",
688
903
  isConstant: true,
689
904
  serializedName: "api-version",
690
905
  type: {
@@ -749,6 +964,10 @@ const parameters = {
749
964
  parameterPath: "parameters",
750
965
  mapper: CustomLocation
751
966
  };
967
+ const parameters2 = {
968
+ parameterPath: "parameters",
969
+ mapper: CustomLocationFindTargetResourceGroupProperties
970
+ };
752
971
  const nextLink = {
753
972
  parameterPath: "nextLink",
754
973
  mapper: {
@@ -760,6 +979,25 @@ const nextLink = {
760
979
  },
761
980
  skipEncoding: true
762
981
  };
982
+ const childResourceName = {
983
+ parameterPath: "childResourceName",
984
+ mapper: {
985
+ constraints: {
986
+ Pattern: new RegExp("^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"),
987
+ MaxLength: 63,
988
+ MinLength: 1
989
+ },
990
+ serializedName: "childResourceName",
991
+ required: true,
992
+ type: {
993
+ name: "String"
994
+ }
995
+ }
996
+ };
997
+ const parameters3 = {
998
+ parameterPath: "parameters",
999
+ mapper: ResourceSyncRule
1000
+ };
763
1001
 
764
1002
  /*
765
1003
  * Copyright (c) Microsoft Corporation.
@@ -1034,7 +1272,7 @@ class CustomLocationsImpl {
1034
1272
  * @param options The options parameters.
1035
1273
  */
1036
1274
  get(resourceGroupName, resourceName, options) {
1037
- return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, getOperationSpec);
1275
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, getOperationSpec$1);
1038
1276
  }
1039
1277
  /**
1040
1278
  * Creates or updates a Custom Location in the specified Subscription and Resource Group
@@ -1067,12 +1305,14 @@ class CustomLocationsImpl {
1067
1305
  }
1068
1306
  };
1069
1307
  });
1070
- const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, parameters, options }, createOrUpdateOperationSpec);
1071
- return new coreLro.LroEngine(lro, {
1308
+ const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, parameters, options }, createOrUpdateOperationSpec$1);
1309
+ const poller = new coreLro.LroEngine(lro, {
1072
1310
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1073
1311
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1074
1312
  lroResourceLocationConfig: "azure-async-operation"
1075
1313
  });
1314
+ yield poller.poll();
1315
+ return poller;
1076
1316
  });
1077
1317
  }
1078
1318
  /**
@@ -1118,12 +1358,14 @@ class CustomLocationsImpl {
1118
1358
  }
1119
1359
  };
1120
1360
  });
1121
- const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, options }, deleteOperationSpec);
1122
- return new coreLro.LroEngine(lro, {
1361
+ const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, options }, deleteOperationSpec$1);
1362
+ const poller = new coreLro.LroEngine(lro, {
1123
1363
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1124
1364
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1125
1365
  lroResourceLocationConfig: "azure-async-operation"
1126
1366
  });
1367
+ yield poller.poll();
1368
+ return poller;
1127
1369
  });
1128
1370
  }
1129
1371
  /**
@@ -1146,7 +1388,7 @@ class CustomLocationsImpl {
1146
1388
  * @param options The options parameters.
1147
1389
  */
1148
1390
  update(resourceGroupName, resourceName, options) {
1149
- return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, updateOperationSpec);
1391
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, updateOperationSpec$1);
1150
1392
  }
1151
1393
  /**
1152
1394
  * Gets the list of the Enabled Resource Types.
@@ -1157,6 +1399,17 @@ class CustomLocationsImpl {
1157
1399
  _listEnabledResourceTypes(resourceGroupName, resourceName, options) {
1158
1400
  return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, listEnabledResourceTypesOperationSpec);
1159
1401
  }
1402
+ /**
1403
+ * Returns the target resource group associated with the resource sync rules of the Custom Location
1404
+ * that match the rules passed in with the Find Target Resource Group Request.
1405
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1406
+ * @param resourceName Custom Locations name.
1407
+ * @param parameters Parameters of the find target resource group request.
1408
+ * @param options The options parameters.
1409
+ */
1410
+ findTargetResourceGroup(resourceGroupName, resourceName, parameters, options) {
1411
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, parameters, options }, findTargetResourceGroupOperationSpec);
1412
+ }
1160
1413
  /**
1161
1414
  * ListOperationsNext
1162
1415
  * @param nextLink The nextLink from the previous successful call to the ListOperations method.
@@ -1195,7 +1448,7 @@ class CustomLocationsImpl {
1195
1448
  }
1196
1449
  }
1197
1450
  // Operation Specifications
1198
- const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1451
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1199
1452
  const listOperationsOperationSpec = {
1200
1453
  path: "/providers/Microsoft.ExtendedLocation/operations",
1201
1454
  httpMethod: "GET",
@@ -1210,7 +1463,7 @@ const listOperationsOperationSpec = {
1210
1463
  queryParameters: [apiVersion],
1211
1464
  urlParameters: [$host],
1212
1465
  headerParameters: [accept],
1213
- serializer
1466
+ serializer: serializer$1
1214
1467
  };
1215
1468
  const listBySubscriptionOperationSpec = {
1216
1469
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.ExtendedLocation/customLocations",
@@ -1226,7 +1479,7 @@ const listBySubscriptionOperationSpec = {
1226
1479
  queryParameters: [apiVersion],
1227
1480
  urlParameters: [$host, subscriptionId],
1228
1481
  headerParameters: [accept],
1229
- serializer
1482
+ serializer: serializer$1
1230
1483
  };
1231
1484
  const listByResourceGroupOperationSpec = {
1232
1485
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations",
@@ -1246,9 +1499,9 @@ const listByResourceGroupOperationSpec = {
1246
1499
  resourceGroupName
1247
1500
  ],
1248
1501
  headerParameters: [accept],
1249
- serializer
1502
+ serializer: serializer$1
1250
1503
  };
1251
- const getOperationSpec = {
1504
+ const getOperationSpec$1 = {
1252
1505
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}",
1253
1506
  httpMethod: "GET",
1254
1507
  responses: {
@@ -1267,9 +1520,9 @@ const getOperationSpec = {
1267
1520
  resourceName
1268
1521
  ],
1269
1522
  headerParameters: [accept],
1270
- serializer
1523
+ serializer: serializer$1
1271
1524
  };
1272
- const createOrUpdateOperationSpec = {
1525
+ const createOrUpdateOperationSpec$1 = {
1273
1526
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}",
1274
1527
  httpMethod: "PUT",
1275
1528
  responses: {
@@ -1299,9 +1552,9 @@ const createOrUpdateOperationSpec = {
1299
1552
  ],
1300
1553
  headerParameters: [accept, contentType],
1301
1554
  mediaType: "json",
1302
- serializer
1555
+ serializer: serializer$1
1303
1556
  };
1304
- const deleteOperationSpec = {
1557
+ const deleteOperationSpec$1 = {
1305
1558
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}",
1306
1559
  httpMethod: "DELETE",
1307
1560
  responses: {
@@ -1321,9 +1574,9 @@ const deleteOperationSpec = {
1321
1574
  resourceName
1322
1575
  ],
1323
1576
  headerParameters: [accept],
1324
- serializer
1577
+ serializer: serializer$1
1325
1578
  };
1326
- const updateOperationSpec = {
1579
+ const updateOperationSpec$1 = {
1327
1580
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}",
1328
1581
  httpMethod: "PATCH",
1329
1582
  responses: {
@@ -1357,7 +1610,7 @@ const updateOperationSpec = {
1357
1610
  ],
1358
1611
  headerParameters: [accept, contentType],
1359
1612
  mediaType: "json",
1360
- serializer
1613
+ serializer: serializer$1
1361
1614
  };
1362
1615
  const listEnabledResourceTypesOperationSpec = {
1363
1616
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/enabledResourceTypes",
@@ -1378,24 +1631,48 @@ const listEnabledResourceTypesOperationSpec = {
1378
1631
  resourceName
1379
1632
  ],
1380
1633
  headerParameters: [accept],
1381
- serializer
1634
+ serializer: serializer$1
1382
1635
  };
1383
- const listOperationsNextOperationSpec = {
1384
- path: "{nextLink}",
1385
- httpMethod: "GET",
1636
+ const findTargetResourceGroupOperationSpec = {
1637
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/findTargetResourceGroup",
1638
+ httpMethod: "POST",
1386
1639
  responses: {
1387
1640
  200: {
1388
- bodyMapper: CustomLocationOperationsList
1641
+ bodyMapper: CustomLocationFindTargetResourceGroupResult
1389
1642
  },
1643
+ 204: {},
1390
1644
  default: {
1391
1645
  bodyMapper: ErrorResponse
1392
1646
  }
1393
1647
  },
1648
+ requestBody: parameters2,
1394
1649
  queryParameters: [apiVersion],
1395
- urlParameters: [$host, nextLink],
1396
- headerParameters: [accept],
1397
- serializer
1398
- };
1650
+ urlParameters: [
1651
+ $host,
1652
+ subscriptionId,
1653
+ resourceGroupName,
1654
+ resourceName
1655
+ ],
1656
+ headerParameters: [accept, contentType],
1657
+ mediaType: "json",
1658
+ serializer: serializer$1
1659
+ };
1660
+ const listOperationsNextOperationSpec = {
1661
+ path: "{nextLink}",
1662
+ httpMethod: "GET",
1663
+ responses: {
1664
+ 200: {
1665
+ bodyMapper: CustomLocationOperationsList
1666
+ },
1667
+ default: {
1668
+ bodyMapper: ErrorResponse
1669
+ }
1670
+ },
1671
+ queryParameters: [apiVersion],
1672
+ urlParameters: [$host, nextLink],
1673
+ headerParameters: [accept],
1674
+ serializer: serializer$1
1675
+ };
1399
1676
  const listBySubscriptionNextOperationSpec = {
1400
1677
  path: "{nextLink}",
1401
1678
  httpMethod: "GET",
@@ -1414,7 +1691,7 @@ const listBySubscriptionNextOperationSpec = {
1414
1691
  nextLink
1415
1692
  ],
1416
1693
  headerParameters: [accept],
1417
- serializer
1694
+ serializer: serializer$1
1418
1695
  };
1419
1696
  const listByResourceGroupNextOperationSpec = {
1420
1697
  path: "{nextLink}",
@@ -1435,7 +1712,7 @@ const listByResourceGroupNextOperationSpec = {
1435
1712
  nextLink
1436
1713
  ],
1437
1714
  headerParameters: [accept],
1438
- serializer
1715
+ serializer: serializer$1
1439
1716
  };
1440
1717
  const listEnabledResourceTypesNextOperationSpec = {
1441
1718
  path: "{nextLink}",
@@ -1457,6 +1734,400 @@ const listEnabledResourceTypesNextOperationSpec = {
1457
1734
  nextLink
1458
1735
  ],
1459
1736
  headerParameters: [accept],
1737
+ serializer: serializer$1
1738
+ };
1739
+
1740
+ /*
1741
+ * Copyright (c) Microsoft Corporation.
1742
+ * Licensed under the MIT License.
1743
+ *
1744
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1745
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1746
+ */
1747
+ /// <reference lib="esnext.asynciterable" />
1748
+ /** Class containing ResourceSyncRules operations. */
1749
+ class ResourceSyncRulesImpl {
1750
+ /**
1751
+ * Initialize a new instance of the class ResourceSyncRules class.
1752
+ * @param client Reference to the service client
1753
+ */
1754
+ constructor(client) {
1755
+ this.client = client;
1756
+ }
1757
+ /**
1758
+ * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties
1759
+ * of each Resource Sync Rule
1760
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1761
+ * @param resourceName Custom Locations name.
1762
+ * @param options The options parameters.
1763
+ */
1764
+ listByCustomLocationID(resourceGroupName, resourceName, options) {
1765
+ const iter = this.listByCustomLocationIDPagingAll(resourceGroupName, resourceName, options);
1766
+ return {
1767
+ next() {
1768
+ return iter.next();
1769
+ },
1770
+ [Symbol.asyncIterator]() {
1771
+ return this;
1772
+ },
1773
+ byPage: () => {
1774
+ return this.listByCustomLocationIDPagingPage(resourceGroupName, resourceName, options);
1775
+ }
1776
+ };
1777
+ }
1778
+ listByCustomLocationIDPagingPage(resourceGroupName, resourceName, options) {
1779
+ return tslib.__asyncGenerator(this, arguments, function* listByCustomLocationIDPagingPage_1() {
1780
+ let result = yield tslib.__await(this._listByCustomLocationID(resourceGroupName, resourceName, options));
1781
+ yield yield tslib.__await(result.value || []);
1782
+ let continuationToken = result.nextLink;
1783
+ while (continuationToken) {
1784
+ result = yield tslib.__await(this._listByCustomLocationIDNext(resourceGroupName, resourceName, continuationToken, options));
1785
+ continuationToken = result.nextLink;
1786
+ yield yield tslib.__await(result.value || []);
1787
+ }
1788
+ });
1789
+ }
1790
+ listByCustomLocationIDPagingAll(resourceGroupName, resourceName, options) {
1791
+ return tslib.__asyncGenerator(this, arguments, function* listByCustomLocationIDPagingAll_1() {
1792
+ var e_1, _a;
1793
+ try {
1794
+ for (var _b = tslib.__asyncValues(this.listByCustomLocationIDPagingPage(resourceGroupName, resourceName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1795
+ const page = _c.value;
1796
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1797
+ }
1798
+ }
1799
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1800
+ finally {
1801
+ try {
1802
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1803
+ }
1804
+ finally { if (e_1) throw e_1.error; }
1805
+ }
1806
+ });
1807
+ }
1808
+ /**
1809
+ * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties
1810
+ * of each Resource Sync Rule
1811
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1812
+ * @param resourceName Custom Locations name.
1813
+ * @param options The options parameters.
1814
+ */
1815
+ _listByCustomLocationID(resourceGroupName, resourceName, options) {
1816
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, listByCustomLocationIDOperationSpec);
1817
+ }
1818
+ /**
1819
+ * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom
1820
+ * Location resource name and Resource Sync Rule name.
1821
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1822
+ * @param resourceName Custom Locations name.
1823
+ * @param childResourceName Resource Sync Rule name.
1824
+ * @param options The options parameters.
1825
+ */
1826
+ get(resourceGroupName, resourceName, childResourceName, options) {
1827
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, childResourceName, options }, getOperationSpec);
1828
+ }
1829
+ /**
1830
+ * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
1831
+ * Group
1832
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1833
+ * @param resourceName Custom Locations name.
1834
+ * @param childResourceName Resource Sync Rule name.
1835
+ * @param parameters Parameters supplied to create or update a Resource Sync Rule.
1836
+ * @param options The options parameters.
1837
+ */
1838
+ beginCreateOrUpdate(resourceGroupName, resourceName, childResourceName, parameters, options) {
1839
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1840
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1841
+ return this.client.sendOperationRequest(args, spec);
1842
+ });
1843
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1844
+ var _a;
1845
+ let currentRawResponse = undefined;
1846
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1847
+ const callback = (rawResponse, flatResponse) => {
1848
+ currentRawResponse = rawResponse;
1849
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1850
+ };
1851
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1852
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1853
+ return {
1854
+ flatResponse,
1855
+ rawResponse: {
1856
+ statusCode: currentRawResponse.status,
1857
+ body: currentRawResponse.parsedBody,
1858
+ headers: currentRawResponse.headers.toJSON()
1859
+ }
1860
+ };
1861
+ });
1862
+ const lro = new LroImpl(sendOperation, {
1863
+ resourceGroupName,
1864
+ resourceName,
1865
+ childResourceName,
1866
+ parameters,
1867
+ options
1868
+ }, createOrUpdateOperationSpec);
1869
+ const poller = new coreLro.LroEngine(lro, {
1870
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1871
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1872
+ lroResourceLocationConfig: "azure-async-operation"
1873
+ });
1874
+ yield poller.poll();
1875
+ return poller;
1876
+ });
1877
+ }
1878
+ /**
1879
+ * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
1880
+ * Group
1881
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1882
+ * @param resourceName Custom Locations name.
1883
+ * @param childResourceName Resource Sync Rule name.
1884
+ * @param parameters Parameters supplied to create or update a Resource Sync Rule.
1885
+ * @param options The options parameters.
1886
+ */
1887
+ beginCreateOrUpdateAndWait(resourceGroupName, resourceName, childResourceName, parameters, options) {
1888
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1889
+ const poller = yield this.beginCreateOrUpdate(resourceGroupName, resourceName, childResourceName, parameters, options);
1890
+ return poller.pollUntilDone();
1891
+ });
1892
+ }
1893
+ /**
1894
+ * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource
1895
+ * Name, Resource Group, and Subscription Id.
1896
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1897
+ * @param resourceName Custom Locations name.
1898
+ * @param childResourceName Resource Sync Rule name.
1899
+ * @param options The options parameters.
1900
+ */
1901
+ delete(resourceGroupName, resourceName, childResourceName, options) {
1902
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, childResourceName, options }, deleteOperationSpec);
1903
+ }
1904
+ /**
1905
+ * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
1906
+ * Group, Subscription and Custom Location name.
1907
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1908
+ * @param resourceName Custom Locations name.
1909
+ * @param childResourceName Resource Sync Rule name.
1910
+ * @param options The options parameters.
1911
+ */
1912
+ beginUpdate(resourceGroupName, resourceName, childResourceName, options) {
1913
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1914
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1915
+ return this.client.sendOperationRequest(args, spec);
1916
+ });
1917
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1918
+ var _a;
1919
+ let currentRawResponse = undefined;
1920
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1921
+ const callback = (rawResponse, flatResponse) => {
1922
+ currentRawResponse = rawResponse;
1923
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1924
+ };
1925
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1926
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1927
+ return {
1928
+ flatResponse,
1929
+ rawResponse: {
1930
+ statusCode: currentRawResponse.status,
1931
+ body: currentRawResponse.parsedBody,
1932
+ headers: currentRawResponse.headers.toJSON()
1933
+ }
1934
+ };
1935
+ });
1936
+ const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, childResourceName, options }, updateOperationSpec);
1937
+ const poller = new coreLro.LroEngine(lro, {
1938
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1939
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1940
+ lroResourceLocationConfig: "azure-async-operation"
1941
+ });
1942
+ yield poller.poll();
1943
+ return poller;
1944
+ });
1945
+ }
1946
+ /**
1947
+ * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
1948
+ * Group, Subscription and Custom Location name.
1949
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1950
+ * @param resourceName Custom Locations name.
1951
+ * @param childResourceName Resource Sync Rule name.
1952
+ * @param options The options parameters.
1953
+ */
1954
+ beginUpdateAndWait(resourceGroupName, resourceName, childResourceName, options) {
1955
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1956
+ const poller = yield this.beginUpdate(resourceGroupName, resourceName, childResourceName, options);
1957
+ return poller.pollUntilDone();
1958
+ });
1959
+ }
1960
+ /**
1961
+ * ListByCustomLocationIDNext
1962
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1963
+ * @param resourceName Custom Locations name.
1964
+ * @param nextLink The nextLink from the previous successful call to the ListByCustomLocationID method.
1965
+ * @param options The options parameters.
1966
+ */
1967
+ _listByCustomLocationIDNext(resourceGroupName, resourceName, nextLink, options) {
1968
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, nextLink, options }, listByCustomLocationIDNextOperationSpec);
1969
+ }
1970
+ }
1971
+ // Operation Specifications
1972
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1973
+ const listByCustomLocationIDOperationSpec = {
1974
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules",
1975
+ httpMethod: "GET",
1976
+ responses: {
1977
+ 200: {
1978
+ bodyMapper: ResourceSyncRuleListResult
1979
+ },
1980
+ default: {
1981
+ bodyMapper: ErrorResponse
1982
+ }
1983
+ },
1984
+ queryParameters: [apiVersion],
1985
+ urlParameters: [
1986
+ $host,
1987
+ subscriptionId,
1988
+ resourceGroupName,
1989
+ resourceName
1990
+ ],
1991
+ headerParameters: [accept],
1992
+ serializer
1993
+ };
1994
+ const getOperationSpec = {
1995
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
1996
+ httpMethod: "GET",
1997
+ responses: {
1998
+ 200: {
1999
+ bodyMapper: ResourceSyncRule
2000
+ },
2001
+ default: {
2002
+ bodyMapper: ErrorResponse
2003
+ }
2004
+ },
2005
+ queryParameters: [apiVersion],
2006
+ urlParameters: [
2007
+ $host,
2008
+ subscriptionId,
2009
+ resourceGroupName,
2010
+ resourceName,
2011
+ childResourceName
2012
+ ],
2013
+ headerParameters: [accept],
2014
+ serializer
2015
+ };
2016
+ const createOrUpdateOperationSpec = {
2017
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
2018
+ httpMethod: "PUT",
2019
+ responses: {
2020
+ 200: {
2021
+ bodyMapper: ResourceSyncRule
2022
+ },
2023
+ 201: {
2024
+ bodyMapper: ResourceSyncRule
2025
+ },
2026
+ 202: {
2027
+ bodyMapper: ResourceSyncRule
2028
+ },
2029
+ 204: {
2030
+ bodyMapper: ResourceSyncRule
2031
+ },
2032
+ default: {
2033
+ bodyMapper: ErrorResponse
2034
+ }
2035
+ },
2036
+ requestBody: parameters3,
2037
+ queryParameters: [apiVersion],
2038
+ urlParameters: [
2039
+ $host,
2040
+ subscriptionId,
2041
+ resourceGroupName,
2042
+ resourceName,
2043
+ childResourceName
2044
+ ],
2045
+ headerParameters: [accept, contentType],
2046
+ mediaType: "json",
2047
+ serializer
2048
+ };
2049
+ const deleteOperationSpec = {
2050
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
2051
+ httpMethod: "DELETE",
2052
+ responses: {
2053
+ 200: {},
2054
+ 204: {},
2055
+ default: {
2056
+ bodyMapper: ErrorResponse
2057
+ }
2058
+ },
2059
+ queryParameters: [apiVersion],
2060
+ urlParameters: [
2061
+ $host,
2062
+ subscriptionId,
2063
+ resourceGroupName,
2064
+ resourceName,
2065
+ childResourceName
2066
+ ],
2067
+ headerParameters: [accept],
2068
+ serializer
2069
+ };
2070
+ const updateOperationSpec = {
2071
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
2072
+ httpMethod: "PATCH",
2073
+ responses: {
2074
+ 200: {
2075
+ bodyMapper: ResourceSyncRule
2076
+ },
2077
+ 201: {
2078
+ bodyMapper: ResourceSyncRule
2079
+ },
2080
+ 202: {
2081
+ bodyMapper: ResourceSyncRule
2082
+ },
2083
+ 204: {
2084
+ bodyMapper: ResourceSyncRule
2085
+ },
2086
+ default: {
2087
+ bodyMapper: ErrorResponse
2088
+ }
2089
+ },
2090
+ requestBody: {
2091
+ parameterPath: {
2092
+ tags: ["options", "tags"],
2093
+ priority: ["options", "priority"],
2094
+ selector: ["options", "selector"],
2095
+ targetResourceGroup: ["options", "targetResourceGroup"]
2096
+ },
2097
+ mapper: Object.assign(Object.assign({}, PatchableResourceSyncRule), { required: true })
2098
+ },
2099
+ queryParameters: [apiVersion],
2100
+ urlParameters: [
2101
+ $host,
2102
+ subscriptionId,
2103
+ resourceGroupName,
2104
+ resourceName,
2105
+ childResourceName
2106
+ ],
2107
+ headerParameters: [accept, contentType],
2108
+ mediaType: "json",
2109
+ serializer
2110
+ };
2111
+ const listByCustomLocationIDNextOperationSpec = {
2112
+ path: "{nextLink}",
2113
+ httpMethod: "GET",
2114
+ responses: {
2115
+ 200: {
2116
+ bodyMapper: ResourceSyncRuleListResult
2117
+ },
2118
+ default: {
2119
+ bodyMapper: ErrorResponse
2120
+ }
2121
+ },
2122
+ queryParameters: [apiVersion],
2123
+ urlParameters: [
2124
+ $host,
2125
+ subscriptionId,
2126
+ resourceGroupName,
2127
+ resourceName,
2128
+ nextLink
2129
+ ],
2130
+ headerParameters: [accept],
1460
2131
  serializer
1461
2132
  };
1462
2133
 
@@ -1467,14 +2138,15 @@ const listEnabledResourceTypesNextOperationSpec = {
1467
2138
  * Code generated by Microsoft (R) AutoRest Code Generator.
1468
2139
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1469
2140
  */
1470
- class CustomLocationsManagementClientContext extends coreClient__namespace.ServiceClient {
2141
+ class CustomLocationsManagementClient extends coreClient__namespace.ServiceClient {
1471
2142
  /**
1472
- * Initializes a new instance of the CustomLocationsManagementClientContext class.
2143
+ * Initializes a new instance of the CustomLocationsManagementClient class.
1473
2144
  * @param credentials Subscription credentials which uniquely identify client subscription.
1474
2145
  * @param subscriptionId The ID of the target subscription.
1475
2146
  * @param options The parameter options
1476
2147
  */
1477
2148
  constructor(credentials, subscriptionId, options) {
2149
+ var _a, _b;
1478
2150
  if (credentials === undefined) {
1479
2151
  throw new Error("'credentials' cannot be null");
1480
2152
  }
@@ -1489,7 +2161,7 @@ class CustomLocationsManagementClientContext extends coreClient__namespace.Servi
1489
2161
  requestContentType: "application/json; charset=utf-8",
1490
2162
  credential: credentials
1491
2163
  };
1492
- const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0-beta.1`;
2164
+ const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0-beta.2`;
1493
2165
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1494
2166
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1495
2167
  : `${packageDetails}`;
@@ -1498,36 +2170,61 @@ class CustomLocationsManagementClientContext extends coreClient__namespace.Servi
1498
2170
  }
1499
2171
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1500
2172
  userAgentPrefix
1501
- }, baseUri: options.endpoint || "https://management.azure.com" });
2173
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1502
2174
  super(optionsWithDefaults);
2175
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
2176
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
2177
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2178
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
2179
+ if (!bearerTokenAuthenticationPolicyFound) {
2180
+ this.pipeline.removePolicy({
2181
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2182
+ });
2183
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2184
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
2185
+ challengeCallbacks: {
2186
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2187
+ }
2188
+ }));
2189
+ }
2190
+ }
1503
2191
  // Parameter assignments
1504
2192
  this.subscriptionId = subscriptionId;
1505
2193
  // Assigning values to Constant parameters
1506
2194
  this.$host = options.$host || "https://management.azure.com";
1507
- this.apiVersion = options.apiVersion || "2021-08-15";
1508
- }
1509
- }
1510
-
1511
- /*
1512
- * Copyright (c) Microsoft Corporation.
1513
- * Licensed under the MIT License.
1514
- *
1515
- * Code generated by Microsoft (R) AutoRest Code Generator.
1516
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1517
- */
1518
- class CustomLocationsManagementClient extends CustomLocationsManagementClientContext {
1519
- /**
1520
- * Initializes a new instance of the CustomLocationsManagementClient class.
1521
- * @param credentials Subscription credentials which uniquely identify client subscription.
1522
- * @param subscriptionId The ID of the target subscription.
1523
- * @param options The parameter options
1524
- */
1525
- constructor(credentials, subscriptionId, options) {
1526
- super(credentials, subscriptionId, options);
2195
+ this.apiVersion = options.apiVersion || "2021-08-31-preview";
1527
2196
  this.customLocations = new CustomLocationsImpl(this);
2197
+ this.resourceSyncRules = new ResourceSyncRulesImpl(this);
2198
+ this.addCustomApiVersionPolicy(options.apiVersion);
2199
+ }
2200
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
2201
+ addCustomApiVersionPolicy(apiVersion) {
2202
+ if (!apiVersion) {
2203
+ return;
2204
+ }
2205
+ const apiVersionPolicy = {
2206
+ name: "CustomApiVersionPolicy",
2207
+ sendRequest(request, next) {
2208
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2209
+ const param = request.url.split("?");
2210
+ if (param.length > 1) {
2211
+ const newParams = param[1].split("&").map((item) => {
2212
+ if (item.indexOf("api-version") > -1) {
2213
+ return "api-version=" + apiVersion;
2214
+ }
2215
+ else {
2216
+ return item;
2217
+ }
2218
+ });
2219
+ request.url = param[0] + "?" + newParams.join("&");
2220
+ }
2221
+ return next(request);
2222
+ });
2223
+ }
2224
+ };
2225
+ this.pipeline.addPolicy(apiVersionPolicy);
1528
2226
  }
1529
2227
  }
1530
2228
 
1531
2229
  exports.CustomLocationsManagementClient = CustomLocationsManagementClient;
1532
- exports.CustomLocationsManagementClientContext = CustomLocationsManagementClientContext;
1533
2230
  //# sourceMappingURL=index.js.map