@azure-tools/communication-short-codes 1.0.0-alpha.20250718.1 → 1.0.0-alpha.20250730.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/generated/src/operations/shortCodes.js +69 -137
- package/dist/browser/generated/src/operations/shortCodes.js.map +1 -1
- package/dist/browser/generated/src/shortCodesClient.js +11 -4
- package/dist/browser/generated/src/shortCodesClient.js.map +1 -1
- package/dist/browser/shortCodesClient.js +11 -4
- package/dist/browser/shortCodesClient.js.map +1 -1
- package/dist/browser/utils/customPipelinePolicies.js +1 -2
- package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
- package/dist/commonjs/generated/src/operations/shortCodes.js +69 -136
- package/dist/commonjs/generated/src/operations/shortCodes.js.map +1 -1
- package/dist/commonjs/generated/src/shortCodesClient.js +11 -4
- package/dist/commonjs/generated/src/shortCodesClient.js.map +1 -1
- package/dist/commonjs/shortCodesClient.js +11 -4
- package/dist/commonjs/shortCodesClient.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/commonjs/utils/customPipelinePolicies.js +1 -2
- package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
- package/dist/esm/generated/src/operations/shortCodes.js +69 -137
- package/dist/esm/generated/src/operations/shortCodes.js.map +1 -1
- package/dist/esm/generated/src/shortCodesClient.js +11 -4
- package/dist/esm/generated/src/shortCodesClient.js.map +1 -1
- package/dist/esm/shortCodesClient.js +11 -4
- package/dist/esm/shortCodesClient.js.map +1 -1
- package/dist/esm/utils/customPipelinePolicies.js +1 -2
- package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
- package/dist/react-native/generated/src/operations/shortCodes.js +69 -137
- package/dist/react-native/generated/src/operations/shortCodes.js.map +1 -1
- package/dist/react-native/generated/src/shortCodesClient.js +11 -4
- package/dist/react-native/generated/src/shortCodesClient.js.map +1 -1
- package/dist/react-native/shortCodesClient.js +11 -4
- package/dist/react-native/shortCodesClient.js.map +1 -1
- package/dist/react-native/utils/customPipelinePolicies.js +1 -2
- package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
- package/package.json +2 -2
|
@@ -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;IAC5D,QAAQ,CAAS;IACjB,UAAU,CAAS;IAEnB;;;;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,GA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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;IAED,UAAU,CAAa;CACxB","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,16 +10,23 @@ 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;
|
|
13
17
|
constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
|
|
14
18
|
const { url, credential } = parseClientArguments(connectionStringOrUrl, credentialOrOptions);
|
|
15
19
|
const options = isShortCodesClientOptions(credentialOrOptions)
|
|
16
20
|
? credentialOrOptions
|
|
17
21
|
: maybeOptions;
|
|
18
|
-
const internalPipelineOptions =
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
const internalPipelineOptions = {
|
|
23
|
+
...options,
|
|
24
|
+
...{
|
|
25
|
+
loggingOptions: {
|
|
26
|
+
logger: logger.info,
|
|
27
|
+
},
|
|
21
28
|
},
|
|
22
|
-
}
|
|
29
|
+
};
|
|
23
30
|
this.client = new ShortCodesGeneratedClient(url, internalPipelineOptions);
|
|
24
31
|
const authPolicy = createCommunicationAuthPolicy(credential);
|
|
25
32
|
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;IAoB3B,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,mBAAmB;YACrB,CAAC,CAAC,YAAY,CAAC;QAEjB,MAAM,uBAAuB,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AG,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;IAC3B;;OAEG;IACc,MAAM,CAA4B;IAgBnD,YACE,qBAA6B,EAC7B,mBAA+E,EAC/E,eAAwC,EAAE;QAE1C,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,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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,9 +12,8 @@ export function createShortCodesPagingPolicy(host) {
|
|
|
12
12
|
return {
|
|
13
13
|
name: "shortCodesPagingPolicy",
|
|
14
14
|
async sendRequest(request, next) {
|
|
15
|
-
var _a;
|
|
16
15
|
const response = await next(request);
|
|
17
|
-
let nextLink =
|
|
16
|
+
let nextLink = response?.parsedBody?.nextLink;
|
|
18
17
|
if (nextLink && !nextLink.startsWith(host)) {
|
|
19
18
|
nextLink = host.endsWith("/") ? nextLink.substring(1) : nextLink;
|
|
20
19
|
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,QAAQ,EAAE,UAAU,EAAE,QAAQ,CAAC;YAEtD,IAAI,QAAQ,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC3C,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;gBACjE,MAAM,YAAY,GAAG,GAAG,IAAI,GAAG,QAAQ,EAAE,CAAC;gBAC1C,QAAQ,CAAC,UAAU,CAAC,QAAQ,GAAG,YAAY,CAAC;YAC9C,CAAC;YAED,OAAO,QAAQ,CAAC;QAClB,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { FullOperationResponse } from \"@azure/core-client\";\nimport type {\n PipelinePolicy,\n PipelineRequest,\n PipelineResponse,\n SendRequest,\n} from \"@azure/core-rest-pipeline\";\n\n/**\n * Creates a `PipelinePolicy` that converts relative URL values in the `nextLink` property to absolute URLs.\n *\n * This is necessary because the Core V2 library does not support paging with relative links at time of writing.\n *\n * @param host - The base URL of the resource.\n * @returns the `PipelinePolicy` that addresses the issue.\n */\nexport function 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"]}
|
|
@@ -16,6 +16,7 @@ const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
|
|
|
16
16
|
/// <reference lib="esnext.asynciterable" />
|
|
17
17
|
/** Class containing ShortCodes operations. */
|
|
18
18
|
class ShortCodesImpl {
|
|
19
|
+
client;
|
|
19
20
|
/**
|
|
20
21
|
* Initialize a new instance of the class ShortCodes class.
|
|
21
22
|
* @param client Reference to the service client
|
|
@@ -41,37 +42,20 @@ class ShortCodesImpl {
|
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
|
-
getShortCodesPagingPage(options) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
});
|
|
45
|
+
async *getShortCodesPagingPage(options) {
|
|
46
|
+
let result = await this._getShortCodes(options);
|
|
47
|
+
yield result.shortCodes || [];
|
|
48
|
+
let continuationToken = result.nextLink;
|
|
49
|
+
while (continuationToken) {
|
|
50
|
+
result = await this._getShortCodesNext(continuationToken, options);
|
|
51
|
+
continuationToken = result.nextLink;
|
|
52
|
+
yield result.shortCodes || [];
|
|
53
|
+
}
|
|
55
54
|
}
|
|
56
|
-
getShortCodesPagingAll(options) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
for (var _d = true, _e = tslib_1.__asyncValues(this.getShortCodesPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
61
|
-
_c = _f.value;
|
|
62
|
-
_d = false;
|
|
63
|
-
const page = _c;
|
|
64
|
-
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
68
|
-
finally {
|
|
69
|
-
try {
|
|
70
|
-
if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
|
|
71
|
-
}
|
|
72
|
-
finally { if (e_1) throw e_1.error; }
|
|
73
|
-
}
|
|
74
|
-
});
|
|
55
|
+
async *getShortCodesPagingAll(options) {
|
|
56
|
+
for await (const page of this.getShortCodesPagingPage(options)) {
|
|
57
|
+
yield* page;
|
|
58
|
+
}
|
|
75
59
|
}
|
|
76
60
|
/**
|
|
77
61
|
* This method supports pagination via the "skip" and "top" query parameters.
|
|
@@ -91,37 +75,20 @@ class ShortCodesImpl {
|
|
|
91
75
|
}
|
|
92
76
|
};
|
|
93
77
|
}
|
|
94
|
-
getCostsPagingPage(options) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
});
|
|
78
|
+
async *getCostsPagingPage(options) {
|
|
79
|
+
let result = await this._getCosts(options);
|
|
80
|
+
yield result.costs || [];
|
|
81
|
+
let continuationToken = result.nextLink;
|
|
82
|
+
while (continuationToken) {
|
|
83
|
+
result = await this._getCostsNext(continuationToken, options);
|
|
84
|
+
continuationToken = result.nextLink;
|
|
85
|
+
yield result.costs || [];
|
|
86
|
+
}
|
|
105
87
|
}
|
|
106
|
-
getCostsPagingAll(options) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
for (var _d = true, _e = tslib_1.__asyncValues(this.getCostsPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
111
|
-
_c = _f.value;
|
|
112
|
-
_d = false;
|
|
113
|
-
const page = _c;
|
|
114
|
-
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
118
|
-
finally {
|
|
119
|
-
try {
|
|
120
|
-
if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
|
|
121
|
-
}
|
|
122
|
-
finally { if (e_2) throw e_2.error; }
|
|
123
|
-
}
|
|
124
|
-
});
|
|
88
|
+
async *getCostsPagingAll(options) {
|
|
89
|
+
for await (const page of this.getCostsPagingPage(options)) {
|
|
90
|
+
yield* page;
|
|
91
|
+
}
|
|
125
92
|
}
|
|
126
93
|
/**
|
|
127
94
|
* Gets the list of US Program Briefs for the current resource.
|
|
@@ -141,37 +108,20 @@ class ShortCodesImpl {
|
|
|
141
108
|
}
|
|
142
109
|
};
|
|
143
110
|
}
|
|
144
|
-
getUSProgramBriefsPagingPage(options) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
}
|
|
154
|
-
});
|
|
111
|
+
async *getUSProgramBriefsPagingPage(options) {
|
|
112
|
+
let result = await this._getUSProgramBriefs(options);
|
|
113
|
+
yield result.programBriefs || [];
|
|
114
|
+
let continuationToken = result.nextLink;
|
|
115
|
+
while (continuationToken) {
|
|
116
|
+
result = await this._getUSProgramBriefsNext(continuationToken, options);
|
|
117
|
+
continuationToken = result.nextLink;
|
|
118
|
+
yield result.programBriefs || [];
|
|
119
|
+
}
|
|
155
120
|
}
|
|
156
|
-
getUSProgramBriefsPagingAll(options) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
for (var _d = true, _e = tslib_1.__asyncValues(this.getUSProgramBriefsPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
161
|
-
_c = _f.value;
|
|
162
|
-
_d = false;
|
|
163
|
-
const page = _c;
|
|
164
|
-
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
168
|
-
finally {
|
|
169
|
-
try {
|
|
170
|
-
if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
|
|
171
|
-
}
|
|
172
|
-
finally { if (e_3) throw e_3.error; }
|
|
173
|
-
}
|
|
174
|
-
});
|
|
121
|
+
async *getUSProgramBriefsPagingAll(options) {
|
|
122
|
+
for await (const page of this.getUSProgramBriefsPagingPage(options)) {
|
|
123
|
+
yield* page;
|
|
124
|
+
}
|
|
175
125
|
}
|
|
176
126
|
/**
|
|
177
127
|
* Gets the list of attachments from a US Program Brief.
|
|
@@ -192,44 +142,27 @@ class ShortCodesImpl {
|
|
|
192
142
|
}
|
|
193
143
|
};
|
|
194
144
|
}
|
|
195
|
-
getUSProgramBriefAttachmentsPagingPage(programBriefId, options) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
}
|
|
205
|
-
});
|
|
145
|
+
async *getUSProgramBriefAttachmentsPagingPage(programBriefId, options) {
|
|
146
|
+
let result = await this._getUSProgramBriefAttachments(programBriefId, options);
|
|
147
|
+
yield result.attachments || [];
|
|
148
|
+
let continuationToken = result.nextLink;
|
|
149
|
+
while (continuationToken) {
|
|
150
|
+
result = await this._getUSProgramBriefAttachmentsNext(programBriefId, continuationToken, options);
|
|
151
|
+
continuationToken = result.nextLink;
|
|
152
|
+
yield result.attachments || [];
|
|
153
|
+
}
|
|
206
154
|
}
|
|
207
|
-
getUSProgramBriefAttachmentsPagingAll(programBriefId, options) {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
for (var _d = true, _e = tslib_1.__asyncValues(this.getUSProgramBriefAttachmentsPagingPage(programBriefId, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
212
|
-
_c = _f.value;
|
|
213
|
-
_d = false;
|
|
214
|
-
const page = _c;
|
|
215
|
-
yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
219
|
-
finally {
|
|
220
|
-
try {
|
|
221
|
-
if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
|
|
222
|
-
}
|
|
223
|
-
finally { if (e_4) throw e_4.error; }
|
|
224
|
-
}
|
|
225
|
-
});
|
|
155
|
+
async *getUSProgramBriefAttachmentsPagingAll(programBriefId, options) {
|
|
156
|
+
for await (const page of this.getUSProgramBriefAttachmentsPagingPage(programBriefId, options)) {
|
|
157
|
+
yield* page;
|
|
158
|
+
}
|
|
226
159
|
}
|
|
227
160
|
/**
|
|
228
161
|
* Gets the list of short codes for the current resource.
|
|
229
162
|
* @param options The options parameters.
|
|
230
163
|
*/
|
|
231
164
|
async _getShortCodes(options) {
|
|
232
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getShortCodes", options
|
|
165
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getShortCodes", options ?? {}, async (options) => {
|
|
233
166
|
return this.client.sendOperationRequest({ options }, getShortCodesOperationSpec);
|
|
234
167
|
});
|
|
235
168
|
}
|
|
@@ -238,7 +171,7 @@ class ShortCodesImpl {
|
|
|
238
171
|
* @param options The options parameters.
|
|
239
172
|
*/
|
|
240
173
|
async _getCosts(options) {
|
|
241
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getCosts", options
|
|
174
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getCosts", options ?? {}, async (options) => {
|
|
242
175
|
return this.client.sendOperationRequest({ options }, getCostsOperationSpec);
|
|
243
176
|
});
|
|
244
177
|
}
|
|
@@ -248,7 +181,7 @@ class ShortCodesImpl {
|
|
|
248
181
|
* @param options The options parameters.
|
|
249
182
|
*/
|
|
250
183
|
async upsertUSProgramBrief(programBriefId, options) {
|
|
251
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.upsertUSProgramBrief", options
|
|
184
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.upsertUSProgramBrief", options ?? {}, async (options) => {
|
|
252
185
|
return this.client.sendOperationRequest({ programBriefId, options }, upsertUSProgramBriefOperationSpec);
|
|
253
186
|
});
|
|
254
187
|
}
|
|
@@ -258,7 +191,7 @@ class ShortCodesImpl {
|
|
|
258
191
|
* @param options The options parameters.
|
|
259
192
|
*/
|
|
260
193
|
async deleteUSProgramBrief(programBriefId, options) {
|
|
261
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.deleteUSProgramBrief", options
|
|
194
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.deleteUSProgramBrief", options ?? {}, async (options) => {
|
|
262
195
|
return this.client.sendOperationRequest({ programBriefId, options }, deleteUSProgramBriefOperationSpec);
|
|
263
196
|
});
|
|
264
197
|
}
|
|
@@ -268,7 +201,7 @@ class ShortCodesImpl {
|
|
|
268
201
|
* @param options The options parameters.
|
|
269
202
|
*/
|
|
270
203
|
async getUSProgramBrief(programBriefId, options) {
|
|
271
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.getUSProgramBrief", options
|
|
204
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.getUSProgramBrief", options ?? {}, async (options) => {
|
|
272
205
|
return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefOperationSpec);
|
|
273
206
|
});
|
|
274
207
|
}
|
|
@@ -278,7 +211,7 @@ class ShortCodesImpl {
|
|
|
278
211
|
* @param options The options parameters.
|
|
279
212
|
*/
|
|
280
213
|
async submitUSProgramBrief(programBriefId, options) {
|
|
281
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.submitUSProgramBrief", options
|
|
214
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.submitUSProgramBrief", options ?? {}, async (options) => {
|
|
282
215
|
return this.client.sendOperationRequest({ programBriefId, options }, submitUSProgramBriefOperationSpec);
|
|
283
216
|
});
|
|
284
217
|
}
|
|
@@ -287,7 +220,7 @@ class ShortCodesImpl {
|
|
|
287
220
|
* @param options The options parameters.
|
|
288
221
|
*/
|
|
289
222
|
async _getUSProgramBriefs(options) {
|
|
290
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefs", options
|
|
223
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefs", options ?? {}, async (options) => {
|
|
291
224
|
return this.client.sendOperationRequest({ options }, getUSProgramBriefsOperationSpec);
|
|
292
225
|
});
|
|
293
226
|
}
|
|
@@ -306,7 +239,7 @@ class ShortCodesImpl {
|
|
|
306
239
|
* @param options The options parameters.
|
|
307
240
|
*/
|
|
308
241
|
async createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, id, fileName, fileType, fileContentBase64, type, options) {
|
|
309
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.createOrReplaceUSProgramBriefAttachment", options
|
|
242
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.createOrReplaceUSProgramBriefAttachment", options ?? {}, async (options) => {
|
|
310
243
|
return this.client.sendOperationRequest({
|
|
311
244
|
programBriefId,
|
|
312
245
|
attachmentId,
|
|
@@ -326,7 +259,7 @@ class ShortCodesImpl {
|
|
|
326
259
|
* @param options The options parameters.
|
|
327
260
|
*/
|
|
328
261
|
async getUSProgramBriefAttachment(programBriefId, attachmentId, options) {
|
|
329
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.getUSProgramBriefAttachment", options
|
|
262
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.getUSProgramBriefAttachment", options ?? {}, async (options) => {
|
|
330
263
|
return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, getUSProgramBriefAttachmentOperationSpec);
|
|
331
264
|
});
|
|
332
265
|
}
|
|
@@ -337,7 +270,7 @@ class ShortCodesImpl {
|
|
|
337
270
|
* @param options The options parameters.
|
|
338
271
|
*/
|
|
339
272
|
async deleteUSProgramBriefAttachment(programBriefId, attachmentId, options) {
|
|
340
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.deleteUSProgramBriefAttachment", options
|
|
273
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient.deleteUSProgramBriefAttachment", options ?? {}, async (options) => {
|
|
341
274
|
return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, deleteUSProgramBriefAttachmentOperationSpec);
|
|
342
275
|
});
|
|
343
276
|
}
|
|
@@ -347,7 +280,7 @@ class ShortCodesImpl {
|
|
|
347
280
|
* @param options The options parameters.
|
|
348
281
|
*/
|
|
349
282
|
async _getUSProgramBriefAttachments(programBriefId, options) {
|
|
350
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachments", options
|
|
283
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachments", options ?? {}, async (options) => {
|
|
351
284
|
return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefAttachmentsOperationSpec);
|
|
352
285
|
});
|
|
353
286
|
}
|
|
@@ -357,7 +290,7 @@ class ShortCodesImpl {
|
|
|
357
290
|
* @param options The options parameters.
|
|
358
291
|
*/
|
|
359
292
|
async _getShortCodesNext(nextLink, options) {
|
|
360
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getShortCodesNext", options
|
|
293
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getShortCodesNext", options ?? {}, async (options) => {
|
|
361
294
|
return this.client.sendOperationRequest({ nextLink, options }, getShortCodesNextOperationSpec);
|
|
362
295
|
});
|
|
363
296
|
}
|
|
@@ -367,7 +300,7 @@ class ShortCodesImpl {
|
|
|
367
300
|
* @param options The options parameters.
|
|
368
301
|
*/
|
|
369
302
|
async _getCostsNext(nextLink, options) {
|
|
370
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getCostsNext", options
|
|
303
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getCostsNext", options ?? {}, async (options) => {
|
|
371
304
|
return this.client.sendOperationRequest({ nextLink, options }, getCostsNextOperationSpec);
|
|
372
305
|
});
|
|
373
306
|
}
|
|
@@ -377,7 +310,7 @@ class ShortCodesImpl {
|
|
|
377
310
|
* @param options The options parameters.
|
|
378
311
|
*/
|
|
379
312
|
async _getUSProgramBriefsNext(nextLink, options) {
|
|
380
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefsNext", options
|
|
313
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefsNext", options ?? {}, async (options) => {
|
|
381
314
|
return this.client.sendOperationRequest({ nextLink, options }, getUSProgramBriefsNextOperationSpec);
|
|
382
315
|
});
|
|
383
316
|
}
|
|
@@ -389,7 +322,7 @@ class ShortCodesImpl {
|
|
|
389
322
|
* @param options The options parameters.
|
|
390
323
|
*/
|
|
391
324
|
async _getUSProgramBriefAttachmentsNext(programBriefId, nextLink, options) {
|
|
392
|
-
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachmentsNext", options
|
|
325
|
+
return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachmentsNext", options ?? {}, async (options) => {
|
|
393
326
|
return this.client.sendOperationRequest({ programBriefId, nextLink, options }, getUSProgramBriefAttachmentsNextOperationSpec);
|
|
394
327
|
});
|
|
395
328
|
}
|
|
@@ -535,7 +468,7 @@ const createOrReplaceUSProgramBriefAttachmentOperationSpec = {
|
|
|
535
468
|
fileType: ["fileType"],
|
|
536
469
|
fileContentBase64: ["fileContentBase64"]
|
|
537
470
|
},
|
|
538
|
-
mapper:
|
|
471
|
+
mapper: { ...Mappers.ProgramBriefAttachment, required: true }
|
|
539
472
|
},
|
|
540
473
|
queryParameters: [Parameters.apiVersion],
|
|
541
474
|
urlParameters: [
|