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

export interface TargetIpArgs extends core.SchemaArgs {
  ip: string | core.StringOut;

  port?: number | core.NumberOut;
}

export class TargetIp extends core.Schema<TargetIpArgs> {
  @core.attr(String)
  public ip!: string | core.StringOut;

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

export interface RuleArgs extends core.ResourceArgs {
  domainName: string | core.StringOut;

  name?: string | core.StringOut;

  resolverEndpointId?: string | core.StringOut;

  ruleType: string | core.StringOut;

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

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

  targetIp?: core.Array<TargetIp> | core.ArrayOut<TargetIp>;
}

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

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

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

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

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

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

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

  @core.attr(String, { computed: true })
  public shareStatus!: 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>;

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

  constructor(name: string, args?: RuleArgs) {
    super(name, "aws_route53_resolver_rule", args);
  }

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