createAgentAlias method
Creates an alias of an agent that can be used to deploy the agent.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter agentAliasName :
The name of the alias.
Parameter agentId :
The unique identifier of the agent.
Parameter clientToken :
A unique, case-sensitive identifier to ensure that the API request
completes no more than one time. If this token matches a previous request,
Amazon Bedrock ignores the request, but does not return an error. For more
information, see Ensuring
idempotency.
Parameter description :
A description of the alias of the agent.
Parameter routingConfiguration :
Contains details about the routing configuration of the alias.
Parameter tags :
Any tags that you want to attach to the alias of the agent.
Implementation
Future<CreateAgentAliasResponse> createAgentAlias({
required String agentAliasName,
required String agentId,
String? clientToken,
String? description,
List<AgentAliasRoutingConfigurationListItem>? routingConfiguration,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'agentAliasName': agentAliasName,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (routingConfiguration != null)
'routingConfiguration': routingConfiguration,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/agents/${Uri.encodeComponent(agentId)}/agentaliases/',
exceptionFnMap: _exceptionFns,
);
return CreateAgentAliasResponse.fromJson(response);
}