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

export interface HealthCheckCustomConfigArgs extends core.SchemaArgs {
  failureThreshold: number | core.NumberOut;
}

export class HealthCheckCustomConfig extends core.Schema<HealthCheckCustomConfigArgs> {
  @core.attr(Number, { computed: true })
  public failureThreshold!: number | core.NumberOut;
}

export interface DnsRecordsArgs extends core.SchemaArgs {
  ttl: number | core.NumberOut;

  type: string | core.StringOut;
}

export class DnsRecords extends core.Schema<DnsRecordsArgs> {
  @core.attr(Number, { computed: true })
  public ttl!: number | core.NumberOut;

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

export interface DnsConfigArgs extends core.SchemaArgs {
  dnsRecords: core.Array<DnsRecords> | core.ArrayOut<DnsRecords>;

  namespaceId: string | core.StringOut;

  routingPolicy: string | core.StringOut;
}

export class DnsConfig extends core.Schema<DnsConfigArgs> {
  @core.attr(DnsRecords, { computed: true, kind: "array" })
  public dnsRecords!: core.Array<DnsRecords> | core.ArrayOut<DnsRecords>;

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

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

export interface HealthCheckConfigArgs extends core.SchemaArgs {
  failureThreshold: number | core.NumberOut;

  resourcePath: string | core.StringOut;

  type: string | core.StringOut;
}

export class HealthCheckConfig extends core.Schema<HealthCheckConfigArgs> {
  @core.attr(Number, { computed: true })
  public failureThreshold!: number | core.NumberOut;

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

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

export interface DsServiceDiscoveryServiceArgs {
  name: string | core.StringOut;

  namespaceId: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

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