@azure-tools/communication-short-codes 1.0.0-alpha.20250718.1 → 1.0.0-alpha.20250723.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.
Files changed (34) hide show
  1. package/dist/browser/generated/src/operations/shortCodes.js +69 -137
  2. package/dist/browser/generated/src/operations/shortCodes.js.map +1 -1
  3. package/dist/browser/generated/src/shortCodesClient.js +11 -4
  4. package/dist/browser/generated/src/shortCodesClient.js.map +1 -1
  5. package/dist/browser/shortCodesClient.js +11 -4
  6. package/dist/browser/shortCodesClient.js.map +1 -1
  7. package/dist/browser/utils/customPipelinePolicies.js +1 -2
  8. package/dist/browser/utils/customPipelinePolicies.js.map +1 -1
  9. package/dist/commonjs/generated/src/operations/shortCodes.js +69 -136
  10. package/dist/commonjs/generated/src/operations/shortCodes.js.map +1 -1
  11. package/dist/commonjs/generated/src/shortCodesClient.js +11 -4
  12. package/dist/commonjs/generated/src/shortCodesClient.js.map +1 -1
  13. package/dist/commonjs/shortCodesClient.js +11 -4
  14. package/dist/commonjs/shortCodesClient.js.map +1 -1
  15. package/dist/commonjs/tsdoc-metadata.json +11 -11
  16. package/dist/commonjs/utils/customPipelinePolicies.js +1 -2
  17. package/dist/commonjs/utils/customPipelinePolicies.js.map +1 -1
  18. package/dist/esm/generated/src/operations/shortCodes.js +69 -137
  19. package/dist/esm/generated/src/operations/shortCodes.js.map +1 -1
  20. package/dist/esm/generated/src/shortCodesClient.js +11 -4
  21. package/dist/esm/generated/src/shortCodesClient.js.map +1 -1
  22. package/dist/esm/shortCodesClient.js +11 -4
  23. package/dist/esm/shortCodesClient.js.map +1 -1
  24. package/dist/esm/utils/customPipelinePolicies.js +1 -2
  25. package/dist/esm/utils/customPipelinePolicies.js.map +1 -1
  26. package/dist/react-native/generated/src/operations/shortCodes.js +69 -137
  27. package/dist/react-native/generated/src/operations/shortCodes.js.map +1 -1
  28. package/dist/react-native/generated/src/shortCodesClient.js +11 -4
  29. package/dist/react-native/generated/src/shortCodesClient.js.map +1 -1
  30. package/dist/react-native/shortCodesClient.js +11 -4
  31. package/dist/react-native/shortCodesClient.js.map +1 -1
  32. package/dist/react-native/utils/customPipelinePolicies.js +1 -2
  33. package/dist/react-native/utils/customPipelinePolicies.js.map +1 -1
  34. 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;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,CAAC,GAAG,cAAc,EAAE,CAAC;QAE1B,MAAM,mBAAmB,iDACpB,QAAQ,GACR,OAAO,KACV,gBAAgB,EAAE;gBAChB,eAAe;aAChB,EACD,OAAO,EAAE,MAAA,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,OAAO,mCAAI,Y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,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"]}
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,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AC,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 = Object.assign(Object.assign({}, options), {
19
- loggingOptions: {
20
- logger: logger.info,
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);
@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BAA8B,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,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,GAAkC;YAC7D,GAAG,OAAO;YACV,GAAG;gBACD,cAAc,EAAE;oBACd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AEM,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 = (_a = response === null || response === void 0 ? void 0 : response.parsedBody) === null || _a === void 0 ? void 0 : _a.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;;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"]}
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"]}
@@ -5,7 +5,6 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import { tracingClient } from "../tracing.js";
10
9
  import * as coreClient from "@azure/core-client";
11
10
  import * as Mappers from "../models/mappers.js";
@@ -13,6 +12,7 @@ import * as Parameters from "../models/parameters.js";
13
12
  /// <reference lib="esnext.asynciterable" />
14
13
  /** Class containing ShortCodes operations. */
15
14
  export class ShortCodesImpl {
15
+ client;
16
16
  /**
17
17
  * Initialize a new instance of the class ShortCodes class.
18
18
  * @param client Reference to the service client
@@ -38,37 +38,20 @@ export class ShortCodesImpl {
38
38
  }
39
39
  };
40
40
  }
41
- getShortCodesPagingPage(options) {
42
- return __asyncGenerator(this, arguments, function* getShortCodesPagingPage_1() {
43
- let result = yield __await(this._getShortCodes(options));
44
- yield yield __await(result.shortCodes || []);
45
- let continuationToken = result.nextLink;
46
- while (continuationToken) {
47
- result = yield __await(this._getShortCodesNext(continuationToken, options));
48
- continuationToken = result.nextLink;
49
- yield yield __await(result.shortCodes || []);
50
- }
51
- });
41
+ async *getShortCodesPagingPage(options) {
42
+ let result = await this._getShortCodes(options);
43
+ yield result.shortCodes || [];
44
+ let continuationToken = result.nextLink;
45
+ while (continuationToken) {
46
+ result = await this._getShortCodesNext(continuationToken, options);
47
+ continuationToken = result.nextLink;
48
+ yield result.shortCodes || [];
49
+ }
52
50
  }
53
- getShortCodesPagingAll(options) {
54
- return __asyncGenerator(this, arguments, function* getShortCodesPagingAll_1() {
55
- var _a, e_1, _b, _c;
56
- try {
57
- for (var _d = true, _e = __asyncValues(this.getShortCodesPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
58
- _c = _f.value;
59
- _d = false;
60
- const page = _c;
61
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
62
- }
63
- }
64
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
65
- finally {
66
- try {
67
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
68
- }
69
- finally { if (e_1) throw e_1.error; }
70
- }
71
- });
51
+ async *getShortCodesPagingAll(options) {
52
+ for await (const page of this.getShortCodesPagingPage(options)) {
53
+ yield* page;
54
+ }
72
55
  }
73
56
  /**
74
57
  * This method supports pagination via the "skip" and "top" query parameters.
@@ -88,37 +71,20 @@ export class ShortCodesImpl {
88
71
  }
89
72
  };
90
73
  }
91
- getCostsPagingPage(options) {
92
- return __asyncGenerator(this, arguments, function* getCostsPagingPage_1() {
93
- let result = yield __await(this._getCosts(options));
94
- yield yield __await(result.costs || []);
95
- let continuationToken = result.nextLink;
96
- while (continuationToken) {
97
- result = yield __await(this._getCostsNext(continuationToken, options));
98
- continuationToken = result.nextLink;
99
- yield yield __await(result.costs || []);
100
- }
101
- });
74
+ async *getCostsPagingPage(options) {
75
+ let result = await this._getCosts(options);
76
+ yield result.costs || [];
77
+ let continuationToken = result.nextLink;
78
+ while (continuationToken) {
79
+ result = await this._getCostsNext(continuationToken, options);
80
+ continuationToken = result.nextLink;
81
+ yield result.costs || [];
82
+ }
102
83
  }
103
- getCostsPagingAll(options) {
104
- return __asyncGenerator(this, arguments, function* getCostsPagingAll_1() {
105
- var _a, e_2, _b, _c;
106
- try {
107
- for (var _d = true, _e = __asyncValues(this.getCostsPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
108
- _c = _f.value;
109
- _d = false;
110
- const page = _c;
111
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
112
- }
113
- }
114
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
115
- finally {
116
- try {
117
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
118
- }
119
- finally { if (e_2) throw e_2.error; }
120
- }
121
- });
84
+ async *getCostsPagingAll(options) {
85
+ for await (const page of this.getCostsPagingPage(options)) {
86
+ yield* page;
87
+ }
122
88
  }
123
89
  /**
124
90
  * Gets the list of US Program Briefs for the current resource.
@@ -138,37 +104,20 @@ export class ShortCodesImpl {
138
104
  }
139
105
  };
140
106
  }
141
- getUSProgramBriefsPagingPage(options) {
142
- return __asyncGenerator(this, arguments, function* getUSProgramBriefsPagingPage_1() {
143
- let result = yield __await(this._getUSProgramBriefs(options));
144
- yield yield __await(result.programBriefs || []);
145
- let continuationToken = result.nextLink;
146
- while (continuationToken) {
147
- result = yield __await(this._getUSProgramBriefsNext(continuationToken, options));
148
- continuationToken = result.nextLink;
149
- yield yield __await(result.programBriefs || []);
150
- }
151
- });
107
+ async *getUSProgramBriefsPagingPage(options) {
108
+ let result = await this._getUSProgramBriefs(options);
109
+ yield result.programBriefs || [];
110
+ let continuationToken = result.nextLink;
111
+ while (continuationToken) {
112
+ result = await this._getUSProgramBriefsNext(continuationToken, options);
113
+ continuationToken = result.nextLink;
114
+ yield result.programBriefs || [];
115
+ }
152
116
  }
153
- getUSProgramBriefsPagingAll(options) {
154
- return __asyncGenerator(this, arguments, function* getUSProgramBriefsPagingAll_1() {
155
- var _a, e_3, _b, _c;
156
- try {
157
- for (var _d = true, _e = __asyncValues(this.getUSProgramBriefsPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
158
- _c = _f.value;
159
- _d = false;
160
- const page = _c;
161
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
162
- }
163
- }
164
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
165
- finally {
166
- try {
167
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
168
- }
169
- finally { if (e_3) throw e_3.error; }
170
- }
171
- });
117
+ async *getUSProgramBriefsPagingAll(options) {
118
+ for await (const page of this.getUSProgramBriefsPagingPage(options)) {
119
+ yield* page;
120
+ }
172
121
  }
173
122
  /**
174
123
  * Gets the list of attachments from a US Program Brief.
@@ -189,44 +138,27 @@ export class ShortCodesImpl {
189
138
  }
190
139
  };
191
140
  }
192
- getUSProgramBriefAttachmentsPagingPage(programBriefId, options) {
193
- return __asyncGenerator(this, arguments, function* getUSProgramBriefAttachmentsPagingPage_1() {
194
- let result = yield __await(this._getUSProgramBriefAttachments(programBriefId, options));
195
- yield yield __await(result.attachments || []);
196
- let continuationToken = result.nextLink;
197
- while (continuationToken) {
198
- result = yield __await(this._getUSProgramBriefAttachmentsNext(programBriefId, continuationToken, options));
199
- continuationToken = result.nextLink;
200
- yield yield __await(result.attachments || []);
201
- }
202
- });
141
+ async *getUSProgramBriefAttachmentsPagingPage(programBriefId, options) {
142
+ let result = await this._getUSProgramBriefAttachments(programBriefId, options);
143
+ yield result.attachments || [];
144
+ let continuationToken = result.nextLink;
145
+ while (continuationToken) {
146
+ result = await this._getUSProgramBriefAttachmentsNext(programBriefId, continuationToken, options);
147
+ continuationToken = result.nextLink;
148
+ yield result.attachments || [];
149
+ }
203
150
  }
204
- getUSProgramBriefAttachmentsPagingAll(programBriefId, options) {
205
- return __asyncGenerator(this, arguments, function* getUSProgramBriefAttachmentsPagingAll_1() {
206
- var _a, e_4, _b, _c;
207
- try {
208
- for (var _d = true, _e = __asyncValues(this.getUSProgramBriefAttachmentsPagingPage(programBriefId, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
209
- _c = _f.value;
210
- _d = false;
211
- const page = _c;
212
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
213
- }
214
- }
215
- catch (e_4_1) { e_4 = { error: e_4_1 }; }
216
- finally {
217
- try {
218
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
219
- }
220
- finally { if (e_4) throw e_4.error; }
221
- }
222
- });
151
+ async *getUSProgramBriefAttachmentsPagingAll(programBriefId, options) {
152
+ for await (const page of this.getUSProgramBriefAttachmentsPagingPage(programBriefId, options)) {
153
+ yield* page;
154
+ }
223
155
  }
224
156
  /**
225
157
  * Gets the list of short codes for the current resource.
226
158
  * @param options The options parameters.
227
159
  */
228
160
  async _getShortCodes(options) {
229
- return tracingClient.withSpan("ShortCodesClient._getShortCodes", options !== null && options !== void 0 ? options : {}, async (options) => {
161
+ return tracingClient.withSpan("ShortCodesClient._getShortCodes", options ?? {}, async (options) => {
230
162
  return this.client.sendOperationRequest({ options }, getShortCodesOperationSpec);
231
163
  });
232
164
  }
@@ -235,7 +167,7 @@ export class ShortCodesImpl {
235
167
  * @param options The options parameters.
236
168
  */
237
169
  async _getCosts(options) {
238
- return tracingClient.withSpan("ShortCodesClient._getCosts", options !== null && options !== void 0 ? options : {}, async (options) => {
170
+ return tracingClient.withSpan("ShortCodesClient._getCosts", options ?? {}, async (options) => {
239
171
  return this.client.sendOperationRequest({ options }, getCostsOperationSpec);
240
172
  });
241
173
  }
@@ -245,7 +177,7 @@ export class ShortCodesImpl {
245
177
  * @param options The options parameters.
246
178
  */
247
179
  async upsertUSProgramBrief(programBriefId, options) {
248
- return tracingClient.withSpan("ShortCodesClient.upsertUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
180
+ return tracingClient.withSpan("ShortCodesClient.upsertUSProgramBrief", options ?? {}, async (options) => {
249
181
  return this.client.sendOperationRequest({ programBriefId, options }, upsertUSProgramBriefOperationSpec);
250
182
  });
251
183
  }
@@ -255,7 +187,7 @@ export class ShortCodesImpl {
255
187
  * @param options The options parameters.
256
188
  */
257
189
  async deleteUSProgramBrief(programBriefId, options) {
258
- return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
190
+ return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBrief", options ?? {}, async (options) => {
259
191
  return this.client.sendOperationRequest({ programBriefId, options }, deleteUSProgramBriefOperationSpec);
260
192
  });
261
193
  }
@@ -265,7 +197,7 @@ export class ShortCodesImpl {
265
197
  * @param options The options parameters.
266
198
  */
267
199
  async getUSProgramBrief(programBriefId, options) {
268
- return tracingClient.withSpan("ShortCodesClient.getUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
200
+ return tracingClient.withSpan("ShortCodesClient.getUSProgramBrief", options ?? {}, async (options) => {
269
201
  return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefOperationSpec);
270
202
  });
271
203
  }
@@ -275,7 +207,7 @@ export class ShortCodesImpl {
275
207
  * @param options The options parameters.
276
208
  */
277
209
  async submitUSProgramBrief(programBriefId, options) {
278
- return tracingClient.withSpan("ShortCodesClient.submitUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
210
+ return tracingClient.withSpan("ShortCodesClient.submitUSProgramBrief", options ?? {}, async (options) => {
279
211
  return this.client.sendOperationRequest({ programBriefId, options }, submitUSProgramBriefOperationSpec);
280
212
  });
281
213
  }
@@ -284,7 +216,7 @@ export class ShortCodesImpl {
284
216
  * @param options The options parameters.
285
217
  */
286
218
  async _getUSProgramBriefs(options) {
287
- return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefs", options !== null && options !== void 0 ? options : {}, async (options) => {
219
+ return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefs", options ?? {}, async (options) => {
288
220
  return this.client.sendOperationRequest({ options }, getUSProgramBriefsOperationSpec);
289
221
  });
290
222
  }
@@ -303,7 +235,7 @@ export class ShortCodesImpl {
303
235
  * @param options The options parameters.
304
236
  */
305
237
  async createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, id, fileName, fileType, fileContentBase64, type, options) {
306
- return tracingClient.withSpan("ShortCodesClient.createOrReplaceUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
238
+ return tracingClient.withSpan("ShortCodesClient.createOrReplaceUSProgramBriefAttachment", options ?? {}, async (options) => {
307
239
  return this.client.sendOperationRequest({
308
240
  programBriefId,
309
241
  attachmentId,
@@ -323,7 +255,7 @@ export class ShortCodesImpl {
323
255
  * @param options The options parameters.
324
256
  */
325
257
  async getUSProgramBriefAttachment(programBriefId, attachmentId, options) {
326
- return tracingClient.withSpan("ShortCodesClient.getUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
258
+ return tracingClient.withSpan("ShortCodesClient.getUSProgramBriefAttachment", options ?? {}, async (options) => {
327
259
  return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, getUSProgramBriefAttachmentOperationSpec);
328
260
  });
329
261
  }
@@ -334,7 +266,7 @@ export class ShortCodesImpl {
334
266
  * @param options The options parameters.
335
267
  */
336
268
  async deleteUSProgramBriefAttachment(programBriefId, attachmentId, options) {
337
- return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
269
+ return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBriefAttachment", options ?? {}, async (options) => {
338
270
  return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, deleteUSProgramBriefAttachmentOperationSpec);
339
271
  });
340
272
  }
@@ -344,7 +276,7 @@ export class ShortCodesImpl {
344
276
  * @param options The options parameters.
345
277
  */
346
278
  async _getUSProgramBriefAttachments(programBriefId, options) {
347
- return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachments", options !== null && options !== void 0 ? options : {}, async (options) => {
279
+ return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachments", options ?? {}, async (options) => {
348
280
  return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefAttachmentsOperationSpec);
349
281
  });
350
282
  }
@@ -354,7 +286,7 @@ export class ShortCodesImpl {
354
286
  * @param options The options parameters.
355
287
  */
356
288
  async _getShortCodesNext(nextLink, options) {
357
- return tracingClient.withSpan("ShortCodesClient._getShortCodesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
289
+ return tracingClient.withSpan("ShortCodesClient._getShortCodesNext", options ?? {}, async (options) => {
358
290
  return this.client.sendOperationRequest({ nextLink, options }, getShortCodesNextOperationSpec);
359
291
  });
360
292
  }
@@ -364,7 +296,7 @@ export class ShortCodesImpl {
364
296
  * @param options The options parameters.
365
297
  */
366
298
  async _getCostsNext(nextLink, options) {
367
- return tracingClient.withSpan("ShortCodesClient._getCostsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
299
+ return tracingClient.withSpan("ShortCodesClient._getCostsNext", options ?? {}, async (options) => {
368
300
  return this.client.sendOperationRequest({ nextLink, options }, getCostsNextOperationSpec);
369
301
  });
370
302
  }
@@ -374,7 +306,7 @@ export class ShortCodesImpl {
374
306
  * @param options The options parameters.
375
307
  */
376
308
  async _getUSProgramBriefsNext(nextLink, options) {
377
- return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
309
+ return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefsNext", options ?? {}, async (options) => {
378
310
  return this.client.sendOperationRequest({ nextLink, options }, getUSProgramBriefsNextOperationSpec);
379
311
  });
380
312
  }
@@ -386,7 +318,7 @@ export class ShortCodesImpl {
386
318
  * @param options The options parameters.
387
319
  */
388
320
  async _getUSProgramBriefAttachmentsNext(programBriefId, nextLink, options) {
389
- return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachmentsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
321
+ return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachmentsNext", options ?? {}, async (options) => {
390
322
  return this.client.sendOperationRequest({ programBriefId, nextLink, options }, getUSProgramBriefAttachmentsNextOperationSpec);
391
323
  });
392
324
  }
@@ -531,7 +463,7 @@ const createOrReplaceUSProgramBriefAttachmentOperationSpec = {
531
463
  fileType: ["fileType"],
532
464
  fileContentBase64: ["fileContentBase64"]
533
465
  },
534
- mapper: Object.assign(Object.assign({}, Mappers.ProgramBriefAttachment), { required: true })
466
+ mapper: { ...Mappers.ProgramBriefAttachment, required: true }
535
467
  },
536
468
  queryParameters: [Parameters.apiVersion],
537
469
  urlParameters: [