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

export interface PhysicalConnectionRequirementsArgs extends core.SchemaArgs {
  availabilityZone?: string | core.StringOut;

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

  subnetId?: string | core.StringOut;
}

export class PhysicalConnectionRequirements extends core.Schema<PhysicalConnectionRequirementsArgs> {
  @core.attr(String)
  public availabilityZone?: string | core.StringOut;

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

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

export interface ConnectionArgs extends core.ResourceArgs {
  catalogId?: string | core.StringOut;

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

  connectionType?: string | core.StringOut;

  description?: string | core.StringOut;

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

  name: string | core.StringOut;

  physicalConnectionRequirements?: PhysicalConnectionRequirements;

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

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

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

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

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

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

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

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

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

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

  @core.attr(PhysicalConnectionRequirements)
  public physicalConnectionRequirements?: PhysicalConnectionRequirements;

  @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?: ConnectionArgs) {
    super(name, "aws_glue_connection", args);
  }

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