Skip to content

Commit

Permalink
feat(client-codebuild): AWS CodeBuild now supports global and organiz…
Browse files Browse the repository at this point in the history
…ation GitHub webhooks
  • Loading branch information
awstools committed Jun 17, 2024
1 parent 76ace8f commit a7798f3
Show file tree
Hide file tree
Showing 8 changed files with 162 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ export interface BatchGetProjectsCommandOutput extends BatchGetProjectsOutput, _
* // buildType: "BUILD" || "BUILD_BATCH",
* // manualCreation: true || false,
* // lastModifiedSecret: new Date("TIMESTAMP"),
* // scopeConfiguration: { // ScopeConfiguration
* // name: "STRING_VALUE", // required
* // domain: "STRING_VALUE",
* // scope: "GITHUB_ORGANIZATION" || "GITHUB_GLOBAL", // required
* // },
* // },
* // vpcConfig: { // VpcConfig
* // vpcId: "STRING_VALUE",
Expand Down
5 changes: 5 additions & 0 deletions clients/client-codebuild/src/commands/CreateProjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ export interface CreateProjectCommandOutput extends CreateProjectOutput, __Metad
* // buildType: "BUILD" || "BUILD_BATCH",
* // manualCreation: true || false,
* // lastModifiedSecret: new Date("TIMESTAMP"),
* // scopeConfiguration: { // ScopeConfiguration
* // name: "STRING_VALUE", // required
* // domain: "STRING_VALUE",
* // scope: "GITHUB_ORGANIZATION" || "GITHUB_GLOBAL", // required
* // },
* // },
* // vpcConfig: { // VpcConfig
* // vpcId: "STRING_VALUE",
Expand Down
10 changes: 10 additions & 0 deletions clients/client-codebuild/src/commands/CreateWebhookCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ export interface CreateWebhookCommandOutput extends CreateWebhookOutput, __Metad
* ],
* buildType: "BUILD" || "BUILD_BATCH",
* manualCreation: true || false,
* scopeConfiguration: { // ScopeConfiguration
* name: "STRING_VALUE", // required
* domain: "STRING_VALUE",
* scope: "GITHUB_ORGANIZATION" || "GITHUB_GLOBAL", // required
* },
* };
* const command = new CreateWebhookCommand(input);
* const response = await client.send(command);
Expand All @@ -80,6 +85,11 @@ export interface CreateWebhookCommandOutput extends CreateWebhookOutput, __Metad
* // buildType: "BUILD" || "BUILD_BATCH",
* // manualCreation: true || false,
* // lastModifiedSecret: new Date("TIMESTAMP"),
* // scopeConfiguration: { // ScopeConfiguration
* // name: "STRING_VALUE", // required
* // domain: "STRING_VALUE",
* // scope: "GITHUB_ORGANIZATION" || "GITHUB_GLOBAL", // required
* // },
* // },
* // };
*
Expand Down
5 changes: 5 additions & 0 deletions clients/client-codebuild/src/commands/UpdateProjectCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ export interface UpdateProjectCommandOutput extends UpdateProjectOutput, __Metad
* // buildType: "BUILD" || "BUILD_BATCH",
* // manualCreation: true || false,
* // lastModifiedSecret: new Date("TIMESTAMP"),
* // scopeConfiguration: { // ScopeConfiguration
* // name: "STRING_VALUE", // required
* // domain: "STRING_VALUE",
* // scope: "GITHUB_ORGANIZATION" || "GITHUB_GLOBAL", // required
* // },
* // },
* // vpcConfig: { // VpcConfig
* // vpcId: "STRING_VALUE",
Expand Down
5 changes: 5 additions & 0 deletions clients/client-codebuild/src/commands/UpdateWebhookCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ export interface UpdateWebhookCommandOutput extends UpdateWebhookOutput, __Metad
* // buildType: "BUILD" || "BUILD_BATCH",
* // manualCreation: true || false,
* // lastModifiedSecret: new Date("TIMESTAMP"),
* // scopeConfiguration: { // ScopeConfiguration
* // name: "STRING_VALUE", // required
* // domain: "STRING_VALUE",
* // scope: "GITHUB_ORGANIZATION" || "GITHUB_GLOBAL", // required
* // },
* // },
* // };
*
Expand Down
68 changes: 68 additions & 0 deletions clients/client-codebuild/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3617,6 +3617,18 @@ export interface WebhookFilter {
* </ul>
* </li>
* <li>
* <p>REPOSITORY_NAME</p>
* <ul>
* <li>
* <p>A webhook triggers a build when the repository name matches the
* regular expression pattern.</p>
* <note>
* <p> Works with GitHub global or organization webhooks only. </p>
* </note>
* </li>
* </ul>
* </li>
* <li>
* <p>WORKFLOW_NAME</p>
* <ul>
* <li>
Expand Down Expand Up @@ -3657,6 +3669,44 @@ export interface WebhookFilter {
excludeMatchedPattern?: boolean;
}

/**
* @public
* @enum
*/
export const WebhookScopeType = {
GITHUB_GLOBAL: "GITHUB_GLOBAL",
GITHUB_ORGANIZATION: "GITHUB_ORGANIZATION",
} as const;

/**
* @public
*/
export type WebhookScopeType = (typeof WebhookScopeType)[keyof typeof WebhookScopeType];

/**
* <p>Contains configuration information about the scope for a webhook. </p>
* @public
*/
export interface ScopeConfiguration {
/**
* <p>The name of either the enterprise or organization that will send webhook events to CodeBuild, depending on if the webhook is a global or organization webhook respectively.</p>
* @public
*/
name: string | undefined;

/**
* <p>The domain of the GitHub Enterprise organization. Note that this parameter is only required if your project's source type is GITHUB_ENTERPRISE</p>
* @public
*/
domain?: string;

/**
* <p>The type of scope for a GitHub webhook.</p>
* @public
*/
scope: WebhookScopeType | undefined;
}

/**
* <p>Information about a webhook that connects repository events to a build project in
* CodeBuild.</p>
Expand Down Expand Up @@ -3730,6 +3780,15 @@ export interface Webhook {
* @public
*/
lastModifiedSecret?: Date;

/**
* <p>The scope configuration for global or organization webhooks.</p>
* <note>
* <p>Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.</p>
* </note>
* @public
*/
scopeConfiguration?: ScopeConfiguration;
}

/**
Expand Down Expand Up @@ -5016,6 +5075,15 @@ export interface CreateWebhookInput {
* @public
*/
manualCreation?: boolean;

/**
* <p>The scope configuration for global or organization webhooks.</p>
* <note>
* <p>Global or organization webhooks are only available for GitHub and Github Enterprise webhooks.</p>
* </note>
* @public
*/
scopeConfiguration?: ScopeConfiguration;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions clients/client-codebuild/src/protocols/Aws_json1_1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ import {
S3ReportExportConfig,
ScalingConfigurationInput,
ScalingConfigurationOutput,
ScopeConfiguration,
SourceAuth,
StartBuildBatchInput,
StartBuildBatchOutput,
Expand Down Expand Up @@ -2199,6 +2200,8 @@ const se_ScalingConfigurationInput = (input: ScalingConfigurationInput, context:
});
};

// se_ScopeConfiguration omitted.

// se_SecurityGroupIds omitted.

// se_SourceAuth omitted.
Expand Down Expand Up @@ -3001,6 +3004,8 @@ const de_ScalingConfigurationOutput = (output: any, context: __SerdeContext): Sc
}) as any;
};

// de_ScopeConfiguration omitted.

// de_SecurityGroupIds omitted.

// de_SourceAuth omitted.
Expand Down Expand Up @@ -3160,6 +3165,7 @@ const de_Webhook = (output: any, context: __SerdeContext): Webhook => {
lastModifiedSecret: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
manualCreation: __expectBoolean,
payloadUrl: __expectString,
scopeConfiguration: _json,
secret: __expectString,
url: __expectString,
}) as any;
Expand Down
59 changes: 58 additions & 1 deletion codegen/sdk-codegen/aws-models/codebuild.json

Large diffs are not rendered by default.

0 comments on commit a7798f3

Please sign in to comment.