Skip to content

create_user_profile async

create_user_profile(
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    domain_id: Optional[DomainId] = None,
    user_profile_name: Optional[UserProfileName] = None,
    single_sign_on_user_identifier: Optional[SingleSignOnUserIdentifier] = None,
    single_sign_on_user_value: Optional[String256] = None,
    tags: Optional[TagList] = None,
    user_settings: Optional[UserSettings] = None,
) -> CreateUserProfileResponse

Creates a user profile. A user profile represents a single user within a domain, and is the main way to reference a "person" for the purposes of sharing, reporting, and other user-oriented features. This entity is created when a user onboards to a domain. If an administrator invites a person by email or imports them from IAM Identity Center, a user profile is automatically created. A user profile is the primary holder of settings for an individual user and has a reference to the user's private Amazon Elastic File System home directory.

Parameters:

  • domain_id (Optional[DomainId], default: None ) –

    The ID of the associated Domain.

  • user_profile_name (Optional[UserProfileName], default: None ) –

    A name for the UserProfile. This value is not case sensitive.

  • single_sign_on_user_identifier (Optional[SingleSignOnUserIdentifier], default: None ) –

    A specifier for the type of value specified in SingleSignOnUserValue. Currently, the only supported value is "UserName". If the Domain's AuthMode is IAM Identity Center, this field is required. If the Domain's AuthMode is not IAM Identity Center, this field cannot be specified.

  • single_sign_on_user_value (Optional[String256], default: None ) –

    The username of the associated Amazon Web Services Single Sign-On User for this UserProfile. If the Domain's AuthMode is IAM Identity Center, this field is required, and must match a valid username of a user in your directory. If the Domain's AuthMode is not IAM Identity Center, this field cannot be specified.

  • tags (Optional[TagList], default: None ) –

    Each tag consists of a key and an optional value. Tag keys must be unique per resource.

    Tags that you specify for the User Profile are also added to all Apps that the User Profile launches.

  • user_settings (Optional[UserSettings], default: None ) –

    A collection of settings.

Raises:

  • ResourceInUse –

    Resource being accessed is in use.

  • ResourceLimitExceeded –

    You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

  • UnknownServiceError –

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

Source code in docs_src/capo_sagemaker/_services/async_sage_maker.py
async def create_user_profile(
    self,
    *,
    config_overrides: Optional[AsyncSageMakerClientConfig] = None,
    domain_id: Optional["capo_sagemaker.types.domain_id.DomainId"] = None,
    user_profile_name: Optional[
        "capo_sagemaker.types.user_profile_name.UserProfileName"
    ] = None,
    single_sign_on_user_identifier: Optional[
        "capo_sagemaker.types.single_sign_on_user_identifier.SingleSignOnUserIdentifier"
    ] = None,
    single_sign_on_user_value: Optional[
        "capo_sagemaker.types.string256.String256"
    ] = None,
    tags: Optional["capo_sagemaker.types.tag_list.TagList"] = None,
    user_settings: Optional[
        "capo_sagemaker.types.user_settings.UserSettings"
    ] = None,
) -> "capo_sagemaker.types.create_user_profile_response.CreateUserProfileResponse":
    """<p>Creates a user profile. A user profile represents a single user within a domain, and is the main way to reference a "person" for the purposes of sharing, reporting, and other user-oriented features. This entity is created when a user onboards to a domain. If an administrator invites a person by email or imports them from IAM Identity Center, a user profile is automatically created. A user profile is the primary holder of settings for an individual user and has a reference to the user's private Amazon Elastic File System home directory. </p>

    Args:
        domain_id: <p>The ID of the associated Domain.</p>
        user_profile_name: <p>A name for the UserProfile. This value is not case sensitive.</p>
        single_sign_on_user_identifier: <p>A specifier for the type of value specified in SingleSignOnUserValue. Currently, the only supported value is "UserName". If the Domain's AuthMode is IAM Identity Center, this field is required. If the Domain's AuthMode is not IAM Identity Center, this field cannot be specified. </p>
        single_sign_on_user_value: <p>The username of the associated Amazon Web Services Single Sign-On User for this UserProfile. If the Domain's AuthMode is IAM Identity Center, this field is required, and must match a valid username of a user in your directory. If the Domain's AuthMode is not IAM Identity Center, this field cannot be specified. </p>
        tags: <p>Each tag consists of a key and an optional value. Tag keys must be unique per resource.</p> <p>Tags that you specify for the User Profile are also added to all Apps that the User Profile launches.</p>
        user_settings: <p>A collection of settings.</p>

    Raises:
        capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker.types.create_user_profile_request.CreateUserProfileRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker.types.create_user_profile_response.CreateUserProfileResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.create_user_profile

        (
            output,
            http_response,
        ) = await capo_sagemaker._operations.sage_maker.create_user_profile.async_create_user_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateUserProfile")
    )
    input_: capo_sagemaker.types.create_user_profile_request.CreateUserProfileRequest = {}
    if domain_id is not None:
        input_["domain_id"] = domain_id
    if user_profile_name is not None:
        input_["user_profile_name"] = user_profile_name
    if single_sign_on_user_identifier is not None:
        input_["single_sign_on_user_identifier"] = single_sign_on_user_identifier
    if single_sign_on_user_value is not None:
        input_["single_sign_on_user_value"] = single_sign_on_user_value
    if tags is not None:
        input_["tags"] = tags
    if user_settings is not None:
        input_["user_settings"] = user_settings

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