Skip to content

create_user async

create_user(
    email_address: Email,
    type: UserType,
    *,
    config_overrides: Optional[AsyncfinspacedataClientConfig] = 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,
) -> CreateUserResponse

Creates a new user in FinSpace.

Parameters:

  • email_address (Email) –

    The email address of the user that you want to register. The email address serves as a uniquer identifier for each user and cannot be changed after it's created.

  • type (UserType) –

    The option to indicate the type of user. Use one of the following options to specify this parameter:

    • 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 that you want to register.

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

    The last name of the user that you want to register.

  • 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 create_user(
    self,
    email_address: "capo_finspace_data.types.email.Email",
    type: "capo_finspace_data.types.user_type.UserType",
    *,
    config_overrides: Optional[AsyncfinspacedataClientConfig] = 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.create_user_response.CreateUserResponse":
    """<p>Creates a new user in FinSpace.</p>

    Args:
        email_address: <p>The email address of the user that you want to register. The email address serves as a uniquer identifier for each user and cannot be changed after it's created.</p>
        type: <p>The option to indicate the type of user. Use one of the following options to specify this parameter:</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 that you want to register.</p>
        last_name: <p>The last name of the user that you want to register.</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.limit_exceeded_exception.LimitExceededException: <p>A limit has exceeded.</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.create_user_request.CreateUserRequest]",
    ) -> AsyncOperationResponse[
        "capo_finspace_data.types.create_user_response.CreateUserResponse"
    ]:
        import capo_finspace_data._operations.aws_habanero_public_api.create_user

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

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

        return capo_finspace_data.types.create_user_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateUser", redact_input=_redact_input)
    )
    input_: capo_finspace_data.types.create_user_request.CreateUserRequest = {
        "email_address": email_address,
        "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