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

export interface PolicyAttributeArgs extends core.SchemaArgs {
  name?: string | core.StringOut;

  value?: string | core.StringOut;
}

export class PolicyAttribute extends core.Schema<PolicyAttributeArgs> {
  @core.attr(String)
  public name?: string | core.StringOut;

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

export interface LoadBalancerPolicyArgs extends core.ResourceArgs {
  loadBalancerName: string | core.StringOut;

  policyAttribute?:
    | core.Array<PolicyAttribute>
    | core.ArrayOut<PolicyAttribute>;

  policyName: string | core.StringOut;

  policyTypeName: string | core.StringOut;
}

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

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

  @core.attr(PolicyAttribute, { computed: true, kind: "array" })
  public policyAttribute?:
    | core.Array<PolicyAttribute>
    | core.ArrayOut<PolicyAttribute>;

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

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

  constructor(name: string, args?: LoadBalancerPolicyArgs) {
    super(name, "aws_load_balancer_policy", args);
  }

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