createProfile method

Future<CreateProfileOutput> createProfile({
  1. required String profileDescription,
  2. required String profileName,
  3. required List<ProfileQuestionUpdate> profileQuestions,
  4. String? clientRequestToken,
  5. Map<String, String>? tags,
})

Create a profile.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter profileDescription : The profile description.

Parameter profileName : Name of the profile.

Parameter profileQuestions : The profile questions.

Parameter tags : The tags assigned to the profile.

Implementation

Future<CreateProfileOutput> createProfile({
  required String profileDescription,
  required String profileName,
  required List<ProfileQuestionUpdate> profileQuestions,
  String? clientRequestToken,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'ProfileDescription': profileDescription,
    'ProfileName': profileName,
    'ProfileQuestions': profileQuestions,
    'ClientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (tags != null) 'Tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/profiles',
    exceptionFnMap: _exceptionFns,
  );
  return CreateProfileOutput.fromJson(response);
}