import * as core from "@terrascript/core";

export interface TopicSubscriptionArgs extends core.ResourceArgs {
  confirmationTimeoutInMinutes?: number | core.NumberOut;

  deliveryPolicy?: string | core.StringOut;

  endpoint: string | core.StringOut;

  endpointAutoConfirms?: boolean | core.BooleanOut;

  filterPolicy?: string | core.StringOut;

  protocol: string | core.StringOut;

  rawMessageDelivery?: boolean | core.BooleanOut;

  redrivePolicy?: string | core.StringOut;

  subscriptionRoleArn?: string | core.StringOut;

  topicArn: string | core.StringOut;
}

export class TopicSubscription extends core.Resource<TopicSubscriptionArgs> {
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(Number)
  public confirmationTimeoutInMinutes?: number | core.NumberOut;

  @core.attr(Boolean, { computed: true })
  public confirmationWasAuthenticated!: boolean | core.BooleanOut;

  @core.attr(String)
  public deliveryPolicy?: string | core.StringOut;

  @core.attr(String)
  public endpoint!: string | core.StringOut;

  @core.attr(Boolean)
  public endpointAutoConfirms?: boolean | core.BooleanOut;

  @core.attr(String)
  public filterPolicy?: string | core.StringOut;

  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  @core.attr(String, { computed: true })
  public ownerId!: string | core.StringOut;

  @core.attr(Boolean, { computed: true })
  public pendingConfirmation!: boolean | core.BooleanOut;

  @core.attr(String)
  public protocol!: string | core.StringOut;

  @core.attr(Boolean)
  public rawMessageDelivery?: boolean | core.BooleanOut;

  @core.attr(String)
  public redrivePolicy?: string | core.StringOut;

  @core.attr(String)
  public subscriptionRoleArn?: string | core.StringOut;

  @core.attr(String)
  public topicArn!: string | core.StringOut;

  constructor(name: string, args?: TopicSubscriptionArgs) {
    super(name, "aws_sns_topic_subscription", args);
  }

  public override getNamespace(): string {
    return "aws_sns";
  }
}
