updateWebhook method
Updates a webhook.
May throw BadRequestException. May throw UnauthorizedException. May throw NotFoundException. May throw InternalFailureException. May throw DependentServiceFailureException.
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 {
ArgumentError.checkNotNull(webhookId, 'webhookId');
_s.validateStringLength(
'webhookId',
webhookId,
0,
255,
isRequired: true,
);
_s.validateStringLength(
'branchName',
branchName,
1,
255,
);
_s.validateStringLength(
'description',
description,
0,
1000,
);
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);
}