@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.
Files changed (35) hide show
  1. package/README.md +0 -2
  2. package/dist/browser/generated/src/operations/shortCodes.js +137 -69
  3. package/dist/browser/generated/src/operations/shortCodes.js.map +1 -1
  4. package/dist/browser/generated/src/shortCodesClient.js +4 -11
  5. package/dist/browser/generated/src/shortCodesClient.js.map +1 -1
  6. package/dist/browser/shortCodesClient.js +4 -11
  7. package/dist/browser/shortCodesClient.js.map +1 -1
  8. package/dist/browser/utils/customPipelinePolicies.js +2 -1
  9. package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
  10. package/dist/commonjs/generated/src/operations/shortCodes.js +136 -69
  11. package/dist/commonjs/generated/src/operations/shortCodes.js.map +1 -1
  12. package/dist/commonjs/generated/src/shortCodesClient.js +4 -11
  13. package/dist/commonjs/generated/src/shortCodesClient.js.map +1 -1
  14. package/dist/commonjs/shortCodesClient.js +4 -11
  15. package/dist/commonjs/shortCodesClient.js.map +1 -1
  16. package/dist/commonjs/tsdoc-metadata.json +11 -11
  17. package/dist/commonjs/utils/customPipelinePolicies.js +2 -1
  18. package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
  19. package/dist/esm/generated/src/operations/shortCodes.js +137 -69
  20. package/dist/esm/generated/src/operations/shortCodes.js.map +1 -1
  21. package/dist/esm/generated/src/shortCodesClient.js +4 -11
  22. package/dist/esm/generated/src/shortCodesClient.js.map +1 -1
  23. package/dist/esm/shortCodesClient.js +4 -11
  24. package/dist/esm/shortCodesClient.js.map +1 -1
  25. package/dist/esm/utils/customPipelinePolicies.js +2 -1
  26. package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
  27. package/dist/react-native/generated/src/operations/shortCodes.js +137 -69
  28. package/dist/react-native/generated/src/operations/shortCodes.js.map +1 -1
  29. package/dist/react-native/generated/src/shortCodesClient.js +4 -11
  30. package/dist/react-native/generated/src/shortCodesClient.js.map +1 -1
  31. package/dist/react-native/shortCodesClient.js +4 -11
  32. package/dist/react-native/shortCodesClient.js.map +1 -1
  33. package/dist/react-native/utils/customPipelinePolicies.js +2 -1
  34. package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
  35. 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;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,GAAG,OAAO,CAAC,gBAAgB,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,GAAG;YAC1B,GAAG,QAAQ;YACX,GAAG,OAAO;YACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB;YACD,OAAO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gB,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"]}
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,CAAC,eAAe,IAAI,cAAc,EAAE;YACjE,CAAC,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BAAyB,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
- ...options,
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(auth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,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,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,mCACxB,OAAO,GACP;YACD,cAAc,E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,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?.parsedBody?.nextLink;
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;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"]}
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"]}
@@ -16,7 +16,6 @@ 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;
20
19
  /**
21
20
  * Initialize a new instance of the class ShortCodes class.
22
21
  * @param client Reference to the service client
@@ -42,20 +41,37 @@ class ShortCodesImpl {
42
41
  }
43
42
  };
44
43
  }
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
- }
44
+ getShortCodesPagingPage(options) {
45
+ return tslib_1.__asyncGenerator(this, arguments, function* getShortCodesPagingPage_1() {
46
+ let result = yield tslib_1.__await(this._getShortCodes(options));
47
+ yield yield tslib_1.__await(result.shortCodes || []);
48
+ let continuationToken = result.nextLink;
49
+ while (continuationToken) {
50
+ result = yield tslib_1.__await(this._getShortCodesNext(continuationToken, options));
51
+ continuationToken = result.nextLink;
52
+ yield yield tslib_1.__await(result.shortCodes || []);
53
+ }
54
+ });
54
55
  }
55
- async *getShortCodesPagingAll(options) {
56
- for await (const page of this.getShortCodesPagingPage(options)) {
57
- yield* page;
58
- }
56
+ getShortCodesPagingAll(options) {
57
+ return tslib_1.__asyncGenerator(this, arguments, function* getShortCodesPagingAll_1() {
58
+ var _a, e_1, _b, _c;
59
+ try {
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
+ });
59
75
  }
60
76
  /**
61
77
  * This method supports pagination via the "skip" and "top" query parameters.
@@ -75,20 +91,37 @@ class ShortCodesImpl {
75
91
  }
76
92
  };
77
93
  }
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
- }
94
+ getCostsPagingPage(options) {
95
+ return tslib_1.__asyncGenerator(this, arguments, function* getCostsPagingPage_1() {
96
+ let result = yield tslib_1.__await(this._getCosts(options));
97
+ yield yield tslib_1.__await(result.costs || []);
98
+ let continuationToken = result.nextLink;
99
+ while (continuationToken) {
100
+ result = yield tslib_1.__await(this._getCostsNext(continuationToken, options));
101
+ continuationToken = result.nextLink;
102
+ yield yield tslib_1.__await(result.costs || []);
103
+ }
104
+ });
87
105
  }
88
- async *getCostsPagingAll(options) {
89
- for await (const page of this.getCostsPagingPage(options)) {
90
- yield* page;
91
- }
106
+ getCostsPagingAll(options) {
107
+ return tslib_1.__asyncGenerator(this, arguments, function* getCostsPagingAll_1() {
108
+ var _a, e_2, _b, _c;
109
+ try {
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
+ });
92
125
  }
93
126
  /**
94
127
  * Gets the list of US Program Briefs for the current resource.
@@ -108,20 +141,37 @@ class ShortCodesImpl {
108
141
  }
109
142
  };
110
143
  }
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
- }
144
+ getUSProgramBriefsPagingPage(options) {
145
+ return tslib_1.__asyncGenerator(this, arguments, function* getUSProgramBriefsPagingPage_1() {
146
+ let result = yield tslib_1.__await(this._getUSProgramBriefs(options));
147
+ yield yield tslib_1.__await(result.programBriefs || []);
148
+ let continuationToken = result.nextLink;
149
+ while (continuationToken) {
150
+ result = yield tslib_1.__await(this._getUSProgramBriefsNext(continuationToken, options));
151
+ continuationToken = result.nextLink;
152
+ yield yield tslib_1.__await(result.programBriefs || []);
153
+ }
154
+ });
120
155
  }
121
- async *getUSProgramBriefsPagingAll(options) {
122
- for await (const page of this.getUSProgramBriefsPagingPage(options)) {
123
- yield* page;
124
- }
156
+ getUSProgramBriefsPagingAll(options) {
157
+ return tslib_1.__asyncGenerator(this, arguments, function* getUSProgramBriefsPagingAll_1() {
158
+ var _a, e_3, _b, _c;
159
+ try {
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
+ });
125
175
  }
126
176
  /**
127
177
  * Gets the list of attachments from a US Program Brief.
@@ -142,27 +192,44 @@ class ShortCodesImpl {
142
192
  }
143
193
  };
144
194
  }
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
- }
195
+ getUSProgramBriefAttachmentsPagingPage(programBriefId, options) {
196
+ return tslib_1.__asyncGenerator(this, arguments, function* getUSProgramBriefAttachmentsPagingPage_1() {
197
+ let result = yield tslib_1.__await(this._getUSProgramBriefAttachments(programBriefId, options));
198
+ yield yield tslib_1.__await(result.attachments || []);
199
+ let continuationToken = result.nextLink;
200
+ while (continuationToken) {
201
+ result = yield tslib_1.__await(this._getUSProgramBriefAttachmentsNext(programBriefId, continuationToken, options));
202
+ continuationToken = result.nextLink;
203
+ yield yield tslib_1.__await(result.attachments || []);
204
+ }
205
+ });
154
206
  }
155
- async *getUSProgramBriefAttachmentsPagingAll(programBriefId, options) {
156
- for await (const page of this.getUSProgramBriefAttachmentsPagingPage(programBriefId, options)) {
157
- yield* page;
158
- }
207
+ getUSProgramBriefAttachmentsPagingAll(programBriefId, options) {
208
+ return tslib_1.__asyncGenerator(this, arguments, function* getUSProgramBriefAttachmentsPagingAll_1() {
209
+ var _a, e_4, _b, _c;
210
+ try {
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
+ });
159
226
  }
160
227
  /**
161
228
  * Gets the list of short codes for the current resource.
162
229
  * @param options The options parameters.
163
230
  */
164
231
  async _getShortCodes(options) {
165
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getShortCodes", options ?? {}, async (options) => {
232
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getShortCodes", options !== null && options !== void 0 ? options : {}, async (options) => {
166
233
  return this.client.sendOperationRequest({ options }, getShortCodesOperationSpec);
167
234
  });
168
235
  }
@@ -171,7 +238,7 @@ class ShortCodesImpl {
171
238
  * @param options The options parameters.
172
239
  */
173
240
  async _getCosts(options) {
174
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getCosts", options ?? {}, async (options) => {
241
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getCosts", options !== null && options !== void 0 ? options : {}, async (options) => {
175
242
  return this.client.sendOperationRequest({ options }, getCostsOperationSpec);
176
243
  });
177
244
  }
@@ -181,7 +248,7 @@ class ShortCodesImpl {
181
248
  * @param options The options parameters.
182
249
  */
183
250
  async upsertUSProgramBrief(programBriefId, options) {
184
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient.upsertUSProgramBrief", options ?? {}, async (options) => {
251
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient.upsertUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
185
252
  return this.client.sendOperationRequest({ programBriefId, options }, upsertUSProgramBriefOperationSpec);
186
253
  });
187
254
  }
@@ -191,7 +258,7 @@ class ShortCodesImpl {
191
258
  * @param options The options parameters.
192
259
  */
193
260
  async deleteUSProgramBrief(programBriefId, options) {
194
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient.deleteUSProgramBrief", options ?? {}, async (options) => {
261
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient.deleteUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
195
262
  return this.client.sendOperationRequest({ programBriefId, options }, deleteUSProgramBriefOperationSpec);
196
263
  });
197
264
  }
@@ -201,7 +268,7 @@ class ShortCodesImpl {
201
268
  * @param options The options parameters.
202
269
  */
203
270
  async getUSProgramBrief(programBriefId, options) {
204
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient.getUSProgramBrief", options ?? {}, async (options) => {
271
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient.getUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
205
272
  return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefOperationSpec);
206
273
  });
207
274
  }
@@ -211,7 +278,7 @@ class ShortCodesImpl {
211
278
  * @param options The options parameters.
212
279
  */
213
280
  async submitUSProgramBrief(programBriefId, options) {
214
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient.submitUSProgramBrief", options ?? {}, async (options) => {
281
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient.submitUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
215
282
  return this.client.sendOperationRequest({ programBriefId, options }, submitUSProgramBriefOperationSpec);
216
283
  });
217
284
  }
@@ -220,7 +287,7 @@ class ShortCodesImpl {
220
287
  * @param options The options parameters.
221
288
  */
222
289
  async _getUSProgramBriefs(options) {
223
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefs", options ?? {}, async (options) => {
290
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefs", options !== null && options !== void 0 ? options : {}, async (options) => {
224
291
  return this.client.sendOperationRequest({ options }, getUSProgramBriefsOperationSpec);
225
292
  });
226
293
  }
@@ -239,7 +306,7 @@ class ShortCodesImpl {
239
306
  * @param options The options parameters.
240
307
  */
241
308
  async createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, id, fileName, fileType, fileContentBase64, type, options) {
242
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient.createOrReplaceUSProgramBriefAttachment", options ?? {}, async (options) => {
309
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient.createOrReplaceUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
243
310
  return this.client.sendOperationRequest({
244
311
  programBriefId,
245
312
  attachmentId,
@@ -259,7 +326,7 @@ class ShortCodesImpl {
259
326
  * @param options The options parameters.
260
327
  */
261
328
  async getUSProgramBriefAttachment(programBriefId, attachmentId, options) {
262
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient.getUSProgramBriefAttachment", options ?? {}, async (options) => {
329
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient.getUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
263
330
  return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, getUSProgramBriefAttachmentOperationSpec);
264
331
  });
265
332
  }
@@ -270,7 +337,7 @@ class ShortCodesImpl {
270
337
  * @param options The options parameters.
271
338
  */
272
339
  async deleteUSProgramBriefAttachment(programBriefId, attachmentId, options) {
273
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient.deleteUSProgramBriefAttachment", options ?? {}, async (options) => {
340
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient.deleteUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
274
341
  return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, deleteUSProgramBriefAttachmentOperationSpec);
275
342
  });
276
343
  }
@@ -280,7 +347,7 @@ class ShortCodesImpl {
280
347
  * @param options The options parameters.
281
348
  */
282
349
  async _getUSProgramBriefAttachments(programBriefId, options) {
283
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachments", options ?? {}, async (options) => {
350
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachments", options !== null && options !== void 0 ? options : {}, async (options) => {
284
351
  return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefAttachmentsOperationSpec);
285
352
  });
286
353
  }
@@ -290,7 +357,7 @@ class ShortCodesImpl {
290
357
  * @param options The options parameters.
291
358
  */
292
359
  async _getShortCodesNext(nextLink, options) {
293
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getShortCodesNext", options ?? {}, async (options) => {
360
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getShortCodesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
294
361
  return this.client.sendOperationRequest({ nextLink, options }, getShortCodesNextOperationSpec);
295
362
  });
296
363
  }
@@ -300,7 +367,7 @@ class ShortCodesImpl {
300
367
  * @param options The options parameters.
301
368
  */
302
369
  async _getCostsNext(nextLink, options) {
303
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getCostsNext", options ?? {}, async (options) => {
370
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getCostsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
304
371
  return this.client.sendOperationRequest({ nextLink, options }, getCostsNextOperationSpec);
305
372
  });
306
373
  }
@@ -310,7 +377,7 @@ class ShortCodesImpl {
310
377
  * @param options The options parameters.
311
378
  */
312
379
  async _getUSProgramBriefsNext(nextLink, options) {
313
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefsNext", options ?? {}, async (options) => {
380
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
314
381
  return this.client.sendOperationRequest({ nextLink, options }, getUSProgramBriefsNextOperationSpec);
315
382
  });
316
383
  }
@@ -322,7 +389,7 @@ class ShortCodesImpl {
322
389
  * @param options The options parameters.
323
390
  */
324
391
  async _getUSProgramBriefAttachmentsNext(programBriefId, nextLink, options) {
325
- return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachmentsNext", options ?? {}, async (options) => {
392
+ return tracing_js_1.tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachmentsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
326
393
  return this.client.sendOperationRequest({ programBriefId, nextLink, options }, getUSProgramBriefAttachmentsNextOperationSpec);
327
394
  });
328
395
  }
@@ -468,7 +535,7 @@ const createOrReplaceUSProgramBriefAttachmentOperationSpec = {
468
535
  fileType: ["fileType"],
469
536
  fileContentBase64: ["fileContentBase64"]
470
537
  },
471
- mapper: { ...Mappers.ProgramBriefAttachment, required: true }
538
+ mapper: Object.assign(Object.assign({}, Mappers.ProgramBriefAttachment), { required: true })
472
539
  },
473
540
  queryParameters: [Parameters.apiVersion],
474
541
  urlParameters: [