From a51678f8c258a706bfe34e3e4e9d0319d58accd9 Mon Sep 17 00:00:00 2001 From: Elad Ben-Israel Date: Mon, 24 Jun 2019 18:40:37 +0300 Subject: [PATCH] chore: more onXxx API fixes on interfaces (#3038) 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: awslabs/jsii#548 --- packages/@aws-cdk/aws-codebuild/lib/project.ts | 12 ++++++------ packages/@aws-cdk/aws-config/lib/rule.ts | 6 +++--- packages/@aws-cdk/aws-rds/lib/instance.ts | 2 +- packages/@aws-cdk/aws-s3/lib/bucket.ts | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/@aws-cdk/aws-codebuild/lib/project.ts b/packages/@aws-cdk/aws-codebuild/lib/project.ts index 91feef13f27ce..02b0ed08152d8 100644 --- a/packages/@aws-cdk/aws-codebuild/lib/project.ts +++ b/packages/@aws-cdk/aws-codebuild/lib/project.ts @@ -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 @@ -69,7 +69,7 @@ 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 @@ -77,22 +77,22 @@ export interface IProject extends IResource, iam.IGrantable, ec2.IConnectable { * * @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. diff --git a/packages/@aws-cdk/aws-config/lib/rule.ts b/packages/@aws-cdk/aws-config/lib/rule.ts index 8d076e6365b0c..57261c543531c 100644 --- a/packages/@aws-cdk/aws-config/lib/rule.ts +++ b/packages/@aws-cdk/aws-config/lib/rule.ts @@ -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; } /** diff --git a/packages/@aws-cdk/aws-rds/lib/instance.ts b/packages/@aws-cdk/aws-rds/lib/instance.ts index e542888b2a76a..0574d8150f947 100644 --- a/packages/@aws-cdk/aws-rds/lib/instance.ts +++ b/packages/@aws-cdk/aws-rds/lib/instance.ts @@ -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; } /** diff --git a/packages/@aws-cdk/aws-s3/lib/bucket.ts b/packages/@aws-cdk/aws-s3/lib/bucket.ts index 2607167c38e05..75d85f2ad3a83 100644 --- a/packages/@aws-cdk/aws-s3/lib/bucket.ts +++ b/packages/@aws-cdk/aws-s3/lib/bucket.ts @@ -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 @@ -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; } /**