Creates a new webhook on an Amplify app.
Parameters:
-
app_id
(AppId)
–
The unique ID for an Amplify app.
-
branch_name
(BranchName)
–
The name for a branch that is part of an Amplify app.
-
description
(Optional[Description], default:
None
)
–
The description for a webhook.
Raises:
Source code in docs_src/capo_amplify/_services/async_amplify.py
| async def create_webhook(
self,
app_id: "capo_amplify.types.app_id.AppId",
branch_name: "capo_amplify.types.branch_name.BranchName",
*,
config_overrides: Optional[AsyncAmplifyClientConfig] = None,
description: Optional["capo_amplify.types.description.Description"] = None,
) -> "capo_amplify.types.create_webhook_result.CreateWebhookResult":
"""<p>Creates a new webhook on an Amplify app. </p>
Args:
app_id: <p>The unique ID for an Amplify app. </p>
branch_name: <p>The name for a branch that is part of an Amplify app. </p>
description: <p>The description for a webhook. </p>
Raises:
capo_amplify.errors.bad_request_exception.BadRequestException: <p>A request contains unexpected data. </p>
capo_amplify.errors.dependent_service_failure_exception.DependentServiceFailureException: <p>An operation failed because a dependent service threw an exception. </p>
capo_amplify.errors.internal_failure_exception.InternalFailureException: <p>The service failed to perform an operation due to an internal issue. </p>
capo_amplify.errors.limit_exceeded_exception.LimitExceededException: <p>A resource could not be created because service quotas were exceeded. </p>
capo_amplify.errors.not_found_exception.NotFoundException: <p>An entity was not found during an operation. </p>
capo_amplify.errors.unauthorized_exception.UnauthorizedException: <p>An operation failed due to a lack of access. </p>
capo_amplify.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_amplify.types.create_webhook_request.CreateWebhookRequest]",
) -> AsyncOperationResponse[
"capo_amplify.types.create_webhook_result.CreateWebhookResult"
]:
import capo_amplify._operations.amplify.create_webhook
(
output,
http_response,
) = await capo_amplify._operations.amplify.create_webhook.async_create_webhook(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateWebhook")
)
input_: capo_amplify.types.create_webhook_request.CreateWebhookRequest = {
"app_id": app_id,
"branch_name": branch_name,
}
if description is not None:
input_["description"] = description
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|