createResourceShare method
Creates a resource share.
May throw IdempotentParameterMismatchException. May throw InvalidStateTransitionException. May throw UnknownResourceException. May throw MalformedArnException. May throw InvalidClientTokenException. May throw InvalidParameterException. May throw OperationNotPermittedException. May throw ResourceShareLimitExceededException. May throw TagPolicyViolationException. May throw ServerInternalException. May throw ServiceUnavailableException.
Parameter name
:
The name of the resource share.
Parameter allowExternalPrincipals
:
Indicates whether principals outside your AWS organization can be
associated with a resource share.
Parameter clientToken
:
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request.
Parameter permissionArns
:
The ARNs of the permissions to associate with the resource share. If you
do not specify an ARN for the permission, AWS RAM automatically attaches
the default version of the permission for each resource type.
Parameter principals
:
The principals to associate with the resource share. The possible values
are IDs of AWS accounts, the ARN of an OU or organization from AWS
Organizations.
Parameter resourceArns
:
The Amazon Resource Names (ARN) of the resources to associate with the
resource share.
Parameter tags
:
One or more tags.
Implementation
Future<CreateResourceShareResponse> createResourceShare({
required String name,
bool? allowExternalPrincipals,
String? clientToken,
List<String>? permissionArns,
List<String>? principals,
List<String>? resourceArns,
List<Tag>? tags,
}) async {
ArgumentError.checkNotNull(name, 'name');
final $payload = <String, dynamic>{
'name': name,
if (allowExternalPrincipals != null)
'allowExternalPrincipals': allowExternalPrincipals,
if (clientToken != null) 'clientToken': clientToken,
if (permissionArns != null) 'permissionArns': permissionArns,
if (principals != null) 'principals': principals,
if (resourceArns != null) 'resourceArns': resourceArns,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/createresourceshare',
exceptionFnMap: _exceptionFns,
);
return CreateResourceShareResponse.fromJson(response);
}