Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: more onXxx API fixes on interfaces #3038

Merged
merged 3 commits into from
Jun 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface IProject extends IResource, iam.IGrantable, ec2.IConnectable {
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html
*/
onEvent(id: string, options: events.OnEventOptions): events.Rule;
onEvent(id: string, options?: events.OnEventOptions): events.Rule;

/**
* Defines a CloudWatch event rule triggered when the build project state
Expand All @@ -69,30 +69,30 @@ export interface IProject extends IResource, iam.IGrantable, ec2.IConnectable {
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html
*/
onStateChange(id: string, options: events.OnEventOptions): events.Rule;
onStateChange(id: string, options?: events.OnEventOptions): events.Rule;

/**
* Defines a CloudWatch event rule that triggers upon phase change of this
* build project.
*
* @see https://docs.aws.amazon.com/codebuild/latest/userguide/sample-build-notifications.html
*/
onPhaseChange(id: string, options: events.OnEventOptions): events.Rule;
onPhaseChange(id: string, options?: events.OnEventOptions): events.Rule;

/**
* Defines an event rule which triggers when a build starts.
*/
onBuildStarted(id: string, options: events.OnEventOptions): events.Rule;
onBuildStarted(id: string, options?: events.OnEventOptions): events.Rule;

/**
* Defines an event rule which triggers when a build fails.
*/
onBuildFailed(id: string, options: events.OnEventOptions): events.Rule;
onBuildFailed(id: string, options?: events.OnEventOptions): events.Rule;

/**
* Defines an event rule which triggers when a build completes successfully.
*/
onBuildSucceeded(id: string, options: events.OnEventOptions): events.Rule;
onBuildSucceeded(id: string, options?: events.OnEventOptions): events.Rule;

/**
* @returns a CloudWatch metric associated with this build project.
Expand Down
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-config/lib/rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ export interface IRule extends IResource {
* Defines a CloudWatch event rule which triggers for rule events. Use
* `rule.addEventPattern(pattern)` to specify a filter.
*/
onEvent(id: string, options: events.OnEventOptions): events.Rule;
onEvent(id: string, options?: events.OnEventOptions): events.Rule;

/**
* Defines a CloudWatch event rule which triggers for rule compliance events.
*/
onComplianceChange(id: string, options: events.OnEventOptions): events.Rule;
onComplianceChange(id: string, options?: events.OnEventOptions): events.Rule;

/**
* Defines a CloudWatch event rule which triggers for rule re-evaluation status events.
*/
onReEvaluationStatus(id: string, options: events.OnEventOptions): events.Rule;
onReEvaluationStatus(id: string, options?: events.OnEventOptions): events.Rule;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-rds/lib/instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export interface IDatabaseInstance extends IResource, ec2.IConnectable, secretsm
* Defines a CloudWatch event rule which triggers for instance events. Use
* `rule.addEventPattern(pattern)` to specify a filter.
*/
onEvent(id: string, options: events.OnEventOptions): events.Rule;
onEvent(id: string, options?: events.OnEventOptions): events.Rule;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-s3/lib/bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ export interface IBucket extends IResource {
* @param id The id of the rule
* @param options Options for adding the rule
*/
onCloudTrailEvent(id: string, options: OnCloudTrailBucketEventOptions): events.Rule;
onCloudTrailEvent(id: string, options?: OnCloudTrailBucketEventOptions): events.Rule;

/**
* Defines an AWS CloudWatch event rule that can trigger a target when an image is pushed to this
Expand All @@ -186,7 +186,7 @@ export interface IBucket extends IResource {
* @param id The id of the rule
* @param options Options for adding the rule
*/
onCloudTrailPutObject(id: string, options: OnCloudTrailBucketEventOptions): events.Rule;
onCloudTrailPutObject(id: string, options?: OnCloudTrailBucketEventOptions): events.Rule;
}

/**
Expand Down