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

export interface SourcePortRangeArgs extends core.SchemaArgs {
  fromPort?: number | core.NumberOut;

  toPort?: number | core.NumberOut;
}

export class SourcePortRange extends core.Schema<SourcePortRangeArgs> {
  @core.attr(Number)
  public fromPort?: number | core.NumberOut;

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

export interface DestinationPortRangeArgs extends core.SchemaArgs {
  fromPort?: number | core.NumberOut;

  toPort?: number | core.NumberOut;
}

export class DestinationPortRange extends core.Schema<DestinationPortRangeArgs> {
  @core.attr(Number)
  public fromPort?: number | core.NumberOut;

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

export interface Ec2TrafficMirrorFilterRuleArgs extends core.ResourceArgs {
  description?: string | core.StringOut;

  destinationCidrBlock: string | core.StringOut;

  destinationPortRange?: DestinationPortRange;

  protocol?: number | core.NumberOut;

  ruleAction: string | core.StringOut;

  ruleNumber: number | core.NumberOut;

  sourceCidrBlock: string | core.StringOut;

  sourcePortRange?: SourcePortRange;

  trafficDirection: string | core.StringOut;

  trafficMirrorFilterId: string | core.StringOut;
}

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

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

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

  @core.attr(DestinationPortRange)
  public destinationPortRange?: DestinationPortRange;

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

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

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

  @core.attr(Number)
  public ruleNumber!: number | core.NumberOut;

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

  @core.attr(SourcePortRange)
  public sourcePortRange?: SourcePortRange;

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

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

  constructor(name: string, args?: Ec2TrafficMirrorFilterRuleArgs) {
    super(name, "aws_ec2_traffic_mirror_filter_rule", args);
  }

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