updateIAMPolicyAssignment method

Future<UpdateIAMPolicyAssignmentResponse> updateIAMPolicyAssignment({
  1. required String assignmentName,
  2. required String awsAccountId,
  3. required String namespace,
  4. AssignmentStatus? assignmentStatus,
  5. Map<String, List<String>>? identities,
  6. String? policyArn,
})

Updates an existing IAM policy assignment. This operation updates only the optional parameter or parameters that are specified in the request. This overwrites all of the users included in Identities.

May throw AccessDeniedException. May throw ConcurrentUpdatingException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw ResourceExistsException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter assignmentName : The name of the assignment, also called a rule. The name must be unique within the Amazon Web Services account.

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the IAM policy assignment.

Parameter namespace : The namespace of the assignment.

Parameter assignmentStatus : The status of the assignment. Possible values are as follows:

  • ENABLED - Anything specified in this assignment is used when creating the data source.
  • DISABLED - This assignment isn't used when creating the data source.
  • DRAFT - This assignment is an unfinished draft and isn't used when creating the data source.

Parameter identities : The Amazon Quick Sight users, groups, or both that you want to assign the policy to.

Parameter policyArn : The ARN for the IAM policy to apply to the Amazon Quick Sight users and groups specified in this assignment.

Implementation

Future<UpdateIAMPolicyAssignmentResponse> updateIAMPolicyAssignment({
  required String assignmentName,
  required String awsAccountId,
  required String namespace,
  AssignmentStatus? assignmentStatus,
  Map<String, List<String>>? identities,
  String? policyArn,
}) async {
  final $payload = <String, dynamic>{
    if (assignmentStatus != null) 'AssignmentStatus': assignmentStatus.value,
    if (identities != null) 'Identities': identities,
    if (policyArn != null) 'PolicyArn': policyArn,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/namespaces/${Uri.encodeComponent(namespace)}/iam-policy-assignments/${Uri.encodeComponent(assignmentName)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateIAMPolicyAssignmentResponse.fromJson(response);
}