createCustomPermissions method

Future<CreateCustomPermissionsResponse> createCustomPermissions({
  1. required String awsAccountId,
  2. required String customPermissionsName,
  3. Capabilities? capabilities,
  4. List<Tag>? tags,
})

Creates a custom permissions profile.

May throw AccessDeniedException. May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw PreconditionNotMetException. May throw ResourceExistsException. May throw ResourceNotFoundException. May throw ResourceUnavailableException. May throw ThrottlingException.

Parameter awsAccountId : The ID of the Amazon Web Services account that you want to create the custom permissions profile in.

Parameter customPermissionsName : The name of the custom permissions profile that you want to create.

Parameter capabilities : A set of actions to include in the custom permissions profile.

Parameter tags : The tags to associate with the custom permissions profile.

Implementation

Future<CreateCustomPermissionsResponse> createCustomPermissions({
  required String awsAccountId,
  required String customPermissionsName,
  Capabilities? capabilities,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'CustomPermissionsName': customPermissionsName,
    if (capabilities != null) 'Capabilities': capabilities,
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/custom-permissions',
    exceptionFnMap: _exceptionFns,
  );
  return CreateCustomPermissionsResponse.fromJson(response);
}