@azure-tools/communication-alpha-ids 1.0.0-alpha.20250620.1 → 1.0.0-alpha.20250730.1
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 +11 -4
- package/dist/browser/alphaIdsClient.js.map +1 -1
- package/dist/browser/generated/src/alphaIDsClient.js +10 -3
- package/dist/browser/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/browser/generated/src/operations/alphaIds.js +30 -47
- package/dist/browser/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/browser/generated/src/pagingHelper.js +2 -4
- package/dist/browser/generated/src/pagingHelper.js.map +1 -1
- package/dist/browser/utils/customPipelinePolicies.js +1 -2
- package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
- package/dist/commonjs/alphaIdsClient.js +11 -4
- package/dist/commonjs/alphaIdsClient.js.map +1 -1
- package/dist/commonjs/generated/src/alphaIDsClient.js +10 -3
- package/dist/commonjs/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/commonjs/generated/src/operations/alphaIds.js +30 -46
- package/dist/commonjs/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/commonjs/generated/src/pagingHelper.js +2 -4
- package/dist/commonjs/generated/src/pagingHelper.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/customPipelinePolicies.js +1 -2
- package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
- package/dist/esm/alphaIdsClient.js +11 -4
- package/dist/esm/alphaIdsClient.js.map +1 -1
- package/dist/esm/generated/src/alphaIDsClient.js +10 -3
- package/dist/esm/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/esm/generated/src/operations/alphaIds.js +30 -47
- package/dist/esm/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/esm/generated/src/pagingHelper.js +2 -4
- package/dist/esm/generated/src/pagingHelper.js.map +1 -1
- package/dist/esm/utils/customPipelinePolicies.js +1 -2
- package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
- package/dist/react-native/alphaIdsClient.js +11 -4
- package/dist/react-native/alphaIdsClient.js.map +1 -1
- package/dist/react-native/generated/src/alphaIDsClient.js +10 -3
- package/dist/react-native/generated/src/alphaIDsClient.js.map +1 -1
- package/dist/react-native/generated/src/operations/alphaIds.js +30 -47
- package/dist/react-native/generated/src/operations/alphaIds.js.map +1 -1
- package/dist/react-native/generated/src/pagingHelper.js +2 -4
- package/dist/react-native/generated/src/pagingHelper.js.map +1 -1
- package/dist/react-native/utils/customPipelinePolicies.js +1 -2
- package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
- package/package.json +2 -2
|
@@ -17,6 +17,7 @@ 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;
|
|
20
21
|
/**
|
|
21
22
|
* Initialize a new instance of the class AlphaIds class.
|
|
22
23
|
* @param client Reference to the service client
|
|
@@ -38,59 +39,42 @@ class AlphaIdsImpl {
|
|
|
38
39
|
return this;
|
|
39
40
|
},
|
|
40
41
|
byPage: (settings) => {
|
|
41
|
-
if (settings
|
|
42
|
+
if (settings?.maxPageSize) {
|
|
42
43
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
43
44
|
}
|
|
44
45
|
return this.getAlphaIdsPagingPage(options, settings);
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
|
-
getAlphaIdsPagingPage(options, settings) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
});
|
|
49
|
+
async *getAlphaIdsPagingPage(options, settings) {
|
|
50
|
+
let result;
|
|
51
|
+
let continuationToken = settings?.continuationToken;
|
|
52
|
+
if (!continuationToken) {
|
|
53
|
+
result = await this._getAlphaIds(options);
|
|
54
|
+
let page = result.alphaIds || [];
|
|
55
|
+
continuationToken = result.nextLink;
|
|
56
|
+
(0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
|
|
57
|
+
yield page;
|
|
58
|
+
}
|
|
59
|
+
while (continuationToken) {
|
|
60
|
+
result = await this._getAlphaIdsNext(continuationToken, options);
|
|
61
|
+
continuationToken = result.nextLink;
|
|
62
|
+
let page = result.alphaIds || [];
|
|
63
|
+
(0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
|
|
64
|
+
yield page;
|
|
65
|
+
}
|
|
67
66
|
}
|
|
68
|
-
getAlphaIdsPagingAll(options) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
});
|
|
67
|
+
async *getAlphaIdsPagingAll(options) {
|
|
68
|
+
for await (const page of this.getAlphaIdsPagingPage(options)) {
|
|
69
|
+
yield* page;
|
|
70
|
+
}
|
|
87
71
|
}
|
|
88
72
|
/**
|
|
89
73
|
* Gets the list of alpha ids for the current resource.
|
|
90
74
|
* @param options The options parameters.
|
|
91
75
|
*/
|
|
92
76
|
async _getAlphaIds(options) {
|
|
93
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options
|
|
77
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options ?? {}, async (options) => {
|
|
94
78
|
return this.client.sendOperationRequest({ options }, getAlphaIdsOperationSpec);
|
|
95
79
|
});
|
|
96
80
|
}
|
|
@@ -99,7 +83,7 @@ class AlphaIdsImpl {
|
|
|
99
83
|
* @param options The options parameters.
|
|
100
84
|
*/
|
|
101
85
|
async getDynamicAlphaIdConfiguration(options) {
|
|
102
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options
|
|
86
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options ?? {}, async (options) => {
|
|
103
87
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdConfigurationOperationSpec);
|
|
104
88
|
});
|
|
105
89
|
}
|
|
@@ -109,7 +93,7 @@ class AlphaIdsImpl {
|
|
|
109
93
|
* @param options The options parameters.
|
|
110
94
|
*/
|
|
111
95
|
async upsertDynamicAlphaIdConfiguration(enabled, options) {
|
|
112
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options
|
|
96
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options ?? {}, async (options) => {
|
|
113
97
|
return this.client.sendOperationRequest({ enabled, options }, upsertDynamicAlphaIdConfigurationOperationSpec);
|
|
114
98
|
});
|
|
115
99
|
}
|
|
@@ -118,7 +102,7 @@ class AlphaIdsImpl {
|
|
|
118
102
|
* @param options The options parameters.
|
|
119
103
|
*/
|
|
120
104
|
async getDynamicAlphaIdCountries(options) {
|
|
121
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options
|
|
105
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options ?? {}, async (options) => {
|
|
122
106
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdCountriesOperationSpec);
|
|
123
107
|
});
|
|
124
108
|
}
|
|
@@ -127,7 +111,7 @@ class AlphaIdsImpl {
|
|
|
127
111
|
* @param options The options parameters.
|
|
128
112
|
*/
|
|
129
113
|
async getPreRegisteredAlphaIdCountries(options) {
|
|
130
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options
|
|
114
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options ?? {}, async (options) => {
|
|
131
115
|
return this.client.sendOperationRequest({ options }, getPreRegisteredAlphaIdCountriesOperationSpec);
|
|
132
116
|
});
|
|
133
117
|
}
|
|
@@ -137,7 +121,7 @@ class AlphaIdsImpl {
|
|
|
137
121
|
* @param options The options parameters.
|
|
138
122
|
*/
|
|
139
123
|
async _getAlphaIdsNext(nextLink, options) {
|
|
140
|
-
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options
|
|
124
|
+
return tracing_js_1.tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options ?? {}, async (options) => {
|
|
141
125
|
return this.client.sendOperationRequest({ nextLink, options }, getAlphaIdsNextOperationSpec);
|
|
142
126
|
});
|
|
143
127
|
}
|
|
@@ -190,7 +174,7 @@ const upsertDynamicAlphaIdConfigurationOperationSpec = {
|
|
|
190
174
|
},
|
|
191
175
|
requestBody: {
|
|
192
176
|
parameterPath: { enabled: ["enabled"] },
|
|
193
|
-
mapper:
|
|
177
|
+
mapper: { ...Mappers.DynamicAlphaIdConfiguration, required: true }
|
|
194
178
|
},
|
|
195
179
|
queryParameters: [Parameters.apiVersion],
|
|
196
180
|
urlParameters: [Parameters.endpoint],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alphaIds.js","s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,QAAQ,CAAC;IACpC,gBAAgB,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"]}
|
|
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,MAAM,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;YAC1C,IAAI,IAAI,GAAG,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC;YACjC,iBAAiB,GAAG,MAAM,CAAC,QAAQ,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,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,18 +18,16 @@ 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;
|
|
22
21
|
if (typeof page !== "object" || page === null) {
|
|
23
22
|
return undefined;
|
|
24
23
|
}
|
|
25
|
-
return
|
|
24
|
+
return pageMap.get(page)?.continuationToken;
|
|
26
25
|
}
|
|
27
26
|
function setContinuationToken(page, continuationToken) {
|
|
28
|
-
var _a;
|
|
29
27
|
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
30
28
|
return;
|
|
31
29
|
}
|
|
32
|
-
const pageInfo =
|
|
30
|
+
const pageInfo = pageMap.get(page) ?? {};
|
|
33
31
|
pageInfo.continuationToken = continuationToken;
|
|
34
32
|
pageMap.set(page, pageInfo);
|
|
35
33
|
}
|
|
@@ -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,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,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,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,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.9"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
@@ -15,9 +15,8 @@ function createAlphaIDsPagingPolicy(host) {
|
|
|
15
15
|
return {
|
|
16
16
|
name: "alphaIDsPagingPolicy",
|
|
17
17
|
async sendRequest(request, next) {
|
|
18
|
-
var _a;
|
|
19
18
|
const response = await next(request);
|
|
20
|
-
let nextLink =
|
|
19
|
+
let nextLink = response?.parsedBody?.nextLink;
|
|
21
20
|
if (nextLink && !nextLink.startsWith(host)) {
|
|
22
21
|
nextLink = host.endsWith("/") ? nextLink.substring(1) : nextLink;
|
|
23
22
|
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,QAAQ,EAAE,UAAU,EAAE,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,16 +7,23 @@ 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;
|
|
10
14
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
11
15
|
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
12
16
|
const options = isAlphaIdsClientOptions(credentialOrOptions)
|
|
13
17
|
? credentialOrOptions
|
|
14
18
|
: maybeOptions;
|
|
15
|
-
const internalPipelineOptions =
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
const internalPipelineOptions = {
|
|
20
|
+
...options,
|
|
21
|
+
...{
|
|
22
|
+
loggingOptions: {
|
|
23
|
+
logger: logger.info,
|
|
24
|
+
},
|
|
18
25
|
},
|
|
19
|
-
}
|
|
26
|
+
};
|
|
20
27
|
this.client = new AlphaIDsGeneratedClient(url, internalPipelineOptions);
|
|
21
28
|
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
22
29
|
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,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,cAAc,IAAI,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAO/E,MAAM,uBAAuB,GAAG,CAAC,OAAY,EAAoC,EAAE,CACjF,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,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AAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAEM,0BAA0B,CAC/B,UAA6C,EAAE;QAE/C,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,SAAS,CACtD,2CAA2C,EAC3C,OAAO,CACR,CAAC;QACF,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,0BAA0B,CAAC,cAAc,CAAC,CAAC;QACzE,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,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;IAEM,gCAAgC,CACrC,UAAmD,EAAE;QAErD,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,aAAa,CAAC,SAAS,CACtD,iDAAiD,EACjD,OAAO,CACR,CAAC;QACF,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,gCAAgC,CAAC,cAAc,CAAC,CAAC;QAC/E,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,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,13 +8,14 @@
|
|
|
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;
|
|
11
13
|
/**
|
|
12
14
|
* Initializes a new instance of the AlphaIDsClient class.
|
|
13
15
|
* @param endpoint The communication resource, for example https://resourcename.communication.azure.com
|
|
14
16
|
* @param options The parameter options
|
|
15
17
|
*/
|
|
16
18
|
constructor(endpoint, options) {
|
|
17
|
-
var _a, _b;
|
|
18
19
|
if (endpoint === undefined) {
|
|
19
20
|
throw new Error("'endpoint' cannot be null");
|
|
20
21
|
}
|
|
@@ -29,9 +30,14 @@ export class AlphaIDsClient extends coreClient.ServiceClient {
|
|
|
29
30
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
30
31
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
31
32
|
: `${packageDetails}`;
|
|
32
|
-
const optionsWithDefaults =
|
|
33
|
+
const optionsWithDefaults = {
|
|
34
|
+
...defaults,
|
|
35
|
+
...options,
|
|
36
|
+
userAgentOptions: {
|
|
33
37
|
userAgentPrefix
|
|
34
|
-
},
|
|
38
|
+
},
|
|
39
|
+
endpoint: options.endpoint ?? options.baseUri ?? "{endpoint}"
|
|
40
|
+
};
|
|
35
41
|
super(optionsWithDefaults);
|
|
36
42
|
// Parameter assignments
|
|
37
43
|
this.endpoint = endpoint;
|
|
@@ -65,5 +71,6 @@ export class AlphaIDsClient extends coreClient.ServiceClient {
|
|
|
65
71
|
};
|
|
66
72
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
67
73
|
}
|
|
74
|
+
alphaIds;
|
|
68
75
|
}
|
|
69
76
|
//# 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,CAAC,aAAa;IAC1D,QAAQ,CAAS;IACjB,UAAU,CAAS;IAEnB;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAsC;QAClE,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;QAC/C,CAAC;QAED,0CAA0C;QAC1C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QACD,MAAM,QAAQ,GAAiC;YAC7C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,+CAA+C,CAAC;QACvE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,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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;IAED,QAAQ,CAAW;CACpB","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,7 +5,6 @@
|
|
|
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";
|
|
9
8
|
import { tracingClient } from "../tracing.js";
|
|
10
9
|
import { setContinuationToken } from "../pagingHelper.js";
|
|
11
10
|
import * as coreClient from "@azure/core-client";
|
|
@@ -14,6 +13,7 @@ import * as Parameters from "../models/parameters.js";
|
|
|
14
13
|
/// <reference lib="esnext.asynciterable" />
|
|
15
14
|
/** Class containing AlphaIds operations. */
|
|
16
15
|
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,59 +35,42 @@ export class AlphaIdsImpl {
|
|
|
35
35
|
return this;
|
|
36
36
|
},
|
|
37
37
|
byPage: (settings) => {
|
|
38
|
-
if (settings
|
|
38
|
+
if (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
|
-
getAlphaIdsPagingPage(options, settings) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
});
|
|
45
|
+
async *getAlphaIdsPagingPage(options, settings) {
|
|
46
|
+
let result;
|
|
47
|
+
let continuationToken = settings?.continuationToken;
|
|
48
|
+
if (!continuationToken) {
|
|
49
|
+
result = await this._getAlphaIds(options);
|
|
50
|
+
let page = result.alphaIds || [];
|
|
51
|
+
continuationToken = result.nextLink;
|
|
52
|
+
setContinuationToken(page, continuationToken);
|
|
53
|
+
yield page;
|
|
54
|
+
}
|
|
55
|
+
while (continuationToken) {
|
|
56
|
+
result = await this._getAlphaIdsNext(continuationToken, options);
|
|
57
|
+
continuationToken = result.nextLink;
|
|
58
|
+
let page = result.alphaIds || [];
|
|
59
|
+
setContinuationToken(page, continuationToken);
|
|
60
|
+
yield page;
|
|
61
|
+
}
|
|
64
62
|
}
|
|
65
|
-
getAlphaIdsPagingAll(options) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
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
|
-
});
|
|
63
|
+
async *getAlphaIdsPagingAll(options) {
|
|
64
|
+
for await (const page of this.getAlphaIdsPagingPage(options)) {
|
|
65
|
+
yield* page;
|
|
66
|
+
}
|
|
84
67
|
}
|
|
85
68
|
/**
|
|
86
69
|
* Gets the list of alpha ids for the current resource.
|
|
87
70
|
* @param options The options parameters.
|
|
88
71
|
*/
|
|
89
72
|
async _getAlphaIds(options) {
|
|
90
|
-
return tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options
|
|
73
|
+
return tracingClient.withSpan("AlphaIDsClient._getAlphaIds", options ?? {}, async (options) => {
|
|
91
74
|
return this.client.sendOperationRequest({ options }, getAlphaIdsOperationSpec);
|
|
92
75
|
});
|
|
93
76
|
}
|
|
@@ -96,7 +79,7 @@ export class AlphaIdsImpl {
|
|
|
96
79
|
* @param options The options parameters.
|
|
97
80
|
*/
|
|
98
81
|
async getDynamicAlphaIdConfiguration(options) {
|
|
99
|
-
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options
|
|
82
|
+
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdConfiguration", options ?? {}, async (options) => {
|
|
100
83
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdConfigurationOperationSpec);
|
|
101
84
|
});
|
|
102
85
|
}
|
|
@@ -106,7 +89,7 @@ export class AlphaIdsImpl {
|
|
|
106
89
|
* @param options The options parameters.
|
|
107
90
|
*/
|
|
108
91
|
async upsertDynamicAlphaIdConfiguration(enabled, options) {
|
|
109
|
-
return tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options
|
|
92
|
+
return tracingClient.withSpan("AlphaIDsClient.upsertDynamicAlphaIdConfiguration", options ?? {}, async (options) => {
|
|
110
93
|
return this.client.sendOperationRequest({ enabled, options }, upsertDynamicAlphaIdConfigurationOperationSpec);
|
|
111
94
|
});
|
|
112
95
|
}
|
|
@@ -115,7 +98,7 @@ export class AlphaIdsImpl {
|
|
|
115
98
|
* @param options The options parameters.
|
|
116
99
|
*/
|
|
117
100
|
async getDynamicAlphaIdCountries(options) {
|
|
118
|
-
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options
|
|
101
|
+
return tracingClient.withSpan("AlphaIDsClient.getDynamicAlphaIdCountries", options ?? {}, async (options) => {
|
|
119
102
|
return this.client.sendOperationRequest({ options }, getDynamicAlphaIdCountriesOperationSpec);
|
|
120
103
|
});
|
|
121
104
|
}
|
|
@@ -124,7 +107,7 @@ export class AlphaIdsImpl {
|
|
|
124
107
|
* @param options The options parameters.
|
|
125
108
|
*/
|
|
126
109
|
async getPreRegisteredAlphaIdCountries(options) {
|
|
127
|
-
return tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options
|
|
110
|
+
return tracingClient.withSpan("AlphaIDsClient.getPreRegisteredAlphaIdCountries", options ?? {}, async (options) => {
|
|
128
111
|
return this.client.sendOperationRequest({ options }, getPreRegisteredAlphaIdCountriesOperationSpec);
|
|
129
112
|
});
|
|
130
113
|
}
|
|
@@ -134,7 +117,7 @@ export class AlphaIdsImpl {
|
|
|
134
117
|
* @param options The options parameters.
|
|
135
118
|
*/
|
|
136
119
|
async _getAlphaIdsNext(nextLink, options) {
|
|
137
|
-
return tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options
|
|
120
|
+
return tracingClient.withSpan("AlphaIDsClient._getAlphaIdsNext", options ?? {}, async (options) => {
|
|
138
121
|
return this.client.sendOperationRequest({ nextLink, options }, getAlphaIdsNextOperationSpec);
|
|
139
122
|
});
|
|
140
123
|
}
|
|
@@ -186,7 +169,7 @@ const upsertDynamicAlphaIdConfigurationOperationSpec = {
|
|
|
186
169
|
},
|
|
187
170
|
requestBody: {
|
|
188
171
|
parameterPath: { enabled: ["enabled"] },
|
|
189
|
-
mapper:
|
|
172
|
+
mapper: { ...Mappers.DynamicAlphaIdConfiguration, required: true }
|
|
190
173
|
},
|
|
191
174
|
queryParameters: [Parameters.apiVersion],
|
|
192
175
|
urlParameters: [Parameters.endpoint],
|