@azure-tools/communication-tiering 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/generated/src/operations/numberAllotment.js +1 -2
- package/dist/browser/generated/src/operations/numberAllotment.js.map +1 -1
- package/dist/browser/generated/src/operations/tiering.js +1 -2
- package/dist/browser/generated/src/operations/tiering.js.map +1 -1
- package/dist/browser/generated/src/tieringClient.js +3 -11
- package/dist/browser/generated/src/tieringClient.js.map +1 -1
- package/dist/browser/tieringClient.js +4 -11
- package/dist/browser/tieringClient.js.map +1 -1
- package/dist/commonjs/generated/src/operations/numberAllotment.js +1 -2
- package/dist/commonjs/generated/src/operations/numberAllotment.js.map +1 -1
- package/dist/commonjs/generated/src/operations/tiering.js +1 -2
- package/dist/commonjs/generated/src/operations/tiering.js.map +1 -1
- package/dist/commonjs/generated/src/tieringClient.js +3 -11
- package/dist/commonjs/generated/src/tieringClient.js.map +1 -1
- package/dist/commonjs/tieringClient.js +4 -11
- package/dist/commonjs/tieringClient.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/generated/src/operations/numberAllotment.js +1 -2
- package/dist/esm/generated/src/operations/numberAllotment.js.map +1 -1
- package/dist/esm/generated/src/operations/tiering.js +1 -2
- package/dist/esm/generated/src/operations/tiering.js.map +1 -1
- package/dist/esm/generated/src/tieringClient.js +3 -11
- package/dist/esm/generated/src/tieringClient.js.map +1 -1
- package/dist/esm/tieringClient.js +4 -11
- package/dist/esm/tieringClient.js.map +1 -1
- package/dist/react-native/generated/src/operations/numberAllotment.js +1 -2
- package/dist/react-native/generated/src/operations/numberAllotment.js.map +1 -1
- package/dist/react-native/generated/src/operations/tiering.js +1 -2
- package/dist/react-native/generated/src/operations/tiering.js.map +1 -1
- package/dist/react-native/generated/src/tieringClient.js +3 -11
- package/dist/react-native/generated/src/tieringClient.js.map +1 -1
- package/dist/react-native/tieringClient.js +4 -11
- package/dist/react-native/tieringClient.js.map +1 -1
- package/package.json +2 -2
|
@@ -11,7 +11,6 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing NumberAllotment operations. */
|
|
13
13
|
export class NumberAllotmentImpl {
|
|
14
|
-
client;
|
|
15
14
|
/**
|
|
16
15
|
* Initialize a new instance of the class NumberAllotment class.
|
|
17
16
|
* @param client Reference to the service client
|
|
@@ -25,7 +24,7 @@ export class NumberAllotmentImpl {
|
|
|
25
24
|
* @param options The options parameters.
|
|
26
25
|
*/
|
|
27
26
|
async getAcquiredNumberLimits(resourceId, options) {
|
|
28
|
-
return tracingClient.withSpan("TieringClient.getAcquiredNumberLimits", options
|
|
27
|
+
return tracingClient.withSpan("TieringClient.getAcquiredNumberLimits", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
29
28
|
return this.client.sendOperationRequest({ resourceId, options }, getAcquiredNumberLimitsOperationSpec);
|
|
30
29
|
});
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberAllotment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/numberAllotment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,mDAAmD;AACnD,MAAM,OAAO,mBAAmB;
|
|
1
|
+
{"version":3,"file":"numberAllotment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/numberAllotment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,mDAAmD;AACnD,MAAM,OAAO,mBAAmB;IAG9B;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,uBAAuB,CAC3B,UAAkB,EAClB,OAA8D;QAE9D,OAAO,aAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,UAAU,EAAE,OAAO,EAAE,EACvB,oCAAoC,CACsB,CAAC;QAC/D,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,oCAAoC,GAA6B;IACrE,IAAI,EAAE,iEAAiE;IACvE,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EACR,OAAO,CAAC,8GAA8G;SACzH;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC3D,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 { NumberAllotment } 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 { TieringClient } from \"../tieringClient.js\";\nimport {\n NumberAllotmentGetAcquiredNumberLimitsOptionalParams,\n NumberAllotmentGetAcquiredNumberLimitsResponse\n} from \"../models/index.js\";\n\n/** Class containing NumberAllotment operations. */\nexport class NumberAllotmentImpl implements NumberAllotment {\n private readonly client: TieringClient;\n\n /**\n * Initialize a new instance of the class NumberAllotment class.\n * @param client Reference to the service client\n */\n constructor(client: TieringClient) {\n this.client = client;\n }\n\n /**\n * Get acquired numbers and limits for a resource.\n * @param resourceId Resource Id. Must be a valid GUID\n * @param options The options parameters.\n */\n async getAcquiredNumberLimits(\n resourceId: string,\n options?: NumberAllotmentGetAcquiredNumberLimitsOptionalParams\n ): Promise<NumberAllotmentGetAcquiredNumberLimitsResponse> {\n return tracingClient.withSpan(\n \"TieringClient.getAcquiredNumberLimits\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { resourceId, options },\n getAcquiredNumberLimitsOperationSpec\n ) as Promise<NumberAllotmentGetAcquiredNumberLimitsResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getAcquiredNumberLimitsOperationSpec: coreClient.OperationSpec = {\n path: \"/administration/resources/{resourceId}/telephone-number-summary\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper:\n Mappers.Paths190FnhrAdministrationResourcesResourceidTelephoneNumberSummaryGetResponses200ContentApplicationJsonSchema\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.resourceId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -11,7 +11,6 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing Tiering operations. */
|
|
13
13
|
export class TieringImpl {
|
|
14
|
-
client;
|
|
15
14
|
/**
|
|
16
15
|
* Initialize a new instance of the class Tiering class.
|
|
17
16
|
* @param client Reference to the service client
|
|
@@ -25,7 +24,7 @@ export class TieringImpl {
|
|
|
25
24
|
* @param options The options parameters.
|
|
26
25
|
*/
|
|
27
26
|
async getByResourceId(resourceId, options) {
|
|
28
|
-
return tracingClient.withSpan("TieringClient.getByResourceId", options
|
|
27
|
+
return tracingClient.withSpan("TieringClient.getByResourceId", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
29
28
|
return this.client.sendOperationRequest({ resourceId, options }, getByResourceIdOperationSpec);
|
|
30
29
|
});
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiering.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/tiering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,2CAA2C;AAC3C,MAAM,OAAO,WAAW;
|
|
1
|
+
{"version":3,"file":"tiering.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/tiering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,2CAA2C;AAC3C,MAAM,OAAO,WAAW;IAGtB;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CACnB,UAAkB,EAClB,OAA8C;QAE9C,OAAO,aAAa,CAAC,QAAQ,CAC3B,+BAA+B,EAC/B,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,UAAU,EAAE,OAAO,EAAE,EACvB,4BAA4B,CACc,CAAC;QAC/C,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,8CAA8C;IACpD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,OAAO;SAC5B;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC3D,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 { Tiering } 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 { TieringClient } from \"../tieringClient.js\";\nimport {\n TieringGetByResourceIdOptionalParams,\n TieringGetByResourceIdResponse\n} from \"../models/index.js\";\n\n/** Class containing Tiering operations. */\nexport class TieringImpl implements Tiering {\n private readonly client: TieringClient;\n\n /**\n * Initialize a new instance of the class Tiering class.\n * @param client Reference to the service client\n */\n constructor(client: TieringClient) {\n this.client = client;\n }\n\n /**\n * Get the tiering data for a given resource\n * @param resourceId Resource Id. Must be a valid GUID\n * @param options The options parameters.\n */\n async getByResourceId(\n resourceId: string,\n options?: TieringGetByResourceIdOptionalParams\n ): Promise<TieringGetByResourceIdResponse> {\n return tracingClient.withSpan(\n \"TieringClient.getByResourceId\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { resourceId, options },\n getByResourceIdOperationSpec\n ) as Promise<TieringGetByResourceIdResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getByResourceIdOperationSpec: coreClient.OperationSpec = {\n path: \"/administration/tiers/resources/{resourceId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcsTier\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.resourceId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -8,14 +8,13 @@
|
|
|
8
8
|
import * as coreClient from "@azure/core-client";
|
|
9
9
|
import { NumberAllotmentImpl, TieringImpl } from "./operations/index.js";
|
|
10
10
|
export class TieringClient extends coreClient.ServiceClient {
|
|
11
|
-
endpoint;
|
|
12
|
-
apiVersion;
|
|
13
11
|
/**
|
|
14
12
|
* Initializes a new instance of the TieringClient 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 TieringClient 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;
|
|
@@ -72,7 +66,5 @@ export class TieringClient extends coreClient.ServiceClient {
|
|
|
72
66
|
};
|
|
73
67
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
74
68
|
}
|
|
75
|
-
numberAllotment;
|
|
76
|
-
tiering;
|
|
77
69
|
}
|
|
78
70
|
//# sourceMappingURL=tieringClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../../../src/generated/src/tieringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzE,MAAM,OAAO,aAAc,SAAQ,UAAU,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../../../src/generated/src/tieringClient.ts"],"names":[],"mappings":"A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;QACrC,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;IAED,8GAA8G;IACtG,yBAAyB,CAAC,UAAmB;QACnD,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO;QACT,CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,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;CAIF","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 { NumberAllotmentImpl, TieringImpl } from \"./operations/index.js\";\nimport { NumberAllotment, Tiering } from \"./operationsInterfaces/index.js\";\nimport { TieringClientOptionalParams } from \"./models/index.js\";\n\nexport class TieringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the TieringClient 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?: TieringClientOptionalParams) {\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: TieringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-tiering/1.0.0-beta.1`;\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-06-15\";\n this.numberAllotment = new NumberAllotmentImpl(this);\n this.tiering = new TieringImpl(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 numberAllotment: NumberAllotment;\n tiering: Tiering;\n}\n"]}
|
|
@@ -12,23 +12,16 @@ const isTieringClientOptions = (options) => options && !isKeyCredential(options)
|
|
|
12
12
|
* Client class for interacting with Azure Communication Services Tiering.
|
|
13
13
|
*/
|
|
14
14
|
export class TieringClient {
|
|
15
|
-
/**
|
|
16
|
-
* A reference to the auto-generated TieringClient HTTP client.
|
|
17
|
-
*/
|
|
18
|
-
client;
|
|
19
15
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
20
16
|
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
21
17
|
const options = isTieringClientOptions(credentialOrOptions)
|
|
22
18
|
? credentialOrOptions
|
|
23
19
|
: maybeOptions;
|
|
24
|
-
const internalPipelineOptions = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
loggingOptions: {
|
|
28
|
-
logger: logger.info,
|
|
29
|
-
},
|
|
20
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
21
|
+
loggingOptions: {
|
|
22
|
+
logger: logger.info,
|
|
30
23
|
},
|
|
31
|
-
};
|
|
24
|
+
});
|
|
32
25
|
this.client = new TieringGeneratedClient(url, internalPipelineOptions);
|
|
33
26
|
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
34
27
|
this.client.pipeline.addPolicy(authPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../src/tieringClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAU5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CA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mBAAmB;YACrB,CAAC,CAAC,YAAY,CAAC;QAEjB,MAAM,uBAAuB,mCACxB,OAAO,GACP;YACD,cAAc,EAAE;gBACd,MAAM,EAAE,MAAM,CAAC,IAAI;aACpB;SACF,CACF,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,IAAI,sBAAsB,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,6BAA6B,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAC5B,UAAkB,EAClB,UAAgE,EAAE;QAElE,OAAO,aAAa,CAAC,QAAQ,CAC3B,yCAAyC,EACzC,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACzF,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CACxB,UAAkB,EAClB,UAAgD,EAAE;QAElD,OAAO,aAAa,CAAC,QAAQ,CAAC,6BAA6B,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,EAAE;YACvF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type {\n NumberAllotmentGetAcquiredNumberLimitsOptionalParams,\n TieringGetByResourceIdOptionalParams,\n AcsTier,\n AssetDetailsModel,\n} from \"./models.js\";\nimport type { CommonClientOptions, InternalClientPipelineOptions } from \"@azure/core-client\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport { TieringClient as TieringGeneratedClient } from \"./generated/src/index.js\";\nimport { logger } from \"./utils/index.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\n\n/**\n * Client options used to configure the TieringGeneratedClient API requests.\n */\nexport interface TieringClientOptions extends CommonClientOptions {}\n\nconst isTieringClientOptions = (options: any): options is TieringClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services Tiering.\n */\nexport class TieringClient {\n /**\n * A reference to the auto-generated TieringClient HTTP client.\n */\n private readonly client: TieringGeneratedClient;\n\n /**\n * Initializes a new instance of the TieringClient class using a connection string.\n *\n * @param connectionString - Connection string to connect to an Azure Communication Service resource. (eg: endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret)\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: TieringClientOptions);\n\n /**\n * Initializes a new instance of the TieringClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net)\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(endpoint: string, credential: KeyCredential, options?: TieringClientOptions);\n\n /**\n * Initializes a new instance of the TieringClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net)\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(endpoint: string, credential: TokenCredential, options?: TieringClientOptions);\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | TieringClientOptions,\n maybeOptions: TieringClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isTieringClientOptions(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 TieringGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Get acquired numbers and limits for a resource.\n *\n * @param options - Additional request options.\n */\n public getAcquiredNumberLimits(\n resourceId: string,\n options: NumberAllotmentGetAcquiredNumberLimitsOptionalParams = {},\n ): Promise<AssetDetailsModel> {\n return tracingClient.withSpan(\n \"numberAllotment.getAcquiredNumberLimits\",\n options,\n (updatedOptions) => {\n return this.client.numberAllotment.getAcquiredNumberLimits(resourceId, updatedOptions);\n },\n );\n }\n\n /**\n * Get tiering info for a resource.\n *\n * @param options - Additional request options.\n */\n public getTierByResourceId(\n resourceId: string,\n options: TieringGetByResourceIdOptionalParams = {},\n ): Promise<AcsTier> {\n return tracingClient.withSpan(\"tiering.getTierByResourceId\", options, (updatedOptions) => {\n return this.client.tiering.getByResourceId(resourceId, updatedOptions);\n });\n }\n}\n"]}
|
|
@@ -15,7 +15,6 @@ const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
|
|
|
15
15
|
const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
|
|
16
16
|
/** Class containing NumberAllotment operations. */
|
|
17
17
|
class NumberAllotmentImpl {
|
|
18
|
-
client;
|
|
19
18
|
/**
|
|
20
19
|
* Initialize a new instance of the class NumberAllotment class.
|
|
21
20
|
* @param client Reference to the service client
|
|
@@ -29,7 +28,7 @@ class NumberAllotmentImpl {
|
|
|
29
28
|
* @param options The options parameters.
|
|
30
29
|
*/
|
|
31
30
|
async getAcquiredNumberLimits(resourceId, options) {
|
|
32
|
-
return tracing_js_1.tracingClient.withSpan("TieringClient.getAcquiredNumberLimits", options
|
|
31
|
+
return tracing_js_1.tracingClient.withSpan("TieringClient.getAcquiredNumberLimits", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
33
32
|
return this.client.sendOperationRequest({ resourceId, options }, getAcquiredNumberLimitsOperationSpec);
|
|
34
33
|
});
|
|
35
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberAllotment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/numberAllotment.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,8CAA8C;AAE9C,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAOtD,mDAAmD;AACnD,MAAa,mBAAmB;
|
|
1
|
+
{"version":3,"file":"numberAllotment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/numberAllotment.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,8CAA8C;AAE9C,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAOtD,mDAAmD;AACnD,MAAa,mBAAmB;IAG9B;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,uBAAuB,CAC3B,UAAkB,EAClB,OAA8D;QAE9D,OAAO,0BAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,UAAU,EAAE,OAAO,EAAE,EACvB,oCAAoC,CACsB,CAAC;QAC/D,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AA/BD,kDA+BC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,oCAAoC,GAA6B;IACrE,IAAI,EAAE,iEAAiE;IACvE,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EACR,OAAO,CAAC,8GAA8G;SACzH;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC3D,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 { NumberAllotment } 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 { TieringClient } from \"../tieringClient.js\";\nimport {\n NumberAllotmentGetAcquiredNumberLimitsOptionalParams,\n NumberAllotmentGetAcquiredNumberLimitsResponse\n} from \"../models/index.js\";\n\n/** Class containing NumberAllotment operations. */\nexport class NumberAllotmentImpl implements NumberAllotment {\n private readonly client: TieringClient;\n\n /**\n * Initialize a new instance of the class NumberAllotment class.\n * @param client Reference to the service client\n */\n constructor(client: TieringClient) {\n this.client = client;\n }\n\n /**\n * Get acquired numbers and limits for a resource.\n * @param resourceId Resource Id. Must be a valid GUID\n * @param options The options parameters.\n */\n async getAcquiredNumberLimits(\n resourceId: string,\n options?: NumberAllotmentGetAcquiredNumberLimitsOptionalParams\n ): Promise<NumberAllotmentGetAcquiredNumberLimitsResponse> {\n return tracingClient.withSpan(\n \"TieringClient.getAcquiredNumberLimits\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { resourceId, options },\n getAcquiredNumberLimitsOperationSpec\n ) as Promise<NumberAllotmentGetAcquiredNumberLimitsResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getAcquiredNumberLimitsOperationSpec: coreClient.OperationSpec = {\n path: \"/administration/resources/{resourceId}/telephone-number-summary\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper:\n Mappers.Paths190FnhrAdministrationResourcesResourceidTelephoneNumberSummaryGetResponses200ContentApplicationJsonSchema\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.resourceId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -15,7 +15,6 @@ const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
|
|
|
15
15
|
const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
|
|
16
16
|
/** Class containing Tiering operations. */
|
|
17
17
|
class TieringImpl {
|
|
18
|
-
client;
|
|
19
18
|
/**
|
|
20
19
|
* Initialize a new instance of the class Tiering class.
|
|
21
20
|
* @param client Reference to the service client
|
|
@@ -29,7 +28,7 @@ class TieringImpl {
|
|
|
29
28
|
* @param options The options parameters.
|
|
30
29
|
*/
|
|
31
30
|
async getByResourceId(resourceId, options) {
|
|
32
|
-
return tracing_js_1.tracingClient.withSpan("TieringClient.getByResourceId", options
|
|
31
|
+
return tracing_js_1.tracingClient.withSpan("TieringClient.getByResourceId", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
33
32
|
return this.client.sendOperationRequest({ resourceId, options }, getByResourceIdOperationSpec);
|
|
34
33
|
});
|
|
35
34
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiering.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/tiering.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,8CAA8C;AAE9C,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAOtD,2CAA2C;AAC3C,MAAa,WAAW;
|
|
1
|
+
{"version":3,"file":"tiering.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/tiering.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,8CAA8C;AAE9C,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAOtD,2CAA2C;AAC3C,MAAa,WAAW;IAGtB;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CACnB,UAAkB,EAClB,OAA8C;QAE9C,OAAO,0BAAa,CAAC,QAAQ,CAC3B,+BAA+B,EAC/B,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,UAAU,EAAE,OAAO,EAAE,EACvB,4BAA4B,CACc,CAAC;QAC/C,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AA/BD,kCA+BC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,8CAA8C;IACpD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,OAAO;SAC5B;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC3D,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 { Tiering } 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 { TieringClient } from \"../tieringClient.js\";\nimport {\n TieringGetByResourceIdOptionalParams,\n TieringGetByResourceIdResponse\n} from \"../models/index.js\";\n\n/** Class containing Tiering operations. */\nexport class TieringImpl implements Tiering {\n private readonly client: TieringClient;\n\n /**\n * Initialize a new instance of the class Tiering class.\n * @param client Reference to the service client\n */\n constructor(client: TieringClient) {\n this.client = client;\n }\n\n /**\n * Get the tiering data for a given resource\n * @param resourceId Resource Id. Must be a valid GUID\n * @param options The options parameters.\n */\n async getByResourceId(\n resourceId: string,\n options?: TieringGetByResourceIdOptionalParams\n ): Promise<TieringGetByResourceIdResponse> {\n return tracingClient.withSpan(\n \"TieringClient.getByResourceId\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { resourceId, options },\n getByResourceIdOperationSpec\n ) as Promise<TieringGetByResourceIdResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getByResourceIdOperationSpec: coreClient.OperationSpec = {\n path: \"/administration/tiers/resources/{resourceId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcsTier\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.resourceId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -12,14 +12,13 @@ const tslib_1 = require("tslib");
|
|
|
12
12
|
const coreClient = tslib_1.__importStar(require("@azure/core-client"));
|
|
13
13
|
const index_js_1 = require("./operations/index.js");
|
|
14
14
|
class TieringClient extends coreClient.ServiceClient {
|
|
15
|
-
endpoint;
|
|
16
|
-
apiVersion;
|
|
17
15
|
/**
|
|
18
16
|
* Initializes a new instance of the TieringClient class.
|
|
19
17
|
* @param endpoint The communication resource, for example https://resourcename.communication.azure.com
|
|
20
18
|
* @param options The parameter options
|
|
21
19
|
*/
|
|
22
20
|
constructor(endpoint, options) {
|
|
21
|
+
var _a, _b;
|
|
23
22
|
if (endpoint === undefined) {
|
|
24
23
|
throw new Error("'endpoint' cannot be null");
|
|
25
24
|
}
|
|
@@ -34,14 +33,9 @@ class TieringClient extends coreClient.ServiceClient {
|
|
|
34
33
|
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
35
34
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
36
35
|
: `${packageDetails}`;
|
|
37
|
-
const optionsWithDefaults = {
|
|
38
|
-
...defaults,
|
|
39
|
-
...options,
|
|
40
|
-
userAgentOptions: {
|
|
36
|
+
const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
|
|
41
37
|
userAgentPrefix
|
|
42
|
-
},
|
|
43
|
-
endpoint: options.endpoint ?? options.baseUri ?? "{endpoint}"
|
|
44
|
-
};
|
|
38
|
+
}, endpoint: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
|
|
45
39
|
super(optionsWithDefaults);
|
|
46
40
|
// Parameter assignments
|
|
47
41
|
this.endpoint = endpoint;
|
|
@@ -76,8 +70,6 @@ class TieringClient extends coreClient.ServiceClient {
|
|
|
76
70
|
};
|
|
77
71
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
78
72
|
}
|
|
79
|
-
numberAllotment;
|
|
80
|
-
tiering;
|
|
81
73
|
}
|
|
82
74
|
exports.TieringClient = TieringClient;
|
|
83
75
|
//# sourceMappingURL=tieringClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../../../src/generated/src/tieringClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AAMjD,oDAAyE;AAIzE,MAAa,aAAc,SAAQ,UAAU,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../../../src/generated/src/tieringClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AAMjD,oDAAyE;AAIzE,MAAa,aAAc,SAAQ,UAAU,CAAC,aAAa;IAIzD;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAqC;;QACjE,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,GAAgC;YAC5C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,6CAA6C,CAAC;QACrE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,QAAQ,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,YAAY,GAC9D,CAAC;QACF,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC3B,wBAAwB;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,0CAA0C;QAC1C,IAAI,CAA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yright (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 { NumberAllotmentImpl, TieringImpl } from \"./operations/index.js\";\nimport { NumberAllotment, Tiering } from \"./operationsInterfaces/index.js\";\nimport { TieringClientOptionalParams } from \"./models/index.js\";\n\nexport class TieringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the TieringClient 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?: TieringClientOptionalParams) {\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: TieringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-tiering/1.0.0-beta.1`;\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-06-15\";\n this.numberAllotment = new NumberAllotmentImpl(this);\n this.tiering = new TieringImpl(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 numberAllotment: NumberAllotment;\n tiering: Tiering;\n}\n"]}
|
|
@@ -15,23 +15,16 @@ const isTieringClientOptions = (options) => options && !(0, communication_common
|
|
|
15
15
|
* Client class for interacting with Azure Communication Services Tiering.
|
|
16
16
|
*/
|
|
17
17
|
class TieringClient {
|
|
18
|
-
/**
|
|
19
|
-
* A reference to the auto-generated TieringClient HTTP client.
|
|
20
|
-
*/
|
|
21
|
-
client;
|
|
22
18
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
23
19
|
const { url, credential } = (0, communication_common_2.parseClientArguments)(connectionStringOrUrl, credentialOrOptions);
|
|
24
20
|
const options = isTieringClientOptions(credentialOrOptions)
|
|
25
21
|
? credentialOrOptions
|
|
26
22
|
: maybeOptions;
|
|
27
|
-
const internalPipelineOptions = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
loggingOptions: {
|
|
31
|
-
logger: index_js_2.logger.info,
|
|
32
|
-
},
|
|
23
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
24
|
+
loggingOptions: {
|
|
25
|
+
logger: index_js_2.logger.info,
|
|
33
26
|
},
|
|
34
|
-
};
|
|
27
|
+
});
|
|
35
28
|
this.client = new index_js_1.TieringClient(url, internalPipelineOptions);
|
|
36
29
|
const authPolicy = (0, communication_common_1.createCommunicationAuthPolicy)(credential);
|
|
37
30
|
this.client.pipeline.addPolicy(authPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../src/tieringClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;;;AAU5C,gDAAqD;AACrD,sEAA4E;AAC5E,sEAAoF;AACpF,uDAAmF;AACnF,+CAA0C;AAC1C,2DAA2D;AAO3D,MAAM,sBAAsB,GAAG,CAAC,OAAY,EAAmC,EAAE,CAC/E,OAAO,IAAI,CAAC,IAAA,sCAAe,EAAC,OAAO,CAAC,IAAI,CAAC,IAAA,6BAAiB,EAAC,OAAO,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAa,aAAa;
|
|
1
|
+
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../src/tieringClient.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;;;AAU5C,gDAAqD;AACrD,sEAA4E;AAC5E,sEAAoF;AACpF,uDAAmF;AACnF,+CAA0C;AAC1C,2DAA2D;AAO3D,MAAM,sBAAsB,GAAG,CAAC,OAAY,EAAmC,EAAE,CAC/E,OAAO,IAAI,CAAC,IAAA,sCAAe,EAAC,OAAO,CAAC,IAAI,CAAC,IAAA,6BAAiB,EAAC,OAAO,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAa,aAAa;IAgCxB,YACE,qBAA6B,EAC7B,mBAA4E,EAC5E,eAAqC,EAAE;QAEvC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,IAAA,2CAAoB,EAAC,qBAAqB,EAAE,mBAAmB,CAAC,CAAC;QAC7F,MAAM,OAAO,GAAG,sBAAsB,CAAC,mBAAmB,CAAC;YACzD,CAAC,CAAC,mBAAmB;YACrB,CAAC,CAAC,YAAY,CAAC;QAEjB,MAAM,uBAAuB,mCACxB,OAAO,GACP;YACD,cAAc,EAAE;gBACd,MAAM,EAAE,iBAAM,CAAC,IAAI;aACpB;SACF,CACF,CAAC;QAEF,IAAI,CAAC,MAAM,GAAG,IAAI,wBAAsB,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,IAAA,oDAA6B,EAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAC5B,UAAkB,EAClB,UAAgE,EAAE;QAElE,OAAO,0BAAa,CAAC,QAAQ,CAC3B,yCAAyC,EACzC,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACzF,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CACxB,UAAkB,EAClB,UAAgD,EAAE;QAElD,OAAO,0BAAa,CAAC,QAAQ,CAAC,6BAA6B,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,EAAE;YACvF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAvFD,sCAuFC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type {\n NumberAllotmentGetAcquiredNumberLimitsOptionalParams,\n TieringGetByResourceIdOptionalParams,\n AcsTier,\n AssetDetailsModel,\n} from \"./models.js\";\nimport type { CommonClientOptions, InternalClientPipelineOptions } from \"@azure/core-client\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport { TieringClient as TieringGeneratedClient } from \"./generated/src/index.js\";\nimport { logger } from \"./utils/index.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\n\n/**\n * Client options used to configure the TieringGeneratedClient API requests.\n */\nexport interface TieringClientOptions extends CommonClientOptions {}\n\nconst isTieringClientOptions = (options: any): options is TieringClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services Tiering.\n */\nexport class TieringClient {\n /**\n * A reference to the auto-generated TieringClient HTTP client.\n */\n private readonly client: TieringGeneratedClient;\n\n /**\n * Initializes a new instance of the TieringClient class using a connection string.\n *\n * @param connectionString - Connection string to connect to an Azure Communication Service resource. (eg: endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret)\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: TieringClientOptions);\n\n /**\n * Initializes a new instance of the TieringClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net)\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(endpoint: string, credential: KeyCredential, options?: TieringClientOptions);\n\n /**\n * Initializes a new instance of the TieringClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net)\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(endpoint: string, credential: TokenCredential, options?: TieringClientOptions);\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | TieringClientOptions,\n maybeOptions: TieringClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isTieringClientOptions(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 TieringGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Get acquired numbers and limits for a resource.\n *\n * @param options - Additional request options.\n */\n public getAcquiredNumberLimits(\n resourceId: string,\n options: NumberAllotmentGetAcquiredNumberLimitsOptionalParams = {},\n ): Promise<AssetDetailsModel> {\n return tracingClient.withSpan(\n \"numberAllotment.getAcquiredNumberLimits\",\n options,\n (updatedOptions) => {\n return this.client.numberAllotment.getAcquiredNumberLimits(resourceId, updatedOptions);\n },\n );\n }\n\n /**\n * Get tiering info for a resource.\n *\n * @param options - Additional request options.\n */\n public getTierByResourceId(\n resourceId: string,\n options: TieringGetByResourceIdOptionalParams = {},\n ): Promise<AcsTier> {\n return tracingClient.withSpan(\"tiering.getTierByResourceId\", options, (updatedOptions) => {\n return this.client.tiering.getByResourceId(resourceId, updatedOptions);\n });\n }\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
|
+
}
|
|
@@ -11,7 +11,6 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing NumberAllotment operations. */
|
|
13
13
|
export class NumberAllotmentImpl {
|
|
14
|
-
client;
|
|
15
14
|
/**
|
|
16
15
|
* Initialize a new instance of the class NumberAllotment class.
|
|
17
16
|
* @param client Reference to the service client
|
|
@@ -25,7 +24,7 @@ export class NumberAllotmentImpl {
|
|
|
25
24
|
* @param options The options parameters.
|
|
26
25
|
*/
|
|
27
26
|
async getAcquiredNumberLimits(resourceId, options) {
|
|
28
|
-
return tracingClient.withSpan("TieringClient.getAcquiredNumberLimits", options
|
|
27
|
+
return tracingClient.withSpan("TieringClient.getAcquiredNumberLimits", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
29
28
|
return this.client.sendOperationRequest({ resourceId, options }, getAcquiredNumberLimitsOperationSpec);
|
|
30
29
|
});
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberAllotment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/numberAllotment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,mDAAmD;AACnD,MAAM,OAAO,mBAAmB;
|
|
1
|
+
{"version":3,"file":"numberAllotment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/numberAllotment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,mDAAmD;AACnD,MAAM,OAAO,mBAAmB;IAG9B;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,uBAAuB,CAC3B,UAAkB,EAClB,OAA8D;QAE9D,OAAO,aAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,UAAU,EAAE,OAAO,EAAE,EACvB,oCAAoC,CACsB,CAAC;QAC/D,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,oCAAoC,GAA6B;IACrE,IAAI,EAAE,iEAAiE;IACvE,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EACR,OAAO,CAAC,8GAA8G;SACzH;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC3D,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 { NumberAllotment } 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 { TieringClient } from \"../tieringClient.js\";\nimport {\n NumberAllotmentGetAcquiredNumberLimitsOptionalParams,\n NumberAllotmentGetAcquiredNumberLimitsResponse\n} from \"../models/index.js\";\n\n/** Class containing NumberAllotment operations. */\nexport class NumberAllotmentImpl implements NumberAllotment {\n private readonly client: TieringClient;\n\n /**\n * Initialize a new instance of the class NumberAllotment class.\n * @param client Reference to the service client\n */\n constructor(client: TieringClient) {\n this.client = client;\n }\n\n /**\n * Get acquired numbers and limits for a resource.\n * @param resourceId Resource Id. Must be a valid GUID\n * @param options The options parameters.\n */\n async getAcquiredNumberLimits(\n resourceId: string,\n options?: NumberAllotmentGetAcquiredNumberLimitsOptionalParams\n ): Promise<NumberAllotmentGetAcquiredNumberLimitsResponse> {\n return tracingClient.withSpan(\n \"TieringClient.getAcquiredNumberLimits\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { resourceId, options },\n getAcquiredNumberLimitsOperationSpec\n ) as Promise<NumberAllotmentGetAcquiredNumberLimitsResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getAcquiredNumberLimitsOperationSpec: coreClient.OperationSpec = {\n path: \"/administration/resources/{resourceId}/telephone-number-summary\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper:\n Mappers.Paths190FnhrAdministrationResourcesResourceidTelephoneNumberSummaryGetResponses200ContentApplicationJsonSchema\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.resourceId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -11,7 +11,6 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing Tiering operations. */
|
|
13
13
|
export class TieringImpl {
|
|
14
|
-
client;
|
|
15
14
|
/**
|
|
16
15
|
* Initialize a new instance of the class Tiering class.
|
|
17
16
|
* @param client Reference to the service client
|
|
@@ -25,7 +24,7 @@ export class TieringImpl {
|
|
|
25
24
|
* @param options The options parameters.
|
|
26
25
|
*/
|
|
27
26
|
async getByResourceId(resourceId, options) {
|
|
28
|
-
return tracingClient.withSpan("TieringClient.getByResourceId", options
|
|
27
|
+
return tracingClient.withSpan("TieringClient.getByResourceId", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
29
28
|
return this.client.sendOperationRequest({ resourceId, options }, getByResourceIdOperationSpec);
|
|
30
29
|
});
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiering.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/tiering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,2CAA2C;AAC3C,MAAM,OAAO,WAAW;
|
|
1
|
+
{"version":3,"file":"tiering.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/tiering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,2CAA2C;AAC3C,MAAM,OAAO,WAAW;IAGtB;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CACnB,UAAkB,EAClB,OAA8C;QAE9C,OAAO,aAAa,CAAC,QAAQ,CAC3B,+BAA+B,EAC/B,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,UAAU,EAAE,OAAO,EAAE,EACvB,4BAA4B,CACc,CAAC;QAC/C,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EAAE,8CAA8C;IACpD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,OAAO;SAC5B;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC3D,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 { Tiering } 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 { TieringClient } from \"../tieringClient.js\";\nimport {\n TieringGetByResourceIdOptionalParams,\n TieringGetByResourceIdResponse\n} from \"../models/index.js\";\n\n/** Class containing Tiering operations. */\nexport class TieringImpl implements Tiering {\n private readonly client: TieringClient;\n\n /**\n * Initialize a new instance of the class Tiering class.\n * @param client Reference to the service client\n */\n constructor(client: TieringClient) {\n this.client = client;\n }\n\n /**\n * Get the tiering data for a given resource\n * @param resourceId Resource Id. Must be a valid GUID\n * @param options The options parameters.\n */\n async getByResourceId(\n resourceId: string,\n options?: TieringGetByResourceIdOptionalParams\n ): Promise<TieringGetByResourceIdResponse> {\n return tracingClient.withSpan(\n \"TieringClient.getByResourceId\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { resourceId, options },\n getByResourceIdOperationSpec\n ) as Promise<TieringGetByResourceIdResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getByResourceIdOperationSpec: coreClient.OperationSpec = {\n path: \"/administration/tiers/resources/{resourceId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcsTier\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.resourceId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -8,14 +8,13 @@
|
|
|
8
8
|
import * as coreClient from "@azure/core-client";
|
|
9
9
|
import { NumberAllotmentImpl, TieringImpl } from "./operations/index.js";
|
|
10
10
|
export class TieringClient extends coreClient.ServiceClient {
|
|
11
|
-
endpoint;
|
|
12
|
-
apiVersion;
|
|
13
11
|
/**
|
|
14
12
|
* Initializes a new instance of the TieringClient 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 TieringClient 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;
|
|
@@ -72,7 +66,5 @@ export class TieringClient extends coreClient.ServiceClient {
|
|
|
72
66
|
};
|
|
73
67
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
74
68
|
}
|
|
75
|
-
numberAllotment;
|
|
76
|
-
tiering;
|
|
77
69
|
}
|
|
78
70
|
//# sourceMappingURL=tieringClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../../../src/generated/src/tieringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzE,MAAM,OAAO,aAAc,SAAQ,UAAU,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../../../src/generated/src/tieringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzE,MAAM,OAAO,aAAc,SAAQ,UAAU,CAA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CAAC;QACD,MAAM,gBAAgB,GAAG;YACvB,IAAI,EAAE,wBAAwB;YAC9B,KAAK,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;CAIF","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 { NumberAllotmentImpl, TieringImpl } from \"./operations/index.js\";\nimport { NumberAllotment, Tiering } from \"./operationsInterfaces/index.js\";\nimport { TieringClientOptionalParams } from \"./models/index.js\";\n\nexport class TieringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the TieringClient 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?: TieringClientOptionalParams) {\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: TieringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-tiering/1.0.0-beta.1`;\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-06-15\";\n this.numberAllotment = new NumberAllotmentImpl(this);\n this.tiering = new TieringImpl(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 numberAllotment: NumberAllotment;\n tiering: Tiering;\n}\n"]}
|
|
@@ -12,23 +12,16 @@ const isTieringClientOptions = (options) => options && !isKeyCredential(options)
|
|
|
12
12
|
* Client class for interacting with Azure Communication Services Tiering.
|
|
13
13
|
*/
|
|
14
14
|
export class TieringClient {
|
|
15
|
-
/**
|
|
16
|
-
* A reference to the auto-generated TieringClient HTTP client.
|
|
17
|
-
*/
|
|
18
|
-
client;
|
|
19
15
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
20
16
|
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
21
17
|
const options = isTieringClientOptions(credentialOrOptions)
|
|
22
18
|
? credentialOrOptions
|
|
23
19
|
: maybeOptions;
|
|
24
|
-
const internalPipelineOptions = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
loggingOptions: {
|
|
28
|
-
logger: logger.info,
|
|
29
|
-
},
|
|
20
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
21
|
+
loggingOptions: {
|
|
22
|
+
logger: logger.info,
|
|
30
23
|
},
|
|
31
|
-
};
|
|
24
|
+
});
|
|
32
25
|
this.client = new TieringGeneratedClient(url, internalPipelineOptions);
|
|
33
26
|
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
34
27
|
this.client.pipeline.addPolicy(authPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../src/tieringClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAU5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC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,MAAM,GAAG,IAAI,sBAAsB,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;QACvE,MAAM,UAAU,GAAG,6BAA6B,CAAC,UAAU,CAAC,CAAC;QAC7D,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC7C,CAAC;IAED;;;;OAIG;IACI,uBAAuB,CAC5B,UAAkB,EAClB,UAAgE,EAAE;QAElE,OAAO,aAAa,CAAC,QAAQ,CAC3B,yCAAyC,EACzC,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,uBAAuB,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACzF,CAAC,CACF,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,mBAAmB,CACxB,UAAkB,EAClB,UAAgD,EAAE;QAElD,OAAO,aAAa,CAAC,QAAQ,CAAC,6BAA6B,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,EAAE;YACvF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type {\n NumberAllotmentGetAcquiredNumberLimitsOptionalParams,\n TieringGetByResourceIdOptionalParams,\n AcsTier,\n AssetDetailsModel,\n} from \"./models.js\";\nimport type { CommonClientOptions, InternalClientPipelineOptions } from \"@azure/core-client\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport { TieringClient as TieringGeneratedClient } from \"./generated/src/index.js\";\nimport { logger } from \"./utils/index.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\n\n/**\n * Client options used to configure the TieringGeneratedClient API requests.\n */\nexport interface TieringClientOptions extends CommonClientOptions {}\n\nconst isTieringClientOptions = (options: any): options is TieringClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services Tiering.\n */\nexport class TieringClient {\n /**\n * A reference to the auto-generated TieringClient HTTP client.\n */\n private readonly client: TieringGeneratedClient;\n\n /**\n * Initializes a new instance of the TieringClient class using a connection string.\n *\n * @param connectionString - Connection string to connect to an Azure Communication Service resource. (eg: endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret)\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: TieringClientOptions);\n\n /**\n * Initializes a new instance of the TieringClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net)\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(endpoint: string, credential: KeyCredential, options?: TieringClientOptions);\n\n /**\n * Initializes a new instance of the TieringClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net)\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(endpoint: string, credential: TokenCredential, options?: TieringClientOptions);\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | TieringClientOptions,\n maybeOptions: TieringClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isTieringClientOptions(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 TieringGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Get acquired numbers and limits for a resource.\n *\n * @param options - Additional request options.\n */\n public getAcquiredNumberLimits(\n resourceId: string,\n options: NumberAllotmentGetAcquiredNumberLimitsOptionalParams = {},\n ): Promise<AssetDetailsModel> {\n return tracingClient.withSpan(\n \"numberAllotment.getAcquiredNumberLimits\",\n options,\n (updatedOptions) => {\n return this.client.numberAllotment.getAcquiredNumberLimits(resourceId, updatedOptions);\n },\n );\n }\n\n /**\n * Get tiering info for a resource.\n *\n * @param options - Additional request options.\n */\n public getTierByResourceId(\n resourceId: string,\n options: TieringGetByResourceIdOptionalParams = {},\n ): Promise<AcsTier> {\n return tracingClient.withSpan(\"tiering.getTierByResourceId\", options, (updatedOptions) => {\n return this.client.tiering.getByResourceId(resourceId, updatedOptions);\n });\n }\n}\n"]}
|
|
@@ -11,7 +11,6 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing NumberAllotment operations. */
|
|
13
13
|
export class NumberAllotmentImpl {
|
|
14
|
-
client;
|
|
15
14
|
/**
|
|
16
15
|
* Initialize a new instance of the class NumberAllotment class.
|
|
17
16
|
* @param client Reference to the service client
|
|
@@ -25,7 +24,7 @@ export class NumberAllotmentImpl {
|
|
|
25
24
|
* @param options The options parameters.
|
|
26
25
|
*/
|
|
27
26
|
async getAcquiredNumberLimits(resourceId, options) {
|
|
28
|
-
return tracingClient.withSpan("TieringClient.getAcquiredNumberLimits", options
|
|
27
|
+
return tracingClient.withSpan("TieringClient.getAcquiredNumberLimits", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
29
28
|
return this.client.sendOperationRequest({ resourceId, options }, getAcquiredNumberLimitsOperationSpec);
|
|
30
29
|
});
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberAllotment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/numberAllotment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,mDAAmD;AACnD,MAAM,OAAO,mBAAmB;
|
|
1
|
+
{"version":3,"file":"numberAllotment.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/numberAllotment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,mDAAmD;AACnD,MAAM,OAAO,mBAAmB;IAG9B;;;OAGG;IACH,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,uBAAuB,CAC3B,UAAkB,EAClB,OAA8D;QAE9D,OAAO,aAAa,CAAC,QAAQ,CAC3B,uCAAuC,EACvC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,EACb,KAAK,EAAE,OAAO,EAAE,EAAE;YAChB,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,UAAU,EAAE,OAAO,EAAE,EACvB,oCAAoC,CACsB,CAAC;QAC/D,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,oCAAoC,GAA6B;IACrE,IAAI,EAAE,iEAAiE;IACvE,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EACR,OAAO,CAAC,8GAA8G;SACzH;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,0BAA0B;SAC/C;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC3D,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 { NumberAllotment } 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 { TieringClient } from \"../tieringClient.js\";\nimport {\n NumberAllotmentGetAcquiredNumberLimitsOptionalParams,\n NumberAllotmentGetAcquiredNumberLimitsResponse\n} from \"../models/index.js\";\n\n/** Class containing NumberAllotment operations. */\nexport class NumberAllotmentImpl implements NumberAllotment {\n private readonly client: TieringClient;\n\n /**\n * Initialize a new instance of the class NumberAllotment class.\n * @param client Reference to the service client\n */\n constructor(client: TieringClient) {\n this.client = client;\n }\n\n /**\n * Get acquired numbers and limits for a resource.\n * @param resourceId Resource Id. Must be a valid GUID\n * @param options The options parameters.\n */\n async getAcquiredNumberLimits(\n resourceId: string,\n options?: NumberAllotmentGetAcquiredNumberLimitsOptionalParams\n ): Promise<NumberAllotmentGetAcquiredNumberLimitsResponse> {\n return tracingClient.withSpan(\n \"TieringClient.getAcquiredNumberLimits\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { resourceId, options },\n getAcquiredNumberLimitsOperationSpec\n ) as Promise<NumberAllotmentGetAcquiredNumberLimitsResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getAcquiredNumberLimitsOperationSpec: coreClient.OperationSpec = {\n path: \"/administration/resources/{resourceId}/telephone-number-summary\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper:\n Mappers.Paths190FnhrAdministrationResourcesResourceidTelephoneNumberSummaryGetResponses200ContentApplicationJsonSchema\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.resourceId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -11,7 +11,6 @@ import * as Mappers from "../models/mappers.js";
|
|
|
11
11
|
import * as Parameters from "../models/parameters.js";
|
|
12
12
|
/** Class containing Tiering operations. */
|
|
13
13
|
export class TieringImpl {
|
|
14
|
-
client;
|
|
15
14
|
/**
|
|
16
15
|
* Initialize a new instance of the class Tiering class.
|
|
17
16
|
* @param client Reference to the service client
|
|
@@ -25,7 +24,7 @@ export class TieringImpl {
|
|
|
25
24
|
* @param options The options parameters.
|
|
26
25
|
*/
|
|
27
26
|
async getByResourceId(resourceId, options) {
|
|
28
|
-
return tracingClient.withSpan("TieringClient.getByResourceId", options
|
|
27
|
+
return tracingClient.withSpan("TieringClient.getByResourceId", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
29
28
|
return this.client.sendOperationRequest({ resourceId, options }, getByResourceIdOperationSpec);
|
|
30
29
|
});
|
|
31
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tiering.js","sourceRoot":"","sources":["../../../../../src/generated/src/operations/tiering.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD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AE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,UAAU,CAAC;IAC3D,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 { Tiering } 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 { TieringClient } from \"../tieringClient.js\";\nimport {\n TieringGetByResourceIdOptionalParams,\n TieringGetByResourceIdResponse\n} from \"../models/index.js\";\n\n/** Class containing Tiering operations. */\nexport class TieringImpl implements Tiering {\n private readonly client: TieringClient;\n\n /**\n * Initialize a new instance of the class Tiering class.\n * @param client Reference to the service client\n */\n constructor(client: TieringClient) {\n this.client = client;\n }\n\n /**\n * Get the tiering data for a given resource\n * @param resourceId Resource Id. Must be a valid GUID\n * @param options The options parameters.\n */\n async getByResourceId(\n resourceId: string,\n options?: TieringGetByResourceIdOptionalParams\n ): Promise<TieringGetByResourceIdResponse> {\n return tracingClient.withSpan(\n \"TieringClient.getByResourceId\",\n options ?? {},\n async (options) => {\n return this.client.sendOperationRequest(\n { resourceId, options },\n getByResourceIdOperationSpec\n ) as Promise<TieringGetByResourceIdResponse>;\n }\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getByResourceIdOperationSpec: coreClient.OperationSpec = {\n path: \"/administration/tiers/resources/{resourceId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.AcsTier\n },\n default: {\n bodyMapper: Mappers.CommunicationErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.endpoint, Parameters.resourceId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
@@ -8,14 +8,13 @@
|
|
|
8
8
|
import * as coreClient from "@azure/core-client";
|
|
9
9
|
import { NumberAllotmentImpl, TieringImpl } from "./operations/index.js";
|
|
10
10
|
export class TieringClient extends coreClient.ServiceClient {
|
|
11
|
-
endpoint;
|
|
12
|
-
apiVersion;
|
|
13
11
|
/**
|
|
14
12
|
* Initializes a new instance of the TieringClient 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 TieringClient 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;
|
|
@@ -72,7 +66,5 @@ export class TieringClient extends coreClient.ServiceClient {
|
|
|
72
66
|
};
|
|
73
67
|
this.pipeline.addPolicy(apiVersionPolicy);
|
|
74
68
|
}
|
|
75
|
-
numberAllotment;
|
|
76
|
-
tiering;
|
|
77
69
|
}
|
|
78
70
|
//# sourceMappingURL=tieringClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../../../src/generated/src/tieringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzE,MAAM,OAAO,aAAc,SAAQ,UAAU,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../../../src/generated/src/tieringClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAMjD,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIzE,MAAM,OAAO,aAAc,SAAQ,UAAU,CAAC,aAAa;IAIzD;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAqC;;QACjE,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,GAAgC;YAC5C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,6CAA6C,CAAC;QACrE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GA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AAC;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;CAIF","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 { NumberAllotmentImpl, TieringImpl } from \"./operations/index.js\";\nimport { NumberAllotment, Tiering } from \"./operationsInterfaces/index.js\";\nimport { TieringClientOptionalParams } from \"./models/index.js\";\n\nexport class TieringClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the TieringClient 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?: TieringClientOptionalParams) {\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: TieringClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-tiering/1.0.0-beta.1`;\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-06-15\";\n this.numberAllotment = new NumberAllotmentImpl(this);\n this.tiering = new TieringImpl(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 numberAllotment: NumberAllotment;\n tiering: Tiering;\n}\n"]}
|
|
@@ -12,23 +12,16 @@ const isTieringClientOptions = (options) => options && !isKeyCredential(options)
|
|
|
12
12
|
* Client class for interacting with Azure Communication Services Tiering.
|
|
13
13
|
*/
|
|
14
14
|
export class TieringClient {
|
|
15
|
-
/**
|
|
16
|
-
* A reference to the auto-generated TieringClient HTTP client.
|
|
17
|
-
*/
|
|
18
|
-
client;
|
|
19
15
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
20
16
|
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
21
17
|
const options = isTieringClientOptions(credentialOrOptions)
|
|
22
18
|
? credentialOrOptions
|
|
23
19
|
: maybeOptions;
|
|
24
|
-
const internalPipelineOptions = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
loggingOptions: {
|
|
28
|
-
logger: logger.info,
|
|
29
|
-
},
|
|
20
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
21
|
+
loggingOptions: {
|
|
22
|
+
logger: logger.info,
|
|
30
23
|
},
|
|
31
|
-
};
|
|
24
|
+
});
|
|
32
25
|
this.client = new TieringGeneratedClient(url, internalPipelineOptions);
|
|
33
26
|
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
34
27
|
this.client.pipeline.addPolicy(authPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../src/tieringClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAU5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACnF,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAO3D,MAAM,sBAAsB,GAAG,CAAC,OAAY,EAAmC,EAAE,CAC/E,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAO,aAAa;
|
|
1
|
+
{"version":3,"file":"tieringClient.js","sourceRoot":"","sources":["../../src/tieringClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAU5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAAE,MAAM,0BAA0B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,EAAE;QAElD,OAAO,aAAa,CAAC,QAAQ,CAAC,6BAA6B,EAAE,OAAO,EAAE,CAAC,cAAc,EAAE,EAAE;YACvF,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;IACL,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type {\n NumberAllotmentGetAcquiredNumberLimitsOptionalParams,\n TieringGetByResourceIdOptionalParams,\n AcsTier,\n AssetDetailsModel,\n} from \"./models.js\";\nimport type { CommonClientOptions, InternalClientPipelineOptions } from \"@azure/core-client\";\nimport type { KeyCredential, TokenCredential } from \"@azure/core-auth\";\nimport { isTokenCredential } from \"@azure/core-auth\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport { TieringClient as TieringGeneratedClient } from \"./generated/src/index.js\";\nimport { logger } from \"./utils/index.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\n\n/**\n * Client options used to configure the TieringGeneratedClient API requests.\n */\nexport interface TieringClientOptions extends CommonClientOptions {}\n\nconst isTieringClientOptions = (options: any): options is TieringClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\n/**\n * Client class for interacting with Azure Communication Services Tiering.\n */\nexport class TieringClient {\n /**\n * A reference to the auto-generated TieringClient HTTP client.\n */\n private readonly client: TieringGeneratedClient;\n\n /**\n * Initializes a new instance of the TieringClient class using a connection string.\n *\n * @param connectionString - Connection string to connect to an Azure Communication Service resource. (eg: endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret)\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(connectionString: string, options?: TieringClientOptions);\n\n /**\n * Initializes a new instance of the TieringClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net)\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(endpoint: string, credential: KeyCredential, options?: TieringClientOptions);\n\n /**\n * Initializes a new instance of the TieringClient class using an Azure KeyCredential.\n *\n * @param endpoint - The endpoint of the service (eg: https://contoso.eastus.communications.azure.net)\n * @param credential - An object that is used to authenticate requests to the service. Use the Azure KeyCredential or `@azure/identity` to create a credential.\n * @param options - Optional. Options to configure the HTTP pipeline.\n */\n public constructor(endpoint: string, credential: TokenCredential, options?: TieringClientOptions);\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | TieringClientOptions,\n maybeOptions: TieringClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isTieringClientOptions(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 TieringGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n }\n\n /**\n * Get acquired numbers and limits for a resource.\n *\n * @param options - Additional request options.\n */\n public getAcquiredNumberLimits(\n resourceId: string,\n options: NumberAllotmentGetAcquiredNumberLimitsOptionalParams = {},\n ): Promise<AssetDetailsModel> {\n return tracingClient.withSpan(\n \"numberAllotment.getAcquiredNumberLimits\",\n options,\n (updatedOptions) => {\n return this.client.numberAllotment.getAcquiredNumberLimits(resourceId, updatedOptions);\n },\n );\n }\n\n /**\n * Get tiering info for a resource.\n *\n * @param options - Additional request options.\n */\n public getTierByResourceId(\n resourceId: string,\n options: TieringGetByResourceIdOptionalParams = {},\n ): Promise<AcsTier> {\n return tracingClient.withSpan(\"tiering.getTierByResourceId\", options, (updatedOptions) => {\n return this.client.tiering.getByResourceId(resourceId, updatedOptions);\n });\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/communication-tiering",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.20250901.2",
|
|
4
4
|
"description": "Test",
|
|
5
5
|
"sdk-type": "client",
|
|
6
6
|
"main": "./dist/commonjs/index.js",
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
"react-native"
|
|
122
122
|
],
|
|
123
123
|
"selfLink": false,
|
|
124
|
-
"project": "
|
|
124
|
+
"project": "./tsconfig.src.json"
|
|
125
125
|
},
|
|
126
126
|
"browser": "./dist/browser/index.js",
|
|
127
127
|
"exports": {
|