import { Command as $Command } from "@smithy/smithy-client"; import type { MetadataBearer as __MetadataBearer } from "@smithy/types"; import type { CodeBuildClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CodeBuildClient"; import type { CreateWebhookInput, CreateWebhookOutput } from "../models/models_0"; /** * @public */ export type { __MetadataBearer }; export { $Command }; /** * @public * * The input for {@link CreateWebhookCommand}. */ export interface CreateWebhookCommandInput extends CreateWebhookInput { } /** * @public * * The output of {@link CreateWebhookCommand}. */ export interface CreateWebhookCommandOutput extends CreateWebhookOutput, __MetadataBearer { } declare const CreateWebhookCommand_base: { new (input: CreateWebhookCommandInput): import("@smithy/smithy-client").CommandImpl; new (input: CreateWebhookCommandInput): import("@smithy/smithy-client").CommandImpl; getEndpointParameterInstructions(): import("@smithy/middleware-endpoint").EndpointParameterInstructions; }; /** *

For an existing CodeBuild build project that has its source code stored in a GitHub or * Bitbucket repository, enables CodeBuild to start rebuilding the source code every time a * code change is pushed to the repository.

* *

If you enable webhooks for an CodeBuild project, and the project is used as a build * step in CodePipeline, then two identical builds are created for each commit. One build is * triggered through webhooks, and one through CodePipeline. Because billing is on a per-build * basis, you are billed for both builds. Therefore, if you are using CodePipeline, we * recommend that you disable webhooks in CodeBuild. In the CodeBuild console, clear the * Webhook box. For more information, see step 5 in Change a Build Project's Settings.

*
* @example * Use a bare-bones client and the command you need to make an API call. * ```javascript * import { CodeBuildClient, CreateWebhookCommand } from "@aws-sdk/client-codebuild"; // ES Modules import * // const { CodeBuildClient, CreateWebhookCommand } = require("@aws-sdk/client-codebuild"); // CommonJS import * // import type { CodeBuildClientConfig } from "@aws-sdk/client-codebuild"; * const config = {}; // type is CodeBuildClientConfig * const client = new CodeBuildClient(config); * const input = { // CreateWebhookInput * projectName: "STRING_VALUE", // required * branchFilter: "STRING_VALUE", * filterGroups: [ // FilterGroups * [ // FilterGroup * { // WebhookFilter * type: "EVENT" || "BASE_REF" || "HEAD_REF" || "ACTOR_ACCOUNT_ID" || "FILE_PATH" || "COMMIT_MESSAGE" || "WORKFLOW_NAME" || "TAG_NAME" || "RELEASE_NAME" || "REPOSITORY_NAME" || "ORGANIZATION_NAME", // required * pattern: "STRING_VALUE", // required * excludeMatchedPattern: true || false, * }, * ], * ], * buildType: "BUILD" || "BUILD_BATCH" || "RUNNER_BUILDKITE_BUILD", * manualCreation: true || false, * scopeConfiguration: { // ScopeConfiguration * name: "STRING_VALUE", // required * domain: "STRING_VALUE", * scope: "GITHUB_ORGANIZATION" || "GITHUB_GLOBAL" || "GITLAB_GROUP", // required * }, * pullRequestBuildPolicy: { // PullRequestBuildPolicy * requiresCommentApproval: "DISABLED" || "ALL_PULL_REQUESTS" || "FORK_PULL_REQUESTS", // required * approverRoles: [ // PullRequestBuildApproverRoles * "GITHUB_READ" || "GITHUB_TRIAGE" || "GITHUB_WRITE" || "GITHUB_MAINTAIN" || "GITHUB_ADMIN" || "GITLAB_GUEST" || "GITLAB_PLANNER" || "GITLAB_REPORTER" || "GITLAB_DEVELOPER" || "GITLAB_MAINTAINER" || "GITLAB_OWNER" || "BITBUCKET_READ" || "BITBUCKET_WRITE" || "BITBUCKET_ADMIN", * ], * }, * }; * const command = new CreateWebhookCommand(input); * const response = await client.send(command); * // { // CreateWebhookOutput * // webhook: { // Webhook * // url: "STRING_VALUE", * // payloadUrl: "STRING_VALUE", * // secret: "STRING_VALUE", * // branchFilter: "STRING_VALUE", * // filterGroups: [ // FilterGroups * // [ // FilterGroup * // { // WebhookFilter * // type: "EVENT" || "BASE_REF" || "HEAD_REF" || "ACTOR_ACCOUNT_ID" || "FILE_PATH" || "COMMIT_MESSAGE" || "WORKFLOW_NAME" || "TAG_NAME" || "RELEASE_NAME" || "REPOSITORY_NAME" || "ORGANIZATION_NAME", // required * // pattern: "STRING_VALUE", // required * // excludeMatchedPattern: true || false, * // }, * // ], * // ], * // buildType: "BUILD" || "BUILD_BATCH" || "RUNNER_BUILDKITE_BUILD", * // manualCreation: true || false, * // lastModifiedSecret: new Date("TIMESTAMP"), * // scopeConfiguration: { // ScopeConfiguration * // name: "STRING_VALUE", // required * // domain: "STRING_VALUE", * // scope: "GITHUB_ORGANIZATION" || "GITHUB_GLOBAL" || "GITLAB_GROUP", // required * // }, * // status: "CREATING" || "CREATE_FAILED" || "ACTIVE" || "DELETING", * // statusMessage: "STRING_VALUE", * // pullRequestBuildPolicy: { // PullRequestBuildPolicy * // requiresCommentApproval: "DISABLED" || "ALL_PULL_REQUESTS" || "FORK_PULL_REQUESTS", // required * // approverRoles: [ // PullRequestBuildApproverRoles * // "GITHUB_READ" || "GITHUB_TRIAGE" || "GITHUB_WRITE" || "GITHUB_MAINTAIN" || "GITHUB_ADMIN" || "GITLAB_GUEST" || "GITLAB_PLANNER" || "GITLAB_REPORTER" || "GITLAB_DEVELOPER" || "GITLAB_MAINTAINER" || "GITLAB_OWNER" || "BITBUCKET_READ" || "BITBUCKET_WRITE" || "BITBUCKET_ADMIN", * // ], * // }, * // }, * // }; * * ``` * * @param CreateWebhookCommandInput - {@link CreateWebhookCommandInput} * @returns {@link CreateWebhookCommandOutput} * @see {@link CreateWebhookCommandInput} for command's `input` shape. * @see {@link CreateWebhookCommandOutput} for command's `response` shape. * @see {@link CodeBuildClientResolvedConfig | config} for CodeBuildClient's `config` shape. * * @throws {@link InvalidInputException} (client fault) *

The input value that was provided is not valid.

* * @throws {@link OAuthProviderException} (client fault) *

There was a problem with the underlying OAuth provider.

* * @throws {@link ResourceAlreadyExistsException} (client fault) *

The specified Amazon Web Services resource cannot be created, because an Amazon Web Services resource with the same * settings already exists.

* * @throws {@link ResourceNotFoundException} (client fault) *

The specified Amazon Web Services resource cannot be found.

* * @throws {@link CodeBuildServiceException} *

Base exception class for all service exceptions from CodeBuild service.

* * * @public */ export declare class CreateWebhookCommand extends CreateWebhookCommand_base { /** @internal type navigation helper, not in runtime. */ protected static __types: { api: { input: CreateWebhookInput; output: CreateWebhookOutput; }; sdk: { input: CreateWebhookCommandInput; output: CreateWebhookCommandOutput; }; }; }