getResourceShareAssociations method

Future<GetResourceShareAssociationsResponse> getResourceShareAssociations({
  1. required ResourceShareAssociationType associationType,
  2. ResourceShareAssociationStatus? associationStatus,
  3. int? maxResults,
  4. String? nextToken,
  5. String? principal,
  6. String? resourceArn,
  7. List<String>? resourceShareArns,
})

Gets the resources or principals for the resource shares that you own.

May throw UnknownResourceException. May throw MalformedArnException. May throw InvalidNextTokenException. May throw InvalidParameterException. May throw OperationNotPermittedException. May throw ServerInternalException. May throw ServiceUnavailableException.

Parameter associationType : The association type. Specify PRINCIPAL to list the principals that are associated with the specified resource share. Specify RESOURCE to list the resources that are associated with the specified resource share.

Parameter associationStatus : The association status.

Parameter maxResults : The maximum number of results to return with a single call. To retrieve the remaining results, make another call with the returned nextToken value.

Parameter nextToken : The token for the next page of results.

Parameter principal : The principal. You cannot specify this parameter if the association type is RESOURCE.

Parameter resourceArn : The Amazon Resource Name (ARN) of the resource. You cannot specify this parameter if the association type is PRINCIPAL.

Parameter resourceShareArns : The Amazon Resource Names (ARN) of the resource shares.

Implementation

Future<GetResourceShareAssociationsResponse> getResourceShareAssociations({
  required ResourceShareAssociationType associationType,
  ResourceShareAssociationStatus? associationStatus,
  int? maxResults,
  String? nextToken,
  String? principal,
  String? resourceArn,
  List<String>? resourceShareArns,
}) async {
  ArgumentError.checkNotNull(associationType, 'associationType');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final $payload = <String, dynamic>{
    'associationType': associationType.toValue(),
    if (associationStatus != null)
      'associationStatus': associationStatus.toValue(),
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (principal != null) 'principal': principal,
    if (resourceArn != null) 'resourceArn': resourceArn,
    if (resourceShareArns != null) 'resourceShareArns': resourceShareArns,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/getresourceshareassociations',
    exceptionFnMap: _exceptionFns,
  );
  return GetResourceShareAssociationsResponse.fromJson(response);
}