@azure/arm-extendedlocation 1.0.0-beta.1 → 1.0.0-beta.3

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 (134) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE +1 -1
  3. package/README.md +24 -9
  4. package/dist/index.js +921 -113
  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 +50 -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 +39 -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 +42 -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 +39 -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 +52 -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 +51 -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 +53 -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 +51 -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 +42 -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 +49 -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 +40 -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 +40 -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 +53 -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 +42 -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 +83 -4
  67. package/dist-esm/src/customLocationsManagementClient.js.map +1 -1
  68. package/dist-esm/src/index.d.ts +1 -1
  69. package/dist-esm/src/index.d.ts.map +1 -1
  70. package/dist-esm/src/index.js +1 -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 +114 -34
  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 +411 -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/src/pagingHelper.d.ts +13 -0
  107. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  108. package/dist-esm/src/pagingHelper.js +32 -0
  109. package/dist-esm/src/pagingHelper.js.map +1 -0
  110. package/dist-esm/test/sampleTest.js +11 -13
  111. package/dist-esm/test/sampleTest.js.map +1 -1
  112. package/package.json +58 -27
  113. package/review/arm-extendedlocation.api.md +142 -27
  114. package/rollup.config.js +6 -72
  115. package/src/customLocationsManagementClient.ts +115 -5
  116. package/src/index.ts +1 -1
  117. package/src/models/index.ts +186 -26
  118. package/src/models/mappers.ts +243 -30
  119. package/src/models/parameters.ts +53 -2
  120. package/src/operations/customLocations.ts +148 -46
  121. package/src/operations/index.ts +1 -0
  122. package/src/operations/resourceSyncRules.ts +575 -0
  123. package/src/operationsInterfaces/customLocations.ts +18 -1
  124. package/src/operationsInterfaces/index.ts +1 -0
  125. package/src/operationsInterfaces/resourceSyncRules.ts +136 -0
  126. package/src/pagingHelper.ts +39 -0
  127. package/tsconfig.json +19 -5
  128. package/types/arm-extendedlocation.d.ts +266 -20
  129. package/types/tsdoc-metadata.json +1 -1
  130. package/dist-esm/src/customLocationsManagementClientContext.d.ts +0 -16
  131. package/dist-esm/src/customLocationsManagementClientContext.d.ts.map +0 -1
  132. package/dist-esm/src/customLocationsManagementClientContext.js +0 -49
  133. package/dist-esm/src/customLocationsManagementClientContext.js.map +0 -1
  134. package/src/customLocationsManagementClientContext.ts +0 -70
package/dist/index.js CHANGED
@@ -4,8 +4,62 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var tslib = require('tslib');
6
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
 
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n["default"] = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
29
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
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
+
9
63
  /*
10
64
  * Copyright (c) Microsoft Corporation.
11
65
  * Licensed under the MIT License.
@@ -13,17 +67,30 @@ var coreLro = require('@azure/core-lro');
13
67
  * Code generated by Microsoft (R) AutoRest Code Generator.
14
68
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
15
69
  */
70
+ /** Known values of {@link ResourceIdentityType} that the service accepts. */
71
+ exports.KnownResourceIdentityType = void 0;
16
72
  (function (KnownResourceIdentityType) {
73
+ /** SystemAssigned */
17
74
  KnownResourceIdentityType["SystemAssigned"] = "SystemAssigned";
75
+ /** None */
18
76
  KnownResourceIdentityType["None"] = "None";
19
77
  })(exports.KnownResourceIdentityType || (exports.KnownResourceIdentityType = {}));
78
+ /** Known values of {@link HostType} that the service accepts. */
79
+ exports.KnownHostType = void 0;
20
80
  (function (KnownHostType) {
81
+ /** Kubernetes */
21
82
  KnownHostType["Kubernetes"] = "Kubernetes";
22
83
  })(exports.KnownHostType || (exports.KnownHostType = {}));
84
+ /** Known values of {@link CreatedByType} that the service accepts. */
85
+ exports.KnownCreatedByType = void 0;
23
86
  (function (KnownCreatedByType) {
87
+ /** User */
24
88
  KnownCreatedByType["User"] = "User";
89
+ /** Application */
25
90
  KnownCreatedByType["Application"] = "Application";
91
+ /** ManagedIdentity */
26
92
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
93
+ /** Key */
27
94
  KnownCreatedByType["Key"] = "Key";
28
95
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
29
96
 
@@ -239,35 +306,6 @@ const CustomLocationListResult = {
239
306
  }
240
307
  }
241
308
  };
242
- const Resource = {
243
- type: {
244
- name: "Composite",
245
- className: "Resource",
246
- modelProperties: {
247
- id: {
248
- serializedName: "id",
249
- readOnly: true,
250
- type: {
251
- name: "String"
252
- }
253
- },
254
- name: {
255
- serializedName: "name",
256
- readOnly: true,
257
- type: {
258
- name: "String"
259
- }
260
- },
261
- type: {
262
- serializedName: "type",
263
- readOnly: true,
264
- type: {
265
- name: "String"
266
- }
267
- }
268
- }
269
- }
270
- };
271
309
  const Identity = {
272
310
  type: {
273
311
  name: "Composite",
@@ -360,6 +398,35 @@ const SystemData = {
360
398
  }
361
399
  }
362
400
  };
401
+ const Resource = {
402
+ type: {
403
+ name: "Composite",
404
+ className: "Resource",
405
+ modelProperties: {
406
+ id: {
407
+ serializedName: "id",
408
+ readOnly: true,
409
+ type: {
410
+ name: "String"
411
+ }
412
+ },
413
+ name: {
414
+ serializedName: "name",
415
+ readOnly: true,
416
+ type: {
417
+ name: "String"
418
+ }
419
+ },
420
+ type: {
421
+ serializedName: "type",
422
+ readOnly: true,
423
+ type: {
424
+ name: "String"
425
+ }
426
+ }
427
+ }
428
+ }
429
+ };
363
430
  const PatchableCustomLocations = {
364
431
  type: {
365
432
  name: "Composite",
@@ -484,6 +551,170 @@ const EnabledResourceTypePropertiesTypesMetadataItem = {
484
551
  }
485
552
  }
486
553
  };
554
+ const CustomLocationFindTargetResourceGroupProperties = {
555
+ type: {
556
+ name: "Composite",
557
+ className: "CustomLocationFindTargetResourceGroupProperties",
558
+ modelProperties: {
559
+ labels: {
560
+ serializedName: "labels",
561
+ type: {
562
+ name: "Dictionary",
563
+ value: { type: { name: "String" } }
564
+ }
565
+ }
566
+ }
567
+ }
568
+ };
569
+ const CustomLocationFindTargetResourceGroupResult = {
570
+ type: {
571
+ name: "Composite",
572
+ className: "CustomLocationFindTargetResourceGroupResult",
573
+ modelProperties: {
574
+ matchedResourceSyncRule: {
575
+ serializedName: "matchedResourceSyncRule",
576
+ readOnly: true,
577
+ type: {
578
+ name: "String"
579
+ }
580
+ },
581
+ targetResourceGroup: {
582
+ serializedName: "targetResourceGroup",
583
+ readOnly: true,
584
+ type: {
585
+ name: "String"
586
+ }
587
+ }
588
+ }
589
+ }
590
+ };
591
+ const ResourceSyncRuleListResult = {
592
+ type: {
593
+ name: "Composite",
594
+ className: "ResourceSyncRuleListResult",
595
+ modelProperties: {
596
+ nextLink: {
597
+ serializedName: "nextLink",
598
+ readOnly: true,
599
+ type: {
600
+ name: "String"
601
+ }
602
+ },
603
+ value: {
604
+ serializedName: "value",
605
+ readOnly: true,
606
+ type: {
607
+ name: "Sequence",
608
+ element: {
609
+ type: {
610
+ name: "Composite",
611
+ className: "ResourceSyncRule"
612
+ }
613
+ }
614
+ }
615
+ }
616
+ }
617
+ }
618
+ };
619
+ const ResourceSyncRulePropertiesSelector = {
620
+ type: {
621
+ name: "Composite",
622
+ className: "ResourceSyncRulePropertiesSelector",
623
+ modelProperties: {
624
+ matchExpressions: {
625
+ serializedName: "matchExpressions",
626
+ type: {
627
+ name: "Sequence",
628
+ element: {
629
+ type: {
630
+ name: "Composite",
631
+ className: "MatchExpressionsProperties"
632
+ }
633
+ }
634
+ }
635
+ },
636
+ matchLabels: {
637
+ serializedName: "matchLabels",
638
+ type: {
639
+ name: "Dictionary",
640
+ value: { type: { name: "String" } }
641
+ }
642
+ }
643
+ }
644
+ }
645
+ };
646
+ const MatchExpressionsProperties = {
647
+ type: {
648
+ name: "Composite",
649
+ className: "MatchExpressionsProperties",
650
+ modelProperties: {
651
+ key: {
652
+ serializedName: "key",
653
+ type: {
654
+ name: "String"
655
+ }
656
+ },
657
+ operator: {
658
+ serializedName: "operator",
659
+ type: {
660
+ name: "String"
661
+ }
662
+ },
663
+ values: {
664
+ serializedName: "values",
665
+ type: {
666
+ name: "Sequence",
667
+ element: {
668
+ type: {
669
+ name: "String"
670
+ }
671
+ }
672
+ }
673
+ }
674
+ }
675
+ }
676
+ };
677
+ const PatchableResourceSyncRule = {
678
+ type: {
679
+ name: "Composite",
680
+ className: "PatchableResourceSyncRule",
681
+ modelProperties: {
682
+ tags: {
683
+ serializedName: "tags",
684
+ type: {
685
+ name: "Dictionary",
686
+ value: { type: { name: "String" } }
687
+ }
688
+ },
689
+ priority: {
690
+ serializedName: "properties.priority",
691
+ type: {
692
+ name: "Number"
693
+ }
694
+ },
695
+ provisioningState: {
696
+ serializedName: "properties.provisioningState",
697
+ readOnly: true,
698
+ type: {
699
+ name: "String"
700
+ }
701
+ },
702
+ selector: {
703
+ serializedName: "properties.selector",
704
+ type: {
705
+ name: "Composite",
706
+ className: "ResourceSyncRulePropertiesSelector"
707
+ }
708
+ },
709
+ targetResourceGroup: {
710
+ serializedName: "properties.targetResourceGroup",
711
+ type: {
712
+ name: "String"
713
+ }
714
+ }
715
+ }
716
+ }
717
+ };
487
718
  const TrackedResource = {
488
719
  type: {
489
720
  name: "Composite",
@@ -570,6 +801,41 @@ const CustomLocation = {
570
801
  } })
571
802
  }
572
803
  };
804
+ const ResourceSyncRule = {
805
+ type: {
806
+ name: "Composite",
807
+ className: "ResourceSyncRule",
808
+ modelProperties: Object.assign(Object.assign({}, TrackedResource.type.modelProperties), { systemData: {
809
+ serializedName: "systemData",
810
+ type: {
811
+ name: "Composite",
812
+ className: "SystemData"
813
+ }
814
+ }, priority: {
815
+ serializedName: "properties.priority",
816
+ type: {
817
+ name: "Number"
818
+ }
819
+ }, provisioningState: {
820
+ serializedName: "properties.provisioningState",
821
+ readOnly: true,
822
+ type: {
823
+ name: "String"
824
+ }
825
+ }, selector: {
826
+ serializedName: "properties.selector",
827
+ type: {
828
+ name: "Composite",
829
+ className: "ResourceSyncRulePropertiesSelector"
830
+ }
831
+ }, targetResourceGroup: {
832
+ serializedName: "properties.targetResourceGroup",
833
+ type: {
834
+ name: "String"
835
+ }
836
+ } })
837
+ }
838
+ };
573
839
  const EnabledResourceType = {
574
840
  type: {
575
841
  name: "Composite",
@@ -613,16 +879,23 @@ var Mappers = /*#__PURE__*/Object.freeze({
613
879
  ErrorDetail: ErrorDetail,
614
880
  ErrorAdditionalInfo: ErrorAdditionalInfo,
615
881
  CustomLocationListResult: CustomLocationListResult,
616
- Resource: Resource,
617
882
  Identity: Identity,
618
883
  CustomLocationPropertiesAuthentication: CustomLocationPropertiesAuthentication,
619
884
  SystemData: SystemData,
885
+ Resource: Resource,
620
886
  PatchableCustomLocations: PatchableCustomLocations,
621
887
  EnabledResourceTypesListResult: EnabledResourceTypesListResult,
622
888
  EnabledResourceTypePropertiesTypesMetadataItem: EnabledResourceTypePropertiesTypesMetadataItem,
889
+ CustomLocationFindTargetResourceGroupProperties: CustomLocationFindTargetResourceGroupProperties,
890
+ CustomLocationFindTargetResourceGroupResult: CustomLocationFindTargetResourceGroupResult,
891
+ ResourceSyncRuleListResult: ResourceSyncRuleListResult,
892
+ ResourceSyncRulePropertiesSelector: ResourceSyncRulePropertiesSelector,
893
+ MatchExpressionsProperties: MatchExpressionsProperties,
894
+ PatchableResourceSyncRule: PatchableResourceSyncRule,
623
895
  TrackedResource: TrackedResource,
624
896
  ProxyResource: ProxyResource,
625
897
  CustomLocation: CustomLocation,
898
+ ResourceSyncRule: ResourceSyncRule,
626
899
  EnabledResourceType: EnabledResourceType
627
900
  });
628
901
 
@@ -658,7 +931,7 @@ const $host = {
658
931
  const apiVersion = {
659
932
  parameterPath: "apiVersion",
660
933
  mapper: {
661
- defaultValue: "2021-08-15",
934
+ defaultValue: "2021-08-31-preview",
662
935
  isConstant: true,
663
936
  serializedName: "api-version",
664
937
  type: {
@@ -723,6 +996,10 @@ const parameters = {
723
996
  parameterPath: "parameters",
724
997
  mapper: CustomLocation
725
998
  };
999
+ const parameters2 = {
1000
+ parameterPath: "parameters",
1001
+ mapper: CustomLocationFindTargetResourceGroupProperties
1002
+ };
726
1003
  const nextLink = {
727
1004
  parameterPath: "nextLink",
728
1005
  mapper: {
@@ -734,6 +1011,25 @@ const nextLink = {
734
1011
  },
735
1012
  skipEncoding: true
736
1013
  };
1014
+ const childResourceName = {
1015
+ parameterPath: "childResourceName",
1016
+ mapper: {
1017
+ constraints: {
1018
+ Pattern: new RegExp("^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$"),
1019
+ MaxLength: 63,
1020
+ MinLength: 1
1021
+ },
1022
+ serializedName: "childResourceName",
1023
+ required: true,
1024
+ type: {
1025
+ name: "String"
1026
+ }
1027
+ }
1028
+ };
1029
+ const parameters3 = {
1030
+ parameterPath: "parameters",
1031
+ mapper: ResourceSyncRule
1032
+ };
737
1033
 
738
1034
  /*
739
1035
  * Copyright (c) Microsoft Corporation.
@@ -793,20 +1089,31 @@ class CustomLocationsImpl {
793
1089
  [Symbol.asyncIterator]() {
794
1090
  return this;
795
1091
  },
796
- byPage: () => {
797
- return this.listOperationsPagingPage(options);
1092
+ byPage: (settings) => {
1093
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1094
+ throw new Error("maxPageSize is not supported by this operation.");
1095
+ }
1096
+ return this.listOperationsPagingPage(options, settings);
798
1097
  }
799
1098
  };
800
1099
  }
801
- listOperationsPagingPage(options) {
1100
+ listOperationsPagingPage(options, settings) {
802
1101
  return tslib.__asyncGenerator(this, arguments, function* listOperationsPagingPage_1() {
803
- let result = yield tslib.__await(this._listOperations(options));
804
- yield yield tslib.__await(result.value || []);
805
- let continuationToken = result.nextLink;
1102
+ let result;
1103
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1104
+ if (!continuationToken) {
1105
+ result = yield tslib.__await(this._listOperations(options));
1106
+ let page = result.value || [];
1107
+ continuationToken = result.nextLink;
1108
+ setContinuationToken(page, continuationToken);
1109
+ yield yield tslib.__await(page);
1110
+ }
806
1111
  while (continuationToken) {
807
1112
  result = yield tslib.__await(this._listOperationsNext(continuationToken, options));
808
1113
  continuationToken = result.nextLink;
809
- yield yield tslib.__await(result.value || []);
1114
+ let page = result.value || [];
1115
+ setContinuationToken(page, continuationToken);
1116
+ yield yield tslib.__await(page);
810
1117
  }
811
1118
  });
812
1119
  }
@@ -842,20 +1149,31 @@ class CustomLocationsImpl {
842
1149
  [Symbol.asyncIterator]() {
843
1150
  return this;
844
1151
  },
845
- byPage: () => {
846
- return this.listBySubscriptionPagingPage(options);
1152
+ byPage: (settings) => {
1153
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1154
+ throw new Error("maxPageSize is not supported by this operation.");
1155
+ }
1156
+ return this.listBySubscriptionPagingPage(options, settings);
847
1157
  }
848
1158
  };
849
1159
  }
850
- listBySubscriptionPagingPage(options) {
1160
+ listBySubscriptionPagingPage(options, settings) {
851
1161
  return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
852
- let result = yield tslib.__await(this._listBySubscription(options));
853
- yield yield tslib.__await(result.value || []);
854
- let continuationToken = result.nextLink;
1162
+ let result;
1163
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1164
+ if (!continuationToken) {
1165
+ result = yield tslib.__await(this._listBySubscription(options));
1166
+ let page = result.value || [];
1167
+ continuationToken = result.nextLink;
1168
+ setContinuationToken(page, continuationToken);
1169
+ yield yield tslib.__await(page);
1170
+ }
855
1171
  while (continuationToken) {
856
1172
  result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
857
1173
  continuationToken = result.nextLink;
858
- yield yield tslib.__await(result.value || []);
1174
+ let page = result.value || [];
1175
+ setContinuationToken(page, continuationToken);
1176
+ yield yield tslib.__await(page);
859
1177
  }
860
1178
  });
861
1179
  }
@@ -892,20 +1210,31 @@ class CustomLocationsImpl {
892
1210
  [Symbol.asyncIterator]() {
893
1211
  return this;
894
1212
  },
895
- byPage: () => {
896
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
1213
+ byPage: (settings) => {
1214
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1215
+ throw new Error("maxPageSize is not supported by this operation.");
1216
+ }
1217
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
897
1218
  }
898
1219
  };
899
1220
  }
900
- listByResourceGroupPagingPage(resourceGroupName, options) {
1221
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
901
1222
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
902
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
903
- yield yield tslib.__await(result.value || []);
904
- let continuationToken = result.nextLink;
1223
+ let result;
1224
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1225
+ if (!continuationToken) {
1226
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1227
+ let page = result.value || [];
1228
+ continuationToken = result.nextLink;
1229
+ setContinuationToken(page, continuationToken);
1230
+ yield yield tslib.__await(page);
1231
+ }
905
1232
  while (continuationToken) {
906
1233
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
907
1234
  continuationToken = result.nextLink;
908
- yield yield tslib.__await(result.value || []);
1235
+ let page = result.value || [];
1236
+ setContinuationToken(page, continuationToken);
1237
+ yield yield tslib.__await(page);
909
1238
  }
910
1239
  });
911
1240
  }
@@ -942,20 +1271,31 @@ class CustomLocationsImpl {
942
1271
  [Symbol.asyncIterator]() {
943
1272
  return this;
944
1273
  },
945
- byPage: () => {
946
- return this.listEnabledResourceTypesPagingPage(resourceGroupName, resourceName, options);
1274
+ byPage: (settings) => {
1275
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1276
+ throw new Error("maxPageSize is not supported by this operation.");
1277
+ }
1278
+ return this.listEnabledResourceTypesPagingPage(resourceGroupName, resourceName, options, settings);
947
1279
  }
948
1280
  };
949
1281
  }
950
- listEnabledResourceTypesPagingPage(resourceGroupName, resourceName, options) {
1282
+ listEnabledResourceTypesPagingPage(resourceGroupName, resourceName, options, settings) {
951
1283
  return tslib.__asyncGenerator(this, arguments, function* listEnabledResourceTypesPagingPage_1() {
952
- let result = yield tslib.__await(this._listEnabledResourceTypes(resourceGroupName, resourceName, options));
953
- yield yield tslib.__await(result.value || []);
954
- let continuationToken = result.nextLink;
955
- while (continuationToken) {
1284
+ let result;
1285
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1286
+ if (!continuationToken) {
1287
+ result = yield tslib.__await(this._listEnabledResourceTypes(resourceGroupName, resourceName, options));
1288
+ let page = result.value || [];
1289
+ continuationToken = result.nextLink;
1290
+ setContinuationToken(page, continuationToken);
1291
+ yield yield tslib.__await(page);
1292
+ }
1293
+ while (continuationToken) {
956
1294
  result = yield tslib.__await(this._listEnabledResourceTypesNext(resourceGroupName, resourceName, continuationToken, options));
957
1295
  continuationToken = result.nextLink;
958
- yield yield tslib.__await(result.value || []);
1296
+ let page = result.value || [];
1297
+ setContinuationToken(page, continuationToken);
1298
+ yield yield tslib.__await(page);
959
1299
  }
960
1300
  });
961
1301
  }
@@ -1008,7 +1348,7 @@ class CustomLocationsImpl {
1008
1348
  * @param options The options parameters.
1009
1349
  */
1010
1350
  get(resourceGroupName, resourceName, options) {
1011
- return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, getOperationSpec);
1351
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, getOperationSpec$1);
1012
1352
  }
1013
1353
  /**
1014
1354
  * Creates or updates a Custom Location in the specified Subscription and Resource Group
@@ -1041,12 +1381,14 @@ class CustomLocationsImpl {
1041
1381
  }
1042
1382
  };
1043
1383
  });
1044
- const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, parameters, options }, createOrUpdateOperationSpec);
1045
- return new coreLro.LroEngine(lro, {
1384
+ const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, parameters, options }, createOrUpdateOperationSpec$1);
1385
+ const poller = new coreLro.LroEngine(lro, {
1046
1386
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1047
1387
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1048
1388
  lroResourceLocationConfig: "azure-async-operation"
1049
1389
  });
1390
+ yield poller.poll();
1391
+ return poller;
1050
1392
  });
1051
1393
  }
1052
1394
  /**
@@ -1092,12 +1434,14 @@ class CustomLocationsImpl {
1092
1434
  }
1093
1435
  };
1094
1436
  });
1095
- const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, options }, deleteOperationSpec);
1096
- return new coreLro.LroEngine(lro, {
1437
+ const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, options }, deleteOperationSpec$1);
1438
+ const poller = new coreLro.LroEngine(lro, {
1097
1439
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1098
1440
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1099
1441
  lroResourceLocationConfig: "azure-async-operation"
1100
1442
  });
1443
+ yield poller.poll();
1444
+ return poller;
1101
1445
  });
1102
1446
  }
1103
1447
  /**
@@ -1120,7 +1464,7 @@ class CustomLocationsImpl {
1120
1464
  * @param options The options parameters.
1121
1465
  */
1122
1466
  update(resourceGroupName, resourceName, options) {
1123
- return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, updateOperationSpec);
1467
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, updateOperationSpec$1);
1124
1468
  }
1125
1469
  /**
1126
1470
  * Gets the list of the Enabled Resource Types.
@@ -1131,6 +1475,17 @@ class CustomLocationsImpl {
1131
1475
  _listEnabledResourceTypes(resourceGroupName, resourceName, options) {
1132
1476
  return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, listEnabledResourceTypesOperationSpec);
1133
1477
  }
1478
+ /**
1479
+ * Returns the target resource group associated with the resource sync rules of the Custom Location
1480
+ * that match the rules passed in with the Find Target Resource Group Request.
1481
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1482
+ * @param resourceName Custom Locations name.
1483
+ * @param parameters Parameters of the find target resource group request.
1484
+ * @param options The options parameters.
1485
+ */
1486
+ findTargetResourceGroup(resourceGroupName, resourceName, parameters, options) {
1487
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, parameters, options }, findTargetResourceGroupOperationSpec);
1488
+ }
1134
1489
  /**
1135
1490
  * ListOperationsNext
1136
1491
  * @param nextLink The nextLink from the previous successful call to the ListOperations method.
@@ -1169,7 +1524,7 @@ class CustomLocationsImpl {
1169
1524
  }
1170
1525
  }
1171
1526
  // Operation Specifications
1172
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
1527
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1173
1528
  const listOperationsOperationSpec = {
1174
1529
  path: "/providers/Microsoft.ExtendedLocation/operations",
1175
1530
  httpMethod: "GET",
@@ -1184,7 +1539,7 @@ const listOperationsOperationSpec = {
1184
1539
  queryParameters: [apiVersion],
1185
1540
  urlParameters: [$host],
1186
1541
  headerParameters: [accept],
1187
- serializer
1542
+ serializer: serializer$1
1188
1543
  };
1189
1544
  const listBySubscriptionOperationSpec = {
1190
1545
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.ExtendedLocation/customLocations",
@@ -1200,7 +1555,7 @@ const listBySubscriptionOperationSpec = {
1200
1555
  queryParameters: [apiVersion],
1201
1556
  urlParameters: [$host, subscriptionId],
1202
1557
  headerParameters: [accept],
1203
- serializer
1558
+ serializer: serializer$1
1204
1559
  };
1205
1560
  const listByResourceGroupOperationSpec = {
1206
1561
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations",
@@ -1220,9 +1575,9 @@ const listByResourceGroupOperationSpec = {
1220
1575
  resourceGroupName
1221
1576
  ],
1222
1577
  headerParameters: [accept],
1223
- serializer
1578
+ serializer: serializer$1
1224
1579
  };
1225
- const getOperationSpec = {
1580
+ const getOperationSpec$1 = {
1226
1581
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}",
1227
1582
  httpMethod: "GET",
1228
1583
  responses: {
@@ -1241,9 +1596,9 @@ const getOperationSpec = {
1241
1596
  resourceName
1242
1597
  ],
1243
1598
  headerParameters: [accept],
1244
- serializer
1599
+ serializer: serializer$1
1245
1600
  };
1246
- const createOrUpdateOperationSpec = {
1601
+ const createOrUpdateOperationSpec$1 = {
1247
1602
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}",
1248
1603
  httpMethod: "PUT",
1249
1604
  responses: {
@@ -1273,9 +1628,9 @@ const createOrUpdateOperationSpec = {
1273
1628
  ],
1274
1629
  headerParameters: [accept, contentType],
1275
1630
  mediaType: "json",
1276
- serializer
1631
+ serializer: serializer$1
1277
1632
  };
1278
- const deleteOperationSpec = {
1633
+ const deleteOperationSpec$1 = {
1279
1634
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}",
1280
1635
  httpMethod: "DELETE",
1281
1636
  responses: {
@@ -1295,9 +1650,9 @@ const deleteOperationSpec = {
1295
1650
  resourceName
1296
1651
  ],
1297
1652
  headerParameters: [accept],
1298
- serializer
1653
+ serializer: serializer$1
1299
1654
  };
1300
- const updateOperationSpec = {
1655
+ const updateOperationSpec$1 = {
1301
1656
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}",
1302
1657
  httpMethod: "PATCH",
1303
1658
  responses: {
@@ -1331,7 +1686,7 @@ const updateOperationSpec = {
1331
1686
  ],
1332
1687
  headerParameters: [accept, contentType],
1333
1688
  mediaType: "json",
1334
- serializer
1689
+ serializer: serializer$1
1335
1690
  };
1336
1691
  const listEnabledResourceTypesOperationSpec = {
1337
1692
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/enabledResourceTypes",
@@ -1352,7 +1707,31 @@ const listEnabledResourceTypesOperationSpec = {
1352
1707
  resourceName
1353
1708
  ],
1354
1709
  headerParameters: [accept],
1355
- serializer
1710
+ serializer: serializer$1
1711
+ };
1712
+ const findTargetResourceGroupOperationSpec = {
1713
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/findTargetResourceGroup",
1714
+ httpMethod: "POST",
1715
+ responses: {
1716
+ 200: {
1717
+ bodyMapper: CustomLocationFindTargetResourceGroupResult
1718
+ },
1719
+ 204: {},
1720
+ default: {
1721
+ bodyMapper: ErrorResponse
1722
+ }
1723
+ },
1724
+ requestBody: parameters2,
1725
+ queryParameters: [apiVersion],
1726
+ urlParameters: [
1727
+ $host,
1728
+ subscriptionId,
1729
+ resourceGroupName,
1730
+ resourceName
1731
+ ],
1732
+ headerParameters: [accept, contentType],
1733
+ mediaType: "json",
1734
+ serializer: serializer$1
1356
1735
  };
1357
1736
  const listOperationsNextOperationSpec = {
1358
1737
  path: "{nextLink}",
@@ -1365,10 +1744,9 @@ const listOperationsNextOperationSpec = {
1365
1744
  bodyMapper: ErrorResponse
1366
1745
  }
1367
1746
  },
1368
- queryParameters: [apiVersion],
1369
1747
  urlParameters: [$host, nextLink],
1370
1748
  headerParameters: [accept],
1371
- serializer
1749
+ serializer: serializer$1
1372
1750
  };
1373
1751
  const listBySubscriptionNextOperationSpec = {
1374
1752
  path: "{nextLink}",
@@ -1381,14 +1759,13 @@ const listBySubscriptionNextOperationSpec = {
1381
1759
  bodyMapper: ErrorResponse
1382
1760
  }
1383
1761
  },
1384
- queryParameters: [apiVersion],
1385
1762
  urlParameters: [
1386
1763
  $host,
1387
1764
  subscriptionId,
1388
1765
  nextLink
1389
1766
  ],
1390
1767
  headerParameters: [accept],
1391
- serializer
1768
+ serializer: serializer$1
1392
1769
  };
1393
1770
  const listByResourceGroupNextOperationSpec = {
1394
1771
  path: "{nextLink}",
@@ -1401,7 +1778,6 @@ const listByResourceGroupNextOperationSpec = {
1401
1778
  bodyMapper: ErrorResponse
1402
1779
  }
1403
1780
  },
1404
- queryParameters: [apiVersion],
1405
1781
  urlParameters: [
1406
1782
  $host,
1407
1783
  subscriptionId,
@@ -1409,7 +1785,7 @@ const listByResourceGroupNextOperationSpec = {
1409
1785
  nextLink
1410
1786
  ],
1411
1787
  headerParameters: [accept],
1412
- serializer
1788
+ serializer: serializer$1
1413
1789
  };
1414
1790
  const listEnabledResourceTypesNextOperationSpec = {
1415
1791
  path: "{nextLink}",
@@ -1422,7 +1798,410 @@ const listEnabledResourceTypesNextOperationSpec = {
1422
1798
  bodyMapper: ErrorResponse
1423
1799
  }
1424
1800
  },
1801
+ urlParameters: [
1802
+ $host,
1803
+ subscriptionId,
1804
+ resourceGroupName,
1805
+ resourceName,
1806
+ nextLink
1807
+ ],
1808
+ headerParameters: [accept],
1809
+ serializer: serializer$1
1810
+ };
1811
+
1812
+ /*
1813
+ * Copyright (c) Microsoft Corporation.
1814
+ * Licensed under the MIT License.
1815
+ *
1816
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1817
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1818
+ */
1819
+ /// <reference lib="esnext.asynciterable" />
1820
+ /** Class containing ResourceSyncRules operations. */
1821
+ class ResourceSyncRulesImpl {
1822
+ /**
1823
+ * Initialize a new instance of the class ResourceSyncRules class.
1824
+ * @param client Reference to the service client
1825
+ */
1826
+ constructor(client) {
1827
+ this.client = client;
1828
+ }
1829
+ /**
1830
+ * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties
1831
+ * of each Resource Sync Rule
1832
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1833
+ * @param resourceName Custom Locations name.
1834
+ * @param options The options parameters.
1835
+ */
1836
+ listByCustomLocationID(resourceGroupName, resourceName, options) {
1837
+ const iter = this.listByCustomLocationIDPagingAll(resourceGroupName, resourceName, options);
1838
+ return {
1839
+ next() {
1840
+ return iter.next();
1841
+ },
1842
+ [Symbol.asyncIterator]() {
1843
+ return this;
1844
+ },
1845
+ byPage: (settings) => {
1846
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1847
+ throw new Error("maxPageSize is not supported by this operation.");
1848
+ }
1849
+ return this.listByCustomLocationIDPagingPage(resourceGroupName, resourceName, options, settings);
1850
+ }
1851
+ };
1852
+ }
1853
+ listByCustomLocationIDPagingPage(resourceGroupName, resourceName, options, settings) {
1854
+ return tslib.__asyncGenerator(this, arguments, function* listByCustomLocationIDPagingPage_1() {
1855
+ let result;
1856
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1857
+ if (!continuationToken) {
1858
+ result = yield tslib.__await(this._listByCustomLocationID(resourceGroupName, resourceName, options));
1859
+ let page = result.value || [];
1860
+ continuationToken = result.nextLink;
1861
+ setContinuationToken(page, continuationToken);
1862
+ yield yield tslib.__await(page);
1863
+ }
1864
+ while (continuationToken) {
1865
+ result = yield tslib.__await(this._listByCustomLocationIDNext(resourceGroupName, resourceName, continuationToken, options));
1866
+ continuationToken = result.nextLink;
1867
+ let page = result.value || [];
1868
+ setContinuationToken(page, continuationToken);
1869
+ yield yield tslib.__await(page);
1870
+ }
1871
+ });
1872
+ }
1873
+ listByCustomLocationIDPagingAll(resourceGroupName, resourceName, options) {
1874
+ return tslib.__asyncGenerator(this, arguments, function* listByCustomLocationIDPagingAll_1() {
1875
+ var e_1, _a;
1876
+ try {
1877
+ for (var _b = tslib.__asyncValues(this.listByCustomLocationIDPagingPage(resourceGroupName, resourceName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1878
+ const page = _c.value;
1879
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1880
+ }
1881
+ }
1882
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1883
+ finally {
1884
+ try {
1885
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1886
+ }
1887
+ finally { if (e_1) throw e_1.error; }
1888
+ }
1889
+ });
1890
+ }
1891
+ /**
1892
+ * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties
1893
+ * of each Resource Sync Rule
1894
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1895
+ * @param resourceName Custom Locations name.
1896
+ * @param options The options parameters.
1897
+ */
1898
+ _listByCustomLocationID(resourceGroupName, resourceName, options) {
1899
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, listByCustomLocationIDOperationSpec);
1900
+ }
1901
+ /**
1902
+ * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom
1903
+ * Location resource name and Resource Sync Rule name.
1904
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1905
+ * @param resourceName Custom Locations name.
1906
+ * @param childResourceName Resource Sync Rule name.
1907
+ * @param options The options parameters.
1908
+ */
1909
+ get(resourceGroupName, resourceName, childResourceName, options) {
1910
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, childResourceName, options }, getOperationSpec);
1911
+ }
1912
+ /**
1913
+ * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
1914
+ * Group
1915
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1916
+ * @param resourceName Custom Locations name.
1917
+ * @param childResourceName Resource Sync Rule name.
1918
+ * @param parameters Parameters supplied to create or update a Resource Sync Rule.
1919
+ * @param options The options parameters.
1920
+ */
1921
+ beginCreateOrUpdate(resourceGroupName, resourceName, childResourceName, parameters, options) {
1922
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1923
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1924
+ return this.client.sendOperationRequest(args, spec);
1925
+ });
1926
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1927
+ var _a;
1928
+ let currentRawResponse = undefined;
1929
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1930
+ const callback = (rawResponse, flatResponse) => {
1931
+ currentRawResponse = rawResponse;
1932
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1933
+ };
1934
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1935
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1936
+ return {
1937
+ flatResponse,
1938
+ rawResponse: {
1939
+ statusCode: currentRawResponse.status,
1940
+ body: currentRawResponse.parsedBody,
1941
+ headers: currentRawResponse.headers.toJSON()
1942
+ }
1943
+ };
1944
+ });
1945
+ const lro = new LroImpl(sendOperation, {
1946
+ resourceGroupName,
1947
+ resourceName,
1948
+ childResourceName,
1949
+ parameters,
1950
+ options
1951
+ }, createOrUpdateOperationSpec);
1952
+ const poller = new coreLro.LroEngine(lro, {
1953
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1954
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1955
+ lroResourceLocationConfig: "azure-async-operation"
1956
+ });
1957
+ yield poller.poll();
1958
+ return poller;
1959
+ });
1960
+ }
1961
+ /**
1962
+ * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
1963
+ * Group
1964
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1965
+ * @param resourceName Custom Locations name.
1966
+ * @param childResourceName Resource Sync Rule name.
1967
+ * @param parameters Parameters supplied to create or update a Resource Sync Rule.
1968
+ * @param options The options parameters.
1969
+ */
1970
+ beginCreateOrUpdateAndWait(resourceGroupName, resourceName, childResourceName, parameters, options) {
1971
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1972
+ const poller = yield this.beginCreateOrUpdate(resourceGroupName, resourceName, childResourceName, parameters, options);
1973
+ return poller.pollUntilDone();
1974
+ });
1975
+ }
1976
+ /**
1977
+ * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource
1978
+ * Name, Resource Group, and Subscription Id.
1979
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1980
+ * @param resourceName Custom Locations name.
1981
+ * @param childResourceName Resource Sync Rule name.
1982
+ * @param options The options parameters.
1983
+ */
1984
+ delete(resourceGroupName, resourceName, childResourceName, options) {
1985
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, childResourceName, options }, deleteOperationSpec);
1986
+ }
1987
+ /**
1988
+ * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
1989
+ * Group, Subscription and Custom Location name.
1990
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1991
+ * @param resourceName Custom Locations name.
1992
+ * @param childResourceName Resource Sync Rule name.
1993
+ * @param options The options parameters.
1994
+ */
1995
+ beginUpdate(resourceGroupName, resourceName, childResourceName, options) {
1996
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1997
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1998
+ return this.client.sendOperationRequest(args, spec);
1999
+ });
2000
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2001
+ var _a;
2002
+ let currentRawResponse = undefined;
2003
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
2004
+ const callback = (rawResponse, flatResponse) => {
2005
+ currentRawResponse = rawResponse;
2006
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
2007
+ };
2008
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
2009
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
2010
+ return {
2011
+ flatResponse,
2012
+ rawResponse: {
2013
+ statusCode: currentRawResponse.status,
2014
+ body: currentRawResponse.parsedBody,
2015
+ headers: currentRawResponse.headers.toJSON()
2016
+ }
2017
+ };
2018
+ });
2019
+ const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, childResourceName, options }, updateOperationSpec);
2020
+ const poller = new coreLro.LroEngine(lro, {
2021
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2022
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
2023
+ lroResourceLocationConfig: "azure-async-operation"
2024
+ });
2025
+ yield poller.poll();
2026
+ return poller;
2027
+ });
2028
+ }
2029
+ /**
2030
+ * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
2031
+ * Group, Subscription and Custom Location name.
2032
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
2033
+ * @param resourceName Custom Locations name.
2034
+ * @param childResourceName Resource Sync Rule name.
2035
+ * @param options The options parameters.
2036
+ */
2037
+ beginUpdateAndWait(resourceGroupName, resourceName, childResourceName, options) {
2038
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2039
+ const poller = yield this.beginUpdate(resourceGroupName, resourceName, childResourceName, options);
2040
+ return poller.pollUntilDone();
2041
+ });
2042
+ }
2043
+ /**
2044
+ * ListByCustomLocationIDNext
2045
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
2046
+ * @param resourceName Custom Locations name.
2047
+ * @param nextLink The nextLink from the previous successful call to the ListByCustomLocationID method.
2048
+ * @param options The options parameters.
2049
+ */
2050
+ _listByCustomLocationIDNext(resourceGroupName, resourceName, nextLink, options) {
2051
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, nextLink, options }, listByCustomLocationIDNextOperationSpec);
2052
+ }
2053
+ }
2054
+ // Operation Specifications
2055
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
2056
+ const listByCustomLocationIDOperationSpec = {
2057
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules",
2058
+ httpMethod: "GET",
2059
+ responses: {
2060
+ 200: {
2061
+ bodyMapper: ResourceSyncRuleListResult
2062
+ },
2063
+ default: {
2064
+ bodyMapper: ErrorResponse
2065
+ }
2066
+ },
2067
+ queryParameters: [apiVersion],
2068
+ urlParameters: [
2069
+ $host,
2070
+ subscriptionId,
2071
+ resourceGroupName,
2072
+ resourceName
2073
+ ],
2074
+ headerParameters: [accept],
2075
+ serializer
2076
+ };
2077
+ const getOperationSpec = {
2078
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
2079
+ httpMethod: "GET",
2080
+ responses: {
2081
+ 200: {
2082
+ bodyMapper: ResourceSyncRule
2083
+ },
2084
+ default: {
2085
+ bodyMapper: ErrorResponse
2086
+ }
2087
+ },
2088
+ queryParameters: [apiVersion],
2089
+ urlParameters: [
2090
+ $host,
2091
+ subscriptionId,
2092
+ resourceGroupName,
2093
+ resourceName,
2094
+ childResourceName
2095
+ ],
2096
+ headerParameters: [accept],
2097
+ serializer
2098
+ };
2099
+ const createOrUpdateOperationSpec = {
2100
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
2101
+ httpMethod: "PUT",
2102
+ responses: {
2103
+ 200: {
2104
+ bodyMapper: ResourceSyncRule
2105
+ },
2106
+ 201: {
2107
+ bodyMapper: ResourceSyncRule
2108
+ },
2109
+ 202: {
2110
+ bodyMapper: ResourceSyncRule
2111
+ },
2112
+ 204: {
2113
+ bodyMapper: ResourceSyncRule
2114
+ },
2115
+ default: {
2116
+ bodyMapper: ErrorResponse
2117
+ }
2118
+ },
2119
+ requestBody: parameters3,
2120
+ queryParameters: [apiVersion],
2121
+ urlParameters: [
2122
+ $host,
2123
+ subscriptionId,
2124
+ resourceGroupName,
2125
+ resourceName,
2126
+ childResourceName
2127
+ ],
2128
+ headerParameters: [accept, contentType],
2129
+ mediaType: "json",
2130
+ serializer
2131
+ };
2132
+ const deleteOperationSpec = {
2133
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
2134
+ httpMethod: "DELETE",
2135
+ responses: {
2136
+ 200: {},
2137
+ 204: {},
2138
+ default: {
2139
+ bodyMapper: ErrorResponse
2140
+ }
2141
+ },
2142
+ queryParameters: [apiVersion],
2143
+ urlParameters: [
2144
+ $host,
2145
+ subscriptionId,
2146
+ resourceGroupName,
2147
+ resourceName,
2148
+ childResourceName
2149
+ ],
2150
+ headerParameters: [accept],
2151
+ serializer
2152
+ };
2153
+ const updateOperationSpec = {
2154
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
2155
+ httpMethod: "PATCH",
2156
+ responses: {
2157
+ 200: {
2158
+ bodyMapper: ResourceSyncRule
2159
+ },
2160
+ 201: {
2161
+ bodyMapper: ResourceSyncRule
2162
+ },
2163
+ 202: {
2164
+ bodyMapper: ResourceSyncRule
2165
+ },
2166
+ 204: {
2167
+ bodyMapper: ResourceSyncRule
2168
+ },
2169
+ default: {
2170
+ bodyMapper: ErrorResponse
2171
+ }
2172
+ },
2173
+ requestBody: {
2174
+ parameterPath: {
2175
+ tags: ["options", "tags"],
2176
+ priority: ["options", "priority"],
2177
+ selector: ["options", "selector"],
2178
+ targetResourceGroup: ["options", "targetResourceGroup"]
2179
+ },
2180
+ mapper: Object.assign(Object.assign({}, PatchableResourceSyncRule), { required: true })
2181
+ },
1425
2182
  queryParameters: [apiVersion],
2183
+ urlParameters: [
2184
+ $host,
2185
+ subscriptionId,
2186
+ resourceGroupName,
2187
+ resourceName,
2188
+ childResourceName
2189
+ ],
2190
+ headerParameters: [accept, contentType],
2191
+ mediaType: "json",
2192
+ serializer
2193
+ };
2194
+ const listByCustomLocationIDNextOperationSpec = {
2195
+ path: "{nextLink}",
2196
+ httpMethod: "GET",
2197
+ responses: {
2198
+ 200: {
2199
+ bodyMapper: ResourceSyncRuleListResult
2200
+ },
2201
+ default: {
2202
+ bodyMapper: ErrorResponse
2203
+ }
2204
+ },
1426
2205
  urlParameters: [
1427
2206
  $host,
1428
2207
  subscriptionId,
@@ -1441,14 +2220,15 @@ const listEnabledResourceTypesNextOperationSpec = {
1441
2220
  * Code generated by Microsoft (R) AutoRest Code Generator.
1442
2221
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1443
2222
  */
1444
- class CustomLocationsManagementClientContext extends coreClient.ServiceClient {
2223
+ class CustomLocationsManagementClient extends coreClient__namespace.ServiceClient {
1445
2224
  /**
1446
- * Initializes a new instance of the CustomLocationsManagementClientContext class.
2225
+ * Initializes a new instance of the CustomLocationsManagementClient class.
1447
2226
  * @param credentials Subscription credentials which uniquely identify client subscription.
1448
2227
  * @param subscriptionId The ID of the target subscription.
1449
2228
  * @param options The parameter options
1450
2229
  */
1451
2230
  constructor(credentials, subscriptionId, options) {
2231
+ var _a, _b, _c;
1452
2232
  if (credentials === undefined) {
1453
2233
  throw new Error("'credentials' cannot be null");
1454
2234
  }
@@ -1463,45 +2243,73 @@ class CustomLocationsManagementClientContext extends coreClient.ServiceClient {
1463
2243
  requestContentType: "application/json; charset=utf-8",
1464
2244
  credential: credentials
1465
2245
  };
1466
- const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0-beta.1`;
2246
+ const packageDetails = `azsdk-js-arm-extendedlocation/1.0.0-beta.3`;
1467
2247
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1468
2248
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1469
2249
  : `${packageDetails}`;
1470
- if (!options.credentialScopes) {
1471
- options.credentialScopes = ["https://management.azure.com/.default"];
1472
- }
1473
2250
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1474
2251
  userAgentPrefix
1475
- }, baseUri: options.endpoint || "https://management.azure.com" });
2252
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1476
2253
  super(optionsWithDefaults);
2254
+ let bearerTokenAuthenticationPolicyFound = false;
2255
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
2256
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
2257
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
2258
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
2259
+ }
2260
+ if (!options ||
2261
+ !options.pipeline ||
2262
+ options.pipeline.getOrderedPolicies().length == 0 ||
2263
+ !bearerTokenAuthenticationPolicyFound) {
2264
+ this.pipeline.removePolicy({
2265
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
2266
+ });
2267
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
2268
+ credential: credentials,
2269
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
2270
+ challengeCallbacks: {
2271
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
2272
+ }
2273
+ }));
2274
+ }
1477
2275
  // Parameter assignments
1478
2276
  this.subscriptionId = subscriptionId;
1479
2277
  // Assigning values to Constant parameters
1480
2278
  this.$host = options.$host || "https://management.azure.com";
1481
- this.apiVersion = options.apiVersion || "2021-08-15";
1482
- }
1483
- }
1484
-
1485
- /*
1486
- * Copyright (c) Microsoft Corporation.
1487
- * Licensed under the MIT License.
1488
- *
1489
- * Code generated by Microsoft (R) AutoRest Code Generator.
1490
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1491
- */
1492
- class CustomLocationsManagementClient extends CustomLocationsManagementClientContext {
1493
- /**
1494
- * Initializes a new instance of the CustomLocationsManagementClient class.
1495
- * @param credentials Subscription credentials which uniquely identify client subscription.
1496
- * @param subscriptionId The ID of the target subscription.
1497
- * @param options The parameter options
1498
- */
1499
- constructor(credentials, subscriptionId, options) {
1500
- super(credentials, subscriptionId, options);
2279
+ this.apiVersion = options.apiVersion || "2021-08-31-preview";
1501
2280
  this.customLocations = new CustomLocationsImpl(this);
2281
+ this.resourceSyncRules = new ResourceSyncRulesImpl(this);
2282
+ this.addCustomApiVersionPolicy(options.apiVersion);
2283
+ }
2284
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
2285
+ addCustomApiVersionPolicy(apiVersion) {
2286
+ if (!apiVersion) {
2287
+ return;
2288
+ }
2289
+ const apiVersionPolicy = {
2290
+ name: "CustomApiVersionPolicy",
2291
+ sendRequest(request, next) {
2292
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2293
+ const param = request.url.split("?");
2294
+ if (param.length > 1) {
2295
+ const newParams = param[1].split("&").map((item) => {
2296
+ if (item.indexOf("api-version") > -1) {
2297
+ return "api-version=" + apiVersion;
2298
+ }
2299
+ else {
2300
+ return item;
2301
+ }
2302
+ });
2303
+ request.url = param[0] + "?" + newParams.join("&");
2304
+ }
2305
+ return next(request);
2306
+ });
2307
+ }
2308
+ };
2309
+ this.pipeline.addPolicy(apiVersionPolicy);
1502
2310
  }
1503
2311
  }
1504
2312
 
1505
2313
  exports.CustomLocationsManagementClient = CustomLocationsManagementClient;
1506
- exports.CustomLocationsManagementClientContext = CustomLocationsManagementClientContext;
2314
+ exports.getContinuationToken = getContinuationToken;
1507
2315
  //# sourceMappingURL=index.js.map