Skip to content

update_user async

update_user(
    identity_store_id: IdentityStoreId,
    user_id: ResourceId,
    operations: AttributeOperations,
    *,
    config_overrides: Optional[AsyncidentitystoreClientConfig] = None,
    revision: Optional[ResourceRevision] = None,
) -> UpdateUserResponse

Updates the specified user metadata and attributes in the specified identity store.

Parameters:

  • identity_store_id (IdentityStoreId) –

    The globally unique identifier for the identity store.

    You can specify the identity store by ID or by Amazon Resource Name (ARN). For example, identity store ID d-1234567890 or identity store ARN arn:aws:identitystore::111122223333:identitystore/d-1234567890.

  • user_id (ResourceId) –

    The identifier for a user in the identity store.

    You can specify the user by ID or by Amazon Resource Name (ARN). For example, user ID a1b2c3d4-5678-90ab-cdef-EXAMPLE11111 or user ARN arn:aws:identitystore:::user/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111.

  • operations (AttributeOperations) –

    A list of AttributeOperation objects to apply to the requested user. These operations might add, replace, or remove an attribute. For more information on the attributes that can be added, replaced, or removed, see User.

  • revision (Optional[ResourceRevision], default: None ) –

    The expected current revision of the user. When you provide this value, the update is applied only if it matches the current revision of the user in the identity store, which prevents you from overwriting concurrent changes. If the value doesn't match, the operation fails with a ConflictException. If you don't provide this value, the update is applied unconditionally.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • InternalServerException –

    The request processing has failed because of an unknown error, exception or failure with an internal server.

  • ThrottlingException –

    Indicates that the principal has crossed the throttling limits of the API operations.

  • ConflictException –

    This request cannot be completed for one of the following reasons:

    • Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.

    • The requested resource was being concurrently modified by another request.

  • ResourceNotFoundException –

    Indicates that a requested resource is not found.

  • ServiceQuotaExceededException –

    The request would cause the number of users or groups in the identity store to exceed the maximum allowed.

  • ValidationException –

    The request failed because it contains a syntax error.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_identitystore/_services/async_identitystore.py
async def update_user(
    self,
    identity_store_id: "capo_identitystore.types.identity_store_id.IdentityStoreId",
    user_id: "capo_identitystore.types.resource_id.ResourceId",
    operations: "capo_identitystore.types.attribute_operations.AttributeOperations",
    *,
    config_overrides: Optional[AsyncidentitystoreClientConfig] = None,
    revision: Optional[
        "capo_identitystore.types.resource_revision.ResourceRevision"
    ] = None,
) -> "capo_identitystore.types.update_user_response.UpdateUserResponse":
    """<p>Updates the specified user metadata and attributes in the specified identity store.</p>

    Args:
        identity_store_id: <p>The globally unique identifier for the identity store.</p> <p>You can specify the identity store by ID or by Amazon Resource Name (ARN). For example, identity store ID <code>d-1234567890</code> or identity store ARN <code>arn:aws:identitystore::111122223333:identitystore/d-1234567890</code>.</p>
        user_id: <p>The identifier for a user in the identity store.</p> <p>You can specify the user by ID or by Amazon Resource Name (ARN). For example, user ID <code>a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code> or user ARN <code>arn:aws:identitystore:::user/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code>.</p>
        operations: <p>A list of <code>AttributeOperation</code> objects to apply to the requested user. These operations might add, replace, or remove an attribute. For more information on the attributes that can be added, replaced, or removed, see <a href="https://docs.aws.amazon.com/singlesignon/latest/IdentityStoreAPIReference/API_User.html">User</a>.</p>
        revision: <p>The expected current revision of the user. When you provide this value, the update is applied only if it matches the current revision of the user in the identity store, which prevents you from overwriting concurrent changes. If the value doesn't match, the operation fails with a <code>ConflictException</code>. If you don't provide this value, the update is applied unconditionally.</p>

    Raises:
        capo_identitystore.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_identitystore.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure with an internal server.</p>
        capo_identitystore.errors.throttling_exception.ThrottlingException: <p>Indicates that the principal has crossed the throttling limits of the API operations.</p>
        capo_identitystore.errors.conflict_exception.ConflictException: <p>This request cannot be completed for one of the following reasons:</p> <ul> <li> <p>Performing the requested operation would violate an existing uniqueness claim in the identity store. Resolve the conflict before retrying this request.</p> </li> <li> <p>The requested resource was being concurrently modified by another request.</p> </li> </ul>
        capo_identitystore.errors.resource_not_found_exception.ResourceNotFoundException: <p>Indicates that a requested resource is not found.</p>
        capo_identitystore.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would cause the number of users or groups in the identity store to exceed the maximum allowed.</p>
        capo_identitystore.errors.validation_exception.ValidationException: <p>The request failed because it contains a syntax error.</p>
        capo_identitystore.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateUser")
    )
    input_: capo_identitystore.types.update_user_request.UpdateUserRequest = {
        "identity_store_id": identity_store_id,
        "user_id": user_id,
        "operations": operations,
    }
    if revision is not None:
        input_["revision"] = revision

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