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

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

  value: string | core.StringOut;
}

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

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

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

  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(IpSetDescriptor, { kind: "array" })
  public ipSetDescriptor?:
    | core.Array<IpSetDescriptor>
    | core.ArrayOut<IpSetDescriptor>;

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

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

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