putAlertManagerDefinition method

Future<PutAlertManagerDefinitionResponse> putAlertManagerDefinition({
  1. required Uint8List data,
  2. required String workspaceId,
  3. String? clientToken,
})

Updates an existing alert manager definition in a workspace. If the workspace does not already have an alert manager definition, don't use this operation to create it. Instead, use CreateAlertManagerDefinition.

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

Parameter data : The alert manager definition to use. A base64-encoded version of the YAML alert manager definition file.

For details about the alert manager definition, see AlertManagedDefinitionData.

Parameter workspaceId : The ID of the workspace to update the alert manager definition in.

Parameter clientToken : A unique identifier that you can provide to ensure the idempotency of the request. Case-sensitive.

Implementation

Future<PutAlertManagerDefinitionResponse> putAlertManagerDefinition({
  required Uint8List data,
  required String workspaceId,
  String? clientToken,
}) async {
  final $payload = <String, dynamic>{
    'data': base64Encode(data),
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/workspaces/${Uri.encodeComponent(workspaceId)}/alertmanager/definition',
    exceptionFnMap: _exceptionFns,
  );
  return PutAlertManagerDefinitionResponse.fromJson(response);
}