createAgent method

Future<CreateAgentResponse> createAgent({
  1. required String agentId,
  2. required String awsAccountId,
  3. required String name,
  4. List<String>? actionConnectors,
  5. AgentLifecycle? agentLifecycle,
  6. CustomPromptInput? customPromptInput,
  7. String? description,
  8. String? iconId,
  9. List<String>? spaces,
  10. List<String>? starterPrompts,
  11. String? welcomeMessage,
})

Creates an agent in Amazon QuickSight.

May throw AccessDeniedException. May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw PreconditionNotMetException. May throw ResourceExistsException. May throw ThrottlingException.

Parameter agentId : A unique identifier for the agent.

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the agent.

Parameter name : The name of the agent.

Parameter actionConnectors : The Amazon Resource Names (ARNs) of the action connectors to attach to the agent.

Parameter agentLifecycle : The lifecycle state of the agent. Valid values are PREVIEW and PUBLISHED.

Parameter customPromptInput : The custom prompt configuration for the agent.

Parameter description : A description of the agent.

Parameter iconId : The icon identifier for the agent.

Parameter spaces : The Amazon Resource Names (ARNs) of the spaces to attach to the agent.

Parameter starterPrompts : A list of starter prompts that are displayed to users when they begin interacting with the agent.

Parameter welcomeMessage : The welcome message that is displayed when a user starts a conversation with the agent.

Implementation

Future<CreateAgentResponse> createAgent({
  required String agentId,
  required String awsAccountId,
  required String name,
  List<String>? actionConnectors,
  AgentLifecycle? agentLifecycle,
  CustomPromptInput? customPromptInput,
  String? description,
  String? iconId,
  List<String>? spaces,
  List<String>? starterPrompts,
  String? welcomeMessage,
}) async {
  final $payload = <String, dynamic>{
    'AgentId': agentId,
    'Name': name,
    if (actionConnectors != null) 'ActionConnectors': actionConnectors,
    if (agentLifecycle != null) 'AgentLifecycle': agentLifecycle.value,
    if (customPromptInput != null) 'CustomPromptInput': customPromptInput,
    if (description != null) 'Description': description,
    if (iconId != null) 'IconId': iconId,
    if (spaces != null) 'Spaces': spaces,
    if (starterPrompts != null) 'StarterPrompts': starterPrompts,
    if (welcomeMessage != null) 'WelcomeMessage': welcomeMessage,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/accounts/${Uri.encodeComponent(awsAccountId)}/agents',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAgentResponse.fromJson(response);
}