getEventTypes method

Future<GetEventTypesResult> getEventTypes({
  1. int? maxResults,
  2. String? name,
  3. String? nextToken,
})

Gets all event types or a specific event type if name is provided. This is a paginated API. If you provide a null maxResults, this action retrieves a maximum of 10 records per page. If you provide a maxResults, the value must be between 5 and 10. To get the next page results, provide the pagination token from the GetEventTypesResponse as part of your request. A null pagination token fetches the records from the beginning.

May throw ValidationException. May throw ResourceNotFoundException. May throw InternalServerException. May throw AccessDeniedException.

Parameter maxResults : The maximum number of objects to return for the request.

Parameter name : The name.

Parameter nextToken : The next token for the subsequent request.

Implementation

Future<GetEventTypesResult> getEventTypes({
  int? maxResults,
  String? name,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    5,
    10,
  );
  _s.validateStringLength(
    'name',
    name,
    1,
    64,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSHawksNestServiceFacade.GetEventTypes'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (maxResults != null) 'maxResults': maxResults,
      if (name != null) 'name': name,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return GetEventTypesResult.fromJson(jsonResponse.body);
}