Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { INotificationRuleTarget, NotificationRuleTargetConfig } from './notific
import { IResource, Resource, Names } from '../../core';
import { addConstructMetadata, MethodMetadata } from '../../core/lib/metadata-resource';
import { propertyInjectable } from '../../core/lib/prop-injectable';
import { INotificationRuleRef, NotificationRuleReference } from '../../interfaces/generated/aws-codestarnotifications-interfaces.generated';

/**
* The level of detail to include in the notifications for this resource.
Expand Down Expand Up @@ -88,7 +89,7 @@ export interface NotificationRuleProps extends NotificationRuleOptions {
/**
* Represents a notification rule
*/
export interface INotificationRule extends IResource {
export interface INotificationRule extends IResource, INotificationRuleRef {

/**
* The ARN of the notification rule (i.e. arn:aws:codestar-notifications:::notificationrule/01234abcde)
Expand Down Expand Up @@ -126,6 +127,12 @@ export class NotificationRule extends Resource implements INotificationRule {
class Import extends Resource implements INotificationRule {
readonly notificationRuleArn = notificationRuleArn;

public get notificationRuleRef(): NotificationRuleReference {
return {
notificationRuleArn: this.notificationRuleArn,
};
}

public addTarget(_target: INotificationRuleTarget): boolean {
return false;
}
Expand All @@ -141,6 +148,12 @@ export class NotificationRule extends Resource implements INotificationRule {
*/
public readonly notificationRuleArn: string;

public get notificationRuleRef(): NotificationRuleReference {
return {
notificationRuleArn: this.notificationRuleArn,
};
}

private readonly targets: NotificationRuleTargetConfig[] = [];

private readonly events: string[] = [];
Expand Down
Loading