@azure/arm-confluent 3.0.0-beta.1 → 3.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 (86) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/README.md +12 -1
  3. package/dist/index.js +246 -67
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/marketplaceAgreementsCreateSample.d.ts +2 -0
  8. package/dist-esm/samples-dev/marketplaceAgreementsCreateSample.d.ts.map +1 -0
  9. package/dist-esm/samples-dev/marketplaceAgreementsCreateSample.js +29 -0
  10. package/dist-esm/samples-dev/marketplaceAgreementsCreateSample.js.map +1 -0
  11. package/dist-esm/samples-dev/marketplaceAgreementsListSample.d.ts +2 -0
  12. package/dist-esm/samples-dev/marketplaceAgreementsListSample.d.ts.map +1 -0
  13. package/dist-esm/samples-dev/marketplaceAgreementsListSample.js +43 -0
  14. package/dist-esm/samples-dev/marketplaceAgreementsListSample.js.map +1 -0
  15. package/dist-esm/samples-dev/organizationCreateSample.d.ts +2 -0
  16. package/dist-esm/samples-dev/organizationCreateSample.d.ts.map +1 -0
  17. package/dist-esm/samples-dev/organizationCreateSample.js +48 -0
  18. package/dist-esm/samples-dev/organizationCreateSample.js.map +1 -0
  19. package/dist-esm/samples-dev/organizationDeleteSample.d.ts +2 -0
  20. package/dist-esm/samples-dev/organizationDeleteSample.d.ts.map +1 -0
  21. package/dist-esm/samples-dev/organizationDeleteSample.js +31 -0
  22. package/dist-esm/samples-dev/organizationDeleteSample.js.map +1 -0
  23. package/dist-esm/samples-dev/organizationGetSample.d.ts +2 -0
  24. package/dist-esm/samples-dev/organizationGetSample.d.ts.map +1 -0
  25. package/dist-esm/samples-dev/organizationGetSample.js +31 -0
  26. package/dist-esm/samples-dev/organizationGetSample.js.map +1 -0
  27. package/dist-esm/samples-dev/organizationListByResourceGroupSample.d.ts +2 -0
  28. package/dist-esm/samples-dev/organizationListByResourceGroupSample.d.ts.map +1 -0
  29. package/dist-esm/samples-dev/organizationListByResourceGroupSample.js +44 -0
  30. package/dist-esm/samples-dev/organizationListByResourceGroupSample.js.map +1 -0
  31. package/dist-esm/samples-dev/organizationListBySubscriptionSample.d.ts +2 -0
  32. package/dist-esm/samples-dev/organizationListBySubscriptionSample.d.ts.map +1 -0
  33. package/dist-esm/samples-dev/organizationListBySubscriptionSample.js +43 -0
  34. package/dist-esm/samples-dev/organizationListBySubscriptionSample.js.map +1 -0
  35. package/dist-esm/samples-dev/organizationOperationsListSample.d.ts +2 -0
  36. package/dist-esm/samples-dev/organizationOperationsListSample.d.ts.map +1 -0
  37. package/dist-esm/samples-dev/organizationOperationsListSample.js +43 -0
  38. package/dist-esm/samples-dev/organizationOperationsListSample.js.map +1 -0
  39. package/dist-esm/samples-dev/organizationUpdateSample.d.ts +2 -0
  40. package/dist-esm/samples-dev/organizationUpdateSample.d.ts.map +1 -0
  41. package/dist-esm/samples-dev/organizationUpdateSample.js +35 -0
  42. package/dist-esm/samples-dev/organizationUpdateSample.js.map +1 -0
  43. package/dist-esm/samples-dev/validationsValidateOrganizationSample.d.ts +2 -0
  44. package/dist-esm/samples-dev/validationsValidateOrganizationSample.d.ts.map +1 -0
  45. package/dist-esm/samples-dev/validationsValidateOrganizationSample.js +47 -0
  46. package/dist-esm/samples-dev/validationsValidateOrganizationSample.js.map +1 -0
  47. package/dist-esm/src/confluentManagementClient.d.ts +2 -0
  48. package/dist-esm/src/confluentManagementClient.d.ts.map +1 -1
  49. package/dist-esm/src/confluentManagementClient.js +54 -5
  50. package/dist-esm/src/confluentManagementClient.js.map +1 -1
  51. package/dist-esm/src/index.d.ts +1 -0
  52. package/dist-esm/src/index.d.ts.map +1 -1
  53. package/dist-esm/src/index.js +1 -0
  54. package/dist-esm/src/index.js.map +1 -1
  55. package/dist-esm/src/models/index.d.ts +23 -0
  56. package/dist-esm/src/models/index.d.ts.map +1 -1
  57. package/dist-esm/src/models/index.js +23 -0
  58. package/dist-esm/src/models/index.js.map +1 -1
  59. package/dist-esm/src/operations/marketplaceAgreements.d.ts.map +1 -1
  60. package/dist-esm/src/operations/marketplaceAgreements.js +19 -7
  61. package/dist-esm/src/operations/marketplaceAgreements.js.map +1 -1
  62. package/dist-esm/src/operations/organization.d.ts.map +1 -1
  63. package/dist-esm/src/operations/organization.js +43 -16
  64. package/dist-esm/src/operations/organization.js.map +1 -1
  65. package/dist-esm/src/operations/organizationOperations.d.ts.map +1 -1
  66. package/dist-esm/src/operations/organizationOperations.js +19 -7
  67. package/dist-esm/src/operations/organizationOperations.js.map +1 -1
  68. package/dist-esm/src/pagingHelper.d.ts +13 -0
  69. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  70. package/dist-esm/src/pagingHelper.js +32 -0
  71. package/dist-esm/src/pagingHelper.js.map +1 -0
  72. package/dist-esm/test/sampleTest.js +11 -13
  73. package/dist-esm/test/sampleTest.js.map +1 -1
  74. package/package.json +51 -21
  75. package/review/arm-confluent.api.md +3 -23
  76. package/rollup.config.js +6 -72
  77. package/src/confluentManagementClient.ts +70 -5
  78. package/src/index.ts +1 -0
  79. package/src/models/index.ts +23 -0
  80. package/src/operations/marketplaceAgreements.ts +21 -8
  81. package/src/operations/organization.ts +51 -18
  82. package/src/operations/organizationOperations.ts +21 -8
  83. package/src/pagingHelper.ts +39 -0
  84. package/tsconfig.json +19 -5
  85. package/types/arm-confluent.d.ts +34 -0
  86. package/types/tsdoc-metadata.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Release History
2
2
 
3
- ## 3.0.0-beta.1 (2022-01-05)
3
+ ## 3.0.0-beta.3 (2022-11-18)
4
4
 
5
- The package of @azure/arm-confluent is using our next generation design principles since version 3.0.0-beta.1, which contains breaking changes.
5
+ The package of @azure/arm-confluent is using our next generation design principles since version 3.0.0-beta.3, which contains breaking changes.
6
6
 
7
7
  To understand the detail of the change, please refer to [Changelog](https://aka.ms/js-track2-changelog).
8
8
 
package/README.md CHANGED
@@ -13,9 +13,11 @@ This package contains an isomorphic SDK (runs both in Node.js and in browsers) f
13
13
 
14
14
  ### Currently supported environments
15
15
 
16
- - [LTS versions of Node.js](https://nodejs.org/about/releases/)
16
+ - [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
17
17
  - Latest versions of Safari, Chrome, Edge and Firefox.
18
18
 
19
+ See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
20
+
19
21
  ### Prerequisites
20
22
 
21
23
  - An [Azure subscription][azure_sub].
@@ -49,8 +51,17 @@ For more information about how to create an Azure AD Application check out [this
49
51
  ```javascript
50
52
  const { ConfluentManagementClient } = require("@azure/arm-confluent");
51
53
  const { DefaultAzureCredential } = require("@azure/identity");
54
+ // For client-side applications running in the browser, use InteractiveBrowserCredential instead of DefaultAzureCredential. See https://aka.ms/azsdk/js/identity/examples for more details.
55
+
52
56
  const subscriptionId = "00000000-0000-0000-0000-000000000000";
53
57
  const client = new ConfluentManagementClient(new DefaultAzureCredential(), subscriptionId);
58
+
59
+ // For client-side applications running in the browser, use this code instead:
60
+ // const credential = new InteractiveBrowserCredential({
61
+ // tenantId: "<YOUR_TENANT_ID>",
62
+ // clientId: "<YOUR_CLIENT_ID>"
63
+ // });
64
+ // const client = new ConfluentManagementClient(credential, subscriptionId);
54
65
  ```
55
66
 
56
67
 
package/dist/index.js CHANGED
@@ -2,10 +2,32 @@
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
 
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
+
9
31
  /*
10
32
  * Copyright (c) Microsoft Corporation.
11
33
  * Licensed under the MIT License.
@@ -13,33 +35,94 @@ var coreLro = require('@azure/core-lro');
13
35
  * Code generated by Microsoft (R) AutoRest Code Generator.
14
36
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
15
37
  */
38
+ const pageMap = new WeakMap();
39
+ /**
40
+ * Given a result page from a pageable operation, returns a
41
+ * continuation token that can be used to begin paging from
42
+ * that point later.
43
+ * @param page A result object from calling .byPage() on a paged operation.
44
+ * @returns The continuation token that can be passed into byPage().
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
+
63
+ /*
64
+ * Copyright (c) Microsoft Corporation.
65
+ * Licensed under the MIT License.
66
+ *
67
+ * Code generated by Microsoft (R) AutoRest Code Generator.
68
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
69
+ */
70
+ /** Known values of {@link CreatedByType} that the service accepts. */
71
+ exports.KnownCreatedByType = void 0;
16
72
  (function (KnownCreatedByType) {
73
+ /** User */
17
74
  KnownCreatedByType["User"] = "User";
75
+ /** Application */
18
76
  KnownCreatedByType["Application"] = "Application";
77
+ /** ManagedIdentity */
19
78
  KnownCreatedByType["ManagedIdentity"] = "ManagedIdentity";
79
+ /** Key */
20
80
  KnownCreatedByType["Key"] = "Key";
21
81
  })(exports.KnownCreatedByType || (exports.KnownCreatedByType = {}));
82
+ /** Known values of {@link ProvisionState} that the service accepts. */
83
+ exports.KnownProvisionState = void 0;
22
84
  (function (KnownProvisionState) {
85
+ /** Accepted */
23
86
  KnownProvisionState["Accepted"] = "Accepted";
87
+ /** Creating */
24
88
  KnownProvisionState["Creating"] = "Creating";
89
+ /** Updating */
25
90
  KnownProvisionState["Updating"] = "Updating";
91
+ /** Deleting */
26
92
  KnownProvisionState["Deleting"] = "Deleting";
93
+ /** Succeeded */
27
94
  KnownProvisionState["Succeeded"] = "Succeeded";
95
+ /** Failed */
28
96
  KnownProvisionState["Failed"] = "Failed";
97
+ /** Canceled */
29
98
  KnownProvisionState["Canceled"] = "Canceled";
99
+ /** Deleted */
30
100
  KnownProvisionState["Deleted"] = "Deleted";
101
+ /** NotSpecified */
31
102
  KnownProvisionState["NotSpecified"] = "NotSpecified";
32
103
  })(exports.KnownProvisionState || (exports.KnownProvisionState = {}));
104
+ /** Known values of {@link SaaSOfferStatus} that the service accepts. */
105
+ exports.KnownSaaSOfferStatus = void 0;
33
106
  (function (KnownSaaSOfferStatus) {
107
+ /** Started */
34
108
  KnownSaaSOfferStatus["Started"] = "Started";
109
+ /** PendingFulfillmentStart */
35
110
  KnownSaaSOfferStatus["PendingFulfillmentStart"] = "PendingFulfillmentStart";
111
+ /** InProgress */
36
112
  KnownSaaSOfferStatus["InProgress"] = "InProgress";
113
+ /** Subscribed */
37
114
  KnownSaaSOfferStatus["Subscribed"] = "Subscribed";
115
+ /** Suspended */
38
116
  KnownSaaSOfferStatus["Suspended"] = "Suspended";
117
+ /** Reinstated */
39
118
  KnownSaaSOfferStatus["Reinstated"] = "Reinstated";
119
+ /** Succeeded */
40
120
  KnownSaaSOfferStatus["Succeeded"] = "Succeeded";
121
+ /** Failed */
41
122
  KnownSaaSOfferStatus["Failed"] = "Failed";
123
+ /** Unsubscribed */
42
124
  KnownSaaSOfferStatus["Unsubscribed"] = "Unsubscribed";
125
+ /** Updating */
43
126
  KnownSaaSOfferStatus["Updating"] = "Updating";
44
127
  })(exports.KnownSaaSOfferStatus || (exports.KnownSaaSOfferStatus = {}));
45
128
 
@@ -736,20 +819,31 @@ class MarketplaceAgreementsImpl {
736
819
  [Symbol.asyncIterator]() {
737
820
  return this;
738
821
  },
739
- byPage: () => {
740
- return this.listPagingPage(options);
822
+ byPage: (settings) => {
823
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
824
+ throw new Error("maxPageSize is not supported by this operation.");
825
+ }
826
+ return this.listPagingPage(options, settings);
741
827
  }
742
828
  };
743
829
  }
744
- listPagingPage(options) {
830
+ listPagingPage(options, settings) {
745
831
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
746
- let result = yield tslib.__await(this._list(options));
747
- yield yield tslib.__await(result.value || []);
748
- let continuationToken = result.nextLink;
832
+ let result;
833
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
834
+ if (!continuationToken) {
835
+ result = yield tslib.__await(this._list(options));
836
+ let page = result.value || [];
837
+ continuationToken = result.nextLink;
838
+ setContinuationToken(page, continuationToken);
839
+ yield yield tslib.__await(page);
840
+ }
749
841
  while (continuationToken) {
750
842
  result = yield tslib.__await(this._listNext(continuationToken, options));
751
843
  continuationToken = result.nextLink;
752
- yield yield tslib.__await(result.value || []);
844
+ let page = result.value || [];
845
+ setContinuationToken(page, continuationToken);
846
+ yield yield tslib.__await(page);
753
847
  }
754
848
  });
755
849
  }
@@ -776,14 +870,14 @@ class MarketplaceAgreementsImpl {
776
870
  * @param options The options parameters.
777
871
  */
778
872
  _list(options) {
779
- return this.client.sendOperationRequest({ options }, listOperationSpec);
873
+ return this.client.sendOperationRequest({ options }, listOperationSpec$1);
780
874
  }
781
875
  /**
782
876
  * Create Confluent Marketplace agreement in the subscription.
783
877
  * @param options The options parameters.
784
878
  */
785
879
  create(options) {
786
- return this.client.sendOperationRequest({ options }, createOperationSpec);
880
+ return this.client.sendOperationRequest({ options }, createOperationSpec$1);
787
881
  }
788
882
  /**
789
883
  * ListNext
@@ -791,12 +885,12 @@ class MarketplaceAgreementsImpl {
791
885
  * @param options The options parameters.
792
886
  */
793
887
  _listNext(nextLink, options) {
794
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
888
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$1);
795
889
  }
796
890
  }
797
891
  // Operation Specifications
798
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
799
- const listOperationSpec = {
892
+ const serializer$3 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
893
+ const listOperationSpec$1 = {
800
894
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements",
801
895
  httpMethod: "GET",
802
896
  responses: {
@@ -810,9 +904,9 @@ const listOperationSpec = {
810
904
  queryParameters: [apiVersion],
811
905
  urlParameters: [$host, subscriptionId],
812
906
  headerParameters: [accept],
813
- serializer
907
+ serializer: serializer$3
814
908
  };
815
- const createOperationSpec = {
909
+ const createOperationSpec$1 = {
816
910
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/agreements/default",
817
911
  httpMethod: "PUT",
818
912
  responses: {
@@ -828,9 +922,9 @@ const createOperationSpec = {
828
922
  urlParameters: [$host, subscriptionId],
829
923
  headerParameters: [accept, contentType],
830
924
  mediaType: "json",
831
- serializer
925
+ serializer: serializer$3
832
926
  };
833
- const listNextOperationSpec = {
927
+ const listNextOperationSpec$1 = {
834
928
  path: "{nextLink}",
835
929
  httpMethod: "GET",
836
930
  responses: {
@@ -848,7 +942,7 @@ const listNextOperationSpec = {
848
942
  nextLink
849
943
  ],
850
944
  headerParameters: [accept],
851
- serializer
945
+ serializer: serializer$3
852
946
  };
853
947
 
854
948
  /*
@@ -881,20 +975,31 @@ class OrganizationOperationsImpl {
881
975
  [Symbol.asyncIterator]() {
882
976
  return this;
883
977
  },
884
- byPage: () => {
885
- return this.listPagingPage(options);
978
+ byPage: (settings) => {
979
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
980
+ throw new Error("maxPageSize is not supported by this operation.");
981
+ }
982
+ return this.listPagingPage(options, settings);
886
983
  }
887
984
  };
888
985
  }
889
- listPagingPage(options) {
986
+ listPagingPage(options, settings) {
890
987
  return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
891
- let result = yield tslib.__await(this._list(options));
892
- yield yield tslib.__await(result.value || []);
893
- let continuationToken = result.nextLink;
988
+ let result;
989
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
990
+ if (!continuationToken) {
991
+ result = yield tslib.__await(this._list(options));
992
+ let page = result.value || [];
993
+ continuationToken = result.nextLink;
994
+ setContinuationToken(page, continuationToken);
995
+ yield yield tslib.__await(page);
996
+ }
894
997
  while (continuationToken) {
895
998
  result = yield tslib.__await(this._listNext(continuationToken, options));
896
999
  continuationToken = result.nextLink;
897
- yield yield tslib.__await(result.value || []);
1000
+ let page = result.value || [];
1001
+ setContinuationToken(page, continuationToken);
1002
+ yield yield tslib.__await(page);
898
1003
  }
899
1004
  });
900
1005
  }
@@ -921,7 +1026,7 @@ class OrganizationOperationsImpl {
921
1026
  * @param options The options parameters.
922
1027
  */
923
1028
  _list(options) {
924
- return this.client.sendOperationRequest({ options }, listOperationSpec$1);
1029
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
925
1030
  }
926
1031
  /**
927
1032
  * ListNext
@@ -929,12 +1034,12 @@ class OrganizationOperationsImpl {
929
1034
  * @param options The options parameters.
930
1035
  */
931
1036
  _listNext(nextLink, options) {
932
- return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$1);
1037
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
933
1038
  }
934
1039
  }
935
1040
  // Operation Specifications
936
- const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
937
- const listOperationSpec$1 = {
1041
+ const serializer$2 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1042
+ const listOperationSpec = {
938
1043
  path: "/providers/Microsoft.Confluent/operations",
939
1044
  httpMethod: "GET",
940
1045
  responses: {
@@ -948,9 +1053,9 @@ const listOperationSpec$1 = {
948
1053
  queryParameters: [apiVersion],
949
1054
  urlParameters: [$host],
950
1055
  headerParameters: [accept],
951
- serializer: serializer$1
1056
+ serializer: serializer$2
952
1057
  };
953
- const listNextOperationSpec$1 = {
1058
+ const listNextOperationSpec = {
954
1059
  path: "{nextLink}",
955
1060
  httpMethod: "GET",
956
1061
  responses: {
@@ -964,7 +1069,7 @@ const listNextOperationSpec$1 = {
964
1069
  queryParameters: [apiVersion],
965
1070
  urlParameters: [$host, nextLink],
966
1071
  headerParameters: [accept],
967
- serializer: serializer$1
1072
+ serializer: serializer$2
968
1073
  };
969
1074
 
970
1075
  /*
@@ -1025,20 +1130,31 @@ class OrganizationImpl {
1025
1130
  [Symbol.asyncIterator]() {
1026
1131
  return this;
1027
1132
  },
1028
- byPage: () => {
1029
- return this.listBySubscriptionPagingPage(options);
1133
+ byPage: (settings) => {
1134
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1135
+ throw new Error("maxPageSize is not supported by this operation.");
1136
+ }
1137
+ return this.listBySubscriptionPagingPage(options, settings);
1030
1138
  }
1031
1139
  };
1032
1140
  }
1033
- listBySubscriptionPagingPage(options) {
1141
+ listBySubscriptionPagingPage(options, settings) {
1034
1142
  return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
1035
- let result = yield tslib.__await(this._listBySubscription(options));
1036
- yield yield tslib.__await(result.value || []);
1037
- let continuationToken = result.nextLink;
1143
+ let result;
1144
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1145
+ if (!continuationToken) {
1146
+ result = yield tslib.__await(this._listBySubscription(options));
1147
+ let page = result.value || [];
1148
+ continuationToken = result.nextLink;
1149
+ setContinuationToken(page, continuationToken);
1150
+ yield yield tslib.__await(page);
1151
+ }
1038
1152
  while (continuationToken) {
1039
1153
  result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
1040
1154
  continuationToken = result.nextLink;
1041
- yield yield tslib.__await(result.value || []);
1155
+ let page = result.value || [];
1156
+ setContinuationToken(page, continuationToken);
1157
+ yield yield tslib.__await(page);
1042
1158
  }
1043
1159
  });
1044
1160
  }
@@ -1074,20 +1190,31 @@ class OrganizationImpl {
1074
1190
  [Symbol.asyncIterator]() {
1075
1191
  return this;
1076
1192
  },
1077
- byPage: () => {
1078
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
1193
+ byPage: (settings) => {
1194
+ if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
1195
+ throw new Error("maxPageSize is not supported by this operation.");
1196
+ }
1197
+ return this.listByResourceGroupPagingPage(resourceGroupName, options, settings);
1079
1198
  }
1080
1199
  };
1081
1200
  }
1082
- listByResourceGroupPagingPage(resourceGroupName, options) {
1201
+ listByResourceGroupPagingPage(resourceGroupName, options, settings) {
1083
1202
  return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1084
- let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1085
- yield yield tslib.__await(result.value || []);
1086
- let continuationToken = result.nextLink;
1203
+ let result;
1204
+ let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
1205
+ if (!continuationToken) {
1206
+ result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1207
+ let page = result.value || [];
1208
+ continuationToken = result.nextLink;
1209
+ setContinuationToken(page, continuationToken);
1210
+ yield yield tslib.__await(page);
1211
+ }
1087
1212
  while (continuationToken) {
1088
1213
  result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1089
1214
  continuationToken = result.nextLink;
1090
- yield yield tslib.__await(result.value || []);
1215
+ let page = result.value || [];
1216
+ setContinuationToken(page, continuationToken);
1217
+ yield yield tslib.__await(page);
1091
1218
  }
1092
1219
  });
1093
1220
  }
@@ -1163,12 +1290,14 @@ class OrganizationImpl {
1163
1290
  }
1164
1291
  };
1165
1292
  });
1166
- const lro = new LroImpl(sendOperation, { resourceGroupName, organizationName, options }, createOperationSpec$1);
1167
- return new coreLro.LroEngine(lro, {
1293
+ const lro = new LroImpl(sendOperation, { resourceGroupName, organizationName, options }, createOperationSpec);
1294
+ const poller = new coreLro.LroEngine(lro, {
1168
1295
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1169
1296
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1170
1297
  lroResourceLocationConfig: "azure-async-operation"
1171
1298
  });
1299
+ yield poller.poll();
1300
+ return poller;
1172
1301
  });
1173
1302
  }
1174
1303
  /**
@@ -1223,11 +1352,13 @@ class OrganizationImpl {
1223
1352
  };
1224
1353
  });
1225
1354
  const lro = new LroImpl(sendOperation, { resourceGroupName, organizationName, options }, deleteOperationSpec);
1226
- return new coreLro.LroEngine(lro, {
1355
+ const poller = new coreLro.LroEngine(lro, {
1227
1356
  resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1228
1357
  intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
1229
1358
  lroResourceLocationConfig: "location"
1230
1359
  });
1360
+ yield poller.poll();
1361
+ return poller;
1231
1362
  });
1232
1363
  }
1233
1364
  /**
@@ -1261,7 +1392,7 @@ class OrganizationImpl {
1261
1392
  }
1262
1393
  }
1263
1394
  // Operation Specifications
1264
- const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
1395
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1265
1396
  const listBySubscriptionOperationSpec = {
1266
1397
  path: "/subscriptions/{subscriptionId}/providers/Microsoft.Confluent/organizations",
1267
1398
  httpMethod: "GET",
@@ -1276,7 +1407,7 @@ const listBySubscriptionOperationSpec = {
1276
1407
  queryParameters: [apiVersion],
1277
1408
  urlParameters: [$host, subscriptionId],
1278
1409
  headerParameters: [accept],
1279
- serializer: serializer$2
1410
+ serializer: serializer$1
1280
1411
  };
1281
1412
  const listByResourceGroupOperationSpec = {
1282
1413
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations",
@@ -1296,7 +1427,7 @@ const listByResourceGroupOperationSpec = {
1296
1427
  resourceGroupName
1297
1428
  ],
1298
1429
  headerParameters: [accept],
1299
- serializer: serializer$2
1430
+ serializer: serializer$1
1300
1431
  };
1301
1432
  const getOperationSpec = {
1302
1433
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}",
@@ -1317,9 +1448,9 @@ const getOperationSpec = {
1317
1448
  organizationName
1318
1449
  ],
1319
1450
  headerParameters: [accept],
1320
- serializer: serializer$2
1451
+ serializer: serializer$1
1321
1452
  };
1322
- const createOperationSpec$1 = {
1453
+ const createOperationSpec = {
1323
1454
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}",
1324
1455
  httpMethod: "PUT",
1325
1456
  responses: {
@@ -1349,7 +1480,7 @@ const createOperationSpec$1 = {
1349
1480
  ],
1350
1481
  headerParameters: [accept, contentType],
1351
1482
  mediaType: "json",
1352
- serializer: serializer$2
1483
+ serializer: serializer$1
1353
1484
  };
1354
1485
  const updateOperationSpec = {
1355
1486
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}",
@@ -1372,7 +1503,7 @@ const updateOperationSpec = {
1372
1503
  ],
1373
1504
  headerParameters: [accept, contentType],
1374
1505
  mediaType: "json",
1375
- serializer: serializer$2
1506
+ serializer: serializer$1
1376
1507
  };
1377
1508
  const deleteOperationSpec = {
1378
1509
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/organizations/{organizationName}",
@@ -1394,7 +1525,7 @@ const deleteOperationSpec = {
1394
1525
  organizationName
1395
1526
  ],
1396
1527
  headerParameters: [accept],
1397
- serializer: serializer$2
1528
+ serializer: serializer$1
1398
1529
  };
1399
1530
  const listBySubscriptionNextOperationSpec = {
1400
1531
  path: "{nextLink}",
@@ -1414,7 +1545,7 @@ const listBySubscriptionNextOperationSpec = {
1414
1545
  nextLink
1415
1546
  ],
1416
1547
  headerParameters: [accept],
1417
- serializer: serializer$2
1548
+ serializer: serializer$1
1418
1549
  };
1419
1550
  const listByResourceGroupNextOperationSpec = {
1420
1551
  path: "{nextLink}",
@@ -1435,7 +1566,7 @@ const listByResourceGroupNextOperationSpec = {
1435
1566
  resourceGroupName
1436
1567
  ],
1437
1568
  headerParameters: [accept],
1438
- serializer: serializer$2
1569
+ serializer: serializer$1
1439
1570
  };
1440
1571
 
1441
1572
  /*
@@ -1466,7 +1597,7 @@ class ValidationsImpl {
1466
1597
  }
1467
1598
  }
1468
1599
  // Operation Specifications
1469
- const serializer$3 = coreClient.createSerializer(Mappers, /* isXml */ false);
1600
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1470
1601
  const validateOrganizationOperationSpec = {
1471
1602
  path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Confluent/validations/{organizationName}/orgvalidate",
1472
1603
  httpMethod: "POST",
@@ -1488,7 +1619,7 @@ const validateOrganizationOperationSpec = {
1488
1619
  ],
1489
1620
  headerParameters: [accept, contentType],
1490
1621
  mediaType: "json",
1491
- serializer: serializer$3
1622
+ serializer
1492
1623
  };
1493
1624
 
1494
1625
  /*
@@ -1498,7 +1629,7 @@ const validateOrganizationOperationSpec = {
1498
1629
  * Code generated by Microsoft (R) AutoRest Code Generator.
1499
1630
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1500
1631
  */
1501
- class ConfluentManagementClient extends coreClient.ServiceClient {
1632
+ class ConfluentManagementClient extends coreClient__namespace.ServiceClient {
1502
1633
  /**
1503
1634
  * Initializes a new instance of the ConfluentManagementClient class.
1504
1635
  * @param credentials Subscription credentials which uniquely identify client subscription.
@@ -1506,6 +1637,7 @@ class ConfluentManagementClient extends coreClient.ServiceClient {
1506
1637
  * @param options The parameter options
1507
1638
  */
1508
1639
  constructor(credentials, subscriptionId, options) {
1640
+ var _a, _b, _c;
1509
1641
  if (credentials === undefined) {
1510
1642
  throw new Error("'credentials' cannot be null");
1511
1643
  }
@@ -1520,17 +1652,35 @@ class ConfluentManagementClient extends coreClient.ServiceClient {
1520
1652
  requestContentType: "application/json; charset=utf-8",
1521
1653
  credential: credentials
1522
1654
  };
1523
- const packageDetails = `azsdk-js-arm-confluent/3.0.0-beta.1`;
1655
+ const packageDetails = `azsdk-js-arm-confluent/3.0.0-beta.3`;
1524
1656
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1525
1657
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1526
1658
  : `${packageDetails}`;
1527
- if (!options.credentialScopes) {
1528
- options.credentialScopes = ["https://management.azure.com/.default"];
1529
- }
1530
1659
  const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1531
1660
  userAgentPrefix
1532
- }, baseUri: options.endpoint || "https://management.azure.com" });
1661
+ }, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1533
1662
  super(optionsWithDefaults);
1663
+ let bearerTokenAuthenticationPolicyFound = false;
1664
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1665
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1666
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1667
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1668
+ }
1669
+ if (!options ||
1670
+ !options.pipeline ||
1671
+ options.pipeline.getOrderedPolicies().length == 0 ||
1672
+ !bearerTokenAuthenticationPolicyFound) {
1673
+ this.pipeline.removePolicy({
1674
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1675
+ });
1676
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1677
+ credential: credentials,
1678
+ scopes: (_c = optionsWithDefaults.credentialScopes) !== null && _c !== void 0 ? _c : `${optionsWithDefaults.endpoint}/.default`,
1679
+ challengeCallbacks: {
1680
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1681
+ }
1682
+ }));
1683
+ }
1534
1684
  // Parameter assignments
1535
1685
  this.subscriptionId = subscriptionId;
1536
1686
  // Assigning values to Constant parameters
@@ -1540,8 +1690,37 @@ class ConfluentManagementClient extends coreClient.ServiceClient {
1540
1690
  this.organizationOperations = new OrganizationOperationsImpl(this);
1541
1691
  this.organization = new OrganizationImpl(this);
1542
1692
  this.validations = new ValidationsImpl(this);
1693
+ this.addCustomApiVersionPolicy(options.apiVersion);
1694
+ }
1695
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
1696
+ addCustomApiVersionPolicy(apiVersion) {
1697
+ if (!apiVersion) {
1698
+ return;
1699
+ }
1700
+ const apiVersionPolicy = {
1701
+ name: "CustomApiVersionPolicy",
1702
+ sendRequest(request, next) {
1703
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1704
+ const param = request.url.split("?");
1705
+ if (param.length > 1) {
1706
+ const newParams = param[1].split("&").map((item) => {
1707
+ if (item.indexOf("api-version") > -1) {
1708
+ return "api-version=" + apiVersion;
1709
+ }
1710
+ else {
1711
+ return item;
1712
+ }
1713
+ });
1714
+ request.url = param[0] + "?" + newParams.join("&");
1715
+ }
1716
+ return next(request);
1717
+ });
1718
+ }
1719
+ };
1720
+ this.pipeline.addPolicy(apiVersionPolicy);
1543
1721
  }
1544
1722
  }
1545
1723
 
1546
1724
  exports.ConfluentManagementClient = ConfluentManagementClient;
1725
+ exports.getContinuationToken = getContinuationToken;
1547
1726
  //# sourceMappingURL=index.js.map