@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.
- package/CHANGELOG.md +10 -0
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/dist/index.js +197 -82
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsCreateOrUpdateAuthorizationRuleSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsCreateOrUpdateAuthorizationRuleSample.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsDeleteAuthorizationRuleSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsDeleteAuthorizationRuleSample.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsDeleteSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsGetAuthorizationRuleSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsGetAuthorizationRuleSample.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsGetSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsListAuthorizationRulesSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsListAuthorizationRulesSample.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsListByNamespaceSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsListByNamespaceSample.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsListKeysSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsListKeysSample.js.map +1 -1
- package/dist-esm/samples-dev/hybridConnectionsRegenerateKeysSample.js +11 -3
- package/dist-esm/samples-dev/hybridConnectionsRegenerateKeysSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesCheckNameAvailabilitySample.js +10 -2
- package/dist-esm/samples-dev/namespacesCheckNameAvailabilitySample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesCreateOrUpdateAuthorizationRuleSample.js +11 -3
- package/dist-esm/samples-dev/namespacesCreateOrUpdateAuthorizationRuleSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/namespacesCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesDeleteAuthorizationRuleSample.js +11 -3
- package/dist-esm/samples-dev/namespacesDeleteAuthorizationRuleSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesDeleteSample.js +11 -3
- package/dist-esm/samples-dev/namespacesDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesGetAuthorizationRuleSample.js +11 -3
- package/dist-esm/samples-dev/namespacesGetAuthorizationRuleSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesGetSample.js +11 -3
- package/dist-esm/samples-dev/namespacesGetSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesListAuthorizationRulesSample.js +11 -3
- package/dist-esm/samples-dev/namespacesListAuthorizationRulesSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesListByResourceGroupSample.js +11 -3
- package/dist-esm/samples-dev/namespacesListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesListKeysSample.js +11 -3
- package/dist-esm/samples-dev/namespacesListKeysSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesListSample.js +10 -2
- package/dist-esm/samples-dev/namespacesListSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesRegenerateKeysSample.js +11 -3
- package/dist-esm/samples-dev/namespacesRegenerateKeysSample.js.map +1 -1
- package/dist-esm/samples-dev/namespacesUpdateSample.js +11 -3
- package/dist-esm/samples-dev/namespacesUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +10 -2
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysCreateOrUpdateAuthorizationRuleSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysCreateOrUpdateAuthorizationRuleSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysCreateOrUpdateSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysDeleteAuthorizationRuleSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysDeleteAuthorizationRuleSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysDeleteSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysGetAuthorizationRuleSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysGetAuthorizationRuleSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysGetSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysGetSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysListAuthorizationRulesSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysListAuthorizationRulesSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysListByNamespaceSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysListByNamespaceSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysListKeysSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysListKeysSample.js.map +1 -1
- package/dist-esm/samples-dev/wcfRelaysRegenerateKeysSample.js +11 -3
- package/dist-esm/samples-dev/wcfRelaysRegenerateKeysSample.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/operations/hybridConnections.d.ts.map +1 -1
- package/dist-esm/src/operations/hybridConnections.js +37 -16
- package/dist-esm/src/operations/hybridConnections.js.map +1 -1
- package/dist-esm/src/operations/namespaces.d.ts.map +1 -1
- package/dist-esm/src/operations/namespaces.js +55 -24
- package/dist-esm/src/operations/namespaces.js.map +1 -1
- package/dist-esm/src/operations/operations.d.ts.map +1 -1
- package/dist-esm/src/operations/operations.js +19 -8
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operations/wCFRelays.d.ts.map +1 -1
- package/dist-esm/src/operations/wCFRelays.js +37 -16
- package/dist-esm/src/operations/wCFRelays.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/src/relayAPI.d.ts.map +1 -1
- package/dist-esm/src/relayAPI.js +20 -18
- package/dist-esm/src/relayAPI.js.map +1 -1
- package/package.json +10 -8
- package/review/arm-relay.api.md +3 -0
- package/src/index.ts +1 -0
- package/src/operations/hybridConnections.ts +53 -28
- package/src/operations/namespaces.ts +71 -32
- package/src/operations/operations.ts +21 -9
- package/src/operations/wCFRelays.ts +53 -28
- package/src/pagingHelper.ts +39 -0
- package/src/relayAPI.ts +26 -20
- package/types/arm-relay.d.ts +9 -0
- 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
|
-
|
|
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
|
|
93
|
-
|
|
94
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
138
|
-
|
|
139
|
-
|
|
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
|
-
|
|
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
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
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
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
84
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
87
85
|
(pipelinePolicy) =>
|
|
88
86
|
pipelinePolicy.name ===
|
|
89
87
|
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
90
88
|
);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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;
|
package/types/arm-relay.d.ts
CHANGED
|
@@ -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
|
/**
|