updateUserProfile method

Future<UpdateUserProfileResponse> updateUserProfile({
  1. required String domainId,
  2. required String userProfileName,
  3. UserSettings? userSettings,
})

Updates a user profile.

May throw ResourceLimitExceeded. May throw ResourceInUse. May throw ResourceNotFound.

Parameter domainId : The domain ID.

Parameter userProfileName : The user profile name.

Parameter userSettings : A collection of settings.

Implementation

Future<UpdateUserProfileResponse> updateUserProfile({
  required String domainId,
  required String userProfileName,
  UserSettings? userSettings,
}) async {
  ArgumentError.checkNotNull(domainId, 'domainId');
  _s.validateStringLength(
    'domainId',
    domainId,
    0,
    63,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userProfileName, 'userProfileName');
  _s.validateStringLength(
    'userProfileName',
    userProfileName,
    0,
    63,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'SageMaker.UpdateUserProfile'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DomainId': domainId,
      'UserProfileName': userProfileName,
      if (userSettings != null) 'UserSettings': userSettings,
    },
  );

  return UpdateUserProfileResponse.fromJson(jsonResponse.body);
}