instanceGetOrganizationMemberships method

Future<OrganizationMemberships?> instanceGetOrganizationMemberships({
  1. String? orderBy,
  2. int? limit,
  3. int? offset,
})

Get a list of all organization memberships within an instance.

Retrieves all organization user memberships for the given instance.

Parameters:

  • String orderBy: Sorts organizations memberships by phone_number, email_address, created_at, first_name, last_name or username. By prepending one of those values with + or -, we can choose to sort in ascending (ASC) or descending (DESC) order.

  • int limit: Applies a limit to the number of results returned. Can be used for paginating the results together with offset.

  • int offset: Skip the first offset results when paginating. Needs to be an integer greater or equal to zero. To be used in conjunction with limit.

Implementation

Future<OrganizationMemberships?> instanceGetOrganizationMemberships({
  String? orderBy,
  int? limit,
  int? offset,
}) async {
  final response = await instanceGetOrganizationMembershipsWithHttpInfo(
    orderBy: orderBy,
    limit: limit,
    offset: offset,
  );
  if (response.statusCode >= HttpStatus.badRequest) {
    throw ApiException(response.statusCode, await _decodeBodyBytes(response));
  }
  // When a remote server returns no body with a status of 204, we shall not decode it.
  // At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
  // FormatException when trying to decode an empty string.
  if (response.body.isNotEmpty &&
      response.statusCode != HttpStatus.noContent) {
    return await apiClient.deserializeAsync(
      await _decodeBodyBytes(response),
      'OrganizationMemberships',
    ) as OrganizationMemberships;
  }
  return null;
}