@azure-tools/communication-alpha-ids 1.0.0-alpha.20250805.1 → 1.0.0-alpha.20250901.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/dist/browser/alphaIdsClient.js +4 -11
- package/dist/browser/alphaIdsClient.js.map +1 -1
- package/dist/browser/generated/src/alphaIDsClient.js +3 -10
- package/dist/browser/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/browser/generated/src/operations/alphaIds.js +47 -30
- package/dist/browser/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/browser/generated/src/pagingHelper.js +4 -2
- package/dist/browser/generated/src/pagingHelper.js.map +1 -1
- package/dist/browser/utils/customPipelinePolicies.js +2 -1
- package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
- package/dist/commonjs/alphaIdsClient.js +4 -11
- package/dist/commonjs/alphaIdsClient.js.map +1 -1
- package/dist/commonjs/generated/src/alphaIDsClient.js +3 -10
- package/dist/commonjs/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/commonjs/generated/src/operations/alphaIds.js +46 -30
- package/dist/commonjs/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/commonjs/generated/src/pagingHelper.js +4 -2
- package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/customPipelinePolicies.js +2 -1
- package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
- package/dist/esm/alphaIdsClient.js +4 -11
- package/dist/esm/alphaIdsClient.js.map +1 -1
- package/dist/esm/generated/src/alphaIDsClient.js +3 -10
- package/dist/esm/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/esm/generated/src/operations/alphaIds.js +47 -30
- package/dist/esm/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/esm/generated/src/pagingHelper.js +4 -2
- package/dist/esm/generated/src/pagingHelper.js.map +1 -1
- package/dist/esm/utils/customPipelinePolicies.js +2 -1
- package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
- package/dist/react-native/alphaIdsClient.js +4 -11
- package/dist/react-native/alphaIdsClient.js.map +1 -1
- package/dist/react-native/generated/src/alphaIDsClient.js +3 -10
- package/dist/react-native/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/react-native/generated/src/operations/alphaIds.js +47 -30
- package/dist/react-native/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/react-native/generated/src/pagingHelper.js +4 -2
- package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
- package/dist/react-native/utils/customPipelinePolicies.js +2 -1
- package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
- package/package.json +2 -2
|
@@ -17,7 +17,6 @@ const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
|
|
|
17
17
|
/// <reference lib="esnext.asynciterable" />
|
|
18
18
|
/** Class containing AlphaIds operations. */
|
|
19
19
|
class AlphaIdsImpl {
|
|
20
|
-
client;
|
|
21
20
|
/**
|
|
22
21
|
* Initialize a new instance of the class AlphaIds class.
|
|
23
22
|
* @param client Reference to the service client
|
|
@@ -39,42 +38,59 @@ class AlphaIdsImpl {
|
|
|
39
38
|
return this;
|
|
40
39
|
},
|
|
41
40
|
byPage: (settings) => {
|
|
42
|
-
if (settings
|
|
41
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
43
42
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
44
43
|
}
|
|
45
44
|
return this.getAlphaIdsPagingPage(options, settings);
|
|
46
45
|
}
|
|
47
46
|
};
|
|
48
47
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
48
|
+
getAlphaIdsPagingPage(options, settings) {
|
|
49
|
+
return tslib_1.__asyncGenerator(this, arguments, function* getAlphaIdsPagingPage_1() {
|
|
50
|
+
let result;
|
|
51
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
52
|
+
if (!continuationToken) {
|
|
53
|
+
result = yield tslib_1.__await(this._getAlphaIds(options));
|
|
54
|
+
let page = result.alphaIds || [];
|
|
55
|
+
continuationToken = result.nextLink;
|
|
56
|
+
(0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
|
|
57
|
+
yield yield tslib_1.__await(page);
|
|
58
|
+
}
|
|
59
|
+
while (continuationToken) {
|
|
60
|
+
result = yield tslib_1.__await(this._getAlphaIdsNext(continuationToken, options));
|
|
61
|
+
continuationToken = result.nextLink;
|
|
62
|
+
let page = result.alphaIds || [];
|
|
63
|
+
(0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
|
|
64
|
+
yield yield tslib_1.__await(page);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
66
67
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
getAlphaIdsPagingAll(options) {
|
|
69
|
+
return tslib_1.__asyncGenerator(this, arguments, function* getAlphaIdsPagingAll_1() {
|
|
70
|
+
var _a, e_1, _b, _c;
|
|
71
|
+
try {
|
|
72
|
+
for (var _d = true, _e = tslib_1.__asyncValues(this.getAlphaIdsPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
73
|
+
_c = _f.value;
|
|
74
|
+
_d = false;
|
|
75
|
+
const page = _c;
|
|
76
|
+
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
80
|
+
finally {
|
|
81
|
+
try {
|
|
82
|
+
if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
|
|
83
|
+
}
|
|
84
|
+
finally { if (e_1) throw e_1.error; }
|
|
85
|
+
}
|
|
86
|
+
});
|
|
71
87
|
}
|
|
72
88
|
/**
|
|
73
89
|
* Gets the list of alpha ids for the current resource.
|
|
74
90
|
* @param options The options parameters.
|
|
75
91
|
*/
|
|
76
92
|
async _getAlphaIds(options) {
|
|
77
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options
|
|
93
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
78
94
|
return this.client.sendOperationRequest({ options }, getAlphaIdsOperationSpec);
|
|
79
95
|
});
|
|
80
96
|
}
|
|
@@ -83,7 +99,7 @@ class AlphaIdsImpl {
|
|
|
83
99
|
* @param options The options parameters.
|
|
84
100
|
*/
|
|
85
101
|
async getDynamicAlphaIdConfiguration(options) {
|
|
86
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options
|
|
102
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
87
103
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdConfigurationOperationSpec);
|
|
88
104
|
});
|
|
89
105
|
}
|
|
@@ -93,7 +109,7 @@ class AlphaIdsImpl {
|
|
|
93
109
|
* @param options The options parameters.
|
|
94
110
|
*/
|
|
95
111
|
async upsertDynamicAlphaIdConfiguration(enabled, options) {
|
|
96
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options
|
|
112
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
97
113
|
return this.client.sendOperationRequest({ enabled, options }, upsertDynamicAlphaIdConfigurationOperationSpec);
|
|
98
114
|
});
|
|
99
115
|
}
|
|
@@ -102,7 +118,7 @@ class AlphaIdsImpl {
|
|
|
102
118
|
* @param options The options parameters.
|
|
103
119
|
*/
|
|
104
120
|
async getDynamicAlphaIdCountries(options) {
|
|
105
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options
|
|
121
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
106
122
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdCountriesOperationSpec);
|
|
107
123
|
});
|
|
108
124
|
}
|
|
@@ -111,7 +127,7 @@ class AlphaIdsImpl {
|
|
|
111
127
|
* @param options The options parameters.
|
|
112
128
|
*/
|
|
113
129
|
async getPreRegisteredAlphaIdCountries(options) {
|
|
114
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options
|
|
130
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
115
131
|
return this.client.sendOperationRequest({ options }, getPreRegisteredAlphaIdCountriesOperationSpec);
|
|
116
132
|
});
|
|
117
133
|
}
|
|
@@ -121,7 +137,7 @@ class AlphaIdsImpl {
|
|
|
121
137
|
* @param options The options parameters.
|
|
122
138
|
*/
|
|
123
139
|
async _getAlphaIdsNext(nextLink, options) {
|
|
124
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options
|
|
140
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
125
141
|
return this.client.sendOperationRequest({ nextLink, options }, getAlphaIdsNextOperationSpec);
|
|
126
142
|
});
|
|
127
143
|
}
|
|
@@ -174,7 +190,7 @@ const upsertDynamicAlphaIdConfigurationOperationSpec = {
|
|
|
174
190
|
},
|
|
175
191
|
requestBody: {
|
|
176
192
|
parameterPath: { enabled: ["enabled"] },
|
|
177
|
-
mapper: {
|
|
193
|
+
mapper: Object.assign(Object.assign({}, Mappers.DynamicAlphaIdConfiguration), { required: true })
|
|
178
194
|
},
|
|
179
195
|
queryParameters: [Parameters.apiVersion],
|
|
180
196
|
urlParameters: [Parameters.endpoint],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaIds.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/alphaIds.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,8CAA8C;AAE9C,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAkBtD,4CAA4C;AAC5C,4CAA4C;AAC5C,MAAa,YAAY;IACN,MAAM,CAAiB;IAExC;;;OAGG;IACH,YAAY,MAAsB;QAChC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,YAAY,CACjB,OAA2C;QAE3C,MAAM,IAAI,GAAG,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,EAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,qBAAqB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,qBAAqB,CAClC,OAA2C,EAC3C,QAAuB;QAEvB,IAAI,MAAmC,CAAC;QACxC,IAAI,iBAAiB,GAAG,QAAQ,EAAE,iBAAiB,CAAC;QACpD,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,M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F,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gBAAgB;SACrC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { AlphaIds } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { AlphaIDsClient } from \"../alphaIDsClient.js\";\nimport {\n AlphaId,\n AlphaIdsGetAlphaIdsNextOptionalParams,\n AlphaIdsGetAlphaIdsOptionalParams,\n AlphaIdsGetAlphaIdsResponse,\n AlphaIdsGetDynamicAlphaIdConfigurationOptionalParams,\n AlphaIdsGetDynamicAlphaIdConfigurationResponse,\n AlphaIdsUpsertDynamicAlphaIdConfigurationOptionalParams,\n AlphaIdsUpsertDynamicAlphaIdConfigurationResponse,\n AlphaIdsGetDynamicAlphaIdCountriesOptionalParams,\n AlphaIdsGetDynamicAlphaIdCountriesResponse,\n AlphaIdsGetPreRegisteredAlphaIdCountriesOptionalParams,\n AlphaIdsGetPreRegisteredAlphaIdCountriesResponse,\n AlphaIdsGetAlphaIdsNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing AlphaIds operations. */\nexport class AlphaIdsImpl implements AlphaIds {\n private readonly client: AlphaIDsClient;\n\n /**\n * Initialize a new instance of the class AlphaIds class.\n * @param client Reference to the service client\n */\n constructor(client: AlphaIDsClient) {\n this.client = client;\n }\n\n /**\n * Gets the list of alpha ids for the current resource.\n * @param options The options parameters.\n */\n public listAlphaIds(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): PagedAsyncIterableIterator<AlphaId> {\n const iter = this.getAlphaIdsPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.getAlphaIdsPagingPage(options, settings);\n }\n };\n }\n\n private async *getAlphaIdsPagingPage(\n options?: AlphaIdsGetAlphaIdsOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<AlphaId[]> {\n let result: AlphaIdsGetAlphaIdsResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._getAlphaIds(options);\n let page = result.alphaIds || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._getAlphaIdsNext(continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.alphaIds || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *getAlphaIdsPagingAll(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): AsyncIterableIterator<AlphaId> {\n for await (const page of this.getAlphaIdsPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Gets the list of alpha ids for the current resource.\n * @param options The options parameters.\n */\n private async _getAlphaIds(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): Promise<AlphaIdsGetAlphaIdsResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient._getAlphaIds\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getAlphaIdsOperationSpec\n ) as Promise<AlphaIdsGetAlphaIdsResponse>;\n }\n );\n }\n\n /**\n * Get the Dynamic Alpha ID configuration that's applied for the current resource.\n * @param options The options parameters.\n */\n async getDynamicAlphaIdConfiguration(\n options?: AlphaIdsGetDynamicAlphaIdConfigurationOptionalParams\n ): Promise<AlphaIdsGetDynamicAlphaIdConfigurationResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getDynamicAlphaIdConfiguration\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getDynamicAlphaIdConfigurationOperationSpec\n ) as Promise<AlphaIdsGetDynamicAlphaIdConfigurationResponse>;\n }\n );\n }\n\n /**\n * Creates or updates Dynamic Alpha ID Configuration for the current resource.\n * @param enabled Indicates whether the use of Dynamic Alpha IDs is supported for a specific resource.\n * @param options The options parameters.\n */\n async upsertDynamicAlphaIdConfiguration(\n enabled: boolean,\n options?: AlphaIdsUpsertDynamicAlphaIdConfigurationOptionalParams\n ): Promise<AlphaIdsUpsertDynamicAlphaIdConfigurationResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.upsertDynamicAlphaIdConfiguration\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { enabled, options },\n upsertDynamicAlphaIdConfigurationOperationSpec\n ) as Promise<AlphaIdsUpsertDynamicAlphaIdConfigurationResponse>;\n }\n );\n }\n\n /**\n * Gets the list of countries that support Dynamic Alpha IDs.\n * @param options The options parameters.\n */\n async getDynamicAlphaIdCountries(\n options?: AlphaIdsGetDynamicAlphaIdCountriesOptionalParams\n ): Promise<AlphaIdsGetDynamicAlphaIdCountriesResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getDynamicAlphaIdCountries\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getDynamicAlphaIdCountriesOperationSpec\n ) as Promise<AlphaIdsGetDynamicAlphaIdCountriesResponse>;\n }\n );\n }\n\n /**\n * Gets the list of countries that support Pre-Registered Alpha IDs.\n * @param options The options parameters.\n */\n async getPreRegisteredAlphaIdCountries(\n options?: AlphaIdsGetPreRegisteredAlphaIdCountriesOptionalParams\n ): Promise<AlphaIdsGetPreRegisteredAlphaIdCountriesResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getPreRegisteredAlphaIdCountries\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getPreRegisteredAlphaIdCountriesOperationSpec\n ) as Promise<AlphaIdsGetPreRegisteredAlphaIdCountriesResponse>;\n }\n );\n }\n\n /**\n * GetAlphaIdsNext\n * @param nextLink The nextLink from the previous successful call to the GetAlphaIds method.\n * @param options The options parameters.\n */\n private async _getAlphaIdsNext(\n nextLink: string,\n options?: AlphaIdsGetAlphaIdsNextOptionalParams\n ): Promise<AlphaIdsGetAlphaIdsNextResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient._getAlphaIdsNext\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { nextLink, options },\n getAlphaIdsNextOperationSpec\n ) as Promise<AlphaIdsGetAlphaIdsNextResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getAlphaIdsOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcquiredAlphaIds\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDynamicAlphaIdConfigurationOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/configuration\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DynamicAlphaIdConfiguration\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst upsertDynamicAlphaIdConfigurationOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/configuration\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.DynamicAlphaIdConfiguration\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n requestBody: {\n parameterPath: { enabled: [\"enabled\"] },\n mapper: { ...Mappers.DynamicAlphaIdConfiguration, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getDynamicAlphaIdCountriesOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/countries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SupportedCountries\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPreRegisteredAlphaIdCountriesOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/pre-registered/countries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SupportedCountries\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAlphaIdsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcquiredAlphaIds\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
1
|
+
{"version":3,"file":"alphaIds.js","sourceRoot":"","sources":["../../../../../src/generated/src/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EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,gBAAgB;SACrC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,QAAQ,CAAC;IACzD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { tracingClient } from \"../tracing.js\";\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { AlphaIds } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { AlphaIDsClient } from \"../alphaIDsClient.js\";\nimport {\n AlphaId,\n AlphaIdsGetAlphaIdsNextOptionalParams,\n AlphaIdsGetAlphaIdsOptionalParams,\n AlphaIdsGetAlphaIdsResponse,\n AlphaIdsGetDynamicAlphaIdConfigurationOptionalParams,\n AlphaIdsGetDynamicAlphaIdConfigurationResponse,\n AlphaIdsUpsertDynamicAlphaIdConfigurationOptionalParams,\n AlphaIdsUpsertDynamicAlphaIdConfigurationResponse,\n AlphaIdsGetDynamicAlphaIdCountriesOptionalParams,\n AlphaIdsGetDynamicAlphaIdCountriesResponse,\n AlphaIdsGetPreRegisteredAlphaIdCountriesOptionalParams,\n AlphaIdsGetPreRegisteredAlphaIdCountriesResponse,\n AlphaIdsGetAlphaIdsNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing AlphaIds operations. */\nexport class AlphaIdsImpl implements AlphaIds {\n private readonly client: AlphaIDsClient;\n\n /**\n * Initialize a new instance of the class AlphaIds class.\n * @param client Reference to the service client\n */\n constructor(client: AlphaIDsClient) {\n this.client = client;\n }\n\n /**\n * Gets the list of alpha ids for the current resource.\n * @param options The options parameters.\n */\n public listAlphaIds(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): PagedAsyncIterableIterator<AlphaId> {\n const iter = this.getAlphaIdsPagingAll(options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.getAlphaIdsPagingPage(options, settings);\n }\n };\n }\n\n private async *getAlphaIdsPagingPage(\n options?: AlphaIdsGetAlphaIdsOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<AlphaId[]> {\n let result: AlphaIdsGetAlphaIdsResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._getAlphaIds(options);\n let page = result.alphaIds || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._getAlphaIdsNext(continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.alphaIds || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *getAlphaIdsPagingAll(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): AsyncIterableIterator<AlphaId> {\n for await (const page of this.getAlphaIdsPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Gets the list of alpha ids for the current resource.\n * @param options The options parameters.\n */\n private async _getAlphaIds(\n options?: AlphaIdsGetAlphaIdsOptionalParams\n ): Promise<AlphaIdsGetAlphaIdsResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient._getAlphaIds\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getAlphaIdsOperationSpec\n ) as Promise<AlphaIdsGetAlphaIdsResponse>;\n }\n );\n }\n\n /**\n * Get the Dynamic Alpha ID configuration that's applied for the current resource.\n * @param options The options parameters.\n */\n async getDynamicAlphaIdConfiguration(\n options?: AlphaIdsGetDynamicAlphaIdConfigurationOptionalParams\n ): Promise<AlphaIdsGetDynamicAlphaIdConfigurationResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getDynamicAlphaIdConfiguration\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getDynamicAlphaIdConfigurationOperationSpec\n ) as Promise<AlphaIdsGetDynamicAlphaIdConfigurationResponse>;\n }\n );\n }\n\n /**\n * Creates or updates Dynamic Alpha ID Configuration for the current resource.\n * @param enabled Indicates whether the use of Dynamic Alpha IDs is supported for a specific resource.\n * @param options The options parameters.\n */\n async upsertDynamicAlphaIdConfiguration(\n enabled: boolean,\n options?: AlphaIdsUpsertDynamicAlphaIdConfigurationOptionalParams\n ): Promise<AlphaIdsUpsertDynamicAlphaIdConfigurationResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.upsertDynamicAlphaIdConfiguration\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { enabled, options },\n upsertDynamicAlphaIdConfigurationOperationSpec\n ) as Promise<AlphaIdsUpsertDynamicAlphaIdConfigurationResponse>;\n }\n );\n }\n\n /**\n * Gets the list of countries that support Dynamic Alpha IDs.\n * @param options The options parameters.\n */\n async getDynamicAlphaIdCountries(\n options?: AlphaIdsGetDynamicAlphaIdCountriesOptionalParams\n ): Promise<AlphaIdsGetDynamicAlphaIdCountriesResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getDynamicAlphaIdCountries\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getDynamicAlphaIdCountriesOperationSpec\n ) as Promise<AlphaIdsGetDynamicAlphaIdCountriesResponse>;\n }\n );\n }\n\n /**\n * Gets the list of countries that support Pre-Registered Alpha IDs.\n * @param options The options parameters.\n */\n async getPreRegisteredAlphaIdCountries(\n options?: AlphaIdsGetPreRegisteredAlphaIdCountriesOptionalParams\n ): Promise<AlphaIdsGetPreRegisteredAlphaIdCountriesResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient.getPreRegisteredAlphaIdCountries\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { options },\n getPreRegisteredAlphaIdCountriesOperationSpec\n ) as Promise<AlphaIdsGetPreRegisteredAlphaIdCountriesResponse>;\n }\n );\n }\n\n /**\n * GetAlphaIdsNext\n * @param nextLink The nextLink from the previous successful call to the GetAlphaIds method.\n * @param options The options parameters.\n */\n private async _getAlphaIdsNext(\n nextLink: string,\n options?: AlphaIdsGetAlphaIdsNextOptionalParams\n ): Promise<AlphaIdsGetAlphaIdsNextResponse> {\n return tracingClient.withSpan(\n \"AlphaIDsClient._getAlphaIdsNext\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { nextLink, options },\n getAlphaIdsNextOperationSpec\n ) as Promise<AlphaIdsGetAlphaIdsNextResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getAlphaIdsOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcquiredAlphaIds\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.skip, Parameters.top, Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getDynamicAlphaIdConfigurationOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/configuration\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.DynamicAlphaIdConfiguration\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst upsertDynamicAlphaIdConfigurationOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/configuration\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.DynamicAlphaIdConfiguration\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n requestBody: {\n parameterPath: { enabled: [\"enabled\"] },\n mapper: { ...Mappers.DynamicAlphaIdConfiguration, required: true }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getDynamicAlphaIdCountriesOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/dynamic/countries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SupportedCountries\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getPreRegisteredAlphaIdCountriesOperationSpec: coreClient.OperationSpec = {\n path: \"/alphaIds/pre-registered/countries\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SupportedCountries\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getAlphaIdsNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcquiredAlphaIds\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n urlParameters: [Parameters.endpoint, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -18,16 +18,18 @@ const pageMap = new WeakMap();
|
|
|
18
18
|
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
19
19
|
*/
|
|
20
20
|
function getContinuationToken(page) {
|
|
21
|
+
var _a;
|
|
21
22
|
if (typeof page !== "object" || page === null) {
|
|
22
23
|
return undefined;
|
|
23
24
|
}
|
|
24
|
-
return pageMap.get(page)
|
|
25
|
+
return (_a = pageMap.get(page)) === null || _a === void 0 ? void 0 : _a.continuationToken;
|
|
25
26
|
}
|
|
26
27
|
function setContinuationToken(page, continuationToken) {
|
|
28
|
+
var _a;
|
|
27
29
|
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
30
|
-
const pageInfo = pageMap.get(page)
|
|
32
|
+
const pageInfo = (_a = pageMap.get(page)) !== null && _a !== void 0 ? _a : {};
|
|
31
33
|
pageInfo.continuationToken = continuationToken;
|
|
32
34
|
pageMap.set(page, pageInfo);
|
|
33
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../../../src/generated/src/pagingHelper.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAeH,oDAKC;AAED,oDAUC;AA1BD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,IAAa
|
|
1
|
+
{"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../../../src/generated/src/pagingHelper.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAeH,oDAKC;AAED,oDAUC;AA1BD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,IAAa;;IAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,0CAAE,iBAAiB,CAAC;AAC9C,CAAC;AAED,SAAgB,oBAAoB,CAClC,IAAa,EACb,iBAAqC;;IAErC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpE,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAG,MAAA,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport interface PageInfo {\n continuationToken?: string;\n}\n\nconst pageMap = new WeakMap<object, PageInfo>();\n\n/**\n * Given the last `.value` produced by the `byPage` iterator,\n * returns a continuation token that can be used to begin paging from\n * that point later.\n * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.\n * @returns The continuation token that can be passed into byPage() during future calls.\n */\nexport function getContinuationToken(page: unknown): string | undefined {\n if (typeof page !== \"object\" || page === null) {\n return undefined;\n }\n return pageMap.get(page)?.continuationToken;\n}\n\nexport function setContinuationToken(\n page: unknown,\n continuationToken: string | undefined\n): void {\n if (typeof page !== \"object\" || page === null || !continuationToken) {\n return;\n }\n const pageInfo = pageMap.get(page) ?? {};\n pageInfo.continuationToken = continuationToken;\n pageMap.set(page, pageInfo);\n}\n"]}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
-
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
-
{
|
|
4
|
-
"tsdocVersion": "0.12",
|
|
5
|
-
"toolPackages": [
|
|
6
|
-
{
|
|
7
|
-
"packageName": "@microsoft/api-extractor",
|
|
8
|
-
"packageVersion": "7.52.
|
|
9
|
-
}
|
|
10
|
-
]
|
|
11
|
-
}
|
|
1
|
+
// This file is read by tools that parse documentation comments conforming to the TSDoc standard.
|
|
2
|
+
// It should be published with your NPM package. It should not be tracked by Git.
|
|
3
|
+
{
|
|
4
|
+
"tsdocVersion": "0.12",
|
|
5
|
+
"toolPackages": [
|
|
6
|
+
{
|
|
7
|
+
"packageName": "@microsoft/api-extractor",
|
|
8
|
+
"packageVersion": "7.52.8"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -15,8 +15,9 @@ function createAlphaIDsPagingPolicy(host) {
|
|
|
15
15
|
return {
|
|
16
16
|
name: "alphaIDsPagingPolicy",
|
|
17
17
|
async sendRequest(request, next) {
|
|
18
|
+
var _a;
|
|
18
19
|
const response = await next(request);
|
|
19
|
-
let nextLink = response
|
|
20
|
+
let nextLink = (_a = response === null || response === void 0 ? void 0 : response.parsedBody) === null || _a === void 0 ? void 0 : _a.nextLink;
|
|
20
21
|
if (nextLink && !nextLink.startsWith(host)) {
|
|
21
22
|
nextLink = host.endsWith("/") ? nextLink.substring(1) : nextLink;
|
|
22
23
|
const absolutePath = `${host}${nextLink}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customPipelinePolicies.js","sourceRoot":"","sources":["../../../src/utils/customPipelinePolicies.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAkBlC,gEAgBC;AAxBD;;;;;;;GAOG;AACH,SAAgB,0BAA0B,CAAC,IAAY;IACrD,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB
|
|
1
|
+
{"version":3,"file":"customPipelinePolicies.js","sourceRoot":"","sources":["../../../src/utils/customPipelinePolicies.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAkBlC,gEAgBC;AAxBD;;;;;;;GAOG;AACH,SAAgB,0BAA0B,CAAC,IAAY;IACrD,OAAO;QACL,IAAI,EAAE,sBAAsB;QAC5B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;;YAC3D,MAAM,QAAQ,GAA0B,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5D,IAAI,QAAQ,GAAW,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,0CAAE,QAAQ,CAAC;YAEtD,IAAI,QAAQ,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;gBACjE,MAAM,YAAY,GAAG,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;gBAC1C,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG,YAAY,CAAC;YAC9C,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullOperationResponse } from \"@azure/core-client\";\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates a `PipelinePolicy` that converts relative URL values in the `nextLink` property to absolute URLs.\n *\n * This is necessary because the Core V2 library does not support paging with relative links at time of writing.\n *\n * @param host - The base URL of the resource.\n * @returns the `PipelinePolicy` that addresses the issue.\n */\nexport function createAlphaIDsPagingPolicy(host: string): PipelinePolicy {\n return {\n name: \"alphaIDsPagingPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const response: FullOperationResponse = await next(request);\n let nextLink: string = response?.parsedBody?.nextLink;\n\n if (nextLink && !nextLink.startsWith(host)) {\n nextLink = host.endsWith(\"/\") ? nextLink.substring(1) : nextLink;\n const absolutePath = `${host}${nextLink}`;\n response.parsedBody.nextLink = absolutePath;\n }\n\n return response;\n },\n };\n}\n"]}
|
|
@@ -7,23 +7,16 @@ import { tracingClient } from "./generated/src/tracing.js";
|
|
|
7
7
|
import { createAlphaIDsPagingPolicy } from "./utils/customPipelinePolicies.js";
|
|
8
8
|
const isAlphaIdsClientOptions = (options) => options && !isKeyCredential(options) && !isTokenCredential(options);
|
|
9
9
|
export class AlphaIdsClient {
|
|
10
|
-
/**
|
|
11
|
-
* A reference to the auto-generated AlphaIDs HTTP client.
|
|
12
|
-
*/
|
|
13
|
-
client;
|
|
14
10
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
15
11
|
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
16
12
|
const options = isAlphaIdsClientOptions(credentialOrOptions)
|
|
17
13
|
? credentialOrOptions
|
|
18
14
|
: maybeOptions;
|
|
19
|
-
const internalPipelineOptions = {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
loggingOptions: {
|
|
23
|
-
logger: logger.info,
|
|
24
|
-
},
|
|
15
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
16
|
+
loggingOptions: {
|
|
17
|
+
logger: logger.info,
|
|
25
18
|
},
|
|
26
|
-
};
|
|
19
|
+
});
|
|
27
20
|
this.client = new AlphaIDsGeneratedClient(url, internalPipelineOptions);
|
|
28
21
|
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
29
22
|
this.client.pipeline.addPolicy(authPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaIdsClient.js","sourceRoot":"","sources":["../../src/alphaIdsClient.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,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IAAI,CAAC,SAAS,CAAC;gBACb,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\nimport type {\n DynamicAlphaIdConfiguration,\n GetConfigurationOptions,\n UpsertConfigurationOptions,\n ListAlphaIdsOptions,\n GetDynamicAlphaIdCountriesOptions,\n GetPreRegisteredAlphaIdCountriesOptions,\n AlphaId,\n SupportedCountries,\n} from \"./models.js\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport type { CommonClientOptions, InternalClientPipelineOptions } from \"@azure/core-client\";\nimport { AlphaIDsClient as AlphaIDsGeneratedClient } from \"./generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { logger } from \"./utils/index.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { createAlphaIDsPagingPolicy } from \"./utils/customPipelinePolicies.js\";\n\n/**\n * Client options used to configure the AlphaIdsClient API requests.\n */\nexport interface AlphaIdsClientOptions extends CommonClientOptions {}\n\nconst isAlphaIdsClientOptions = (options: any): options is AlphaIdsClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\nexport class AlphaIdsClient {\n /**\n * A reference to the auto-generated AlphaIDs HTTP client.\n */\n private readonly client: AlphaIDsGeneratedClient;\n\n public constructor(connectionString: string, options?: AlphaIdsClientOptions);\n\n public constructor(endpoint: string, credential: KeyCredential, options?: AlphaIdsClientOptions);\n\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: AlphaIdsClientOptions,\n );\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | AlphaIdsClientOptions,\n maybeOptions: AlphaIdsClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isAlphaIdsClientOptions(credentialOrOptions)\n ? credentialOrOptions\n : maybeOptions;\n\n const internalPipelineOptions: InternalClientPipelineOptions = {\n ...options,\n ...{\n loggingOptions: {\n logger: logger.info,\n },\n },\n };\n\n this.client = new AlphaIDsGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n // This policy is a temporary workarounds to address compatibility issues with Azure Core V2.\n const alphaIDsPagingPolicy = createAlphaIDsPagingPolicy(url);\n this.client.pipeline.addPolicy(alphaIDsPagingPolicy);\n }\n\n public getDynamicAlphaIdConfiguration(\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: GetConfigurationOptions = {},\n ): Promise<DynamicAlphaIdConfiguration> {\n return tracingClient.withSpan(\n \"AlphaIdsClient-getConfiguration\",\n options,\n async (updatedOptions) => {\n return this.client.alphaIds.getDynamicAlphaIdConfiguration(updatedOptions);\n },\n );\n }\n\n public upsertDynamicAlphaIdConfiguration(\n enabled: boolean,\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n options: UpsertConfigurationOptions = {},\n ): Promise<DynamicAlphaIdConfiguration> {\n return tracingClient.withSpan(\n \"AlphaIdsClient-upsertConfiguration\",\n options,\n async (updatedOptions) => {\n return this.client.alphaIds.upsertDynamicAlphaIdConfiguration(enabled, updatedOptions);\n },\n );\n }\n\n // eslint-disable-next-line @azure/azure-sdk/ts-naming-options\n public getAlphaIds(options: ListAlphaIdsOptions = {}): PagedAsyncIterableIterator<AlphaId> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"AlphaIdsClient-listAlphaIds\",\n options,\n );\n try {\n return this.client.alphaIds.listAlphaIds(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public getDynamicAlphaIdCountries(\n options: GetDynamicAlphaIdCountriesOptions = {},\n ): Promise<SupportedCountries> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"AlphaIdsClient-getDynamicAlphaIdCountries\",\n options,\n );\n try {\n return this.client.alphaIds.getDynamicAlphaIdCountries(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public getPreRegisteredAlphaIdCountries(\n options: GetPreRegisteredAlphaIdCountriesOptions = {},\n ): Promise<SupportedCountries> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"AlphaIdsClient-getPreRegisteredAlphaIdCountries\",\n options,\n );\n try {\n return this.client.alphaIds.getPreRegisteredAlphaIdCountries(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n}\n"]}
|
|
@@ -8,14 +8,13 @@
|
|
|
8
8
|
import * as coreClient from "@azure/core-client";
|
|
9
9
|
import { AlphaIdsImpl } from "./operations/index.js";
|
|
10
10
|
export class AlphaIDsClient extends coreClient.ServiceClient {
|
|
11
|
-
endpoint;
|
|
12
|
-
apiVersion;
|
|
13
11
|
/**
|
|
14
12
|
* Initializes a new instance of the AlphaIDsClient class.
|
|
15
13
|
* @param endpoint The communication resource, for example https://resourcename.communication.azure.com
|
|
16
14
|
* @param options The parameter options
|
|
17
15
|
*/
|
|
18
16
|
constructor(endpoint, options) {
|
|
17
|
+
var _a, _b;
|
|
19
18
|
if (endpoint === undefined) {
|
|
20
19
|
throw new Error("'endpoint' cannot be null");
|
|
21
20
|
}
|
|
@@ -30,14 +29,9 @@ export class AlphaIDsClient extends coreClient.ServiceClient {
|
|
|
30
29
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
31
30
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
32
31
|
: `${packageDetails}`;
|
|
33
|
-
const optionsWithDefaults = {
|
|
34
|
-
...defaults,
|
|
35
|
-
...options,
|
|
36
|
-
userAgentOptions: {
|
|
32
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
37
33
|
userAgentPrefix
|
|
38
|
-
},
|
|
39
|
-
endpoint: options.endpoint ?? options.baseUri ?? "{endpoint}"
|
|
40
|
-
};
|
|
34
|
+
}, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
|
|
41
35
|
super(optionsWithDefaults);
|
|
42
36
|
// Parameter assignments
|
|
43
37
|
this.endpoint = endpoint;
|
|
@@ -71,6 +65,5 @@ export class AlphaIDsClient extends coreClient.ServiceClient {
|
|
|
71
65
|
};
|
|
72
66
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
73
67
|
}
|
|
74
|
-
alphaIds;
|
|
75
68
|
}
|
|
76
69
|
//# sourceMappingURL=alphaIDsClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaIDsClient.js","sourceRoot":"","sources":["../../../../src/generated/src/alphaIDsClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAIrD,MAAM,OAAO,cAAe,SAAQ,UAAU,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"alphaIDsClient.js","sourceRoot":"","sources":["../../../../src/generated/src/alphaIDsClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAIrD,MAAM,OAAO,cAAe,SAAQ,UAAU,CAA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AK,CAAC,WAAW,CACf,OAAwB,EACxB,IAAiB;gBAEjB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACrC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;oBACrB,MAAM,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;wBACjD,IAAI,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;4BACrC,OAAO,cAAc,GAAG,UAAU,CAAC;wBACrC,CAAC;6BAAM,CAAC;4BACN,OAAO,IAAI,CAAC;wBACd,CAAC;oBACH,CAAC,CAAC,CAAC;oBACH,OAAO,CAAC,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACrD,CAAC;gBACD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;YACvB,CAAC;SACF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;IAC5C,CAAC;CAGF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { AlphaIdsImpl } from \"./operations/index.js\";\nimport { AlphaIds } from \"./operationsInterfaces/index.js\";\nimport { AlphaIDsClientOptionalParams } from \"./models/index.js\";\n\nexport class AlphaIDsClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the AlphaIDsClient class.\n * @param endpoint The communication resource, for example https://resourcename.communication.azure.com\n * @param options The parameter options\n */\n constructor(endpoint: string, options?: AlphaIDsClientOptionalParams) {\n if (endpoint === undefined) {\n throw new Error(\"'endpoint' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: AlphaIDsClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-alpha-ids/1.0.0-beta.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n endpoint: options.endpoint ?? options.baseUri ?? \"{endpoint}\"\n };\n super(optionsWithDefaults);\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2023-07-12\";\n this.alphaIds = new AlphaIdsImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n alphaIds: AlphaIds;\n}\n"]}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
+
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
8
9
|
import { tracingClient } from "../tracing.js";
|
|
9
10
|
import { setContinuationToken } from "../pagingHelper.js";
|
|
10
11
|
import * as coreClient from "@azure/core-client";
|
|
@@ -13,7 +14,6 @@ import * as Parameters from "../models/parameters.js";
|
|
|
13
14
|
/// <reference lib="esnext.asynciterable" />
|
|
14
15
|
/** Class containing AlphaIds operations. */
|
|
15
16
|
export class AlphaIdsImpl {
|
|
16
|
-
client;
|
|
17
17
|
/**
|
|
18
18
|
* Initialize a new instance of the class AlphaIds class.
|
|
19
19
|
* @param client Reference to the service client
|
|
@@ -35,42 +35,59 @@ export class AlphaIdsImpl {
|
|
|
35
35
|
return this;
|
|
36
36
|
},
|
|
37
37
|
byPage: (settings) => {
|
|
38
|
-
if (settings
|
|
38
|
+
if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
|
|
39
39
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
40
40
|
}
|
|
41
41
|
return this.getAlphaIdsPagingPage(options, settings);
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
getAlphaIdsPagingPage(options, settings) {
|
|
46
|
+
return __asyncGenerator(this, arguments, function* getAlphaIdsPagingPage_1() {
|
|
47
|
+
let result;
|
|
48
|
+
let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
|
|
49
|
+
if (!continuationToken) {
|
|
50
|
+
result = yield __await(this._getAlphaIds(options));
|
|
51
|
+
let page = result.alphaIds || [];
|
|
52
|
+
continuationToken = result.nextLink;
|
|
53
|
+
setContinuationToken(page, continuationToken);
|
|
54
|
+
yield yield __await(page);
|
|
55
|
+
}
|
|
56
|
+
while (continuationToken) {
|
|
57
|
+
result = yield __await(this._getAlphaIdsNext(continuationToken, options));
|
|
58
|
+
continuationToken = result.nextLink;
|
|
59
|
+
let page = result.alphaIds || [];
|
|
60
|
+
setContinuationToken(page, continuationToken);
|
|
61
|
+
yield yield __await(page);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
62
64
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
getAlphaIdsPagingAll(options) {
|
|
66
|
+
return __asyncGenerator(this, arguments, function* getAlphaIdsPagingAll_1() {
|
|
67
|
+
var _a, e_1, _b, _c;
|
|
68
|
+
try {
|
|
69
|
+
for (var _d = true, _e = __asyncValues(this.getAlphaIdsPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
70
|
+
_c = _f.value;
|
|
71
|
+
_d = false;
|
|
72
|
+
const page = _c;
|
|
73
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
77
|
+
finally {
|
|
78
|
+
try {
|
|
79
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
80
|
+
}
|
|
81
|
+
finally { if (e_1) throw e_1.error; }
|
|
82
|
+
}
|
|
83
|
+
});
|
|
67
84
|
}
|
|
68
85
|
/**
|
|
69
86
|
* Gets the list of alpha ids for the current resource.
|
|
70
87
|
* @param options The options parameters.
|
|
71
88
|
*/
|
|
72
89
|
async _getAlphaIds(options) {
|
|
73
|
-
return tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options
|
|
90
|
+
return tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
74
91
|
return this.client.sendOperationRequest({ options }, getAlphaIdsOperationSpec);
|
|
75
92
|
});
|
|
76
93
|
}
|
|
@@ -79,7 +96,7 @@ export class AlphaIdsImpl {
|
|
|
79
96
|
* @param options The options parameters.
|
|
80
97
|
*/
|
|
81
98
|
async getDynamicAlphaIdConfiguration(options) {
|
|
82
|
-
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options
|
|
99
|
+
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
83
100
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdConfigurationOperationSpec);
|
|
84
101
|
});
|
|
85
102
|
}
|
|
@@ -89,7 +106,7 @@ export class AlphaIdsImpl {
|
|
|
89
106
|
* @param options The options parameters.
|
|
90
107
|
*/
|
|
91
108
|
async upsertDynamicAlphaIdConfiguration(enabled, options) {
|
|
92
|
-
return tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options
|
|
109
|
+
return tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
93
110
|
return this.client.sendOperationRequest({ enabled, options }, upsertDynamicAlphaIdConfigurationOperationSpec);
|
|
94
111
|
});
|
|
95
112
|
}
|
|
@@ -98,7 +115,7 @@ export class AlphaIdsImpl {
|
|
|
98
115
|
* @param options The options parameters.
|
|
99
116
|
*/
|
|
100
117
|
async getDynamicAlphaIdCountries(options) {
|
|
101
|
-
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options
|
|
118
|
+
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
102
119
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdCountriesOperationSpec);
|
|
103
120
|
});
|
|
104
121
|
}
|
|
@@ -107,7 +124,7 @@ export class AlphaIdsImpl {
|
|
|
107
124
|
* @param options The options parameters.
|
|
108
125
|
*/
|
|
109
126
|
async getPreRegisteredAlphaIdCountries(options) {
|
|
110
|
-
return tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options
|
|
127
|
+
return tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
111
128
|
return this.client.sendOperationRequest({ options }, getPreRegisteredAlphaIdCountriesOperationSpec);
|
|
112
129
|
});
|
|
113
130
|
}
|
|
@@ -117,7 +134,7 @@ export class AlphaIdsImpl {
|
|
|
117
134
|
* @param options The options parameters.
|
|
118
135
|
*/
|
|
119
136
|
async _getAlphaIdsNext(nextLink, options) {
|
|
120
|
-
return tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options
|
|
137
|
+
return tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
121
138
|
return this.client.sendOperationRequest({ nextLink, options }, getAlphaIdsNextOperationSpec);
|
|
122
139
|
});
|
|
123
140
|
}
|
|
@@ -169,7 +186,7 @@ const upsertDynamicAlphaIdConfigurationOperationSpec = {
|
|
|
169
186
|
},
|
|
170
187
|
requestBody: {
|
|
171
188
|
parameterPath: { enabled: ["enabled"] },
|
|
172
|
-
mapper: {
|
|
189
|
+
mapper: Object.assign(Object.assign({}, Mappers.DynamicAlphaIdConfiguration), { required: true })
|
|
173
190
|
},
|
|
174
191
|
queryParameters: [Parameters.apiVersion],
|
|
175
192
|
urlParameters: [Parameters.endpoint],
|