listCrossAccountResources method

Future<ListCrossAccountResourcesResponse> listCrossAccountResources({
  1. required String resourceOwnerAwsAccountId,
  2. String? acceleratorArn,
  3. int? maxResults,
  4. String? nextToken,
})

List the cross-account resources available to work with.

May throw AcceleratorNotFoundException. May throw AccessDeniedException. May throw InternalServiceErrorException. May throw InvalidArgumentException. May throw InvalidNextTokenException.

Parameter resourceOwnerAwsAccountId : The account ID of a resource owner in a cross-account attachment.

Parameter acceleratorArn : The Amazon Resource Name (ARN) of an accelerator in a cross-account attachment.

Parameter maxResults : The number of cross-account resource objects that you want to return with this call. The default value is 10.

Parameter nextToken : The token for the next set of results. You receive this token from a previous call.

Implementation

Future<ListCrossAccountResourcesResponse> listCrossAccountResources({
  required String resourceOwnerAwsAccountId,
  String? acceleratorArn,
  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': 'GlobalAccelerator_V20180706.ListCrossAccountResources'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceOwnerAwsAccountId': resourceOwnerAwsAccountId,
      if (acceleratorArn != null) 'AcceleratorArn': acceleratorArn,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListCrossAccountResourcesResponse.fromJson(jsonResponse.body);
}