@azure-tools/communication-short-codes 1.0.0-beta.1 → 1.0.0-beta.4

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 (38) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +596 -267
  3. package/dist/index.js.map +1 -1
  4. package/dist-esm/src/generated/src/index.js +1 -1
  5. package/dist-esm/src/generated/src/index.js.map +1 -1
  6. package/dist-esm/src/generated/src/models/index.js.map +1 -1
  7. package/dist-esm/src/generated/src/models/mappers.js +153 -91
  8. package/dist-esm/src/generated/src/models/mappers.js.map +1 -1
  9. package/dist-esm/src/generated/src/models/parameters.js +48 -2
  10. package/dist-esm/src/generated/src/models/parameters.js.map +1 -1
  11. package/dist-esm/src/generated/src/operations/index.js +1 -1
  12. package/dist-esm/src/generated/src/operations/index.js.map +1 -1
  13. package/dist-esm/src/generated/src/operations/shortCodesOperations.js +561 -0
  14. package/dist-esm/src/generated/src/operations/shortCodesOperations.js.map +1 -0
  15. package/dist-esm/src/generated/src/operationsInterfaces/index.js +9 -0
  16. package/dist-esm/src/generated/src/operationsInterfaces/index.js.map +1 -0
  17. package/dist-esm/src/generated/src/operationsInterfaces/shortCodesOperations.js +9 -0
  18. package/dist-esm/src/generated/src/operationsInterfaces/shortCodesOperations.js.map +1 -0
  19. package/dist-esm/src/generated/src/shortCodesClient.js +70 -5
  20. package/dist-esm/src/generated/src/shortCodesClient.js.map +1 -1
  21. package/dist-esm/src/generated/src/tracing.js +14 -0
  22. package/dist-esm/src/generated/src/tracing.js.map +1 -0
  23. package/dist-esm/src/models.js.map +1 -1
  24. package/dist-esm/src/shortCodesClient.js +53 -76
  25. package/dist-esm/src/shortCodesClient.js.map +1 -1
  26. package/dist-esm/src/utils/constants.js +1 -1
  27. package/dist-esm/src/utils/constants.js.map +1 -1
  28. package/dist-esm/src/utils/index.js +0 -1
  29. package/dist-esm/src/utils/index.js.map +1 -1
  30. package/package.json +42 -40
  31. package/types/communication-short-codes.d.ts +105 -26
  32. package/CHANGELOG.md +0 -10
  33. package/dist-esm/src/generated/src/operations/shortCodes.js +0 -341
  34. package/dist-esm/src/generated/src/operations/shortCodes.js.map +0 -1
  35. package/dist-esm/src/generated/src/shortCodesClientContext.js +0 -38
  36. package/dist-esm/src/generated/src/shortCodesClientContext.js.map +0 -1
  37. package/dist-esm/src/utils/tracing.js +0 -14
  38. package/dist-esm/src/utils/tracing.js.map +0 -1
package/dist/index.js CHANGED
@@ -2,33 +2,46 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var communicationCommon = require('@azure/communication-common');
6
5
  var coreAuth = require('@azure/core-auth');
7
- var coreHttp = require('@azure/core-http');
8
- var logger$1 = require('@azure/logger');
6
+ var communicationCommon = require('@azure/communication-common');
9
7
  var coreTracing = require('@azure/core-tracing');
8
+ var logger$1 = require('@azure/logger');
9
+ var coreClient = require('@azure/core-client');
10
+ var coreRestPipeline = require('@azure/core-rest-pipeline');
10
11
  var tslib = require('tslib');
11
12
 
12
- // Copyright (c) Microsoft Corporation.
13
- // Licensed under the MIT license.
14
- const SDK_VERSION = "1.0.0-beta.1";
13
+ function _interopNamespace(e) {
14
+ if (e && e.__esModule) return e;
15
+ var n = Object.create(null);
16
+ if (e) {
17
+ Object.keys(e).forEach(function (k) {
18
+ if (k !== 'default') {
19
+ var d = Object.getOwnPropertyDescriptor(e, k);
20
+ Object.defineProperty(n, k, d.get ? d : {
21
+ enumerable: true,
22
+ get: function () { return e[k]; }
23
+ });
24
+ }
25
+ });
26
+ }
27
+ n["default"] = e;
28
+ return Object.freeze(n);
29
+ }
15
30
 
16
- // Copyright (c) Microsoft Corporation.
17
- /**
18
- * The \@azure\/logger configuration for this package.
19
- */
20
- const logger = logger$1.createClientLogger("communication-short-codes");
31
+ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
32
+ var coreRestPipeline__namespace = /*#__PURE__*/_interopNamespace(coreRestPipeline);
21
33
 
22
- // Copyright (c) Microsoft Corporation.
23
- /**
24
- * Creates a span using the global tracer.
25
- * @internal
26
- * @param name - The name of the operation being performed.
27
- * @param tracingOptions - The options for the underlying http request.
34
+ /*
35
+ * Copyright (c) Microsoft Corporation.
36
+ * Licensed under the MIT License.
37
+ *
38
+ * Code generated by Microsoft (R) AutoRest Code Generator.
39
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
28
40
  */
29
- const createSpan = coreTracing.createSpanFunction({
30
- packagePrefix: "Azure.Communication",
31
- namespace: "Microsoft.Communication"
41
+ const tracingClient = coreTracing.createTracingClient({
42
+ namespace: "Microsoft.Communication",
43
+ packageName: "@azure/communication-short-codes",
44
+ packageVersion: "1.0.0-beta.4"
32
45
  });
33
46
 
34
47
  /*
@@ -78,8 +91,7 @@ const ShortCode = {
78
91
  numberType: {
79
92
  serializedName: "numberType",
80
93
  type: {
81
- name: "Enum",
82
- allowedValues: ["shortCode", "alphaId"]
94
+ name: "String"
83
95
  }
84
96
  },
85
97
  countryCode: {
@@ -187,15 +199,7 @@ const USProgramBrief = {
187
199
  status: {
188
200
  serializedName: "status",
189
201
  type: {
190
- name: "Enum",
191
- allowedValues: [
192
- "submitted",
193
- "approved",
194
- "submitNewVanityNumbers",
195
- "updateProgramBrief",
196
- "draft",
197
- "denied"
198
- ]
202
+ name: "String"
199
203
  }
200
204
  },
201
205
  number: {
@@ -267,6 +271,18 @@ const USProgramBrief = {
267
271
  name: "Composite",
268
272
  className: "TrafficDetails"
269
273
  }
274
+ },
275
+ attachments: {
276
+ serializedName: "attachments",
277
+ type: {
278
+ name: "Sequence",
279
+ element: {
280
+ type: {
281
+ name: "Composite",
282
+ className: "ProgramBriefAttachmentSummary"
283
+ }
284
+ }
285
+ }
270
286
  }
271
287
  }
272
288
  }
@@ -314,8 +330,7 @@ const ShortCodeCost = {
314
330
  serializedName: "billingFrequency",
315
331
  required: true,
316
332
  type: {
317
- name: "Enum",
318
- allowedValues: ["monthly", "once"]
333
+ name: "String"
319
334
  }
320
335
  }
321
336
  }
@@ -346,8 +361,7 @@ const ProgramDetails = {
346
361
  numberType: {
347
362
  serializedName: "numberType",
348
363
  type: {
349
- name: "Enum",
350
- allowedValues: ["shortCode", "alphaId"]
364
+ name: "String"
351
365
  }
352
366
  },
353
367
  isPoliticalCampaign: {
@@ -374,8 +388,8 @@ const ProgramDetails = {
374
388
  name: "String"
375
389
  }
376
390
  },
377
- signUpTypes: {
378
- serializedName: "signUpTypes",
391
+ callToActionTypes: {
392
+ serializedName: "callToActionTypes",
379
393
  type: {
380
394
  name: "Sequence",
381
395
  element: {
@@ -391,8 +405,14 @@ const ProgramDetails = {
391
405
  }
392
406
  }
393
407
  },
394
- signUpUrl: {
395
- serializedName: "signUpUrl",
408
+ callToActionUrl: {
409
+ serializedName: "callToActionUrl",
410
+ type: {
411
+ name: "String"
412
+ }
413
+ },
414
+ callToAction: {
415
+ serializedName: "callToAction",
396
416
  type: {
397
417
  name: "String"
398
418
  }
@@ -509,51 +529,44 @@ const MessageDetails = {
509
529
  name: "Composite",
510
530
  className: "MessageDetails",
511
531
  modelProperties: {
512
- supportedProtocols: {
513
- serializedName: "supportedProtocols",
532
+ supportedProtocol: {
533
+ serializedName: "supportedProtocol",
514
534
  type: {
515
- name: "Sequence",
516
- element: {
517
- type: {
518
- name: "Enum",
519
- allowedValues: ["sms", "mms"]
520
- }
521
- }
535
+ name: "String"
522
536
  }
523
537
  },
524
538
  recurrence: {
525
539
  serializedName: "recurrence",
526
540
  type: {
527
- name: "Enum",
528
- allowedValues: ["subscription", "transaction"]
541
+ name: "String"
529
542
  }
530
543
  },
531
- helpMessage: {
532
- serializedName: "helpMessage",
544
+ helpAnswerToUser: {
545
+ serializedName: "helpAnswerToUser",
533
546
  type: {
534
547
  name: "String"
535
548
  }
536
549
  },
537
- optOutMessage: {
538
- serializedName: "optOutMessage",
550
+ optOutAnswerToUser: {
551
+ serializedName: "optOutAnswerToUser",
539
552
  type: {
540
553
  name: "String"
541
554
  }
542
555
  },
543
- optInMessage: {
544
- serializedName: "optInMessage",
556
+ optInMessageToUser: {
557
+ serializedName: "optInMessageToUser",
545
558
  type: {
546
559
  name: "String"
547
560
  }
548
561
  },
549
- optInReply: {
550
- serializedName: "optInReply",
562
+ optInAnswerFromUser: {
563
+ serializedName: "optInAnswerFromUser",
551
564
  type: {
552
565
  name: "String"
553
566
  }
554
567
  },
555
- confirmationMessage: {
556
- serializedName: "confirmationMessage",
568
+ optInConfirmationMessageToUser: {
569
+ serializedName: "optInConfirmationMessageToUser",
557
570
  type: {
558
571
  name: "String"
559
572
  }
@@ -561,8 +574,7 @@ const MessageDetails = {
561
574
  directionality: {
562
575
  serializedName: "directionality",
563
576
  type: {
564
- name: "Enum",
565
- allowedValues: ["oneWay", "twoWay"]
577
+ name: "String"
566
578
  }
567
579
  },
568
580
  useCases: {
@@ -585,53 +597,16 @@ const UseCase = {
585
597
  name: "Composite",
586
598
  className: "UseCase",
587
599
  modelProperties: {
588
- contentCategory: {
589
- serializedName: "contentCategory",
590
- type: {
591
- name: "Enum",
592
- allowedValues: [
593
- "ringTones",
594
- "smsChat",
595
- "video",
596
- "loyaltyProgramPointsPrizes",
597
- "gifting",
598
- "inApplicationBilling",
599
- "textToScreen",
600
- "games",
601
- "audioChat",
602
- "mmsPictures",
603
- "sweepstakesContestAuction",
604
- "financialBanking",
605
- "premiumWap",
606
- "queryService",
607
- "wallpaperScreensaver",
608
- "voting",
609
- "application",
610
- "mobileGivingDonations",
611
- "coupons",
612
- "loyaltyProgram",
613
- "noPointsPrizes",
614
- "informationalAlerts",
615
- "microBilling",
616
- "trivia",
617
- "entertainmentAlerts",
618
- "accountNotification",
619
- "ageGatedContent",
620
- "conversationalMessaging",
621
- "deliveryNotification",
622
- "education",
623
- "emergencyAlerts",
624
- "fraudAlerts",
625
- "loanArrangement",
626
- "onBehalfOfCarrier",
627
- "political",
628
- "promotionalMarketing",
629
- "publicServiceAnnouncements",
630
- "securityAlerts",
631
- "socialMedia",
632
- "twoFactorAuthentication",
633
- "other"
634
- ]
600
+ contentType: {
601
+ serializedName: "contentType",
602
+ type: {
603
+ name: "String"
604
+ }
605
+ },
606
+ customContentType: {
607
+ serializedName: "customContentType",
608
+ type: {
609
+ name: "String"
635
610
  }
636
611
  },
637
612
  examples: {
@@ -677,8 +652,7 @@ const MessageExample = {
677
652
  direction: {
678
653
  serializedName: "direction",
679
654
  type: {
680
- name: "Enum",
681
- allowedValues: ["toUser", "fromUser"]
655
+ name: "String"
682
656
  }
683
657
  },
684
658
  text: {
@@ -750,6 +724,32 @@ const TrafficDetails = {
750
724
  }
751
725
  }
752
726
  };
727
+ const ProgramBriefAttachmentSummary = {
728
+ type: {
729
+ name: "Composite",
730
+ className: "ProgramBriefAttachmentSummary",
731
+ modelProperties: {
732
+ id: {
733
+ serializedName: "id",
734
+ type: {
735
+ name: "Uuid"
736
+ }
737
+ },
738
+ type: {
739
+ serializedName: "type",
740
+ type: {
741
+ name: "String"
742
+ }
743
+ },
744
+ fileName: {
745
+ serializedName: "fileName",
746
+ type: {
747
+ name: "String"
748
+ }
749
+ }
750
+ }
751
+ }
752
+ };
753
753
  const USProgramBriefs = {
754
754
  type: {
755
755
  name: "Composite",
@@ -776,6 +776,81 @@ const USProgramBriefs = {
776
776
  }
777
777
  }
778
778
  };
779
+ const ProgramBriefAttachment = {
780
+ type: {
781
+ name: "Composite",
782
+ className: "ProgramBriefAttachment",
783
+ modelProperties: {
784
+ id: {
785
+ serializedName: "id",
786
+ required: true,
787
+ type: {
788
+ name: "Uuid"
789
+ }
790
+ },
791
+ type: {
792
+ serializedName: "type",
793
+ required: true,
794
+ type: {
795
+ name: "String"
796
+ }
797
+ },
798
+ fileName: {
799
+ serializedName: "fileName",
800
+ required: true,
801
+ type: {
802
+ name: "String"
803
+ }
804
+ },
805
+ fileSizeInBytes: {
806
+ serializedName: "fileSizeInBytes",
807
+ type: {
808
+ name: "Number"
809
+ }
810
+ },
811
+ fileType: {
812
+ serializedName: "fileType",
813
+ required: true,
814
+ type: {
815
+ name: "String"
816
+ }
817
+ },
818
+ fileContentBase64: {
819
+ serializedName: "fileContentBase64",
820
+ required: true,
821
+ type: {
822
+ name: "String"
823
+ }
824
+ }
825
+ }
826
+ }
827
+ };
828
+ const ProgramBriefAttachments = {
829
+ type: {
830
+ name: "Composite",
831
+ className: "ProgramBriefAttachments",
832
+ modelProperties: {
833
+ attachments: {
834
+ serializedName: "attachments",
835
+ type: {
836
+ name: "Sequence",
837
+ element: {
838
+ type: {
839
+ name: "Composite",
840
+ className: "ProgramBriefAttachment"
841
+ }
842
+ }
843
+ }
844
+ },
845
+ nextLink: {
846
+ serializedName: "nextLink",
847
+ type: {
848
+ name: "String"
849
+ }
850
+ }
851
+ }
852
+ }
853
+ };
779
854
 
780
855
  var Mappers = /*#__PURE__*/Object.freeze({
781
856
  __proto__: null,
@@ -795,7 +870,10 @@ var Mappers = /*#__PURE__*/Object.freeze({
795
870
  MessageExampleSequence: MessageExampleSequence,
796
871
  MessageExample: MessageExample,
797
872
  TrafficDetails: TrafficDetails,
798
- USProgramBriefs: USProgramBriefs
873
+ ProgramBriefAttachmentSummary: ProgramBriefAttachmentSummary,
874
+ USProgramBriefs: USProgramBriefs,
875
+ ProgramBriefAttachment: ProgramBriefAttachment,
876
+ ProgramBriefAttachments: ProgramBriefAttachments
799
877
  });
800
878
 
801
879
  /*
@@ -830,6 +908,7 @@ const endpoint = {
830
908
  const skip = {
831
909
  parameterPath: ["options", "skip"],
832
910
  mapper: {
911
+ defaultValue: 0,
833
912
  serializedName: "skip",
834
913
  type: {
835
914
  name: "Number"
@@ -849,7 +928,7 @@ const top = {
849
928
  const apiVersion = {
850
929
  parameterPath: "apiVersion",
851
930
  mapper: {
852
- defaultValue: "2021-10-25-preview",
931
+ defaultValue: "2022-09-06",
853
932
  isConstant: true,
854
933
  serializedName: "api-version",
855
934
  type: {
@@ -882,6 +961,27 @@ const programBriefId = {
882
961
  }
883
962
  }
884
963
  };
964
+ const contentType1 = {
965
+ parameterPath: ["options", "contentType"],
966
+ mapper: {
967
+ defaultValue: "application/json",
968
+ isConstant: true,
969
+ serializedName: "Content-Type",
970
+ type: {
971
+ name: "String"
972
+ }
973
+ }
974
+ };
975
+ const attachmentId = {
976
+ parameterPath: "attachmentId",
977
+ mapper: {
978
+ serializedName: "attachmentId",
979
+ required: true,
980
+ type: {
981
+ name: "Uuid"
982
+ }
983
+ }
984
+ };
885
985
  const nextLink = {
886
986
  parameterPath: "nextLink",
887
987
  mapper: {
@@ -901,10 +1001,11 @@ const nextLink = {
901
1001
  * Code generated by Microsoft (R) AutoRest Code Generator.
902
1002
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
903
1003
  */
904
- /** Class representing a ShortCodes. */
905
- class ShortCodes$1 {
1004
+ /// <reference lib="esnext.asynciterable" />
1005
+ /** Class containing ShortCodesOperations operations. */
1006
+ class ShortCodesOperationsImpl {
906
1007
  /**
907
- * Initialize a new instance of the class ShortCodes class.
1008
+ * Initialize a new instance of the class ShortCodesOperations class.
908
1009
  * @param client Reference to the service client
909
1010
  */
910
1011
  constructor(client) {
@@ -1007,98 +1108,207 @@ class ShortCodes$1 {
1007
1108
  });
1008
1109
  }
1009
1110
  /**
1010
- * Gets the list of short codes for the current resource.
1111
+ * Gets the list of attachments from a US Program Brief.
1112
+ * @param programBriefId
1011
1113
  * @param options The options parameters.
1012
1114
  */
1013
- _getShortCodes(options) {
1014
- const operationArguments = {
1015
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1115
+ listUSProgramBriefAttachments(programBriefId, options) {
1116
+ const iter = this.getUSProgramBriefAttachmentsPagingAll(programBriefId, options);
1117
+ return {
1118
+ next() {
1119
+ return iter.next();
1120
+ },
1121
+ [Symbol.asyncIterator]() {
1122
+ return this;
1123
+ },
1124
+ byPage: () => {
1125
+ return this.getUSProgramBriefAttachmentsPagingPage(programBriefId, options);
1126
+ }
1016
1127
  };
1017
- return this.client.sendOperationRequest(operationArguments, getShortCodesOperationSpec);
1128
+ }
1129
+ getUSProgramBriefAttachmentsPagingPage(programBriefId, options) {
1130
+ return tslib.__asyncGenerator(this, arguments, function* getUSProgramBriefAttachmentsPagingPage_1() {
1131
+ let result = yield tslib.__await(this._getUSProgramBriefAttachments(programBriefId, options));
1132
+ yield yield tslib.__await(result.attachments || []);
1133
+ let continuationToken = result.nextLink;
1134
+ while (continuationToken) {
1135
+ result = yield tslib.__await(this._getUSProgramBriefAttachmentsNext(programBriefId, continuationToken, options));
1136
+ continuationToken = result.nextLink;
1137
+ yield yield tslib.__await(result.attachments || []);
1138
+ }
1139
+ });
1140
+ }
1141
+ getUSProgramBriefAttachmentsPagingAll(programBriefId, options) {
1142
+ return tslib.__asyncGenerator(this, arguments, function* getUSProgramBriefAttachmentsPagingAll_1() {
1143
+ var e_3, _a;
1144
+ try {
1145
+ for (var _b = tslib.__asyncValues(this.getUSProgramBriefAttachmentsPagingPage(programBriefId, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1146
+ const page = _c.value;
1147
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1148
+ }
1149
+ }
1150
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
1151
+ finally {
1152
+ try {
1153
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1154
+ }
1155
+ finally { if (e_3) throw e_3.error; }
1156
+ }
1157
+ });
1158
+ }
1159
+ /**
1160
+ * Gets the list of short codes for the current resource.
1161
+ * @param options The options parameters.
1162
+ */
1163
+ async _getShortCodes(options) {
1164
+ return tracingClient.withSpan("ShortCodesClient._getShortCodes", options !== null && options !== void 0 ? options : {}, async (options) => {
1165
+ return this.client.sendOperationRequest({ options }, getShortCodesOperationSpec);
1166
+ });
1018
1167
  }
1019
1168
  /**
1020
1169
  * Creates or updates a US Program Brief.
1021
1170
  * @param programBriefId Program Brief Id. Must be a valid GUID
1022
1171
  * @param options The options parameters.
1023
1172
  */
1024
- upsertUSProgramBrief(programBriefId, options) {
1025
- const operationArguments = {
1026
- programBriefId,
1027
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1028
- };
1029
- return this.client.sendOperationRequest(operationArguments, upsertUSProgramBriefOperationSpec);
1173
+ async upsertUSProgramBrief(programBriefId, options) {
1174
+ return tracingClient.withSpan("ShortCodesClient.upsertUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
1175
+ return this.client.sendOperationRequest({ programBriefId, options }, upsertUSProgramBriefOperationSpec);
1176
+ });
1030
1177
  }
1031
1178
  /**
1032
1179
  * Deletes a US Program Brief.
1033
1180
  * @param programBriefId Program Brief Id. Must be a valid GUID
1034
1181
  * @param options The options parameters.
1035
1182
  */
1036
- deleteUSProgramBrief(programBriefId, options) {
1037
- const operationArguments = {
1038
- programBriefId,
1039
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1040
- };
1041
- return this.client.sendOperationRequest(operationArguments, deleteUSProgramBriefOperationSpec);
1183
+ async deleteUSProgramBrief(programBriefId, options) {
1184
+ return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
1185
+ return this.client.sendOperationRequest({ programBriefId, options }, deleteUSProgramBriefOperationSpec);
1186
+ });
1042
1187
  }
1043
1188
  /**
1044
- * @param programBriefId
1189
+ * Get a US Program Brief by id.
1190
+ * @param programBriefId Program Brief Id. Must be a valid GUID
1045
1191
  * @param options The options parameters.
1046
1192
  */
1047
- getUSProgramBrief(programBriefId, options) {
1048
- const operationArguments = {
1049
- programBriefId,
1050
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1051
- };
1052
- return this.client.sendOperationRequest(operationArguments, getUSProgramBriefOperationSpec);
1193
+ async getUSProgramBrief(programBriefId, options) {
1194
+ return tracingClient.withSpan("ShortCodesClient.getUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
1195
+ return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefOperationSpec);
1196
+ });
1053
1197
  }
1054
1198
  /**
1055
- * @param programBriefId
1199
+ * Submits a US Program Brief for review.
1200
+ * @param programBriefId Program Brief Id. Must be a valid GUID
1056
1201
  * @param options The options parameters.
1057
1202
  */
1058
- submitUSProgramBrief(programBriefId, options) {
1059
- const operationArguments = {
1060
- programBriefId,
1061
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1062
- };
1063
- return this.client.sendOperationRequest(operationArguments, submitUSProgramBriefOperationSpec);
1203
+ async submitUSProgramBrief(programBriefId, options) {
1204
+ return tracingClient.withSpan("ShortCodesClient.submitUSProgramBrief", options !== null && options !== void 0 ? options : {}, async (options) => {
1205
+ return this.client.sendOperationRequest({ programBriefId, options }, submitUSProgramBriefOperationSpec);
1206
+ });
1064
1207
  }
1065
1208
  /**
1066
1209
  * Gets the list of US Program Briefs for the current resource.
1067
1210
  * @param options The options parameters.
1068
1211
  */
1069
- _getUSProgramBriefs(options) {
1070
- const operationArguments = {
1071
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1072
- };
1073
- return this.client.sendOperationRequest(operationArguments, getUSProgramBriefsOperationSpec);
1212
+ async _getUSProgramBriefs(options) {
1213
+ return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefs", options !== null && options !== void 0 ? options : {}, async (options) => {
1214
+ return this.client.sendOperationRequest({ options }, getUSProgramBriefsOperationSpec);
1215
+ });
1216
+ }
1217
+ /**
1218
+ * Creates or replace an attachment on a US Program Brief.
1219
+ * @param programBriefId Program Brief Id. Must be a valid GUID
1220
+ * @param attachmentId Attachment Id. Must be a valid GUID
1221
+ * @param id Program Brief Attachment Id.
1222
+ * @param fileName The name of the file being attached
1223
+ * e.g. 'myFile01'
1224
+ * @param fileType The type of file being attached
1225
+ * e.g. 'pdf', 'jpg', 'png'
1226
+ * @param fileContentBase64 File content as base 64 encoded string
1227
+ * @param type Attachment type describing the purpose of the attachment
1228
+ * e.g. 'callToAction', 'termsOfService'
1229
+ * @param options The options parameters.
1230
+ */
1231
+ async createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, id, fileName, fileType, fileContentBase64, type, options) {
1232
+ return tracingClient.withSpan("ShortCodesClient.createOrReplaceUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
1233
+ return this.client.sendOperationRequest({
1234
+ programBriefId,
1235
+ attachmentId,
1236
+ id,
1237
+ fileName,
1238
+ fileType,
1239
+ fileContentBase64,
1240
+ type,
1241
+ options
1242
+ }, createOrReplaceUSProgramBriefAttachmentOperationSpec);
1243
+ });
1244
+ }
1245
+ /**
1246
+ * Gets a specific an attachment from a US Program Brief.
1247
+ * @param programBriefId Program Brief Id. Must be a valid GUID
1248
+ * @param attachmentId Attachment Id. Must be a valid GUID
1249
+ * @param options The options parameters.
1250
+ */
1251
+ async getUSProgramBriefAttachment(programBriefId, attachmentId, options) {
1252
+ return tracingClient.withSpan("ShortCodesClient.getUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
1253
+ return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, getUSProgramBriefAttachmentOperationSpec);
1254
+ });
1255
+ }
1256
+ /**
1257
+ * Deletes a specific attachment from a US Program Brief.
1258
+ * @param programBriefId Program Brief Id. Must be a valid GUID
1259
+ * @param attachmentId Attachment Id. Must be a valid GUID
1260
+ * @param options The options parameters.
1261
+ */
1262
+ async deleteUSProgramBriefAttachment(programBriefId, attachmentId, options) {
1263
+ return tracingClient.withSpan("ShortCodesClient.deleteUSProgramBriefAttachment", options !== null && options !== void 0 ? options : {}, async (options) => {
1264
+ return this.client.sendOperationRequest({ programBriefId, attachmentId, options }, deleteUSProgramBriefAttachmentOperationSpec);
1265
+ });
1266
+ }
1267
+ /**
1268
+ * Gets the list of attachments from a US Program Brief.
1269
+ * @param programBriefId
1270
+ * @param options The options parameters.
1271
+ */
1272
+ async _getUSProgramBriefAttachments(programBriefId, options) {
1273
+ return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachments", options !== null && options !== void 0 ? options : {}, async (options) => {
1274
+ return this.client.sendOperationRequest({ programBriefId, options }, getUSProgramBriefAttachmentsOperationSpec);
1275
+ });
1074
1276
  }
1075
1277
  /**
1076
1278
  * GetShortCodesNext
1077
1279
  * @param nextLink The nextLink from the previous successful call to the GetShortCodes method.
1078
1280
  * @param options The options parameters.
1079
1281
  */
1080
- _getShortCodesNext(nextLink, options) {
1081
- const operationArguments = {
1082
- nextLink,
1083
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1084
- };
1085
- return this.client.sendOperationRequest(operationArguments, getShortCodesNextOperationSpec);
1282
+ async _getShortCodesNext(nextLink, options) {
1283
+ return tracingClient.withSpan("ShortCodesClient._getShortCodesNext", options !== null && options !== void 0 ? options : {}, async (options) => {
1284
+ return this.client.sendOperationRequest({ nextLink, options }, getShortCodesNextOperationSpec);
1285
+ });
1086
1286
  }
1087
1287
  /**
1088
1288
  * GetUSProgramBriefsNext
1089
1289
  * @param nextLink The nextLink from the previous successful call to the GetUSProgramBriefs method.
1090
1290
  * @param options The options parameters.
1091
1291
  */
1092
- _getUSProgramBriefsNext(nextLink, options) {
1093
- const operationArguments = {
1094
- nextLink,
1095
- options: coreHttp.operationOptionsToRequestOptionsBase(options || {})
1096
- };
1097
- return this.client.sendOperationRequest(operationArguments, getUSProgramBriefsNextOperationSpec);
1292
+ async _getUSProgramBriefsNext(nextLink, options) {
1293
+ return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
1294
+ return this.client.sendOperationRequest({ nextLink, options }, getUSProgramBriefsNextOperationSpec);
1295
+ });
1296
+ }
1297
+ /**
1298
+ * GetUSProgramBriefAttachmentsNext
1299
+ * @param programBriefId
1300
+ * @param nextLink The nextLink from the previous successful call to the GetUSProgramBriefAttachments
1301
+ * method.
1302
+ * @param options The options parameters.
1303
+ */
1304
+ async _getUSProgramBriefAttachmentsNext(programBriefId, nextLink, options) {
1305
+ return tracingClient.withSpan("ShortCodesClient._getUSProgramBriefAttachmentsNext", options !== null && options !== void 0 ? options : {}, async (options) => {
1306
+ return this.client.sendOperationRequest({ programBriefId, nextLink, options }, getUSProgramBriefAttachmentsNextOperationSpec);
1307
+ });
1098
1308
  }
1099
1309
  }
1100
1310
  // Operation Specifications
1101
- const serializer = new coreHttp.Serializer(Mappers, /* isXml */ false);
1311
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1102
1312
  const getShortCodesOperationSpec = {
1103
1313
  path: "/shortCodes",
1104
1314
  httpMethod: "GET",
@@ -1198,6 +1408,95 @@ const getUSProgramBriefsOperationSpec = {
1198
1408
  headerParameters: [accept],
1199
1409
  serializer
1200
1410
  };
1411
+ const createOrReplaceUSProgramBriefAttachmentOperationSpec = {
1412
+ path: "/shortCodes/countries/US/programBriefs/{programBriefId}/attachments/{attachmentId}",
1413
+ httpMethod: "PUT",
1414
+ responses: {
1415
+ 200: {
1416
+ bodyMapper: ProgramBriefAttachment
1417
+ },
1418
+ 201: {
1419
+ bodyMapper: ProgramBriefAttachment
1420
+ },
1421
+ default: {
1422
+ bodyMapper: CommunicationErrorResponse
1423
+ }
1424
+ },
1425
+ requestBody: {
1426
+ parameterPath: {
1427
+ id: ["id"],
1428
+ type: ["type"],
1429
+ fileName: ["fileName"],
1430
+ fileSizeInBytes: ["options", "fileSizeInBytes"],
1431
+ fileType: ["fileType"],
1432
+ fileContentBase64: ["fileContentBase64"]
1433
+ },
1434
+ mapper: Object.assign(Object.assign({}, ProgramBriefAttachment), { required: true })
1435
+ },
1436
+ queryParameters: [apiVersion],
1437
+ urlParameters: [
1438
+ endpoint,
1439
+ programBriefId,
1440
+ attachmentId
1441
+ ],
1442
+ headerParameters: [accept, contentType1],
1443
+ mediaType: "json",
1444
+ serializer
1445
+ };
1446
+ const getUSProgramBriefAttachmentOperationSpec = {
1447
+ path: "/shortCodes/countries/US/programBriefs/{programBriefId}/attachments/{attachmentId}",
1448
+ httpMethod: "GET",
1449
+ responses: {
1450
+ 200: {
1451
+ bodyMapper: ProgramBriefAttachment
1452
+ },
1453
+ default: {
1454
+ bodyMapper: CommunicationErrorResponse
1455
+ }
1456
+ },
1457
+ queryParameters: [apiVersion],
1458
+ urlParameters: [
1459
+ endpoint,
1460
+ programBriefId,
1461
+ attachmentId
1462
+ ],
1463
+ headerParameters: [accept],
1464
+ serializer
1465
+ };
1466
+ const deleteUSProgramBriefAttachmentOperationSpec = {
1467
+ path: "/shortCodes/countries/US/programBriefs/{programBriefId}/attachments/{attachmentId}",
1468
+ httpMethod: "DELETE",
1469
+ responses: {
1470
+ 204: {},
1471
+ default: {
1472
+ bodyMapper: CommunicationErrorResponse
1473
+ }
1474
+ },
1475
+ queryParameters: [apiVersion],
1476
+ urlParameters: [
1477
+ endpoint,
1478
+ programBriefId,
1479
+ attachmentId
1480
+ ],
1481
+ headerParameters: [accept],
1482
+ serializer
1483
+ };
1484
+ const getUSProgramBriefAttachmentsOperationSpec = {
1485
+ path: "/shortCodes/countries/US/programBriefs/{programBriefId}/attachments",
1486
+ httpMethod: "GET",
1487
+ responses: {
1488
+ 200: {
1489
+ bodyMapper: ProgramBriefAttachments
1490
+ },
1491
+ default: {
1492
+ bodyMapper: CommunicationErrorResponse
1493
+ }
1494
+ },
1495
+ queryParameters: [skip, top, apiVersion],
1496
+ urlParameters: [endpoint, programBriefId],
1497
+ headerParameters: [accept],
1498
+ serializer
1499
+ };
1201
1500
  const getShortCodesNextOperationSpec = {
1202
1501
  path: "{nextLink}",
1203
1502
  httpMethod: "GET",
@@ -1230,6 +1529,26 @@ const getUSProgramBriefsNextOperationSpec = {
1230
1529
  headerParameters: [accept],
1231
1530
  serializer
1232
1531
  };
1532
+ const getUSProgramBriefAttachmentsNextOperationSpec = {
1533
+ path: "{nextLink}",
1534
+ httpMethod: "GET",
1535
+ responses: {
1536
+ 200: {
1537
+ bodyMapper: ProgramBriefAttachments
1538
+ },
1539
+ default: {
1540
+ bodyMapper: CommunicationErrorResponse
1541
+ }
1542
+ },
1543
+ queryParameters: [skip, top, apiVersion],
1544
+ urlParameters: [
1545
+ endpoint,
1546
+ programBriefId,
1547
+ nextLink
1548
+ ],
1549
+ headerParameters: [accept],
1550
+ serializer
1551
+ };
1233
1552
 
1234
1553
  /*
1235
1554
  * Copyright (c) Microsoft Corporation.
@@ -1238,15 +1557,14 @@ const getUSProgramBriefsNextOperationSpec = {
1238
1557
  * Code generated by Microsoft (R) AutoRest Code Generator.
1239
1558
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1240
1559
  */
1241
- const packageName = "azure-communication-short-codes";
1242
- const packageVersion = "1.0.0-beta.1";
1243
- class ShortCodesClientContext extends coreHttp.ServiceClient {
1560
+ class ShortCodesClient$1 extends coreClient__namespace.ServiceClient {
1244
1561
  /**
1245
- * Initializes a new instance of the ShortCodesClientContext class.
1562
+ * Initializes a new instance of the ShortCodesClient class.
1246
1563
  * @param endpoint The communication resource, for example https://resourcename.communication.azure.com
1247
1564
  * @param options The parameter options
1248
1565
  */
1249
1566
  constructor(endpoint, options) {
1567
+ var _a, _b;
1250
1568
  if (endpoint === undefined) {
1251
1569
  throw new Error("'endpoint' cannot be null");
1252
1570
  }
@@ -1254,75 +1572,99 @@ class ShortCodesClientContext extends coreHttp.ServiceClient {
1254
1572
  if (!options) {
1255
1573
  options = {};
1256
1574
  }
1257
- if (!options.userAgent) {
1258
- const defaultUserAgent = coreHttp.getDefaultUserAgentValue();
1259
- options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
1575
+ const defaults = {
1576
+ requestContentType: "application/json; charset=utf-8"
1577
+ };
1578
+ const packageDetails = `azsdk-js-communication-short-codes/1.0.0-beta.4`;
1579
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1580
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1581
+ : `${packageDetails}`;
1582
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1583
+ userAgentPrefix
1584
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "{endpoint}" });
1585
+ super(optionsWithDefaults);
1586
+ if ((options === null || options === void 0 ? void 0 : options.pipeline) && options.pipeline.getOrderedPolicies().length > 0) {
1587
+ const pipelinePolicies = options.pipeline.getOrderedPolicies();
1588
+ const bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
1589
+ coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName);
1590
+ if (!bearerTokenAuthenticationPolicyFound) {
1591
+ this.pipeline.removePolicy({
1592
+ name: coreRestPipeline__namespace.bearerTokenAuthenticationPolicyName
1593
+ });
1594
+ this.pipeline.addPolicy(coreRestPipeline__namespace.bearerTokenAuthenticationPolicy({
1595
+ scopes: `${optionsWithDefaults.baseUri}/.default`,
1596
+ challengeCallbacks: {
1597
+ authorizeRequestOnChallenge: coreClient__namespace.authorizeRequestOnClaimChallenge
1598
+ }
1599
+ }));
1600
+ }
1260
1601
  }
1261
- super(undefined, options);
1262
- this.requestContentType = "application/json; charset=utf-8";
1263
- this.baseUri = options.endpoint || "{endpoint}";
1264
1602
  // Parameter assignments
1265
1603
  this.endpoint = endpoint;
1266
1604
  // Assigning values to Constant parameters
1267
- this.apiVersion = options.apiVersion || "2021-10-25-preview";
1605
+ this.apiVersion = options.apiVersion || "2022-09-06";
1606
+ this.shortCodesOperations = new ShortCodesOperationsImpl(this);
1607
+ this.addCustomApiVersionPolicy(options.apiVersion);
1608
+ }
1609
+ /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
1610
+ addCustomApiVersionPolicy(apiVersion) {
1611
+ if (!apiVersion) {
1612
+ return;
1613
+ }
1614
+ const apiVersionPolicy = {
1615
+ name: "CustomApiVersionPolicy",
1616
+ async sendRequest(request, next) {
1617
+ const param = request.url.split("?");
1618
+ if (param.length > 1) {
1619
+ const newParams = param[1].split("&").map((item) => {
1620
+ if (item.indexOf("api-version") > -1) {
1621
+ return "api-version=" + apiVersion;
1622
+ }
1623
+ else {
1624
+ return item;
1625
+ }
1626
+ });
1627
+ request.url = param[0] + "?" + newParams.join("&");
1628
+ }
1629
+ return next(request);
1630
+ }
1631
+ };
1632
+ this.pipeline.addPolicy(apiVersionPolicy);
1268
1633
  }
1269
1634
  }
1270
1635
 
1271
- /*
1272
- * Copyright (c) Microsoft Corporation.
1273
- * Licensed under the MIT License.
1274
- *
1275
- * Code generated by Microsoft (R) AutoRest Code Generator.
1276
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1636
+ // Copyright (c) Microsoft Corporation.
1637
+ /**
1638
+ * The \@azure\/logger configuration for this package.
1277
1639
  */
1278
- class ShortCodesClient extends ShortCodesClientContext {
1279
- /**
1280
- * Initializes a new instance of the ShortCodesClient class.
1281
- * @param endpoint The communication resource, for example https://resourcename.communication.azure.com
1282
- * @param options The parameter options
1283
- */
1284
- constructor(endpoint, options) {
1285
- super(endpoint, options);
1286
- this.shortCodes = new ShortCodes$1(this);
1287
- }
1288
- }
1640
+ const logger = logger$1.createClientLogger("communication-short-codes");
1289
1641
 
1290
1642
  // Copyright (c) Microsoft Corporation.
1291
1643
  const isShortCodesClientOptions = (options) => options && !communicationCommon.isKeyCredential(options) && !coreAuth.isTokenCredential(options);
1292
- class ShortCodesClient$1 {
1644
+ class ShortCodesClient {
1293
1645
  constructor(connectionStringOrUrl, credentialOrOptions, maybeOptions = {}) {
1294
1646
  const { url, credential } = communicationCommon.parseClientArguments(connectionStringOrUrl, credentialOrOptions);
1295
1647
  const options = isShortCodesClientOptions(credentialOrOptions)
1296
1648
  ? credentialOrOptions
1297
1649
  : maybeOptions;
1298
- const libInfo = `azsdk-js-communication-short-codes/${SDK_VERSION}`;
1299
- if (!options.userAgentOptions) {
1300
- options.userAgentOptions = {};
1301
- }
1302
- if (options.userAgentOptions.userAgentPrefix) {
1303
- options.userAgentOptions.userAgentPrefix = `${options.userAgentOptions.userAgentPrefix} ${libInfo}`;
1304
- }
1305
- else {
1306
- options.userAgentOptions.userAgentPrefix = libInfo;
1307
- }
1308
1650
  const internalPipelineOptions = Object.assign(Object.assign({}, options), {
1309
1651
  loggingOptions: {
1310
- logger: logger.info
1311
- }
1652
+ logger: logger.info,
1653
+ },
1312
1654
  });
1655
+ this.client = new ShortCodesClient$1(url, internalPipelineOptions);
1313
1656
  const authPolicy = communicationCommon.createCommunicationAuthPolicy(credential);
1314
- const pipeline = coreHttp.createPipelineFromOptions(internalPipelineOptions, authPolicy);
1315
- this.client = new ShortCodesClient(url, pipeline).shortCodes;
1657
+ this.client.pipeline.addPolicy(authPolicy);
1316
1658
  }
1317
1659
  listShortCodes(options = {}) {
1318
- const { span, updatedOptions } = createSpan("ShortCodesClient-listShortCodes", options);
1660
+ const { span, updatedOptions } = tracingClient.startSpan("ShortCodesClient-listShortCodes", options);
1319
1661
  try {
1320
- return this.client.listShortCodes(updatedOptions);
1662
+ return this.client.shortCodesOperations.listShortCodes(updatedOptions);
1321
1663
  }
1322
1664
  catch (e) {
1323
1665
  span.setStatus({
1324
- code: coreTracing.SpanStatusCode.ERROR,
1325
- message: e.message
1666
+ status: "error",
1667
+ error: e,
1326
1668
  });
1327
1669
  throw e;
1328
1670
  }
@@ -1330,63 +1672,30 @@ class ShortCodesClient$1 {
1330
1672
  span.end();
1331
1673
  }
1332
1674
  }
1333
- async upsertUSProgramBrief(programBriefId, options = {}) {
1334
- const { span, updatedOptions } = createSpan("ShortCodesClient-upsertUSProgramBrief", options);
1335
- try {
1336
- return await this.client.upsertUSProgramBrief(programBriefId, updatedOptions);
1337
- }
1338
- catch (e) {
1339
- span.setStatus({
1340
- code: coreTracing.SpanStatusCode.ERROR,
1341
- message: e.message
1342
- });
1343
- throw e;
1344
- }
1345
- finally {
1346
- span.end();
1347
- }
1675
+ upsertUSProgramBrief(programBriefId, options = {}) {
1676
+ return tracingClient.withSpan("ShortCodesClient-upsertUSProgramBrief", options, (updatedOptions) => {
1677
+ return this.client.shortCodesOperations.upsertUSProgramBrief(programBriefId, updatedOptions);
1678
+ });
1348
1679
  }
1349
- async deleteUSProgramBrief(programBriefId, options) {
1350
- const { span, updatedOptions } = createSpan("ShortCodesClient-deleteUSProgramBrief", options);
1351
- try {
1352
- return await this.client.deleteUSProgramBrief(programBriefId, updatedOptions);
1353
- }
1354
- catch (e) {
1355
- span.setStatus({
1356
- code: coreTracing.SpanStatusCode.ERROR,
1357
- message: e.message
1358
- });
1359
- throw e;
1360
- }
1361
- finally {
1362
- span.end();
1363
- }
1680
+ deleteUSProgramBrief(programBriefId, options = {}) {
1681
+ return tracingClient.withSpan("ShortCodesClient-deleteUSProgramBrief", options, (updatedOptions) => {
1682
+ return this.client.shortCodesOperations.deleteUSProgramBrief(programBriefId, updatedOptions);
1683
+ });
1364
1684
  }
1365
- async getUSProgramBrief(programBriefId, options) {
1366
- const { span, updatedOptions } = createSpan("ShortCodesClient-getUSProgramBrief", options);
1367
- try {
1368
- return await this.client.getUSProgramBrief(programBriefId, updatedOptions);
1369
- }
1370
- catch (e) {
1371
- span.setStatus({
1372
- code: coreTracing.SpanStatusCode.ERROR,
1373
- message: e.message
1374
- });
1375
- throw e;
1376
- }
1377
- finally {
1378
- span.end();
1379
- }
1685
+ getUSProgramBrief(programBriefId, options = {}) {
1686
+ return tracingClient.withSpan("ShortCodesClient-getUSProgramBrief", options, (updatedOptions) => {
1687
+ return this.client.shortCodesOperations.getUSProgramBrief(programBriefId, updatedOptions);
1688
+ });
1380
1689
  }
1381
1690
  listUSProgramBriefs(options = {}) {
1382
- const { span, updatedOptions } = createSpan("ShortCodesClient-listUSProgramBriefs", options);
1691
+ const { span, updatedOptions } = tracingClient.startSpan("ShortCodesClient-listUSProgramBriefs", options);
1383
1692
  try {
1384
- return this.client.listUSProgramBriefs(updatedOptions);
1693
+ return this.client.shortCodesOperations.listUSProgramBriefs(updatedOptions);
1385
1694
  }
1386
1695
  catch (e) {
1387
1696
  span.setStatus({
1388
- code: coreTracing.SpanStatusCode.ERROR,
1389
- message: e.message
1697
+ status: "error",
1698
+ error: e,
1390
1699
  });
1391
1700
  throw e;
1392
1701
  }
@@ -1394,15 +1703,25 @@ class ShortCodesClient$1 {
1394
1703
  span.end();
1395
1704
  }
1396
1705
  }
1397
- async submitUSProgramBrief(programBriefId, options) {
1398
- const { span, updatedOptions } = createSpan("ShortCodesClient-submitUSProgramBrief", options);
1706
+ submitUSProgramBrief(programBriefId, options = {}) {
1707
+ return tracingClient.withSpan("ShortCodesClient-submitUSProgramBrief", options, (updatedOptions) => {
1708
+ return this.client.shortCodesOperations.submitUSProgramBrief(programBriefId, updatedOptions);
1709
+ });
1710
+ }
1711
+ getUSProgramBriefAttachment(programBriefId, attachmentId, options = {}) {
1712
+ return tracingClient.withSpan("ShortCodesClient-getUSProgramBriefAttachment", options, (updatedOptions) => {
1713
+ return this.client.shortCodesOperations.getUSProgramBriefAttachment(programBriefId, attachmentId, updatedOptions);
1714
+ });
1715
+ }
1716
+ listUSProgramBriefAttachments(programBriefId, options = {}) {
1717
+ const { span, updatedOptions } = tracingClient.startSpan("ShortCodesClient-listUSProgramBriefAttachments", options);
1399
1718
  try {
1400
- return await this.client.submitUSProgramBrief(programBriefId, updatedOptions);
1719
+ return this.client.shortCodesOperations.listUSProgramBriefAttachments(programBriefId, updatedOptions);
1401
1720
  }
1402
1721
  catch (e) {
1403
1722
  span.setStatus({
1404
- code: coreTracing.SpanStatusCode.ERROR,
1405
- message: e.message
1723
+ status: "error",
1724
+ error: e,
1406
1725
  });
1407
1726
  throw e;
1408
1727
  }
@@ -1410,7 +1729,17 @@ class ShortCodesClient$1 {
1410
1729
  span.end();
1411
1730
  }
1412
1731
  }
1732
+ deleteUSProgramBriefAttachment(programBriefId, attachmentId, options = {}) {
1733
+ return tracingClient.withSpan("ShortCodesClient-deleteUSProgramBriefAttachment", options, (updatedOptions) => {
1734
+ return this.client.shortCodesOperations.deleteUSProgramBriefAttachment(programBriefId, attachmentId, updatedOptions);
1735
+ });
1736
+ }
1737
+ createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, fileName, fileType, fileContent, attachmentType, options = {}) {
1738
+ return tracingClient.withSpan("ShortCodesClient-createOrReplaceUSProgramBriefAttachment", options, (updatedOptions) => {
1739
+ return this.client.shortCodesOperations.createOrReplaceUSProgramBriefAttachment(programBriefId, attachmentId, attachmentId, fileName, fileType, fileContent, attachmentType, updatedOptions);
1740
+ });
1741
+ }
1413
1742
  }
1414
1743
 
1415
- exports.ShortCodesClient = ShortCodesClient$1;
1744
+ exports.ShortCodesClient = ShortCodesClient;
1416
1745
  //# sourceMappingURL=index.js.map