listAssociatedGroups method

Future<ListAssociatedGroupsResponse> listAssociatedGroups({
  1. required String resourceArn,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of the groups that the specified canary is associated with. The canary that you specify must be in the current Region.

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

Parameter resourceArn : The ARN of the canary that you want to view groups for.

Parameter maxResults : Specify this parameter to limit how many groups are returned each time you use the ListAssociatedGroups operation. If you omit this parameter, the default of 20 is used.

Parameter nextToken : A token that indicates that there is more data available. You can use this token in a subsequent operation to retrieve the next set of results.

Implementation

Future<ListAssociatedGroupsResponse> listAssociatedGroups({
  required String resourceArn,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    20,
  );
  final $payload = <String, dynamic>{
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/resource/${Uri.encodeComponent(resourceArn)}/groups',
    exceptionFnMap: _exceptionFns,
  );
  return ListAssociatedGroupsResponse.fromJson(response);
}