getSmsMessagesPaginatedWithHttpInfo method

Future<Response> getSmsMessagesPaginatedWithHttpInfo({
  1. String? phoneNumber,
  2. int? page,
  3. int? size,
  4. String? sort,
  5. bool? unreadOnly,
  6. DateTime? since,
  7. DateTime? before,
})

Get all SMS messages in all phone numbers in paginated form. .

By default returns all SMS messages across all phone numbers sorted by ascending created at date. Responses are paginated. You can restrict results to a list of phone number IDs. You can also filter out read messages

Note: This method returns the HTTP Response.

Parameters:

  • String phoneNumber: Optional receiving phone number to filter SMS messages for

  • int page: Optional page index in SMS list pagination

  • int size: Optional page size in SMS list pagination. Maximum size is 100. Use page index and sort to page through larger results

  • String sort: Optional createdAt sort direction ASC or DESC

  • bool unreadOnly: Optional filter for unread SMS only. All SMS are considered unread until they are viewed in the dashboard or requested directly

  • DateTime since: Optional filter SMSs received after given date time

  • DateTime before: Optional filter SMSs received before given date time

Implementation

Future<Response> getSmsMessagesPaginatedWithHttpInfo({ String? phoneNumber, int? page, int? size, String? sort, bool? unreadOnly, DateTime? since, DateTime? before, }) async {
  // ignore: prefer_const_declarations
  final path = r'/sms';

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (phoneNumber != null) {
    queryParams.addAll(_queryParams('', 'phoneNumber', phoneNumber));
  }
  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (size != null) {
    queryParams.addAll(_queryParams('', 'size', size));
  }
  if (sort != null) {
    queryParams.addAll(_queryParams('', 'sort', sort));
  }
  if (unreadOnly != null) {
    queryParams.addAll(_queryParams('', 'unreadOnly', unreadOnly));
  }
  if (since != null) {
    queryParams.addAll(_queryParams('', 'since', since));
  }
  if (before != null) {
    queryParams.addAll(_queryParams('', 'before', before));
  }

  const contentTypes = <String>[];


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