updateTrigger method

Future<UpdateTriggerResponse> updateTrigger({
  1. required String agentSpaceId,
  2. required String triggerId,
  3. String? clientToken,
  4. String? status,
})

Updates the status of an existing Trigger

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

Parameter agentSpaceId : The unique identifier for the agent space containing the Trigger

Parameter triggerId : The unique identifier of the Trigger to update

Parameter clientToken : A unique, case-sensitive identifier used for idempotent Trigger update

Parameter status : The new status for the Trigger

Implementation

Future<UpdateTriggerResponse> updateTrigger({
  required String agentSpaceId,
  required String triggerId,
  String? clientToken,
  String? status,
}) async {
  final $payload = <String, dynamic>{
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (status != null) 'status': status,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PATCH',
    requestUri:
        '/trigger/agent-space/${Uri.encodeComponent(agentSpaceId)}/triggers/${Uri.encodeComponent(triggerId)}',
    hostPrefix: 'dp.',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateTriggerResponse.fromJson(response);
}