airtimeGetOperatorWithHttpInfo method

Future<Response> airtimeGetOperatorWithHttpInfo(
  1. String id,
  2. String phoneNumber, {
  3. String? valueType,
  4. String? valueCurrency,
  5. num? minValue,
  6. num? maxValue,
  7. num? minPrice,
  8. num? maxPrice,
  9. String? currency,
  10. Future<void>? abortTrigger,
})

Get an airtime operator

Returns one operator with its offers for a phone number of its country (manual flow, step 2). Returns the operator in the item shape that search returns, without a carrier lookup. A number of another country than the operator's gives 400 / 10001 with COUNTRY_MISMATCH at phoneNumber. An unknown or unparseable ID, or an operator without an orderable offer, gives 404 / 10004. Offer filters that match none of the operator's offers leave offers empty. A manual choice is not checked against the number's carrier, so have the customer confirm the operator before ordering.

Note: This method returns the HTTP Response.

Parameters:

  • String id (required): The operator ID from the operator list, the catalog or search.

  • String phoneNumber (required): The recipient's number in international format, starting with + or 00. It must belong to the operator's country.

  • String valueType: Keep only fixed or only range offers.

  • String valueCurrency: Currency of minValue and maxValue, three letters; required with either of them.

  • num minValue: Keep the offers whose value reaches at least this amount, in valueCurrency.

  • num maxValue: Keep the offers whose value starts at or below this amount, in valueCurrency.

  • num minPrice: Keep the offers whose indicative price reaches at least this amount, in the price currency.

  • num maxPrice: Keep the offers whose indicative price starts at or below this amount, in the price currency. A filter, not the inputs.maxPrice limit of a purchase.

  • String currency: Price currency, three letters in either case; the API key's currency when omitted. An unsupported code gives 404 / 10004.

Implementation

Future<Response> airtimeGetOperatorWithHttpInfo(String id, String phoneNumber, { String? valueType, String? valueCurrency, num? minValue, num? maxValue, num? minPrice, num? maxPrice, String? currency, Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/b2b/airtime/operators/{id}'
    .replaceAll('{id}', id);

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

    queryParams.addAll(_queryParams('', 'phoneNumber', phoneNumber));
  if (valueType != null) {
    queryParams.addAll(_queryParams('', 'valueType', valueType));
  }
  if (valueCurrency != null) {
    queryParams.addAll(_queryParams('', 'valueCurrency', valueCurrency));
  }
  if (minValue != null) {
    queryParams.addAll(_queryParams('', 'minValue', minValue));
  }
  if (maxValue != null) {
    queryParams.addAll(_queryParams('', 'maxValue', maxValue));
  }
  if (minPrice != null) {
    queryParams.addAll(_queryParams('', 'minPrice', minPrice));
  }
  if (maxPrice != null) {
    queryParams.addAll(_queryParams('', 'maxPrice', maxPrice));
  }
  if (currency != null) {
    queryParams.addAll(_queryParams('', 'currency', currency));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    abortTrigger: abortTrigger,
  );
}