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

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

  networkInterfaceId: string | core.StringOut;

  privateIpAddress: string | core.StringOut;

  subnetId: string | core.StringOut;
}

export class NetworkInterface extends core.Schema<NetworkInterfaceArgs> {
  @core.attr(String, { computed: true })
  public availabilityZone!: string | core.StringOut;

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

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

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

export interface VpcEndpointArgs extends core.SchemaArgs {
  networkInterface:
    | core.Array<NetworkInterface>
    | core.ArrayOut<NetworkInterface>;

  vpcEndpointId: string | core.StringOut;

  vpcId: string | core.StringOut;
}

export class VpcEndpoint extends core.Schema<VpcEndpointArgs> {
  @core.attr(NetworkInterface, { computed: true, kind: "array" })
  public networkInterface!:
    | core.Array<NetworkInterface>
    | core.ArrayOut<NetworkInterface>;

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

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

export interface EndpointAccessArgs extends core.ResourceArgs {
  clusterIdentifier: string | core.StringOut;

  endpointName: string | core.StringOut;

  resourceOwner?: string | core.StringOut;

  subnetGroupName: string | core.StringOut;

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

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

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

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

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

  @core.attr(Number, { computed: true })
  public port!: number | core.NumberOut;

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

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

  @core.attr(VpcEndpoint, { computed: true, kind: "array" })
  public vpcEndpoint!: core.Array<VpcEndpoint> | core.ArrayOut<VpcEndpoint>;

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

  constructor(name: string, args?: EndpointAccessArgs) {
    super(name, "aws_redshift_endpoint_access", args);
  }

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