listOrganizationPermissionsWithHttpInfo method

Future<Response> listOrganizationPermissionsWithHttpInfo({
  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.

Note: This method returns the HTTP Response.

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<http.Response> listOrganizationPermissionsWithHttpInfo({
  String? query,
  String? orderBy,
  int? limit,
  int? offset,
}) async {
  // ignore: prefer_const_declarations
  final path = r'/organization_permissions';

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (query != null) {
    queryParams.addAll(_queryParams('', 'query', query));
  }
  if (orderBy != null) {
    queryParams.addAll(_queryParams('', 'order_by', orderBy));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }
  if (offset != null) {
    queryParams.addAll(_queryParams('', 'offset', offset));
  }

  const contentTypes = <String>[];

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