listOrganizationPermissions method

Future<Permissions?> listOrganizationPermissions({
  1. String? query,
  2. String? orderBy,
  3. int? limit,
  4. int? offset,
})

Get a list of all organization permissions

Retrieves all organization permissions for the given instance.

Parameters:

  • String query: Returns organization permissions with ID, name, or key that match the given query. Uses exact match for permission ID and partial match for name and key.

  • String orderBy: Allows to return organization permissions in a particular order. At the moment, you can order the returned permissions by their created_at, name, or key. In order to specify the direction, you can use the +/- symbols prepended in the property to order by. For example, if you want permissions to be returned in descending order according to their created_at property, you can use -created_at.

  • 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<Permissions?> listOrganizationPermissions({
  String? query,
  String? orderBy,
  int? limit,
  int? offset,
}) async {
  final response = await listOrganizationPermissionsWithHttpInfo(
    query: query,
    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),
      'Permissions',
    ) as Permissions;
  }
  return null;
}