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

export interface IpSetDescriptorsArgs extends core.SchemaArgs {
  type: string | core.StringOut;

  value: string | core.StringOut;
}

export class IpSetDescriptors extends core.Schema<IpSetDescriptorsArgs> {
  @core.attr(String)
  public type!: string | core.StringOut;

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

export interface IpsetArgs extends core.ResourceArgs {
  ipSetDescriptors?:
    | core.Array<IpSetDescriptors>
    | core.ArrayOut<IpSetDescriptors>;

  name: string | core.StringOut;
}

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

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

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

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

  constructor(name: string, args?: IpsetArgs) {
    super(name, "aws_waf_ipset", args);
  }

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