listResourcesInProtectionGroup method

Future<ListResourcesInProtectionGroupResponse> listResourcesInProtectionGroup({
  1. required String protectionGroupId,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves the resources that are included in the protection group.

May throw InternalErrorException. May throw ResourceNotFoundException. May throw InvalidPaginationTokenException.

Parameter protectionGroupId : The name of the protection group. You use this to identify the protection group in lists and to manage the protection group, for example to update, delete, or describe it.

Parameter maxResults : The maximum number of resource ARN objects to return. If you leave this blank, Shield Advanced returns the first 20 results.

This is a maximum value. Shield Advanced might return the results in smaller batches. That is, the number of objects returned could be less than MaxResults, even if there are still more objects yet to return. If there are more objects to return, Shield Advanced returns a value in NextToken that you can use in your next request, to get the next batch of objects.

Parameter nextToken : The next token value from a previous call to ListResourcesInProtectionGroup. Pass null if this is the first call.

Implementation

Future<ListResourcesInProtectionGroupResponse>
    listResourcesInProtectionGroup({
  required String protectionGroupId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(protectionGroupId, 'protectionGroupId');
  _s.validateStringLength(
    'protectionGroupId',
    protectionGroupId,
    1,
    36,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    10000,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    4096,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSShield_20160616.ListResourcesInProtectionGroup'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ProtectionGroupId': protectionGroupId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListResourcesInProtectionGroupResponse.fromJson(jsonResponse.body);
}