Skip to content

Commit

Permalink
chore(sns): clear docs linter exclusions
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
shivlaks and mergify[bot] authored May 4, 2020
1 parent 5ec0af6 commit 2008b91
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 23 deletions.
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-sns/lib/policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { Construct, Resource } from '@aws-cdk/core';
import { CfnTopicPolicy } from './sns.generated';
import { ITopic } from './topic-base';

/**
* Properties to associate SNS topics with a policy
*/
export interface TopicPolicyProps {
/**
* The set of topics this policy applies to.
Expand Down
5 changes: 5 additions & 0 deletions packages/@aws-cdk/aws-sns/lib/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,10 @@ export interface TopicSubscriptionConfig extends SubscriptionOptions {
* Topic subscription
*/
export interface ITopicSubscription {
/**
* Returns a configuration used to subscribe to an SNS topic
*
* @param topic topic for which subscription will be configured
*/
bind(topic: ITopic): TopicSubscriptionConfig;
}
24 changes: 24 additions & 0 deletions packages/@aws-cdk/aws-sns/lib/subscription-filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@
export interface StringConditions {
/**
* Match one or more values.
*
* @default - None
*/
readonly whitelist?: string[];

/**
* Match any value that doesn't include any of the specified values.
*
* @default - None
*/
readonly blacklist?: string[];

/**
* Matches values that begins with the specified prefixes.
*
* @default - None
*/
readonly matchPrefixes?: string[];
}
Expand All @@ -39,36 +45,50 @@ export interface BetweenCondition {
export interface NumericConditions {
/**
* Match one or more values.
*
* @default - None
*/
readonly whitelist?: number[];

/**
* Match values that are greater than the specified value.
*
* @default - None
*/
readonly greaterThan?: number;

/**
* Match values that are greater than or equal to the specified value.
*
* @default - None
*/
readonly greaterThanOrEqualTo?: number;

/**
* Match values that are less than the specified value.
*
* @default - None
*/
readonly lessThan?: number;

/**
* Match values that are less than or equal to the specified value.
*
* @default - None
*/
readonly lessThanOrEqualTo?: number;

/**
* Match values that are between the specified values.
*
* @default - None
*/
readonly between?: BetweenCondition;

/**
* Match values that are strictly between the specified values.
*
* @default - None
*/
readonly betweenStrict?: BetweenCondition;
}
Expand Down Expand Up @@ -142,5 +162,9 @@ export class SubscriptionFilter {
return new SubscriptionFilter([{ exists: true }]);
}

/**
*
* @param conditions conditions that specify the message attributes that should be included, excluded, matched, etc.
*/
constructor(public readonly conditions: any[] = []) {}
}
7 changes: 7 additions & 0 deletions packages/@aws-cdk/aws-sns/lib/topic-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ import { TopicPolicy } from './policy';
import { ITopicSubscription } from './subscriber';
import { Subscription } from './subscription';

/**
* Represents an SNS topic
*/
export interface ITopic extends IResource {
/**
* The ARN of the topic
*
* @attribute
*/
readonly topicArn: string;

/**
* The name of the topic
*
* @attribute
*/
readonly topicName: string;
Expand Down
7 changes: 7 additions & 0 deletions packages/@aws-cdk/aws-sns/lib/topic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ export interface TopicProps {
*/
export class Topic extends TopicBase {

/**
* Import an existing SNS topic provided an ARN
*
* @param scope The parent creating construct
* @param id The construct's name
* @param topicArn topic ARN (i.e. arn:aws:sns:us-east-2:444455556666:MyTopic)
*/
public static fromTopicArn(scope: Construct, id: string, topicArn: string): ITopic {
class Import extends TopicBase {
public readonly topicArn = topicArn;
Expand Down
24 changes: 1 addition & 23 deletions packages/@aws-cdk/aws-sns/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,30 +96,8 @@
},
"awslint": {
"exclude": [
"construct-base-is-private:@aws-cdk/aws-sns.TopicBase",
"props-physical-name:@aws-cdk/aws-sns.SubscriptionProps",
"props-physical-name:@aws-cdk/aws-sns.TopicPolicyProps",
"docs-public-apis:@aws-cdk/aws-sns.ITopic.topicName",
"docs-public-apis:@aws-cdk/aws-sns.TopicPolicyProps",
"props-default-doc:@aws-cdk/aws-sns.StringConditions.whitelist",
"props-default-doc:@aws-cdk/aws-sns.StringConditions.matchPrefixes",
"props-default-doc:@aws-cdk/aws-sns.StringConditions.blacklist",
"docs-public-apis:@aws-cdk/aws-sns.SubscriptionFilter.conditions",
"docs-public-apis:@aws-cdk/aws-sns.Topic.topicArn",
"docs-public-apis:@aws-cdk/aws-sns.Topic.topicName",
"docs-public-apis:@aws-cdk/aws-sns.Topic.fromTopicArn",
"docs-public-apis:@aws-cdk/aws-sns.TopicBase.topicArn",
"docs-public-apis:@aws-cdk/aws-sns.TopicBase.topicName",
"docs-public-apis:@aws-cdk/aws-sns.ITopic",
"docs-public-apis:@aws-cdk/aws-sns.ITopic.topicArn",
"props-default-doc:@aws-cdk/aws-sns.NumericConditions.whitelist",
"docs-public-apis:@aws-cdk/aws-sns.ITopicSubscription.bind",
"props-default-doc:@aws-cdk/aws-sns.NumericConditions.between",
"props-default-doc:@aws-cdk/aws-sns.NumericConditions.betweenStrict",
"props-default-doc:@aws-cdk/aws-sns.NumericConditions.greaterThan",
"props-default-doc:@aws-cdk/aws-sns.NumericConditions.greaterThanOrEqualTo",
"props-default-doc:@aws-cdk/aws-sns.NumericConditions.lessThan",
"props-default-doc:@aws-cdk/aws-sns.NumericConditions.lessThanOrEqualTo"
"props-physical-name:@aws-cdk/aws-sns.TopicPolicyProps"
]
},
"stability": "stable",
Expand Down

0 comments on commit 2008b91

Please sign in to comment.