listPoliciesWithHttpInfo method

Future<Response> listPoliciesWithHttpInfo(
  1. String account, {
  2. Object? page,
  3. int? limit,
  4. String? product,
})

List all policies

Returns a list of policies. The policies are returned sorted by creation date, with the most recent policies appearing first. Resources are automatically scoped to the authenticated bearer e.g. when authenticated as a product, only policies of that specific product will be listed.

Note: This method returns the HTTP Response.

Parameters:

  • String account (required): The identifier (UUID) or slug of your Keygen account.

  • Object page: Object containing page size and page number.

  • int limit:

  • String product: The identifier (UUID) of the product to filter by.

Implementation

Future<Response> listPoliciesWithHttpInfo(String account, { Object? page, int? limit, String? product, }) async {
  // ignore: prefer_const_declarations
  final path = r'/accounts/{account}/policies'
    .replaceAll('{account}', account);

  // ignore: prefer_final_locals
  Object? postBody;

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

  if (page != null) {
    queryParams.addAll(_queryParams('', 'page', page));
  }
  if (limit != null) {
    queryParams.addAll(_queryParams('', 'limit', limit));
  }
  if (product != null) {
    queryParams.addAll(_queryParams('', 'product', product));
  }

  const contentTypes = <String>[];


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