createUserProfile method
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.
May throw ResourceInUse.
May throw ResourceLimitExceeded.
Parameter domainId :
The ID of the associated Domain.
Parameter userProfileName :
A name for the UserProfile. This value is not case sensitive.
Parameter singleSignOnUserIdentifier :
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.
Parameter singleSignOnUserValue :
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.
Parameter tags :
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.
Parameter userSettings :
A collection of settings.
Implementation
Future<CreateUserProfileResponse> createUserProfile({
required String domainId,
required String userProfileName,
String? singleSignOnUserIdentifier,
String? singleSignOnUserValue,
List<Tag>? tags,
UserSettings? userSettings,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.CreateUserProfile'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DomainId': domainId,
'UserProfileName': userProfileName,
if (singleSignOnUserIdentifier != null)
'SingleSignOnUserIdentifier': singleSignOnUserIdentifier,
if (singleSignOnUserValue != null)
'SingleSignOnUserValue': singleSignOnUserValue,
if (tags != null) 'Tags': tags,
if (userSettings != null) 'UserSettings': userSettings,
},
);
return CreateUserProfileResponse.fromJson(jsonResponse.body);
}