@azure/arm-relay 3.1.0 → 3.1.1-alpha.20230201.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/LICENSE +1 -1
  3. package/README.md +1 -1
  4. package/dist/index.js +197 -82
  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/hybridConnectionsCreateOrUpdateAuthorizationRuleSample.js +11 -3
  9. package/dist-esm/samples-dev/hybridConnectionsCreateOrUpdateAuthorizationRuleSample.js.map +1 -1
  10. package/dist-esm/samples-dev/hybridConnectionsCreateOrUpdateSample.js +11 -3
  11. package/dist-esm/samples-dev/hybridConnectionsCreateOrUpdateSample.js.map +1 -1
  12. package/dist-esm/samples-dev/hybridConnectionsDeleteAuthorizationRuleSample.js +11 -3
  13. package/dist-esm/samples-dev/hybridConnectionsDeleteAuthorizationRuleSample.js.map +1 -1
  14. package/dist-esm/samples-dev/hybridConnectionsDeleteSample.js +11 -3
  15. package/dist-esm/samples-dev/hybridConnectionsDeleteSample.js.map +1 -1
  16. package/dist-esm/samples-dev/hybridConnectionsGetAuthorizationRuleSample.js +11 -3
  17. package/dist-esm/samples-dev/hybridConnectionsGetAuthorizationRuleSample.js.map +1 -1
  18. package/dist-esm/samples-dev/hybridConnectionsGetSample.js +11 -3
  19. package/dist-esm/samples-dev/hybridConnectionsGetSample.js.map +1 -1
  20. package/dist-esm/samples-dev/hybridConnectionsListAuthorizationRulesSample.js +11 -3
  21. package/dist-esm/samples-dev/hybridConnectionsListAuthorizationRulesSample.js.map +1 -1
  22. package/dist-esm/samples-dev/hybridConnectionsListByNamespaceSample.js +11 -3
  23. package/dist-esm/samples-dev/hybridConnectionsListByNamespaceSample.js.map +1 -1
  24. package/dist-esm/samples-dev/hybridConnectionsListKeysSample.js +11 -3
  25. package/dist-esm/samples-dev/hybridConnectionsListKeysSample.js.map +1 -1
  26. package/dist-esm/samples-dev/hybridConnectionsRegenerateKeysSample.js +11 -3
  27. package/dist-esm/samples-dev/hybridConnectionsRegenerateKeysSample.js.map +1 -1
  28. package/dist-esm/samples-dev/namespacesCheckNameAvailabilitySample.js +10 -2
  29. package/dist-esm/samples-dev/namespacesCheckNameAvailabilitySample.js.map +1 -1
  30. package/dist-esm/samples-dev/namespacesCreateOrUpdateAuthorizationRuleSample.js +11 -3
  31. package/dist-esm/samples-dev/namespacesCreateOrUpdateAuthorizationRuleSample.js.map +1 -1
  32. package/dist-esm/samples-dev/namespacesCreateOrUpdateSample.js +11 -3
  33. package/dist-esm/samples-dev/namespacesCreateOrUpdateSample.js.map +1 -1
  34. package/dist-esm/samples-dev/namespacesDeleteAuthorizationRuleSample.js +11 -3
  35. package/dist-esm/samples-dev/namespacesDeleteAuthorizationRuleSample.js.map +1 -1
  36. package/dist-esm/samples-dev/namespacesDeleteSample.js +11 -3
  37. package/dist-esm/samples-dev/namespacesDeleteSample.js.map +1 -1
  38. package/dist-esm/samples-dev/namespacesGetAuthorizationRuleSample.js +11 -3
  39. package/dist-esm/samples-dev/namespacesGetAuthorizationRuleSample.js.map +1 -1
  40. package/dist-esm/samples-dev/namespacesGetSample.js +11 -3
  41. package/dist-esm/samples-dev/namespacesGetSample.js.map +1 -1
  42. package/dist-esm/samples-dev/namespacesListAuthorizationRulesSample.js +11 -3
  43. package/dist-esm/samples-dev/namespacesListAuthorizationRulesSample.js.map +1 -1
  44. package/dist-esm/samples-dev/namespacesListByResourceGroupSample.js +11 -3
  45. package/dist-esm/samples-dev/namespacesListByResourceGroupSample.js.map +1 -1
  46. package/dist-esm/samples-dev/namespacesListKeysSample.js +11 -3
  47. package/dist-esm/samples-dev/namespacesListKeysSample.js.map +1 -1
  48. package/dist-esm/samples-dev/namespacesListSample.js +10 -2
  49. package/dist-esm/samples-dev/namespacesListSample.js.map +1 -1
  50. package/dist-esm/samples-dev/namespacesRegenerateKeysSample.js +11 -3
  51. package/dist-esm/samples-dev/namespacesRegenerateKeysSample.js.map +1 -1
  52. package/dist-esm/samples-dev/namespacesUpdateSample.js +11 -3
  53. package/dist-esm/samples-dev/namespacesUpdateSample.js.map +1 -1
  54. package/dist-esm/samples-dev/operationsListSample.js +10 -2
  55. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  56. package/dist-esm/samples-dev/wcfRelaysCreateOrUpdateAuthorizationRuleSample.js +11 -3
  57. package/dist-esm/samples-dev/wcfRelaysCreateOrUpdateAuthorizationRuleSample.js.map +1 -1
  58. package/dist-esm/samples-dev/wcfRelaysCreateOrUpdateSample.js +11 -3
  59. package/dist-esm/samples-dev/wcfRelaysCreateOrUpdateSample.js.map +1 -1
  60. package/dist-esm/samples-dev/wcfRelaysDeleteAuthorizationRuleSample.js +11 -3
  61. package/dist-esm/samples-dev/wcfRelaysDeleteAuthorizationRuleSample.js.map +1 -1
  62. package/dist-esm/samples-dev/wcfRelaysDeleteSample.js +11 -3
  63. package/dist-esm/samples-dev/wcfRelaysDeleteSample.js.map +1 -1
  64. package/dist-esm/samples-dev/wcfRelaysGetAuthorizationRuleSample.js +11 -3
  65. package/dist-esm/samples-dev/wcfRelaysGetAuthorizationRuleSample.js.map +1 -1
  66. package/dist-esm/samples-dev/wcfRelaysGetSample.js +11 -3
  67. package/dist-esm/samples-dev/wcfRelaysGetSample.js.map +1 -1
  68. package/dist-esm/samples-dev/wcfRelaysListAuthorizationRulesSample.js +11 -3
  69. package/dist-esm/samples-dev/wcfRelaysListAuthorizationRulesSample.js.map +1 -1
  70. package/dist-esm/samples-dev/wcfRelaysListByNamespaceSample.js +11 -3
  71. package/dist-esm/samples-dev/wcfRelaysListByNamespaceSample.js.map +1 -1
  72. package/dist-esm/samples-dev/wcfRelaysListKeysSample.js +11 -3
  73. package/dist-esm/samples-dev/wcfRelaysListKeysSample.js.map +1 -1
  74. package/dist-esm/samples-dev/wcfRelaysRegenerateKeysSample.js +11 -3
  75. package/dist-esm/samples-dev/wcfRelaysRegenerateKeysSample.js.map +1 -1
  76. package/dist-esm/src/index.d.ts +1 -0
  77. package/dist-esm/src/index.d.ts.map +1 -1
  78. package/dist-esm/src/index.js +1 -0
  79. package/dist-esm/src/index.js.map +1 -1
  80. package/dist-esm/src/operations/hybridConnections.d.ts.map +1 -1
  81. package/dist-esm/src/operations/hybridConnections.js +37 -16
  82. package/dist-esm/src/operations/hybridConnections.js.map +1 -1
  83. package/dist-esm/src/operations/namespaces.d.ts.map +1 -1
  84. package/dist-esm/src/operations/namespaces.js +55 -24
  85. package/dist-esm/src/operations/namespaces.js.map +1 -1
  86. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  87. package/dist-esm/src/operations/operations.js +19 -8
  88. package/dist-esm/src/operations/operations.js.map +1 -1
  89. package/dist-esm/src/operations/wCFRelays.d.ts.map +1 -1
  90. package/dist-esm/src/operations/wCFRelays.js +37 -16
  91. package/dist-esm/src/operations/wCFRelays.js.map +1 -1
  92. package/dist-esm/src/pagingHelper.d.ts +13 -0
  93. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  94. package/dist-esm/src/pagingHelper.js +32 -0
  95. package/dist-esm/src/pagingHelper.js.map +1 -0
  96. package/dist-esm/src/relayAPI.d.ts.map +1 -1
  97. package/dist-esm/src/relayAPI.js +20 -18
  98. package/dist-esm/src/relayAPI.js.map +1 -1
  99. package/package.json +10 -8
  100. package/review/arm-relay.api.md +3 -0
  101. package/src/index.ts +1 -0
  102. package/src/operations/hybridConnections.ts +53 -28
  103. package/src/operations/namespaces.ts +71 -32
  104. package/src/operations/operations.ts +21 -9
  105. package/src/operations/wCFRelays.ts +53 -28
  106. package/src/pagingHelper.ts +39 -0
  107. package/src/relayAPI.ts +26 -20
  108. package/types/arm-relay.d.ts +9 -0
  109. package/types/tsdoc-metadata.json +1 -1
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Namespaces } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,16 +19,17 @@ import {
18
19
  RelayNamespace,
19
20
  NamespacesListNextOptionalParams,
20
21
  NamespacesListOptionalParams,
22
+ NamespacesListResponse,
21
23
  NamespacesListByResourceGroupNextOptionalParams,
22
24
  NamespacesListByResourceGroupOptionalParams,
25
+ NamespacesListByResourceGroupResponse,
23
26
  AuthorizationRule,
24
27
  NamespacesListAuthorizationRulesNextOptionalParams,
25
28
  NamespacesListAuthorizationRulesOptionalParams,
29
+ NamespacesListAuthorizationRulesResponse,
26
30
  CheckNameAvailability,
27
31
  NamespacesCheckNameAvailabilityOptionalParams,
28
32
  NamespacesCheckNameAvailabilityResponse,
29
- NamespacesListResponse,
30
- NamespacesListByResourceGroupResponse,
31
33
  NamespacesCreateOrUpdateOptionalParams,
32
34
  NamespacesCreateOrUpdateResponse,
33
35
  NamespacesDeleteOptionalParams,
@@ -36,7 +38,6 @@ import {
36
38
  RelayUpdateParameters,
37
39
  NamespacesUpdateOptionalParams,
38
40
  NamespacesUpdateResponse,
39
- NamespacesListAuthorizationRulesResponse,
40
41
  NamespacesCreateOrUpdateAuthorizationRuleOptionalParams,
41
42
  NamespacesCreateOrUpdateAuthorizationRuleResponse,
42
43
  NamespacesDeleteAuthorizationRuleOptionalParams,
@@ -80,22 +81,34 @@ export class NamespacesImpl implements Namespaces {
80
81
  [Symbol.asyncIterator]() {
81
82
  return this;
82
83
  },
83
- byPage: () => {
84
- return this.listPagingPage(options);
84
+ byPage: (settings?: PageSettings) => {
85
+ if (settings?.maxPageSize) {
86
+ throw new Error("maxPageSize is not supported by this operation.");
87
+ }
88
+ return this.listPagingPage(options, settings);
85
89
  }
86
90
  };
87
91
  }
88
92
 
89
93
  private async *listPagingPage(
90
- options?: NamespacesListOptionalParams
94
+ options?: NamespacesListOptionalParams,
95
+ settings?: PageSettings
91
96
  ): AsyncIterableIterator<RelayNamespace[]> {
92
- let result = await this._list(options);
93
- yield result.value || [];
94
- let continuationToken = result.nextLink;
97
+ let result: NamespacesListResponse;
98
+ let continuationToken = settings?.continuationToken;
99
+ if (!continuationToken) {
100
+ result = await this._list(options);
101
+ let page = result.value || [];
102
+ continuationToken = result.nextLink;
103
+ setContinuationToken(page, continuationToken);
104
+ yield page;
105
+ }
95
106
  while (continuationToken) {
96
107
  result = await this._listNext(continuationToken, options);
97
108
  continuationToken = result.nextLink;
98
- yield result.value || [];
109
+ let page = result.value || [];
110
+ setContinuationToken(page, continuationToken);
111
+ yield page;
99
112
  }
100
113
  }
101
114
 
@@ -124,19 +137,33 @@ export class NamespacesImpl implements Namespaces {
124
137
  [Symbol.asyncIterator]() {
125
138
  return this;
126
139
  },
127
- byPage: () => {
128
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
140
+ byPage: (settings?: PageSettings) => {
141
+ if (settings?.maxPageSize) {
142
+ throw new Error("maxPageSize is not supported by this operation.");
143
+ }
144
+ return this.listByResourceGroupPagingPage(
145
+ resourceGroupName,
146
+ options,
147
+ settings
148
+ );
129
149
  }
130
150
  };
131
151
  }
132
152
 
133
153
  private async *listByResourceGroupPagingPage(
134
154
  resourceGroupName: string,
135
- options?: NamespacesListByResourceGroupOptionalParams
155
+ options?: NamespacesListByResourceGroupOptionalParams,
156
+ settings?: PageSettings
136
157
  ): AsyncIterableIterator<RelayNamespace[]> {
137
- let result = await this._listByResourceGroup(resourceGroupName, options);
138
- yield result.value || [];
139
- let continuationToken = result.nextLink;
158
+ let result: NamespacesListByResourceGroupResponse;
159
+ let continuationToken = settings?.continuationToken;
160
+ if (!continuationToken) {
161
+ result = await this._listByResourceGroup(resourceGroupName, options);
162
+ let page = result.value || [];
163
+ continuationToken = result.nextLink;
164
+ setContinuationToken(page, continuationToken);
165
+ yield page;
166
+ }
140
167
  while (continuationToken) {
141
168
  result = await this._listByResourceGroupNext(
142
169
  resourceGroupName,
@@ -144,7 +171,9 @@ export class NamespacesImpl implements Namespaces {
144
171
  options
145
172
  );
146
173
  continuationToken = result.nextLink;
147
- yield result.value || [];
174
+ let page = result.value || [];
175
+ setContinuationToken(page, continuationToken);
176
+ yield page;
148
177
  }
149
178
  }
150
179
 
@@ -183,11 +212,15 @@ export class NamespacesImpl implements Namespaces {
183
212
  [Symbol.asyncIterator]() {
184
213
  return this;
185
214
  },
186
- byPage: () => {
215
+ byPage: (settings?: PageSettings) => {
216
+ if (settings?.maxPageSize) {
217
+ throw new Error("maxPageSize is not supported by this operation.");
218
+ }
187
219
  return this.listAuthorizationRulesPagingPage(
188
220
  resourceGroupName,
189
221
  namespaceName,
190
- options
222
+ options,
223
+ settings
191
224
  );
192
225
  }
193
226
  };
@@ -196,15 +229,22 @@ export class NamespacesImpl implements Namespaces {
196
229
  private async *listAuthorizationRulesPagingPage(
197
230
  resourceGroupName: string,
198
231
  namespaceName: string,
199
- options?: NamespacesListAuthorizationRulesOptionalParams
232
+ options?: NamespacesListAuthorizationRulesOptionalParams,
233
+ settings?: PageSettings
200
234
  ): AsyncIterableIterator<AuthorizationRule[]> {
201
- let result = await this._listAuthorizationRules(
202
- resourceGroupName,
203
- namespaceName,
204
- options
205
- );
206
- yield result.value || [];
207
- let continuationToken = result.nextLink;
235
+ let result: NamespacesListAuthorizationRulesResponse;
236
+ let continuationToken = settings?.continuationToken;
237
+ if (!continuationToken) {
238
+ result = await this._listAuthorizationRules(
239
+ resourceGroupName,
240
+ namespaceName,
241
+ options
242
+ );
243
+ let page = result.value || [];
244
+ continuationToken = result.nextLink;
245
+ setContinuationToken(page, continuationToken);
246
+ yield page;
247
+ }
208
248
  while (continuationToken) {
209
249
  result = await this._listAuthorizationRulesNext(
210
250
  resourceGroupName,
@@ -213,7 +253,9 @@ export class NamespacesImpl implements Namespaces {
213
253
  options
214
254
  );
215
255
  continuationToken = result.nextLink;
216
- yield result.value || [];
256
+ let page = result.value || [];
257
+ setContinuationToken(page, continuationToken);
258
+ yield page;
217
259
  }
218
260
  }
219
261
 
@@ -978,7 +1020,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
978
1020
  bodyMapper: Mappers.ErrorResponse
979
1021
  }
980
1022
  },
981
- queryParameters: [Parameters.apiVersion],
982
1023
  urlParameters: [
983
1024
  Parameters.$host,
984
1025
  Parameters.nextLink,
@@ -998,7 +1039,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
998
1039
  bodyMapper: Mappers.ErrorResponse
999
1040
  }
1000
1041
  },
1001
- queryParameters: [Parameters.apiVersion],
1002
1042
  urlParameters: [
1003
1043
  Parameters.$host,
1004
1044
  Parameters.nextLink,
@@ -1019,7 +1059,6 @@ const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = {
1019
1059
  bodyMapper: Mappers.ErrorResponse
1020
1060
  }
1021
1061
  },
1022
- queryParameters: [Parameters.apiVersion],
1023
1062
  urlParameters: [
1024
1063
  Parameters.$host,
1025
1064
  Parameters.nextLink,
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Operations } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -48,22 +49,34 @@ export class OperationsImpl implements Operations {
48
49
  [Symbol.asyncIterator]() {
49
50
  return this;
50
51
  },
51
- byPage: () => {
52
- return this.listPagingPage(options);
52
+ byPage: (settings?: PageSettings) => {
53
+ if (settings?.maxPageSize) {
54
+ throw new Error("maxPageSize is not supported by this operation.");
55
+ }
56
+ return this.listPagingPage(options, settings);
53
57
  }
54
58
  };
55
59
  }
56
60
 
57
61
  private async *listPagingPage(
58
- options?: OperationsListOptionalParams
62
+ options?: OperationsListOptionalParams,
63
+ settings?: PageSettings
59
64
  ): AsyncIterableIterator<Operation[]> {
60
- let result = await this._list(options);
61
- yield result.value || [];
62
- let continuationToken = result.nextLink;
65
+ let result: OperationsListResponse;
66
+ let continuationToken = settings?.continuationToken;
67
+ if (!continuationToken) {
68
+ result = await this._list(options);
69
+ let page = result.value || [];
70
+ continuationToken = result.nextLink;
71
+ setContinuationToken(page, continuationToken);
72
+ yield page;
73
+ }
63
74
  while (continuationToken) {
64
75
  result = await this._listNext(continuationToken, options);
65
76
  continuationToken = result.nextLink;
66
- yield result.value || [];
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
67
80
  }
68
81
  }
69
82
 
@@ -130,7 +143,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
130
143
  bodyMapper: Mappers.ErrorResponse
131
144
  }
132
145
  },
133
- queryParameters: [Parameters.apiVersion],
134
146
  urlParameters: [Parameters.$host, Parameters.nextLink],
135
147
  headerParameters: [Parameters.accept],
136
148
  serializer
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { WCFRelays } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -16,16 +17,16 @@ import {
16
17
  WcfRelay,
17
18
  WCFRelaysListByNamespaceNextOptionalParams,
18
19
  WCFRelaysListByNamespaceOptionalParams,
20
+ WCFRelaysListByNamespaceResponse,
19
21
  AuthorizationRule,
20
22
  WCFRelaysListAuthorizationRulesNextOptionalParams,
21
23
  WCFRelaysListAuthorizationRulesOptionalParams,
22
- WCFRelaysListByNamespaceResponse,
24
+ WCFRelaysListAuthorizationRulesResponse,
23
25
  WCFRelaysCreateOrUpdateOptionalParams,
24
26
  WCFRelaysCreateOrUpdateResponse,
25
27
  WCFRelaysDeleteOptionalParams,
26
28
  WCFRelaysGetOptionalParams,
27
29
  WCFRelaysGetResponse,
28
- WCFRelaysListAuthorizationRulesResponse,
29
30
  WCFRelaysCreateOrUpdateAuthorizationRuleOptionalParams,
30
31
  WCFRelaysCreateOrUpdateAuthorizationRuleResponse,
31
32
  WCFRelaysDeleteAuthorizationRuleOptionalParams,
@@ -76,11 +77,15 @@ export class WCFRelaysImpl implements WCFRelays {
76
77
  [Symbol.asyncIterator]() {
77
78
  return this;
78
79
  },
79
- byPage: () => {
80
+ byPage: (settings?: PageSettings) => {
81
+ if (settings?.maxPageSize) {
82
+ throw new Error("maxPageSize is not supported by this operation.");
83
+ }
80
84
  return this.listByNamespacePagingPage(
81
85
  resourceGroupName,
82
86
  namespaceName,
83
- options
87
+ options,
88
+ settings
84
89
  );
85
90
  }
86
91
  };
@@ -89,15 +94,22 @@ export class WCFRelaysImpl implements WCFRelays {
89
94
  private async *listByNamespacePagingPage(
90
95
  resourceGroupName: string,
91
96
  namespaceName: string,
92
- options?: WCFRelaysListByNamespaceOptionalParams
97
+ options?: WCFRelaysListByNamespaceOptionalParams,
98
+ settings?: PageSettings
93
99
  ): AsyncIterableIterator<WcfRelay[]> {
94
- let result = await this._listByNamespace(
95
- resourceGroupName,
96
- namespaceName,
97
- options
98
- );
99
- yield result.value || [];
100
- let continuationToken = result.nextLink;
100
+ let result: WCFRelaysListByNamespaceResponse;
101
+ let continuationToken = settings?.continuationToken;
102
+ if (!continuationToken) {
103
+ result = await this._listByNamespace(
104
+ resourceGroupName,
105
+ namespaceName,
106
+ options
107
+ );
108
+ let page = result.value || [];
109
+ continuationToken = result.nextLink;
110
+ setContinuationToken(page, continuationToken);
111
+ yield page;
112
+ }
101
113
  while (continuationToken) {
102
114
  result = await this._listByNamespaceNext(
103
115
  resourceGroupName,
@@ -106,7 +118,9 @@ export class WCFRelaysImpl implements WCFRelays {
106
118
  options
107
119
  );
108
120
  continuationToken = result.nextLink;
109
- yield result.value || [];
121
+ let page = result.value || [];
122
+ setContinuationToken(page, continuationToken);
123
+ yield page;
110
124
  }
111
125
  }
112
126
 
@@ -150,12 +164,16 @@ export class WCFRelaysImpl implements WCFRelays {
150
164
  [Symbol.asyncIterator]() {
151
165
  return this;
152
166
  },
153
- byPage: () => {
167
+ byPage: (settings?: PageSettings) => {
168
+ if (settings?.maxPageSize) {
169
+ throw new Error("maxPageSize is not supported by this operation.");
170
+ }
154
171
  return this.listAuthorizationRulesPagingPage(
155
172
  resourceGroupName,
156
173
  namespaceName,
157
174
  relayName,
158
- options
175
+ options,
176
+ settings
159
177
  );
160
178
  }
161
179
  };
@@ -165,16 +183,23 @@ export class WCFRelaysImpl implements WCFRelays {
165
183
  resourceGroupName: string,
166
184
  namespaceName: string,
167
185
  relayName: string,
168
- options?: WCFRelaysListAuthorizationRulesOptionalParams
186
+ options?: WCFRelaysListAuthorizationRulesOptionalParams,
187
+ settings?: PageSettings
169
188
  ): AsyncIterableIterator<AuthorizationRule[]> {
170
- let result = await this._listAuthorizationRules(
171
- resourceGroupName,
172
- namespaceName,
173
- relayName,
174
- options
175
- );
176
- yield result.value || [];
177
- let continuationToken = result.nextLink;
189
+ let result: WCFRelaysListAuthorizationRulesResponse;
190
+ let continuationToken = settings?.continuationToken;
191
+ if (!continuationToken) {
192
+ result = await this._listAuthorizationRules(
193
+ resourceGroupName,
194
+ namespaceName,
195
+ relayName,
196
+ options
197
+ );
198
+ let page = result.value || [];
199
+ continuationToken = result.nextLink;
200
+ setContinuationToken(page, continuationToken);
201
+ yield page;
202
+ }
178
203
  while (continuationToken) {
179
204
  result = await this._listAuthorizationRulesNext(
180
205
  resourceGroupName,
@@ -184,7 +209,9 @@ export class WCFRelaysImpl implements WCFRelays {
184
209
  options
185
210
  );
186
211
  continuationToken = result.nextLink;
187
- yield result.value || [];
212
+ let page = result.value || [];
213
+ setContinuationToken(page, continuationToken);
214
+ yield page;
188
215
  }
189
216
  }
190
217
 
@@ -730,7 +757,6 @@ const listByNamespaceNextOperationSpec: coreClient.OperationSpec = {
730
757
  bodyMapper: Mappers.ErrorResponse
731
758
  }
732
759
  },
733
- queryParameters: [Parameters.apiVersion],
734
760
  urlParameters: [
735
761
  Parameters.$host,
736
762
  Parameters.nextLink,
@@ -749,7 +775,6 @@ const listAuthorizationRulesNextOperationSpec: coreClient.OperationSpec = {
749
775
  bodyMapper: Mappers.AuthorizationRuleListResult
750
776
  }
751
777
  },
752
- queryParameters: [Parameters.apiVersion],
753
778
  urlParameters: [
754
779
  Parameters.$host,
755
780
  Parameters.nextLink,
@@ -0,0 +1,39 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ export interface PageInfo {
10
+ continuationToken?: string;
11
+ }
12
+
13
+ const pageMap = new WeakMap<object, PageInfo>();
14
+
15
+ /**
16
+ * Given the last `.value` produced by the `byPage` iterator,
17
+ * returns a continuation token that can be used to begin paging from
18
+ * that point later.
19
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
20
+ * @returns The continuation token that can be passed into byPage() during future calls.
21
+ */
22
+ export function getContinuationToken(page: unknown): string | undefined {
23
+ if (typeof page !== "object" || page === null) {
24
+ return undefined;
25
+ }
26
+ return pageMap.get(page)?.continuationToken;
27
+ }
28
+
29
+ export function setContinuationToken(
30
+ page: unknown,
31
+ continuationToken: string | undefined
32
+ ): void {
33
+ if (typeof page !== "object" || page === null || !continuationToken) {
34
+ return;
35
+ }
36
+ const pageInfo = pageMap.get(page) ?? {};
37
+ pageInfo.continuationToken = continuationToken;
38
+ pageMap.set(page, pageInfo);
39
+ }
package/src/relayAPI.ts CHANGED
@@ -61,47 +61,53 @@ export class RelayAPI extends coreClient.ServiceClient {
61
61
  credential: credentials
62
62
  };
63
63
 
64
- const packageDetails = `azsdk-js-arm-relay/3.1.0`;
64
+ const packageDetails = `azsdk-js-arm-relay/3.1.1`;
65
65
  const userAgentPrefix =
66
66
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
67
67
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
68
68
  : `${packageDetails}`;
69
69
 
70
- if (!options.credentialScopes) {
71
- options.credentialScopes = ["https://management.azure.com/.default"];
72
- }
73
70
  const optionsWithDefaults = {
74
71
  ...defaults,
75
72
  ...options,
76
73
  userAgentOptions: {
77
74
  userAgentPrefix
78
75
  },
79
- baseUri:
76
+ endpoint:
80
77
  options.endpoint ?? options.baseUri ?? "https://management.azure.com"
81
78
  };
82
79
  super(optionsWithDefaults);
83
80
 
81
+ let bearerTokenAuthenticationPolicyFound: boolean = false;
84
82
  if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
85
83
  const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
86
- const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
84
+ bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
87
85
  (pipelinePolicy) =>
88
86
  pipelinePolicy.name ===
89
87
  coreRestPipeline.bearerTokenAuthenticationPolicyName
90
88
  );
91
- if (!bearerTokenAuthenticationPolicyFound) {
92
- this.pipeline.removePolicy({
93
- name: coreRestPipeline.bearerTokenAuthenticationPolicyName
94
- });
95
- this.pipeline.addPolicy(
96
- coreRestPipeline.bearerTokenAuthenticationPolicy({
97
- scopes: `${optionsWithDefaults.baseUri}/.default`,
98
- challengeCallbacks: {
99
- authorizeRequestOnChallenge:
100
- coreClient.authorizeRequestOnClaimChallenge
101
- }
102
- })
103
- );
104
- }
89
+ }
90
+ if (
91
+ !options ||
92
+ !options.pipeline ||
93
+ options.pipeline.getOrderedPolicies().length == 0 ||
94
+ !bearerTokenAuthenticationPolicyFound
95
+ ) {
96
+ this.pipeline.removePolicy({
97
+ name: coreRestPipeline.bearerTokenAuthenticationPolicyName
98
+ });
99
+ this.pipeline.addPolicy(
100
+ coreRestPipeline.bearerTokenAuthenticationPolicy({
101
+ credential: credentials,
102
+ scopes:
103
+ optionsWithDefaults.credentialScopes ??
104
+ `${optionsWithDefaults.endpoint}/.default`,
105
+ challengeCallbacks: {
106
+ authorizeRequestOnChallenge:
107
+ coreClient.authorizeRequestOnClaimChallenge
108
+ }
109
+ })
110
+ );
105
111
  }
106
112
  // Parameter assignments
107
113
  this.subscriptionId = subscriptionId;
@@ -62,6 +62,15 @@ export declare interface ErrorResponse {
62
62
  message?: string;
63
63
  }
64
64
 
65
+ /**
66
+ * Given the last `.value` produced by the `byPage` iterator,
67
+ * returns a continuation token that can be used to begin paging from
68
+ * that point later.
69
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
70
+ * @returns The continuation token that can be passed into byPage() during future calls.
71
+ */
72
+ export declare function getContinuationToken(page: unknown): string | undefined;
73
+
65
74
  /** Description of hybrid connection resource. */
66
75
  export declare interface HybridConnection extends Resource {
67
76
  /**
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.18.11"
8
+ "packageVersion": "7.34.2"
9
9
  }
10
10
  ]
11
11
  }