@azure-tools/communication-short-codes 1.0.0-alpha.20250730.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/README.md +0 -2
- package/dist/browser/generated/src/operations/shortCodes.js +137 -69
- package/dist/browser/generated/src/operations/shortCodes.js.map +1 -1
- package/dist/browser/generated/src/shortCodesClient.js +4 -11
- package/dist/browser/generated/src/shortCodesClient.js.map +1 -1
- package/dist/browser/shortCodesClient.js +4 -11
- package/dist/browser/shortCodesClient.js.map +1 -1
- package/dist/browser/utils/customPipelinePolicies.js +2 -1
- package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
- package/dist/commonjs/generated/src/operations/shortCodes.js +136 -69
- package/dist/commonjs/generated/src/operations/shortCodes.js.map +1 -1
- package/dist/commonjs/generated/src/shortCodesClient.js +4 -11
- package/dist/commonjs/generated/src/shortCodesClient.js.map +1 -1
- package/dist/commonjs/shortCodesClient.js +4 -11
- package/dist/commonjs/shortCodesClient.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/customPipelinePolicies.js +2 -1
- package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
- package/dist/esm/generated/src/operations/shortCodes.js +137 -69
- package/dist/esm/generated/src/operations/shortCodes.js.map +1 -1
- package/dist/esm/generated/src/shortCodesClient.js +4 -11
- package/dist/esm/generated/src/shortCodesClient.js.map +1 -1
- package/dist/esm/shortCodesClient.js +4 -11
- package/dist/esm/shortCodesClient.js.map +1 -1
- package/dist/esm/utils/customPipelinePolicies.js +2 -1
- package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
- package/dist/react-native/generated/src/operations/shortCodes.js +137 -69
- package/dist/react-native/generated/src/operations/shortCodes.js.map +1 -1
- package/dist/react-native/generated/src/shortCodesClient.js +4 -11
- package/dist/react-native/generated/src/shortCodesClient.js.map +1 -1
- package/dist/react-native/shortCodesClient.js +4 -11
- package/dist/react-native/shortCodesClient.js.map +1 -1
- package/dist/react-native/utils/customPipelinePolicies.js +2 -1
- package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortCodesClient.js","sourceRoot":"","sources":["../../../../src/generated/src/shortCodesClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAM9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,OAAO,gBAAiB,SAAQ,UAAU,CAAC,aAAa;
|
|
1
|
+
{"version":3,"file":"shortCodesClient.js","sourceRoot":"","sources":["../../../../src/generated/src/shortCodesClient.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,gBAAgB,MAAM,2BAA2B,CAAC;AAM9D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIvD,MAAM,OAAO,gBAAiB,SAAQ,UAAU,CAAC,aAAa;IAI5D;;;;OAIG;IACH,YAAY,QAAgB,EAAE,OAAwC;;QACpE,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,GAAmC;YAC/C,kBAAkB,EAAE,iCAAiC;SACtD,CAAC;QAEF,MAAM,cAAc,GAAG,iDAAiD,CAAC;QACzE,MAAM,eAAe,GACnB,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,gBAAgB,CAAC,eAAe;YAClE,CAAC,CAAC,GAAG,OAAO,CAAC,gBAAgB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AAC,IAAI,CAAC,CAAC;QAC3C,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;CAGF","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport { ShortCodesImpl } from \"./operations/index.js\";\nimport { ShortCodes } from \"./operationsInterfaces/index.js\";\nimport { ShortCodesClientOptionalParams } from \"./models/index.js\";\n\nexport class ShortCodesClient extends coreClient.ServiceClient {\n endpoint: string;\n apiVersion: string;\n\n /**\n * Initializes a new instance of the ShortCodesClient 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?: ShortCodesClientOptionalParams) {\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: ShortCodesClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\"\n };\n\n const packageDetails = `azsdk-js-communication-short-codes/1.0.0-beta.5`;\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 baseUri: options.endpoint ?? options.baseUri ?? \"{endpoint}\"\n };\n super(optionsWithDefaults);\n\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n if (!bearerTokenAuthenticationPolicyFound) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n scopes: `${optionsWithDefaults.baseUri}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n }\n // Parameter assignments\n this.endpoint = endpoint;\n\n // Assigning values to Constant parameters\n this.apiVersion = options.apiVersion || \"2022-09-06\";\n this.shortCodes = new ShortCodesImpl(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 shortCodes: ShortCodes;\n}\n"]}
|
|
@@ -10,23 +10,16 @@ import { tracingClient } from "./generated/src/tracing.js";
|
|
|
10
10
|
import { createShortCodesPagingPolicy } from "./utils/customPipelinePolicies.js";
|
|
11
11
|
const isShortCodesClientOptions = (options) => options && !isKeyCredential(options) && !isTokenCredential(options);
|
|
12
12
|
export class ShortCodesClient {
|
|
13
|
-
/**
|
|
14
|
-
* A reference to the auto-generated ShortCodes HTTP client.
|
|
15
|
-
*/
|
|
16
|
-
client;
|
|
17
13
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
18
14
|
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
19
15
|
const options = isShortCodesClientOptions(credentialOrOptions)
|
|
20
16
|
? credentialOrOptions
|
|
21
17
|
: maybeOptions;
|
|
22
|
-
const internalPipelineOptions = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
loggingOptions: {
|
|
26
|
-
logger: logger.info,
|
|
27
|
-
},
|
|
18
|
+
const internalPipelineOptions = Object.assign(Object.assign({}, options), {
|
|
19
|
+
loggingOptions: {
|
|
20
|
+
logger: logger.info,
|
|
28
21
|
},
|
|
29
|
-
};
|
|
22
|
+
});
|
|
30
23
|
this.client = new ShortCodesGeneratedClient(url, internalPipelineOptions);
|
|
31
24
|
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
32
25
|
this.client.pipeline.addPolicy(authPolicy);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shortCodesClient.js","sourceRoot":"","sources":["../../src/shortCodesClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAkB5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAQrD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAOjF,MAAM,yBAAyB,GAAG,CAAC,OAAY,EAAsC,EAAE,CACrF,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAEtE,MAAM,OAAO,gBAAgB;IAC3B;;OAEG;IACc,MAAM,CAA4B;IAgBnD,YACE,qBAA6B,EAC7B,mBAA+E,EAC/E,eAAwC,EAAE;QAE1C,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,oBAAoB,CAAC,qBAAqB,EAAE,mBAAmB,CAAC,CAAC;QAC7F,MAAM,OAAO,GAAG,yBAAyB,CAAC,mBAAmB,CAAC;YAC5D,CAAC,CAAC,mBAAm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AC,CAAC;YACH,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAEM,8BAA8B,CACnC,cAAsB,EACtB,YAAoB,EACpB,UAAkE,EAAE;QAEpE,OAAO,aAAa,CAAC,QAAQ,CAC3B,iDAAiD,EACjD,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAC1D,cAAc,EACd,YAAY,EACZ,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAEM,uCAAuC,CAC5C,cAAsB,EACtB,YAAoB,EACpB,QAAgB,EAChB,QAAkB,EAClB,WAAmB,EACnB,cAA8B,EAC9B,UAA2E,EAAE;QAE7E,OAAO,aAAa,CAAC,QAAQ,CAC3B,0DAA0D,EAC1D,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,uCAAuC,CACnE,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type {\n AttachmentType,\n DeleteUSProgramBriefOptions,\n FileType,\n GetUSProgramBriefOptions,\n ListShortCodesOptions,\n ListShortCodeCostsOptions,\n ListUSProgramBriefsOptions,\n ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams,\n ShortCodesDeleteUSProgramBriefAttachmentOptionalParams,\n ShortCodesGetUSProgramBriefAttachmentOptionalParams,\n ShortCodesGetUSProgramBriefAttachmentsOptionalParams,\n SubmitUSProgramBriefOptions,\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 type {\n ProgramBriefAttachment,\n ShortCode,\n ShortCodeCost,\n ShortCodesUpsertUSProgramBriefOptionalParams,\n USProgramBrief,\n} from \"./generated/src/models/index.js\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { ShortCodesClient as ShortCodesGeneratedClient } from \"./generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { logger } from \"./utils/index.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\nimport { createShortCodesPagingPolicy } from \"./utils/customPipelinePolicies.js\";\n\n/**\n * Client options used to configure the ShortCodesClient API requests.\n */\nexport interface ShortCodesClientOptions extends CommonClientOptions {}\n\nconst isShortCodesClientOptions = (options: any): options is ShortCodesClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\nexport class ShortCodesClient {\n /**\n * A reference to the auto-generated ShortCodes HTTP client.\n */\n private readonly client: ShortCodesGeneratedClient;\n\n public constructor(connectionString: string, options?: ShortCodesClientOptions);\n\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: ShortCodesClientOptions,\n );\n\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: ShortCodesClientOptions,\n );\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | ShortCodesClientOptions,\n maybeOptions: ShortCodesClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isShortCodesClientOptions(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 ShortCodesGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n // This policy is temporary workarounds to address compatibility issues with Azure Core V2.\n const shortCodesPagingPolicy = createShortCodesPagingPolicy(url);\n this.client.pipeline.addPolicy(shortCodesPagingPolicy);\n }\n\n public listShortCodes(\n options: ListShortCodesOptions = {},\n ): PagedAsyncIterableIterator<ShortCode> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listShortCodes\",\n options,\n );\n try {\n return this.client.shortCodes.listShortCodes(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public listShortCodeCosts(\n options: ListShortCodeCostsOptions = {},\n ): PagedAsyncIterableIterator<ShortCodeCost> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listShortCodeCosts\",\n options,\n );\n try {\n return this.client.shortCodes.listCosts(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public upsertUSProgramBrief(\n programBriefId: string,\n options: ShortCodesUpsertUSProgramBriefOptionalParams = {},\n ): Promise<USProgramBrief> {\n return tracingClient.withSpan(\n \"ShortCodesClient-upsertUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.upsertUSProgramBrief(programBriefId, updatedOptions);\n },\n );\n }\n\n public deleteUSProgramBrief(\n programBriefId: string,\n options: DeleteUSProgramBriefOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShortCodesClient-deleteUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.deleteUSProgramBrief(programBriefId, updatedOptions);\n },\n );\n }\n\n public getUSProgramBrief(\n programBriefId: string,\n options: GetUSProgramBriefOptions = {},\n ): Promise<USProgramBrief> {\n return tracingClient.withSpan(\n \"ShortCodesClient-getUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.getUSProgramBrief(programBriefId, updatedOptions);\n },\n );\n }\n\n public listUSProgramBriefs(\n options: ListUSProgramBriefsOptions = {},\n ): PagedAsyncIterableIterator<USProgramBrief> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listUSProgramBriefs\",\n options,\n );\n try {\n return this.client.shortCodes.listUSProgramBriefs(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public submitUSProgramBrief(\n programBriefId: string,\n options: SubmitUSProgramBriefOptions = {},\n ): Promise<USProgramBrief> {\n return tracingClient.withSpan(\n \"ShortCodesClient-submitUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.submitUSProgramBrief(programBriefId, updatedOptions);\n },\n );\n }\n\n public getUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options: ShortCodesGetUSProgramBriefAttachmentOptionalParams = {},\n ): Promise<ProgramBriefAttachment> {\n return tracingClient.withSpan(\n \"ShortCodesClient-getUSProgramBriefAttachment\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.getUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n updatedOptions,\n );\n },\n );\n }\n\n public listUSProgramBriefAttachments(\n programBriefId: string,\n options: ShortCodesGetUSProgramBriefAttachmentsOptionalParams = {},\n ): PagedAsyncIterableIterator<ProgramBriefAttachment> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listUSProgramBriefAttachments\",\n options,\n );\n try {\n return this.client.shortCodes.listUSProgramBriefAttachments(programBriefId, updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public deleteUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options: ShortCodesDeleteUSProgramBriefAttachmentOptionalParams = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShortCodesClient-deleteUSProgramBriefAttachment\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.deleteUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n updatedOptions,\n );\n },\n );\n }\n\n public createOrReplaceUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n fileName: string,\n fileType: FileType,\n fileContent: string,\n attachmentType: AttachmentType,\n options: ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams = {},\n ): Promise<ProgramBriefAttachment> {\n return tracingClient.withSpan(\n \"ShortCodesClient-createOrReplaceUSProgramBriefAttachment\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.createOrReplaceUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n attachmentId,\n fileName,\n fileType,\n fileContent,\n attachmentType,\n updatedOptions,\n );\n },\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"shortCodesClient.js","sourceRoot":"","sources":["../../src/shortCodesClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,4CAA4C;AAkB5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAQrD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAE,gBAAgB,IAAI,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,6BAA6B,EAAE,MAAM,6BAA6B,CAAC;AAC5E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAOjF,MAAM,yBAAyB,GAAG,CAAC,OAAY,EAAsC,EAAE,CACrF,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;AAEtE,MAAM,OAAO,gBAAgB;IAoB3B,YACE,qBAA6B,EAC7B,mBAA+E,EAC/E,eAAwC,EAAE;QAE1C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AE,cAAc,CAAC,CAAC;QAC9F,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,IAAI,CAAC,SAAS,CAAC;gBACb,MAAM,EAAE,OAAO;gBACf,KAAK,EAAE,CAAC;aACT,CAAC,CAAC;YACH,MAAM,CAAC,CAAC;QACV,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,GAAG,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAEM,8BAA8B,CACnC,cAAsB,EACtB,YAAoB,EACpB,UAAkE,EAAE;QAEpE,OAAO,aAAa,CAAC,QAAQ,CAC3B,iDAAiD,EACjD,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAC1D,cAAc,EACd,YAAY,EACZ,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;IAEM,uCAAuC,CAC5C,cAAsB,EACtB,YAAoB,EACpB,QAAgB,EAChB,QAAkB,EAClB,WAAmB,EACnB,cAA8B,EAC9B,UAA2E,EAAE;QAE7E,OAAO,aAAa,CAAC,QAAQ,CAC3B,0DAA0D,EAC1D,OAAO,EACP,CAAC,cAAc,EAAE,EAAE;YACjB,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,uCAAuC,CACnE,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,cAAc,CACf,CAAC;QACJ,CAAC,CACF,CAAC;IACJ,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type {\n AttachmentType,\n DeleteUSProgramBriefOptions,\n FileType,\n GetUSProgramBriefOptions,\n ListShortCodesOptions,\n ListShortCodeCostsOptions,\n ListUSProgramBriefsOptions,\n ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams,\n ShortCodesDeleteUSProgramBriefAttachmentOptionalParams,\n ShortCodesGetUSProgramBriefAttachmentOptionalParams,\n ShortCodesGetUSProgramBriefAttachmentsOptionalParams,\n SubmitUSProgramBriefOptions,\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 type {\n ProgramBriefAttachment,\n ShortCode,\n ShortCodeCost,\n ShortCodesUpsertUSProgramBriefOptionalParams,\n USProgramBrief,\n} from \"./generated/src/models/index.js\";\nimport { isKeyCredential, parseClientArguments } from \"@azure/communication-common\";\nimport type { PagedAsyncIterableIterator } from \"@azure/core-paging\";\nimport { ShortCodesClient as ShortCodesGeneratedClient } from \"./generated/src/index.js\";\nimport { createCommunicationAuthPolicy } from \"@azure/communication-common\";\nimport { logger } from \"./utils/index.js\";\nimport { tracingClient } from \"./generated/src/tracing.js\";\nimport { createShortCodesPagingPolicy } from \"./utils/customPipelinePolicies.js\";\n\n/**\n * Client options used to configure the ShortCodesClient API requests.\n */\nexport interface ShortCodesClientOptions extends CommonClientOptions {}\n\nconst isShortCodesClientOptions = (options: any): options is ShortCodesClientOptions =>\n options && !isKeyCredential(options) && !isTokenCredential(options);\n\nexport class ShortCodesClient {\n /**\n * A reference to the auto-generated ShortCodes HTTP client.\n */\n private readonly client: ShortCodesGeneratedClient;\n\n public constructor(connectionString: string, options?: ShortCodesClientOptions);\n\n public constructor(\n endpoint: string,\n credential: KeyCredential,\n options?: ShortCodesClientOptions,\n );\n\n public constructor(\n endpoint: string,\n credential: TokenCredential,\n options?: ShortCodesClientOptions,\n );\n\n public constructor(\n connectionStringOrUrl: string,\n credentialOrOptions?: KeyCredential | TokenCredential | ShortCodesClientOptions,\n maybeOptions: ShortCodesClientOptions = {},\n ) {\n const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);\n const options = isShortCodesClientOptions(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 ShortCodesGeneratedClient(url, internalPipelineOptions);\n const authPolicy = createCommunicationAuthPolicy(credential);\n this.client.pipeline.addPolicy(authPolicy);\n // This policy is temporary workarounds to address compatibility issues with Azure Core V2.\n const shortCodesPagingPolicy = createShortCodesPagingPolicy(url);\n this.client.pipeline.addPolicy(shortCodesPagingPolicy);\n }\n\n public listShortCodes(\n options: ListShortCodesOptions = {},\n ): PagedAsyncIterableIterator<ShortCode> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listShortCodes\",\n options,\n );\n try {\n return this.client.shortCodes.listShortCodes(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public listShortCodeCosts(\n options: ListShortCodeCostsOptions = {},\n ): PagedAsyncIterableIterator<ShortCodeCost> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listShortCodeCosts\",\n options,\n );\n try {\n return this.client.shortCodes.listCosts(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public upsertUSProgramBrief(\n programBriefId: string,\n options: ShortCodesUpsertUSProgramBriefOptionalParams = {},\n ): Promise<USProgramBrief> {\n return tracingClient.withSpan(\n \"ShortCodesClient-upsertUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.upsertUSProgramBrief(programBriefId, updatedOptions);\n },\n );\n }\n\n public deleteUSProgramBrief(\n programBriefId: string,\n options: DeleteUSProgramBriefOptions = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShortCodesClient-deleteUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.deleteUSProgramBrief(programBriefId, updatedOptions);\n },\n );\n }\n\n public getUSProgramBrief(\n programBriefId: string,\n options: GetUSProgramBriefOptions = {},\n ): Promise<USProgramBrief> {\n return tracingClient.withSpan(\n \"ShortCodesClient-getUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.getUSProgramBrief(programBriefId, updatedOptions);\n },\n );\n }\n\n public listUSProgramBriefs(\n options: ListUSProgramBriefsOptions = {},\n ): PagedAsyncIterableIterator<USProgramBrief> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listUSProgramBriefs\",\n options,\n );\n try {\n return this.client.shortCodes.listUSProgramBriefs(updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public submitUSProgramBrief(\n programBriefId: string,\n options: SubmitUSProgramBriefOptions = {},\n ): Promise<USProgramBrief> {\n return tracingClient.withSpan(\n \"ShortCodesClient-submitUSProgramBrief\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.submitUSProgramBrief(programBriefId, updatedOptions);\n },\n );\n }\n\n public getUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options: ShortCodesGetUSProgramBriefAttachmentOptionalParams = {},\n ): Promise<ProgramBriefAttachment> {\n return tracingClient.withSpan(\n \"ShortCodesClient-getUSProgramBriefAttachment\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.getUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n updatedOptions,\n );\n },\n );\n }\n\n public listUSProgramBriefAttachments(\n programBriefId: string,\n options: ShortCodesGetUSProgramBriefAttachmentsOptionalParams = {},\n ): PagedAsyncIterableIterator<ProgramBriefAttachment> {\n const { span, updatedOptions } = tracingClient.startSpan(\n \"ShortCodesClient-listUSProgramBriefAttachments\",\n options,\n );\n try {\n return this.client.shortCodes.listUSProgramBriefAttachments(programBriefId, updatedOptions);\n } catch (e: any) {\n span.setStatus({\n status: \"error\",\n error: e,\n });\n throw e;\n } finally {\n span.end();\n }\n }\n\n public deleteUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n options: ShortCodesDeleteUSProgramBriefAttachmentOptionalParams = {},\n ): Promise<void> {\n return tracingClient.withSpan(\n \"ShortCodesClient-deleteUSProgramBriefAttachment\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.deleteUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n updatedOptions,\n );\n },\n );\n }\n\n public createOrReplaceUSProgramBriefAttachment(\n programBriefId: string,\n attachmentId: string,\n fileName: string,\n fileType: FileType,\n fileContent: string,\n attachmentType: AttachmentType,\n options: ShortCodesCreateOrReplaceUSProgramBriefAttachmentOptionalParams = {},\n ): Promise<ProgramBriefAttachment> {\n return tracingClient.withSpan(\n \"ShortCodesClient-createOrReplaceUSProgramBriefAttachment\",\n options,\n (updatedOptions) => {\n return this.client.shortCodes.createOrReplaceUSProgramBriefAttachment(\n programBriefId,\n attachmentId,\n attachmentId,\n fileName,\n fileType,\n fileContent,\n attachmentType,\n updatedOptions,\n );\n },\n );\n }\n}\n"]}
|
|
@@ -12,8 +12,9 @@ export function createShortCodesPagingPolicy(host) {
|
|
|
12
12
|
return {
|
|
13
13
|
name: "shortCodesPagingPolicy",
|
|
14
14
|
async sendRequest(request, next) {
|
|
15
|
+
var _a;
|
|
15
16
|
const response = await next(request);
|
|
16
|
-
let nextLink = response
|
|
17
|
+
let nextLink = (_a = response === null || response === void 0 ? void 0 : response.parsedBody) === null || _a === void 0 ? void 0 : _a.nextLink;
|
|
17
18
|
if (nextLink && !nextLink.startsWith(host)) {
|
|
18
19
|
nextLink = host.endsWith("/") ? nextLink.substring(1) : nextLink;
|
|
19
20
|
const absolutePath = `${host}${nextLink}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customPipelinePolicies.js","sourceRoot":"","sources":["../../../src/utils/customPipelinePolicies.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAAY;IACvD,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB
|
|
1
|
+
{"version":3,"file":"customPipelinePolicies.js","sourceRoot":"","sources":["../../../src/utils/customPipelinePolicies.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAAC,IAAY;IACvD,OAAO;QACL,IAAI,EAAE,wBAAwB;QAC9B,KAAK,CAAC,WAAW,CAAC,OAAwB,EAAE,IAAiB;;YAC3D,MAAM,QAAQ,GAA0B,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5D,IAAI,QAAQ,GAAW,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,0CAAE,QAAQ,CAAC;YAEtD,IAAI,QAAQ,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;gBACjE,MAAM,YAAY,GAAG,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;gBAC1C,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG,YAAY,CAAC;YAC9C,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullOperationResponse } from \"@azure/core-client\";\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates a `PipelinePolicy` that converts relative URL values in the `nextLink` property to absolute URLs.\n *\n * This is necessary because the Core V2 library does not support paging with relative links at time of writing.\n *\n * @param host - The base URL of the resource.\n * @returns the `PipelinePolicy` that addresses the issue.\n */\nexport function createShortCodesPagingPolicy(host: string): PipelinePolicy {\n return {\n name: \"shortCodesPagingPolicy\",\n async sendRequest(request: PipelineRequest, next: SendRequest): Promise<PipelineResponse> {\n const response: FullOperationResponse = await next(request);\n let nextLink: string = response?.parsedBody?.nextLink;\n\n if (nextLink && !nextLink.startsWith(host)) {\n nextLink = host.endsWith(\"/\") ? nextLink.substring(1) : nextLink;\n const absolutePath = `${host}${nextLink}`;\n response.parsedBody.nextLink = absolutePath;\n }\n\n return response;\n },\n };\n}\n"]}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
+
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
8
9
|
import { tracingClient } from "../tracing.js";
|
|
9
10
|
import * as coreClient from "@azure/core-client";
|
|
10
11
|
import * as Mappers from "../models/mappers.js";
|
|
@@ -12,7 +13,6 @@ import * as Parameters from "../models/parameters.js";
|
|
|
12
13
|
/// <reference lib="esnext.asynciterable" />
|
|
13
14
|
/** Class containing ShortCodes operations. */
|
|
14
15
|
export class ShortCodesImpl {
|
|
15
|
-
client;
|
|
16
16
|
/**
|
|
17
17
|
* Initialize a new instance of the class ShortCodes class.
|
|
18
18
|
* @param client Reference to the service client
|
|
@@ -38,20 +38,37 @@ export class ShortCodesImpl {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
41
|
+
getShortCodesPagingPage(options) {
|
|
42
|
+
return __asyncGenerator(this, arguments, function* getShortCodesPagingPage_1() {
|
|
43
|
+
let result = yield __await(this._getShortCodes(options));
|
|
44
|
+
yield yield __await(result.shortCodes || []);
|
|
45
|
+
let continuationToken = result.nextLink;
|
|
46
|
+
while (continuationToken) {
|
|
47
|
+
result = yield __await(this._getShortCodesNext(continuationToken, options));
|
|
48
|
+
continuationToken = result.nextLink;
|
|
49
|
+
yield yield __await(result.shortCodes || []);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
50
52
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
getShortCodesPagingAll(options) {
|
|
54
|
+
return __asyncGenerator(this, arguments, function* getShortCodesPagingAll_1() {
|
|
55
|
+
var _a, e_1, _b, _c;
|
|
56
|
+
try {
|
|
57
|
+
for (var _d = true, _e = __asyncValues(this.getShortCodesPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
58
|
+
_c = _f.value;
|
|
59
|
+
_d = false;
|
|
60
|
+
const page = _c;
|
|
61
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
65
|
+
finally {
|
|
66
|
+
try {
|
|
67
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
68
|
+
}
|
|
69
|
+
finally { if (e_1) throw e_1.error; }
|
|
70
|
+
}
|
|
71
|
+
});
|
|
55
72
|
}
|
|
56
73
|
/**
|
|
57
74
|
* This method supports pagination via the "skip" and "top" query parameters.
|
|
@@ -71,20 +88,37 @@ export class ShortCodesImpl {
|
|
|
71
88
|
}
|
|
72
89
|
};
|
|
73
90
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
91
|
+
getCostsPagingPage(options) {
|
|
92
|
+
return __asyncGenerator(this, arguments, function* getCostsPagingPage_1() {
|
|
93
|
+
let result = yield __await(this._getCosts(options));
|
|
94
|
+
yield yield __await(result.costs || []);
|
|
95
|
+
let continuationToken = result.nextLink;
|
|
96
|
+
while (continuationToken) {
|
|
97
|
+
result = yield __await(this._getCostsNext(continuationToken, options));
|
|
98
|
+
continuationToken = result.nextLink;
|
|
99
|
+
yield yield __await(result.costs || []);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
83
102
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
103
|
+
getCostsPagingAll(options) {
|
|
104
|
+
return __asyncGenerator(this, arguments, function* getCostsPagingAll_1() {
|
|
105
|
+
var _a, e_2, _b, _c;
|
|
106
|
+
try {
|
|
107
|
+
for (var _d = true, _e = __asyncValues(this.getCostsPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
108
|
+
_c = _f.value;
|
|
109
|
+
_d = false;
|
|
110
|
+
const page = _c;
|
|
111
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
115
|
+
finally {
|
|
116
|
+
try {
|
|
117
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
118
|
+
}
|
|
119
|
+
finally { if (e_2) throw e_2.error; }
|
|
120
|
+
}
|
|
121
|
+
});
|
|
88
122
|
}
|
|
89
123
|
/**
|
|
90
124
|
* Gets the list of US Program Briefs for the current resource.
|
|
@@ -104,20 +138,37 @@ export class ShortCodesImpl {
|
|
|
104
138
|
}
|
|
105
139
|
};
|
|
106
140
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
141
|
+
getUSProgramBriefsPagingPage(options) {
|
|
142
|
+
return __asyncGenerator(this, arguments, function* getUSProgramBriefsPagingPage_1() {
|
|
143
|
+
let result = yield __await(this._getUSProgramBriefs(options));
|
|
144
|
+
yield yield __await(result.programBriefs || []);
|
|
145
|
+
let continuationToken = result.nextLink;
|
|
146
|
+
while (continuationToken) {
|
|
147
|
+
result = yield __await(this._getUSProgramBriefsNext(continuationToken, options));
|
|
148
|
+
continuationToken = result.nextLink;
|
|
149
|
+
yield yield __await(result.programBriefs || []);
|
|
150
|
+
}
|
|
151
|
+
});
|
|
116
152
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
153
|
+
getUSProgramBriefsPagingAll(options) {
|
|
154
|
+
return __asyncGenerator(this, arguments, function* getUSProgramBriefsPagingAll_1() {
|
|
155
|
+
var _a, e_3, _b, _c;
|
|
156
|
+
try {
|
|
157
|
+
for (var _d = true, _e = __asyncValues(this.getUSProgramBriefsPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
158
|
+
_c = _f.value;
|
|
159
|
+
_d = false;
|
|
160
|
+
const page = _c;
|
|
161
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
165
|
+
finally {
|
|
166
|
+
try {
|
|
167
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
168
|
+
}
|
|
169
|
+
finally { if (e_3) throw e_3.error; }
|
|
170
|
+
}
|
|
171
|
+
});
|
|
121
172
|
}
|
|
122
173
|
/**
|
|
123
174
|
* Gets the list of attachments from a US Program Brief.
|
|
@@ -138,27 +189,44 @@ export class ShortCodesImpl {
|
|
|
138
189
|
}
|
|
139
190
|
};
|
|
140
191
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
192
|
+
getUSProgramBriefAttachmentsPagingPage(programBriefId, options) {
|
|
193
|
+
return __asyncGenerator(this, arguments, function* getUSProgramBriefAttachmentsPagingPage_1() {
|
|
194
|
+
let result = yield __await(this._getUSProgramBriefAttachments(programBriefId, options));
|
|
195
|
+
yield yield __await(result.attachments || []);
|
|
196
|
+
let continuationToken = result.nextLink;
|
|
197
|
+
while (continuationToken) {
|
|
198
|
+
result = yield __await(this._getUSProgramBriefAttachmentsNext(programBriefId, continuationToken, options));
|
|
199
|
+
continuationToken = result.nextLink;
|
|
200
|
+
yield yield __await(result.attachments || []);
|
|
201
|
+
}
|
|
202
|
+
});
|
|
150
203
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
204
|
+
getUSProgramBriefAttachmentsPagingAll(programBriefId, options) {
|
|
205
|
+
return __asyncGenerator(this, arguments, function* getUSProgramBriefAttachmentsPagingAll_1() {
|
|
206
|
+
var _a, e_4, _b, _c;
|
|
207
|
+
try {
|
|
208
|
+
for (var _d = true, _e = __asyncValues(this.getUSProgramBriefAttachmentsPagingPage(programBriefId, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
209
|
+
_c = _f.value;
|
|
210
|
+
_d = false;
|
|
211
|
+
const page = _c;
|
|
212
|
+
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
216
|
+
finally {
|
|
217
|
+
try {
|
|
218
|
+
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
219
|
+
}
|
|
220
|
+
finally { if (e_4) throw e_4.error; }
|
|
221
|
+
}
|
|
222
|
+
});
|
|
155
223
|
}
|
|
156
224
|
/**
|
|
157
225
|
* Gets the list of short codes for the current resource.
|
|
158
226
|
* @param options The options parameters.
|
|
159
227
|
*/
|
|
160
228
|
async _getShortCodes(options) {
|
|
161
|
-
return tracingClient.withSpan("ShortCodesClient._getShortCodes", options
|
|
229
|
+
return tracingClient.withSpan("ShortCodesClient._getShortCodes", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
162
230
|
return this.client.sendOperationRequest({ options }, getShortCodesOperationSpec);
|
|
163
231
|
});
|
|
164
232
|
}
|
|
@@ -167,7 +235,7 @@ export class ShortCodesImpl {
|
|
|
167
235
|
* @param options The options parameters.
|
|
168
236
|
*/
|
|
169
237
|
async _getCosts(options) {
|
|
170
|
-
return tracingClient.withSpan("ShortCodesClient._getCosts", options
|
|
238
|
+
return tracingClient.withSpan("ShortCodesClient._getCosts", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
171
239
|
return this.client.sendOperationRequest({ options }, getCostsOperationSpec);
|
|
172
240
|
});
|
|
173
241
|
}
|
|
@@ -177,7 +245,7 @@ export class ShortCodesImpl {
|
|
|
177
245
|
* @param options The options parameters.
|
|
178
246
|
*/
|
|
179
247
|
async upsertUSProgramBrief(programBriefId, options) {
|
|
180
|
-
return tracingClient.withSpan("ShortCodesClient.upsertUSProgramBrief", options
|
|
248
|
+
return tracingClient.withSpan("ShortCodesClient.upsertUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
181
249
|
return this.client.sendOperationRequest({ programBriefId, options }, upsertUSProgramBriefOperationSpec);
|
|
182
250
|
});
|
|
183
251
|
}
|
|
@@ -187,7 +255,7 @@ export class ShortCodesImpl {
|
|
|
187
255
|
* @param options The options parameters.
|
|
188
256
|
*/
|
|
189
257
|
async deleteUSProgramBrief(programBriefId, options) {
|
|
190
|
-
return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBrief", options
|
|
258
|
+
return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
191
259
|
return this.client.sendOperationRequest({ programBriefId, options }, deleteUSProgramBriefOperationSpec);
|
|
192
260
|
});
|
|
193
261
|
}
|
|
@@ -197,7 +265,7 @@ export class ShortCodesImpl {
|
|
|
197
265
|
* @param options The options parameters.
|
|
198
266
|
*/
|
|
199
267
|
async getUSProgramBrief(programBriefId, options) {
|
|
200
|
-
return tracingClient.withSpan("ShortCodesClient.getUSProgramBrief", options
|
|
268
|
+
return tracingClient.withSpan("ShortCodesClient.getUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
201
269
|
return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefOperationSpec);
|
|
202
270
|
});
|
|
203
271
|
}
|
|
@@ -207,7 +275,7 @@ export class ShortCodesImpl {
|
|
|
207
275
|
* @param options The options parameters.
|
|
208
276
|
*/
|
|
209
277
|
async submitUSProgramBrief(programBriefId, options) {
|
|
210
|
-
return tracingClient.withSpan("ShortCodesClient.submitUSProgramBrief", options
|
|
278
|
+
return tracingClient.withSpan("ShortCodesClient.submitUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
211
279
|
return this.client.sendOperationRequest({ programBriefId, options }, submitUSProgramBriefOperationSpec);
|
|
212
280
|
});
|
|
213
281
|
}
|
|
@@ -216,7 +284,7 @@ export class ShortCodesImpl {
|
|
|
216
284
|
* @param options The options parameters.
|
|
217
285
|
*/
|
|
218
286
|
async _getUSProgramBriefs(options) {
|
|
219
|
-
return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefs", options
|
|
287
|
+
return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefs", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
220
288
|
return this.client.sendOperationRequest({ options }, getUSProgramBriefsOperationSpec);
|
|
221
289
|
});
|
|
222
290
|
}
|
|
@@ -235,7 +303,7 @@ export class ShortCodesImpl {
|
|
|
235
303
|
* @param options The options parameters.
|
|
236
304
|
*/
|
|
237
305
|
async createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, id, fileName, fileType, fileContentBase64, type, options) {
|
|
238
|
-
return tracingClient.withSpan("ShortCodesClient.createOrReplaceUSProgramBriefAttachment", options
|
|
306
|
+
return tracingClient.withSpan("ShortCodesClient.createOrReplaceUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
239
307
|
return this.client.sendOperationRequest({
|
|
240
308
|
programBriefId,
|
|
241
309
|
attachmentId,
|
|
@@ -255,7 +323,7 @@ export class ShortCodesImpl {
|
|
|
255
323
|
* @param options The options parameters.
|
|
256
324
|
*/
|
|
257
325
|
async getUSProgramBriefAttachment(programBriefId, attachmentId, options) {
|
|
258
|
-
return tracingClient.withSpan("ShortCodesClient.getUSProgramBriefAttachment", options
|
|
326
|
+
return tracingClient.withSpan("ShortCodesClient.getUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
259
327
|
return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, getUSProgramBriefAttachmentOperationSpec);
|
|
260
328
|
});
|
|
261
329
|
}
|
|
@@ -266,7 +334,7 @@ export class ShortCodesImpl {
|
|
|
266
334
|
* @param options The options parameters.
|
|
267
335
|
*/
|
|
268
336
|
async deleteUSProgramBriefAttachment(programBriefId, attachmentId, options) {
|
|
269
|
-
return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBriefAttachment", options
|
|
337
|
+
return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
270
338
|
return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, deleteUSProgramBriefAttachmentOperationSpec);
|
|
271
339
|
});
|
|
272
340
|
}
|
|
@@ -276,7 +344,7 @@ export class ShortCodesImpl {
|
|
|
276
344
|
* @param options The options parameters.
|
|
277
345
|
*/
|
|
278
346
|
async _getUSProgramBriefAttachments(programBriefId, options) {
|
|
279
|
-
return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachments", options
|
|
347
|
+
return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachments", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
280
348
|
return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefAttachmentsOperationSpec);
|
|
281
349
|
});
|
|
282
350
|
}
|
|
@@ -286,7 +354,7 @@ export class ShortCodesImpl {
|
|
|
286
354
|
* @param options The options parameters.
|
|
287
355
|
*/
|
|
288
356
|
async _getShortCodesNext(nextLink, options) {
|
|
289
|
-
return tracingClient.withSpan("ShortCodesClient._getShortCodesNext", options
|
|
357
|
+
return tracingClient.withSpan("ShortCodesClient._getShortCodesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
290
358
|
return this.client.sendOperationRequest({ nextLink, options }, getShortCodesNextOperationSpec);
|
|
291
359
|
});
|
|
292
360
|
}
|
|
@@ -296,7 +364,7 @@ export class ShortCodesImpl {
|
|
|
296
364
|
* @param options The options parameters.
|
|
297
365
|
*/
|
|
298
366
|
async _getCostsNext(nextLink, options) {
|
|
299
|
-
return tracingClient.withSpan("ShortCodesClient._getCostsNext", options
|
|
367
|
+
return tracingClient.withSpan("ShortCodesClient._getCostsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
300
368
|
return this.client.sendOperationRequest({ nextLink, options }, getCostsNextOperationSpec);
|
|
301
369
|
});
|
|
302
370
|
}
|
|
@@ -306,7 +374,7 @@ export class ShortCodesImpl {
|
|
|
306
374
|
* @param options The options parameters.
|
|
307
375
|
*/
|
|
308
376
|
async _getUSProgramBriefsNext(nextLink, options) {
|
|
309
|
-
return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefsNext", options
|
|
377
|
+
return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
310
378
|
return this.client.sendOperationRequest({ nextLink, options }, getUSProgramBriefsNextOperationSpec);
|
|
311
379
|
});
|
|
312
380
|
}
|
|
@@ -318,7 +386,7 @@ export class ShortCodesImpl {
|
|
|
318
386
|
* @param options The options parameters.
|
|
319
387
|
*/
|
|
320
388
|
async _getUSProgramBriefAttachmentsNext(programBriefId, nextLink, options) {
|
|
321
|
-
return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachmentsNext", options
|
|
389
|
+
return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachmentsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
|
|
322
390
|
return this.client.sendOperationRequest({ programBriefId, nextLink, options }, getUSProgramBriefAttachmentsNextOperationSpec);
|
|
323
391
|
});
|
|
324
392
|
}
|
|
@@ -463,7 +531,7 @@ const createOrReplaceUSProgramBriefAttachmentOperationSpec = {
|
|
|
463
531
|
fileType: ["fileType"],
|
|
464
532
|
fileContentBase64: ["fileContentBase64"]
|
|
465
533
|
},
|
|
466
|
-
mapper: {
|
|
534
|
+
mapper: Object.assign(Object.assign({}, Mappers.ProgramBriefAttachment), { required: true })
|
|
467
535
|
},
|
|
468
536
|
queryParameters: [Parameters.apiVersion],
|
|
469
537
|
urlParameters: [
|