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

export interface AliasArgs extends core.SchemaArgs {
  evaluateTargetHealth: boolean | core.BooleanOut;

  name: string | core.StringOut;

  zoneId: string | core.StringOut;
}

export class Alias extends core.Schema<AliasArgs> {
  @core.attr(Boolean)
  public evaluateTargetHealth!: boolean | core.BooleanOut;

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

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

export interface LatencyRoutingPolicyArgs extends core.SchemaArgs {
  region: string | core.StringOut;
}

export class LatencyRoutingPolicy extends core.Schema<LatencyRoutingPolicyArgs> {
  @core.attr(String)
  public region!: string | core.StringOut;
}

export interface GeolocationRoutingPolicyArgs extends core.SchemaArgs {
  continent?: string | core.StringOut;

  country?: string | core.StringOut;

  subdivision?: string | core.StringOut;
}

export class GeolocationRoutingPolicy extends core.Schema<GeolocationRoutingPolicyArgs> {
  @core.attr(String)
  public continent?: string | core.StringOut;

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

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

export interface WeightedRoutingPolicyArgs extends core.SchemaArgs {
  weight: number | core.NumberOut;
}

export class WeightedRoutingPolicy extends core.Schema<WeightedRoutingPolicyArgs> {
  @core.attr(Number)
  public weight!: number | core.NumberOut;
}

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

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

export interface RecordArgs extends core.ResourceArgs {
  alias?: core.Array<Alias> | core.ArrayOut<Alias>;

  allowOverwrite?: boolean | core.BooleanOut;

  failoverRoutingPolicy?:
    | core.Array<FailoverRoutingPolicy>
    | core.ArrayOut<FailoverRoutingPolicy>;

  geolocationRoutingPolicy?:
    | core.Array<GeolocationRoutingPolicy>
    | core.ArrayOut<GeolocationRoutingPolicy>;

  healthCheckId?: string | core.StringOut;

  latencyRoutingPolicy?:
    | core.Array<LatencyRoutingPolicy>
    | core.ArrayOut<LatencyRoutingPolicy>;

  multivalueAnswerRoutingPolicy?: boolean | core.BooleanOut;

  name: string | core.StringOut;

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

  setIdentifier?: string | core.StringOut;

  ttl?: number | core.NumberOut;

  type: string | core.StringOut;

  weightedRoutingPolicy?:
    | core.Array<WeightedRoutingPolicy>
    | core.ArrayOut<WeightedRoutingPolicy>;

  zoneId: string | core.StringOut;
}

export class Record extends core.Resource<RecordArgs> {
  @core.attr(Alias, { kind: "array" })
  public alias?: core.Array<Alias> | core.ArrayOut<Alias>;

  @core.attr(Boolean, { computed: true })
  public allowOverwrite?: boolean | core.BooleanOut;

  @core.attr(FailoverRoutingPolicy, { kind: "array" })
  public failoverRoutingPolicy?:
    | core.Array<FailoverRoutingPolicy>
    | core.ArrayOut<FailoverRoutingPolicy>;

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

  @core.attr(GeolocationRoutingPolicy, { kind: "array" })
  public geolocationRoutingPolicy?:
    | core.Array<GeolocationRoutingPolicy>
    | core.ArrayOut<GeolocationRoutingPolicy>;

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

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

  @core.attr(LatencyRoutingPolicy, { kind: "array" })
  public latencyRoutingPolicy?:
    | core.Array<LatencyRoutingPolicy>
    | core.ArrayOut<LatencyRoutingPolicy>;

  @core.attr(Boolean)
  public multivalueAnswerRoutingPolicy?: boolean | core.BooleanOut;

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

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

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

  @core.attr(Number)
  public ttl?: number | core.NumberOut;

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

  @core.attr(WeightedRoutingPolicy, { kind: "array" })
  public weightedRoutingPolicy?:
    | core.Array<WeightedRoutingPolicy>
    | core.ArrayOut<WeightedRoutingPolicy>;

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

  constructor(name: string, args?: RecordArgs) {
    super(name, "aws_route53_record", args);
  }

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