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

export interface RulesArgs extends core.SchemaArgs {
  description?: string | core.StringOut;

  source: string | core.StringOut;
}

export class Rules extends core.Schema<RulesArgs> {
  @core.attr(String)
  public description?: string | core.StringOut;

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

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

  name: string | core.StringOut;

  rules?: core.Array<Rules> | core.ArrayOut<Rules>;

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

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

export class IpGroup extends core.Resource<IpGroupArgs> {
  @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(Rules, { kind: "array" })
  public rules?: core.Array<Rules> | core.ArrayOut<Rules>;

  @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>;

  constructor(name: string, args?: IpGroupArgs) {
    super(name, "aws_workspaces_ip_group", args);
  }

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