createFlowAlias method

Future<CreateFlowAliasResponse> createFlowAlias({
  1. required String flowIdentifier,
  2. required String name,
  3. required List<FlowAliasRoutingConfigurationListItem> routingConfiguration,
  4. String? clientToken,
  5. FlowAliasConcurrencyConfiguration? concurrencyConfiguration,
  6. String? description,
  7. Map<String, String>? tags,
})

Creates an alias of a flow for deployment. For more information, see Deploy a flow in Amazon Bedrock in the Amazon Bedrock User Guide.

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

Parameter flowIdentifier : The unique identifier of the flow for which to create an alias.

Parameter name : A name for the alias.

Parameter routingConfiguration : Contains information about the version to which to map the alias.

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 concurrencyConfiguration : The configuration that specifies how nodes in the flow are executed in parallel.

Parameter description : A description for the alias.

Parameter tags : Any tags that you want to attach to the alias of the flow. For more information, see Tagging resources in Amazon Bedrock.

Implementation

Future<CreateFlowAliasResponse> createFlowAlias({
  required String flowIdentifier,
  required String name,
  required List<FlowAliasRoutingConfigurationListItem> routingConfiguration,
  String? clientToken,
  FlowAliasConcurrencyConfiguration? concurrencyConfiguration,
  String? description,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    'routingConfiguration': routingConfiguration,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (concurrencyConfiguration != null)
      'concurrencyConfiguration': concurrencyConfiguration,
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/flows/${Uri.encodeComponent(flowIdentifier)}/aliases',
    exceptionFnMap: _exceptionFns,
  );
  return CreateFlowAliasResponse.fromJson(response);
}