updateProfileWithAgent method

Future<UpdateProfileWithAgentResponse> updateProfileWithAgent({
  1. required AgentInputMessage inputMessage,
  2. required String profileId,
  3. required SourceFormat sourceFormat,
  4. String? conversationId,
})

Updates a data transformation profile using chat-based interaction with an agent. Supports multi-turn conversations for iteratively customizing profiles.

May throw AccessDeniedException. May throw AgentMessageOutOfContextException. May throw ConversationNotFoundException. May throw InternalServerException. May throw NotImplementedOperationException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnauthorizedException. May throw UnsupportedMIMETypeException. May throw ValidationException.

Parameter inputMessage : The message to send to the agent.

Parameter profileId : The unique identifier of the profile to update via the agent.

Parameter sourceFormat : The source data format for the transformation.

Parameter conversationId : The conversation identifier for multi-turn interactions. Omit to start a new conversation.

Implementation

Future<UpdateProfileWithAgentResponse> updateProfileWithAgent({
  required AgentInputMessage inputMessage,
  required String profileId,
  required SourceFormat sourceFormat,
  String? conversationId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'HealthLake.UpdateProfileWithAgent'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'InputMessage': inputMessage,
      'ProfileId': profileId,
      'SourceFormat': sourceFormat.value,
      if (conversationId != null) 'ConversationId': conversationId,
    },

    hostPrefix: 'datatransformation.',
  );

  return UpdateProfileWithAgentResponse.fromJson(jsonResponse.body);
}