associateResourceShare method

Future<AssociateResourceShareResponse> associateResourceShare({
  1. required String resourceShareArn,
  2. String? clientToken,
  3. List<String>? principals,
  4. List<String>? resourceArns,
})

Associates the specified resource share with the specified principals and resources.

May throw IdempotentParameterMismatchException. May throw UnknownResourceException. May throw InvalidStateTransitionException. May throw ResourceShareLimitExceededException. May throw MalformedArnException. May throw InvalidStateTransitionException. May throw InvalidClientTokenException. May throw InvalidParameterException. May throw OperationNotPermittedException. May throw ServerInternalException. May throw ServiceUnavailableException. May throw UnknownResourceException.

Parameter resourceShareArn : The Amazon Resource Name (ARN) of the resource share.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

Parameter principals : The principals.

Parameter resourceArns : The Amazon Resource Names (ARN) of the resources.

Implementation

Future<AssociateResourceShareResponse> associateResourceShare({
  required String resourceShareArn,
  String? clientToken,
  List<String>? principals,
  List<String>? resourceArns,
}) async {
  ArgumentError.checkNotNull(resourceShareArn, 'resourceShareArn');
  final $payload = <String, dynamic>{
    'resourceShareArn': resourceShareArn,
    if (clientToken != null) 'clientToken': clientToken,
    if (principals != null) 'principals': principals,
    if (resourceArns != null) 'resourceArns': resourceArns,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/associateresourceshare',
    exceptionFnMap: _exceptionFns,
  );
  return AssociateResourceShareResponse.fromJson(response);
}