Skip to content

update_user async

update_user(
    user_id: UserId,
    *,
    config_overrides: Optional[AsyncfinspacedataClientConfig] = None,
    type: Optional[UserType] = None,
    first_name: Optional[FirstName] = None,
    last_name: Optional[LastName] = None,
    api_access: Optional[ApiAccess] = None,
    api_access_principal_arn: Optional[RoleArn] = None,
    client_token: Optional[ClientToken] = None,
) -> UpdateUserResponse

Modifies the details of the specified user. You cannot update the userId for a user.

Parameters:

  • user_id (UserId) –

    The unique identifier for the user that you want to update.

  • type (Optional[UserType], default: None ) –

    The option to indicate the type of user.

    • SUPER_USER– A user with permission to all the functionality and data in FinSpace.

    • APP_USER – A user with specific permissions in FinSpace. The users are assigned permissions by adding them to a permission group.

  • first_name (Optional[FirstName], default: None ) –

    The first name of the user.

  • last_name (Optional[LastName], default: None ) –

    The last name of the user.

  • api_access (Optional[ApiAccess], default: None ) –

    The option to indicate whether the user can use the GetProgrammaticAccessCredentials API to obtain credentials that can then be used to access other FinSpace Data API operations.

    • ENABLED – The user has permissions to use the APIs.

    • DISABLED – The user does not have permissions to use any APIs.

  • api_access_principal_arn (Optional[RoleArn], default: None ) –

    The ARN identifier of an AWS user or role that is allowed to call the GetProgrammaticAccessCredentials API to obtain a credentials token for a specific FinSpace user. This must be an IAM role within your FinSpace account.

  • client_token (Optional[ClientToken], default: None ) –

    A token that ensures idempotency. This token expires in 10 minutes.

Raises:

Source code in docs_src/capo_finspace_data/_services/async_finspacedata.py
async def update_user(
    self,
    user_id: "capo_finspace_data.types.user_id.UserId",
    *,
    config_overrides: Optional[AsyncfinspacedataClientConfig] = None,
    type: Optional["capo_finspace_data.types.user_type.UserType"] = None,
    first_name: Optional["capo_finspace_data.types.first_name.FirstName"] = None,
    last_name: Optional["capo_finspace_data.types.last_name.LastName"] = None,
    api_access: Optional["capo_finspace_data.types.api_access.ApiAccess"] = None,
    api_access_principal_arn: Optional[
        "capo_finspace_data.types.role_arn.RoleArn"
    ] = None,
    client_token: Optional[
        "capo_finspace_data.types.client_token.ClientToken"
    ] = None,
) -> "capo_finspace_data.types.update_user_response.UpdateUserResponse":
    """<p>Modifies the details of the specified user. You cannot update the <code>userId</code> for a user.</p>

    Args:
        user_id: <p>The unique identifier for the user that you want to update.</p>
        type: <p>The option to indicate the type of user.</p> <ul> <li> <p> <code>SUPER_USER</code>– A user with permission to all the functionality and data in FinSpace.</p> </li> <li> <p> <code>APP_USER</code> – A user with specific permissions in FinSpace. The users are assigned permissions by adding them to a permission group.</p> </li> </ul>
        first_name: <p>The first name of the user.</p>
        last_name: <p>The last name of the user.</p>
        api_access: <p>The option to indicate whether the user can use the <code>GetProgrammaticAccessCredentials</code> API to obtain credentials that can then be used to access other FinSpace Data API operations.</p> <ul> <li> <p> <code>ENABLED</code> – The user has permissions to use the APIs.</p> </li> <li> <p> <code>DISABLED</code> – The user does not have permissions to use any APIs.</p> </li> </ul>
        api_access_principal_arn: <p>The ARN identifier of an AWS user or role that is allowed to call the <code>GetProgrammaticAccessCredentials</code> API to obtain a credentials token for a specific FinSpace user. This must be an IAM role within your FinSpace account.</p>
        client_token: <p>A token that ensures idempotency. This token expires in 10 minutes.</p>

    Raises:
        capo_finspace_data.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_finspace_data.errors.conflict_exception.ConflictException: <p>The request conflicts with an existing resource.</p>
        capo_finspace_data.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_finspace_data.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</p>
        capo_finspace_data.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_finspace_data.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_finspace_data.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_finspace_data.types.update_user_request.UpdateUserRequest]",
    ) -> AsyncOperationResponse[
        "capo_finspace_data.types.update_user_response.UpdateUserResponse"
    ]:
        import capo_finspace_data._operations.aws_habanero_public_api.update_user

        (
            output,
            http_response,
        ) = await capo_finspace_data._operations.aws_habanero_public_api.update_user.async_update_user(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_finspace_data.types.update_user_request.UpdateUserRequest",
    ) -> dict[str, Any]:
        import capo_finspace_data.types.update_user_request

        return capo_finspace_data.types.update_user_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateUser", redact_input=_redact_input)
    )
    input_: capo_finspace_data.types.update_user_request.UpdateUserRequest = {
        "user_id": user_id
    }
    if type is not None:
        input_["type"] = type
    if first_name is not None:
        input_["first_name"] = first_name
    if last_name is not None:
        input_["last_name"] = last_name
    if api_access is not None:
        input_["api_access"] = api_access
    if api_access_principal_arn is not None:
        input_["api_access_principal_arn"] = api_access_principal_arn
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output