createWebhook method

Future<CreateWebhookResult> createWebhook({
  1. required String appId,
  2. required String branchName,
  3. String? description,
})

Creates a new webhook on an Amplify app.

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

Parameter appId : The unique ID for an Amplify app.

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

Parameter description : The description for a webhook.

Implementation

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