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

export interface PortSetArgs extends core.SchemaArgs {
  definition: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class PortSet extends core.Schema<PortSetArgs> {
  @core.attr(String, { kind: "array" })
  public definition!: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface PortSetsArgs extends core.SchemaArgs {
  key: string | core.StringOut;

  portSet: PortSet;
}

export class PortSets extends core.Schema<PortSetsArgs> {
  @core.attr(String)
  public key!: string | core.StringOut;

  @core.attr(PortSet)
  public portSet!: PortSet;
}

export interface IpSetArgs extends core.SchemaArgs {
  definition: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class IpSet extends core.Schema<IpSetArgs> {
  @core.attr(String, { kind: "array" })
  public definition!: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface IpSetsArgs extends core.SchemaArgs {
  ipSet: IpSet;

  key: string | core.StringOut;
}

export class IpSets extends core.Schema<IpSetsArgs> {
  @core.attr(IpSet)
  public ipSet!: IpSet;

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

export interface RuleVariablesArgs extends core.SchemaArgs {
  ipSets?: core.Array<IpSets> | core.ArrayOut<IpSets>;

  portSets?: core.Array<PortSets> | core.ArrayOut<PortSets>;
}

export class RuleVariables extends core.Schema<RuleVariablesArgs> {
  @core.attr(IpSets, { kind: "array" })
  public ipSets?: core.Array<IpSets> | core.ArrayOut<IpSets>;

  @core.attr(PortSets, { kind: "array" })
  public portSets?: core.Array<PortSets> | core.ArrayOut<PortSets>;
}

export interface RulesSourceListArgs extends core.SchemaArgs {
  generatedRulesType: string | core.StringOut;

  targetTypes: core.Array<string> | core.ArrayOut<core.StringOut>;

  targets: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class RulesSourceList extends core.Schema<RulesSourceListArgs> {
  @core.attr(String)
  public generatedRulesType!: string | core.StringOut;

  @core.attr(String, { kind: "array" })
  public targetTypes!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { kind: "array" })
  public targets!: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface HeaderArgs extends core.SchemaArgs {
  destination: string | core.StringOut;

  destinationPort: string | core.StringOut;

  direction: string | core.StringOut;

  protocol: string | core.StringOut;

  source: string | core.StringOut;

  sourcePort: string | core.StringOut;
}

export class Header extends core.Schema<HeaderArgs> {
  @core.attr(String)
  public destination!: string | core.StringOut;

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

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

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

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

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

export interface RuleOptionArgs extends core.SchemaArgs {
  keyword: string | core.StringOut;

  settings?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class RuleOption extends core.Schema<RuleOptionArgs> {
  @core.attr(String)
  public keyword!: string | core.StringOut;

  @core.attr(String, { kind: "array" })
  public settings?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface StatefulRuleArgs extends core.SchemaArgs {
  action: string | core.StringOut;

  header: Header;

  ruleOption: core.Array<RuleOption> | core.ArrayOut<RuleOption>;
}

export class StatefulRule extends core.Schema<StatefulRuleArgs> {
  @core.attr(String)
  public action!: string | core.StringOut;

  @core.attr(Header)
  public header!: Header;

  @core.attr(RuleOption, { kind: "array" })
  public ruleOption!: core.Array<RuleOption> | core.ArrayOut<RuleOption>;
}

export interface DimensionArgs extends core.SchemaArgs {
  value: string | core.StringOut;
}

export class Dimension extends core.Schema<DimensionArgs> {
  @core.attr(String)
  public value!: string | core.StringOut;
}

export interface PublishMetricActionArgs extends core.SchemaArgs {
  dimension: core.Array<Dimension> | core.ArrayOut<Dimension>;
}

export class PublishMetricAction extends core.Schema<PublishMetricActionArgs> {
  @core.attr(Dimension, { kind: "array" })
  public dimension!: core.Array<Dimension> | core.ArrayOut<Dimension>;
}

export interface ActionDefinitionArgs extends core.SchemaArgs {
  publishMetricAction: PublishMetricAction;
}

export class ActionDefinition extends core.Schema<ActionDefinitionArgs> {
  @core.attr(PublishMetricAction)
  public publishMetricAction!: PublishMetricAction;
}

export interface CustomActionArgs extends core.SchemaArgs {
  actionDefinition: ActionDefinition;

  actionName: string | core.StringOut;
}

export class CustomAction extends core.Schema<CustomActionArgs> {
  @core.attr(ActionDefinition)
  public actionDefinition!: ActionDefinition;

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

export interface TcpFlagArgs extends core.SchemaArgs {
  flags: core.Array<string> | core.ArrayOut<core.StringOut>;

  masks?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class TcpFlag extends core.Schema<TcpFlagArgs> {
  @core.attr(String, { kind: "array" })
  public flags!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { kind: "array" })
  public masks?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface DestinationArgs extends core.SchemaArgs {
  addressDefinition: string | core.StringOut;
}

export class Destination extends core.Schema<DestinationArgs> {
  @core.attr(String)
  public addressDefinition!: string | core.StringOut;
}

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

  toPort?: number | core.NumberOut;
}

export class DestinationPort extends core.Schema<DestinationPortArgs> {
  @core.attr(Number)
  public fromPort!: number | core.NumberOut;

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

export interface SourceArgs extends core.SchemaArgs {
  addressDefinition: string | core.StringOut;
}

export class Source extends core.Schema<SourceArgs> {
  @core.attr(String)
  public addressDefinition!: string | core.StringOut;
}

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

  toPort?: number | core.NumberOut;
}

export class SourcePort extends core.Schema<SourcePortArgs> {
  @core.attr(Number)
  public fromPort!: number | core.NumberOut;

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

export interface MatchAttributesArgs extends core.SchemaArgs {
  destination?: core.Array<Destination> | core.ArrayOut<Destination>;

  destinationPort?:
    | core.Array<DestinationPort>
    | core.ArrayOut<DestinationPort>;

  protocols?: core.Array<number> | core.ArrayOut<core.NumberOut>;

  source?: core.Array<Source> | core.ArrayOut<Source>;

  sourcePort?: core.Array<SourcePort> | core.ArrayOut<SourcePort>;

  tcpFlag?: core.Array<TcpFlag> | core.ArrayOut<TcpFlag>;
}

export class MatchAttributes extends core.Schema<MatchAttributesArgs> {
  @core.attr(Destination, { kind: "array" })
  public destination?: core.Array<Destination> | core.ArrayOut<Destination>;

  @core.attr(DestinationPort, { kind: "array" })
  public destinationPort?:
    | core.Array<DestinationPort>
    | core.ArrayOut<DestinationPort>;

  @core.attr(Number, { kind: "array" })
  public protocols?: core.Array<number> | core.ArrayOut<core.NumberOut>;

  @core.attr(Source, { kind: "array" })
  public source?: core.Array<Source> | core.ArrayOut<Source>;

  @core.attr(SourcePort, { kind: "array" })
  public sourcePort?: core.Array<SourcePort> | core.ArrayOut<SourcePort>;

  @core.attr(TcpFlag, { kind: "array" })
  public tcpFlag?: core.Array<TcpFlag> | core.ArrayOut<TcpFlag>;
}

export interface RuleDefinitionArgs extends core.SchemaArgs {
  actions: core.Array<string> | core.ArrayOut<core.StringOut>;

  matchAttributes: MatchAttributes;
}

export class RuleDefinition extends core.Schema<RuleDefinitionArgs> {
  @core.attr(String, { kind: "array" })
  public actions!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(MatchAttributes)
  public matchAttributes!: MatchAttributes;
}

export interface StatelessRuleArgs extends core.SchemaArgs {
  priority: number | core.NumberOut;

  ruleDefinition: RuleDefinition;
}

export class StatelessRule extends core.Schema<StatelessRuleArgs> {
  @core.attr(Number)
  public priority!: number | core.NumberOut;

  @core.attr(RuleDefinition)
  public ruleDefinition!: RuleDefinition;
}

export interface StatelessRulesAndCustomActionsArgs extends core.SchemaArgs {
  customAction?: core.Array<CustomAction> | core.ArrayOut<CustomAction>;

  statelessRule: core.Array<StatelessRule> | core.ArrayOut<StatelessRule>;
}

export class StatelessRulesAndCustomActions extends core.Schema<StatelessRulesAndCustomActionsArgs> {
  @core.attr(CustomAction, { kind: "array" })
  public customAction?: core.Array<CustomAction> | core.ArrayOut<CustomAction>;

  @core.attr(StatelessRule, { kind: "array" })
  public statelessRule!:
    | core.Array<StatelessRule>
    | core.ArrayOut<StatelessRule>;
}

export interface RulesSourceArgs extends core.SchemaArgs {
  rulesSourceList?: RulesSourceList;

  rulesString?: string | core.StringOut;

  statefulRule?: core.Array<StatefulRule> | core.ArrayOut<StatefulRule>;

  statelessRulesAndCustomActions?: StatelessRulesAndCustomActions;
}

export class RulesSource extends core.Schema<RulesSourceArgs> {
  @core.attr(RulesSourceList)
  public rulesSourceList?: RulesSourceList;

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

  @core.attr(StatefulRule, { kind: "array" })
  public statefulRule?: core.Array<StatefulRule> | core.ArrayOut<StatefulRule>;

  @core.attr(StatelessRulesAndCustomActions)
  public statelessRulesAndCustomActions?: StatelessRulesAndCustomActions;
}

export interface StatefulRuleOptionsArgs extends core.SchemaArgs {
  ruleOrder: string | core.StringOut;
}

export class StatefulRuleOptions extends core.Schema<StatefulRuleOptionsArgs> {
  @core.attr(String)
  public ruleOrder!: string | core.StringOut;
}

export interface RuleGroupBlkArgs extends core.SchemaArgs {
  ruleVariables?: RuleVariables;

  rulesSource: RulesSource;

  statefulRuleOptions?: StatefulRuleOptions;
}

export class RuleGroupBlk extends core.Schema<RuleGroupBlkArgs> {
  @core.attr(RuleVariables)
  public ruleVariables?: RuleVariables;

  @core.attr(RulesSource)
  public rulesSource!: RulesSource;

  @core.attr(StatefulRuleOptions)
  public statefulRuleOptions?: StatefulRuleOptions;
}

export interface RuleGroupArgs extends core.ResourceArgs {
  capacity: number | core.NumberOut;

  description?: string | core.StringOut;

  name: string | core.StringOut;

  ruleGroup?: RuleGroupBlk;

  rules?: string | core.StringOut;

  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  type: string | core.StringOut;
}

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

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

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

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

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

  @core.attr(RuleGroupBlk, { computed: true })
  public ruleGroup?: RuleGroupBlk;

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

  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

  constructor(name: string, args?: RuleGroupArgs) {
    super(name, "aws_networkfirewall_rule_group", args);
  }

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