@azure/communication-phone-numbers 1.3.0-beta.3 → 1.3.0-beta.4

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -57,7 +57,7 @@ function setContinuationToken(page, continuationToken) {
57
57
  const tracingClient = coreTracing.createTracingClient({
58
58
  namespace: "Microsoft.Communication",
59
59
  packageName: "@azure/communication-phone-numbers",
60
- packageVersion: "1.3.0-beta.3",
60
+ packageVersion: "1.2.1",
61
61
  });
62
62
 
63
63
  /*
@@ -507,6 +507,18 @@ const PhoneNumberSearchResult = {
507
507
  name: "DateTime",
508
508
  },
509
509
  },
510
+ errorCode: {
511
+ serializedName: "errorCode",
512
+ type: {
513
+ name: "Number",
514
+ },
515
+ },
516
+ error: {
517
+ serializedName: "error",
518
+ type: {
519
+ name: "String",
520
+ },
521
+ },
510
522
  },
511
523
  },
512
524
  };
@@ -521,12 +533,6 @@ const PhoneNumberPurchaseRequest = {
521
533
  name: "String",
522
534
  },
523
535
  },
524
- consentToNotResellNumbers: {
525
- serializedName: "consentToNotResellNumbers",
526
- type: {
527
- name: "Boolean",
528
- },
529
- },
530
536
  },
531
537
  },
532
538
  };
@@ -667,18 +673,6 @@ const PurchasedPhoneNumber = {
667
673
  className: "PhoneNumberCost",
668
674
  },
669
675
  },
670
- operatorId: {
671
- serializedName: "operatorId",
672
- type: {
673
- name: "String",
674
- },
675
- },
676
- operatorName: {
677
- serializedName: "operatorName",
678
- type: {
679
- name: "String",
680
- },
681
- },
682
676
  },
683
677
  },
684
678
  };
@@ -716,6 +710,7 @@ const OperatorInformationRequest = {
716
710
  modelProperties: {
717
711
  phoneNumbers: {
718
712
  serializedName: "phoneNumbers",
713
+ required: true,
719
714
  type: {
720
715
  name: "Sequence",
721
716
  element: {
@@ -725,6 +720,27 @@ const OperatorInformationRequest = {
725
720
  },
726
721
  },
727
722
  },
723
+ options: {
724
+ serializedName: "options",
725
+ type: {
726
+ name: "Composite",
727
+ className: "OperatorInformationOptions",
728
+ },
729
+ },
730
+ },
731
+ },
732
+ };
733
+ const OperatorInformationOptions = {
734
+ type: {
735
+ name: "Composite",
736
+ className: "OperatorInformationOptions",
737
+ modelProperties: {
738
+ includeAdditionalOperatorDetails: {
739
+ serializedName: "includeAdditionalOperatorDetails",
740
+ type: {
741
+ name: "Boolean",
742
+ },
743
+ },
728
744
  },
729
745
  },
730
746
  };
@@ -755,12 +771,19 @@ const OperatorInformation = {
755
771
  modelProperties: {
756
772
  phoneNumber: {
757
773
  serializedName: "phoneNumber",
774
+ required: true,
758
775
  type: {
759
776
  name: "String",
760
777
  },
761
778
  },
762
- numberType: {
763
- serializedName: "numberType",
779
+ nationalFormat: {
780
+ serializedName: "nationalFormat",
781
+ type: {
782
+ name: "String",
783
+ },
784
+ },
785
+ internationalFormat: {
786
+ serializedName: "internationalFormat",
764
787
  type: {
765
788
  name: "String",
766
789
  },
@@ -771,6 +794,12 @@ const OperatorInformation = {
771
794
  name: "String",
772
795
  },
773
796
  },
797
+ numberType: {
798
+ serializedName: "numberType",
799
+ type: {
800
+ name: "String",
801
+ },
802
+ },
774
803
  operatorDetails: {
775
804
  serializedName: "operatorDetails",
776
805
  type: {
@@ -788,6 +817,7 @@ const OperatorDetails = {
788
817
  modelProperties: {
789
818
  name: {
790
819
  serializedName: "name",
820
+ required: true,
791
821
  type: {
792
822
  name: "String",
793
823
  },
@@ -945,6 +975,7 @@ var Mappers$1 = /*#__PURE__*/Object.freeze({
945
975
  OfferingsResponse: OfferingsResponse,
946
976
  OperatorDetails: OperatorDetails,
947
977
  OperatorInformation: OperatorInformation,
978
+ OperatorInformationOptions: OperatorInformationOptions,
948
979
  OperatorInformationRequest: OperatorInformationRequest,
949
980
  OperatorInformationResult: OperatorInformationResult,
950
981
  PhoneNumberAdministrativeDivision: PhoneNumberAdministrativeDivision,
@@ -1072,7 +1103,7 @@ const administrativeDivision = {
1072
1103
  const apiVersion$1 = {
1073
1104
  parameterPath: "apiVersion",
1074
1105
  mapper: {
1075
- defaultValue: "2023-10-01-preview",
1106
+ defaultValue: "2024-03-01-preview",
1076
1107
  isConstant: true,
1077
1108
  serializedName: "api-version",
1078
1109
  type: {
@@ -1830,12 +1861,13 @@ class PhoneNumbersImpl {
1830
1861
  });
1831
1862
  }
1832
1863
  /**
1833
- * Searches for operator information for a given list of phone numbers.
1864
+ * Searches for number format and operator information for a given list of phone numbers.
1865
+ * @param phoneNumbers Phone number(s) whose operator information is being requested
1834
1866
  * @param options The options parameters.
1835
1867
  */
1836
- async operatorInformationSearch(options) {
1868
+ async operatorInformationSearch(phoneNumbers, options) {
1837
1869
  return tracingClient.withSpan("PhoneNumbersClient.operatorInformationSearch", options !== null && options !== void 0 ? options : {}, async (options) => {
1838
- return this.client.sendOperationRequest({ options }, operatorInformationSearchOperationSpec);
1870
+ return this.client.sendOperationRequest({ phoneNumbers, options }, operatorInformationSearchOperationSpec);
1839
1871
  });
1840
1872
  }
1841
1873
  /**
@@ -2059,10 +2091,7 @@ const purchasePhoneNumbersOperationSpec = {
2059
2091
  },
2060
2092
  },
2061
2093
  requestBody: {
2062
- parameterPath: {
2063
- searchId: ["options", "searchId"],
2064
- consentToNotResellNumbers: ["options", "consentToNotResellNumbers"],
2065
- },
2094
+ parameterPath: { searchId: ["options", "searchId"] },
2066
2095
  mapper: Object.assign(Object.assign({}, PhoneNumberPurchaseRequest), { required: true }),
2067
2096
  },
2068
2097
  queryParameters: [apiVersion$1],
@@ -2205,7 +2234,10 @@ const operatorInformationSearchOperationSpec = {
2205
2234
  },
2206
2235
  },
2207
2236
  requestBody: {
2208
- parameterPath: { phoneNumbers: ["options", "phoneNumbers"] },
2237
+ parameterPath: {
2238
+ phoneNumbers: ["phoneNumbers"],
2239
+ options: ["options", "options"],
2240
+ },
2209
2241
  mapper: Object.assign(Object.assign({}, OperatorInformationRequest), { required: true }),
2210
2242
  },
2211
2243
  queryParameters: [apiVersion$1],
@@ -2327,7 +2359,7 @@ let PhoneNumbersClient$1 = class PhoneNumbersClient extends coreClient__namespac
2327
2359
  const defaults = {
2328
2360
  requestContentType: "application/json; charset=utf-8",
2329
2361
  };
2330
- const packageDetails = `azsdk-js-communication-phone-numbers/1.3.0-beta.3`;
2362
+ const packageDetails = `azsdk-js-communication-phone-numbers/1.2.1`;
2331
2363
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2332
2364
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2333
2365
  : `${packageDetails}`;
@@ -2338,7 +2370,7 @@ let PhoneNumbersClient$1 = class PhoneNumbersClient extends coreClient__namespac
2338
2370
  // Parameter assignments
2339
2371
  this.endpoint = endpoint;
2340
2372
  // Assigning values to Constant parameters
2341
- this.apiVersion = options.apiVersion || "2023-10-01-preview";
2373
+ this.apiVersion = options.apiVersion || "2024-03-01-preview";
2342
2374
  this.phoneNumbers = new PhoneNumbersImpl(this);
2343
2375
  this.addCustomApiVersionPolicy(options.apiVersion);
2344
2376
  }
@@ -2541,13 +2573,11 @@ class PhoneNumbersClient {
2541
2573
  * ```
2542
2574
  *
2543
2575
  * @param searchId - The id of the search to purchase. Returned from `beginSearchAvailablePhoneNumbers`
2544
- * @param consentToNotResellNumbers - The consent to not resell Phone Numbers.
2545
2576
  * @param options - Additional request options.
2546
2577
  */
2547
- beginPurchasePhoneNumbers(searchId, consentToNotResellNumbers = false, options = {}) {
2578
+ beginPurchasePhoneNumbers(searchId, options = {}) {
2548
2579
  return tracingClient.withSpan("PhoneNumbersClient-beginPurchasePhoneNumbers", options, (updatedOptions) => {
2549
- return this.client.phoneNumbers.beginPurchasePhoneNumbers(Object.assign(Object.assign({}, updatedOptions), { searchId,
2550
- consentToNotResellNumbers }));
2580
+ return this.client.phoneNumbers.beginPurchasePhoneNumbers(Object.assign(Object.assign({}, updatedOptions), { searchId }));
2551
2581
  });
2552
2582
  }
2553
2583
  /**
@@ -2730,6 +2760,28 @@ class PhoneNumbersClient {
2730
2760
  span.end();
2731
2761
  }
2732
2762
  }
2763
+ /**
2764
+ * Search for operator information about specified phone numbers.
2765
+ *
2766
+ * @param phoneNumbers - The phone numbers to search.
2767
+ * @param options - Additional request options.
2768
+ */
2769
+ searchOperatorInformation(phoneNumbers, options = { includeAdditionalOperatorDetails: false }) {
2770
+ const { span, updatedOptions } = tracingClient.startSpan("PhoneNumbersClient-searchOperatorInformation", options);
2771
+ try {
2772
+ return this.client.phoneNumbers.operatorInformationSearch(phoneNumbers, Object.assign(Object.assign({}, updatedOptions), { options: { includeAdditionalOperatorDetails: options.includeAdditionalOperatorDetails } }));
2773
+ }
2774
+ catch (e) {
2775
+ span.setStatus({
2776
+ status: "error",
2777
+ error: e,
2778
+ });
2779
+ throw e;
2780
+ }
2781
+ finally {
2782
+ span.end();
2783
+ }
2784
+ }
2733
2785
  }
2734
2786
 
2735
2787
  /*
@@ -3137,7 +3189,7 @@ class SipRoutingClientContext extends coreClient__namespace.ServiceClient {
3137
3189
  const defaults = {
3138
3190
  requestContentType: "application/json; charset=utf-8"
3139
3191
  };
3140
- const packageDetails = `azsdk-js-communication-phone-numbers/1.3.0-beta.3`;
3192
+ const packageDetails = `azsdk-js-communication-phone-numbers/1.2.1`;
3141
3193
  const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
3142
3194
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
3143
3195
  : `${packageDetails}`;