createAutomatedReasoningPolicyVersion method

Future<CreateAutomatedReasoningPolicyVersionResponse> createAutomatedReasoningPolicyVersion({
  1. required String lastUpdatedDefinitionHash,
  2. required String policyArn,
  3. String? clientRequestToken,
  4. List<Tag>? tags,
})

Creates a new version of an existing Automated Reasoning policy. This allows you to iterate on your policy rules while maintaining previous versions for rollback or comparison purposes.

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

Parameter lastUpdatedDefinitionHash : The hash of the current policy definition used as a concurrency token to ensure the policy hasn't been modified since you last retrieved it.

Parameter policyArn : The Amazon Resource Name (ARN) of the Automated Reasoning policy for which to create a version.

Parameter clientRequestToken : A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error.

Parameter tags : A list of tags to associate with the policy version.

Implementation

Future<CreateAutomatedReasoningPolicyVersionResponse>
    createAutomatedReasoningPolicyVersion({
  required String lastUpdatedDefinitionHash,
  required String policyArn,
  String? clientRequestToken,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'lastUpdatedDefinitionHash': lastUpdatedDefinitionHash,
    'clientRequestToken': clientRequestToken ?? _s.generateIdempotencyToken(),
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/automated-reasoning-policies/${Uri.encodeComponent(policyArn)}/versions',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAutomatedReasoningPolicyVersionResponse.fromJson(response);
}