updateCalculatedAttributeDefinition method

Future<UpdateCalculatedAttributeDefinitionResponse> updateCalculatedAttributeDefinition({
  1. required String calculatedAttributeName,
  2. required String domainName,
  3. Conditions? conditions,
  4. String? description,
  5. String? displayName,
})

Updates an existing calculated attribute definition. When updating the Conditions, note that increasing the date range of a calculated attribute will not trigger inclusion of historical data greater than the current date range.

May throw AccessDeniedException. May throw BadRequestException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter calculatedAttributeName : The unique name of the calculated attribute.

Parameter domainName : The unique name of the domain.

Parameter conditions : The conditions including range, object count, and threshold for the calculated attribute.

Parameter description : The description of the calculated attribute.

Parameter displayName : The display name of the calculated attribute.

Implementation

Future<UpdateCalculatedAttributeDefinitionResponse>
    updateCalculatedAttributeDefinition({
  required String calculatedAttributeName,
  required String domainName,
  Conditions? conditions,
  String? description,
  String? displayName,
}) async {
  final $payload = <String, dynamic>{
    if (conditions != null) 'Conditions': conditions,
    if (description != null) 'Description': description,
    if (displayName != null) 'DisplayName': displayName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/domains/${Uri.encodeComponent(domainName)}/calculated-attributes/${Uri.encodeComponent(calculatedAttributeName)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateCalculatedAttributeDefinitionResponse.fromJson(response);
}