@azure/communication-phone-numbers 1.2.1-alpha.20230720.1 → 1.3.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -507,6 +507,18 @@ const PhoneNumberSearchResult = {
507
507
  type: {
508
508
  name: "DateTime"
509
509
  }
510
+ },
511
+ errorCode: {
512
+ serializedName: "errorCode",
513
+ type: {
514
+ name: "Number"
515
+ }
516
+ },
517
+ error: {
518
+ serializedName: "error",
519
+ type: {
520
+ name: "String"
521
+ }
510
522
  }
511
523
  }
512
524
  }
@@ -692,6 +704,104 @@ const PurchasedPhoneNumbers = {
692
704
  }
693
705
  }
694
706
  };
707
+ const OperatorInformationRequest = {
708
+ type: {
709
+ name: "Composite",
710
+ className: "OperatorInformationRequest",
711
+ modelProperties: {
712
+ phoneNumbers: {
713
+ serializedName: "phoneNumbers",
714
+ type: {
715
+ name: "Sequence",
716
+ element: {
717
+ type: {
718
+ name: "String"
719
+ }
720
+ }
721
+ }
722
+ }
723
+ }
724
+ }
725
+ };
726
+ const OperatorInformationResult = {
727
+ type: {
728
+ name: "Composite",
729
+ className: "OperatorInformationResult",
730
+ modelProperties: {
731
+ values: {
732
+ serializedName: "values",
733
+ type: {
734
+ name: "Sequence",
735
+ element: {
736
+ type: {
737
+ name: "Composite",
738
+ className: "OperatorInformation"
739
+ }
740
+ }
741
+ }
742
+ }
743
+ }
744
+ }
745
+ };
746
+ const OperatorInformation = {
747
+ type: {
748
+ name: "Composite",
749
+ className: "OperatorInformation",
750
+ modelProperties: {
751
+ phoneNumber: {
752
+ serializedName: "phoneNumber",
753
+ type: {
754
+ name: "String"
755
+ }
756
+ },
757
+ numberType: {
758
+ serializedName: "numberType",
759
+ type: {
760
+ name: "String"
761
+ }
762
+ },
763
+ isoCountryCode: {
764
+ serializedName: "isoCountryCode",
765
+ type: {
766
+ name: "String"
767
+ }
768
+ },
769
+ operatorDetails: {
770
+ serializedName: "operatorDetails",
771
+ type: {
772
+ name: "Composite",
773
+ className: "OperatorDetails"
774
+ }
775
+ }
776
+ }
777
+ }
778
+ };
779
+ const OperatorDetails = {
780
+ type: {
781
+ name: "Composite",
782
+ className: "OperatorDetails",
783
+ modelProperties: {
784
+ name: {
785
+ serializedName: "name",
786
+ type: {
787
+ name: "String"
788
+ }
789
+ },
790
+ mobileNetworkCode: {
791
+ serializedName: "mobileNetworkCode",
792
+ type: {
793
+ name: "String"
794
+ }
795
+ },
796
+ mobileCountryCode: {
797
+ serializedName: "mobileCountryCode",
798
+ type: {
799
+ name: "String"
800
+ }
801
+ }
802
+ }
803
+ }
804
+ };
695
805
  const PhoneNumbersSearchAvailablePhoneNumbersHeaders = {
696
806
  type: {
697
807
  name: "Composite",
@@ -845,6 +955,10 @@ var Mappers$1 = /*#__PURE__*/Object.freeze({
845
955
  PhoneNumberCapabilitiesRequest: PhoneNumberCapabilitiesRequest,
846
956
  PurchasedPhoneNumber: PurchasedPhoneNumber,
847
957
  PurchasedPhoneNumbers: PurchasedPhoneNumbers,
958
+ OperatorInformationRequest: OperatorInformationRequest,
959
+ OperatorInformationResult: OperatorInformationResult,
960
+ OperatorInformation: OperatorInformation,
961
+ OperatorDetails: OperatorDetails,
848
962
  PhoneNumbersSearchAvailablePhoneNumbersHeaders: PhoneNumbersSearchAvailablePhoneNumbersHeaders,
849
963
  PhoneNumbersPurchasePhoneNumbersHeaders: PhoneNumbersPurchasePhoneNumbersHeaders,
850
964
  PhoneNumbersGetOperationHeaders: PhoneNumbersGetOperationHeaders,
@@ -953,7 +1067,7 @@ const administrativeDivision = {
953
1067
  const apiVersion$1 = {
954
1068
  parameterPath: "apiVersion",
955
1069
  mapper: {
956
- defaultValue: "2022-12-01",
1070
+ defaultValue: "2023-05-01-preview",
957
1071
  isConstant: true,
958
1072
  serializedName: "api-version",
959
1073
  type: {
@@ -1735,6 +1849,15 @@ class PhoneNumbersImpl {
1735
1849
  return this.client.sendOperationRequest({ options }, listPhoneNumbersOperationSpec);
1736
1850
  });
1737
1851
  }
1852
+ /**
1853
+ * Searches for operator information for a given list of phone numbers.
1854
+ * @param options The options parameters.
1855
+ */
1856
+ async operatorInformationSearch(options) {
1857
+ return tracingClient.withSpan("PhoneNumbersClient.operatorInformationSearch", options !== null && options !== void 0 ? options : {}, async (options) => {
1858
+ return this.client.sendOperationRequest({ options }, operatorInformationSearchOperationSpec);
1859
+ });
1860
+ }
1738
1861
  /**
1739
1862
  * ListAreaCodesNext
1740
1863
  * @param countryCode The ISO 3166-2 country code, e.g. US.
@@ -2087,6 +2210,27 @@ const listPhoneNumbersOperationSpec = {
2087
2210
  headerParameters: [accept$1],
2088
2211
  serializer: serializer$1
2089
2212
  };
2213
+ const operatorInformationSearchOperationSpec = {
2214
+ path: "/operatorInformation/:search",
2215
+ httpMethod: "POST",
2216
+ responses: {
2217
+ 200: {
2218
+ bodyMapper: OperatorInformationResult
2219
+ },
2220
+ default: {
2221
+ bodyMapper: CommunicationErrorResponse$1
2222
+ }
2223
+ },
2224
+ requestBody: {
2225
+ parameterPath: { phoneNumbers: ["options", "phoneNumbers"] },
2226
+ mapper: Object.assign(Object.assign({}, OperatorInformationRequest), { required: true })
2227
+ },
2228
+ queryParameters: [apiVersion$1],
2229
+ urlParameters: [endpoint$1],
2230
+ headerParameters: [accept$1, contentType$1],
2231
+ mediaType: "json",
2232
+ serializer: serializer$1
2233
+ };
2090
2234
  const listAreaCodesNextOperationSpec = {
2091
2235
  path: "{nextLink}",
2092
2236
  httpMethod: "GET",
@@ -2211,7 +2355,7 @@ class PhoneNumbersClient$1 extends coreClient__namespace.ServiceClient {
2211
2355
  // Parameter assignments
2212
2356
  this.endpoint = endpoint;
2213
2357
  // Assigning values to Constant parameters
2214
- this.apiVersion = options.apiVersion || "2022-12-01";
2358
+ this.apiVersion = options.apiVersion || "2023-05-01-preview";
2215
2359
  this.phoneNumbers = new PhoneNumbersImpl(this);
2216
2360
  this.addCustomApiVersionPolicy(options.apiVersion);
2217
2361
  }
@@ -2598,6 +2742,19 @@ class PhoneNumbersClient {
2598
2742
  span.end();
2599
2743
  }
2600
2744
  }
2745
+ /**
2746
+ * Search for operator information about specified phone numbers.
2747
+ *
2748
+ * @param phoneNumbers - The phone numbers to search.
2749
+ * @param options - Additional request options.
2750
+ */
2751
+ searchOperatorInformation(phoneNumbers, options = {}) {
2752
+ return tracingClient.withSpan("PhoneNumbersClient-searchOperatorInformation", options, (updatedOptions) => {
2753
+ const params = updatedOptions;
2754
+ params.phoneNumbers = phoneNumbers;
2755
+ return this.client.phoneNumbers.operatorInformationSearch(params);
2756
+ });
2757
+ }
2601
2758
  }
2602
2759
 
2603
2760
  /*