listReceivedGrants method

Future<ListReceivedGrantsResponse> listReceivedGrants({
  1. List<Filter>? filters,
  2. List<String>? grantArns,
  3. int? maxResults,
  4. String? nextToken,
})

Lists grants that are received. Received grants are grants created while specifying the recipient as this Amazon Web Services account, your organization, or an organizational unit (OU) to which this member account belongs.

May throw AccessDeniedException. May throw AuthorizationException. May throw InvalidParameterValueException. May throw RateLimitExceededException. May throw ResourceLimitExceededException. May throw ServerInternalException. May throw ValidationException.

Parameter filters : Filters to scope the results. The following filters are supported:

  • ProductSKU
  • LicenseIssuerName
  • LicenseArn
  • GrantStatus
  • GranterAccountId

Parameter grantArns : Amazon Resource Names (ARNs) of the grants.

Parameter maxResults : Maximum number of results to return in a single call.

Parameter nextToken : Token for the next set of results.

Implementation

Future<ListReceivedGrantsResponse> listReceivedGrants({
  List<Filter>? filters,
  List<String>? grantArns,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSLicenseManager.ListReceivedGrants'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filters != null) 'Filters': filters,
      if (grantArns != null) 'GrantArns': grantArns,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListReceivedGrantsResponse.fromJson(jsonResponse.body);
}