updateWebhook method

Future<UpdateWebhookResult> updateWebhook({
  1. required String webhookId,
  2. String? branchName,
  3. String? description,
})

Updates a webhook.

May throw BadRequestException. May throw DependentServiceFailureException. May throw InternalFailureException. May throw NotFoundException. May throw UnauthorizedException.

Parameter webhookId : The unique ID for a webhook.

Parameter branchName : The name for a branch that is part of an Amplify app.

Parameter description : The description for a webhook.

Implementation

Future<UpdateWebhookResult> updateWebhook({
  required String webhookId,
  String? branchName,
  String? description,
}) async {
  final $payload = <String, dynamic>{
    if (branchName != null) 'branchName': branchName,
    if (description != null) 'description': description,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/webhooks/${Uri.encodeComponent(webhookId)}',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateWebhookResult.fromJson(response);
}