Skip to content

Commit

Permalink
chore: more onXxx API fixes on interfaces (#3038)
Browse files Browse the repository at this point in the history
Additional fixes like #3036

Options are now not required in onXxx methods, but the interfaces where not updated to that end.

Related #2921
Root cause: aws/jsii#548
  • Loading branch information
Elad Ben-Israel authored Jun 24, 2019
1 parent f69bbb0 commit a51678f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
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

0 comments on commit a51678f

Please sign in to comment.