updateABTest method
Updates an A/B test's configuration, including variants, traffic allocation, evaluation settings, or execution status.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw UnauthorizedException.
May throw ValidationException.
Parameter abTestId :
The unique identifier of the A/B test to update.
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,
the service ignores the request, but does not return an error.
Parameter description :
The updated description of the A/B test.
Parameter evaluationConfig :
The updated evaluation configuration.
Parameter executionStatus :
The updated execution status to enable or disable the A/B test.
Parameter gatewayFilter :
The updated gateway filter.
Parameter name :
The updated name of the A/B test.
Parameter roleArn :
The updated IAM role ARN.
Parameter variants :
The updated list of variants.
Implementation
Future<UpdateABTestResponse> updateABTest({
required String abTestId,
String? clientToken,
String? description,
ABTestEvaluationConfig? evaluationConfig,
ABTestExecutionStatus? executionStatus,
GatewayFilter? gatewayFilter,
String? name,
String? roleArn,
List<Variant>? variants,
}) async {
final $payload = <String, dynamic>{
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (evaluationConfig != null) 'evaluationConfig': evaluationConfig,
if (executionStatus != null) 'executionStatus': executionStatus.value,
if (gatewayFilter != null) 'gatewayFilter': gatewayFilter,
if (name != null) 'name': name,
if (roleArn != null) 'roleArn': roleArn,
if (variants != null) 'variants': variants,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/ab-tests/${Uri.encodeComponent(abTestId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateABTestResponse.fromJson(response);
}