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

export interface ShareDistributionArgs extends core.SchemaArgs {
  shareIdentifier: string | core.StringOut;

  weightFactor: number | core.NumberOut;
}

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

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

export interface FairSharePolicyArgs extends core.SchemaArgs {
  computeReservation: number | core.NumberOut;

  shareDecaySeconds: number | core.NumberOut;

  shareDistribution:
    | core.Array<ShareDistribution>
    | core.ArrayOut<ShareDistribution>;
}

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

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

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

export interface DsSchedulingPolicyArgs {
  arn: string | core.StringOut;

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

export class DsSchedulingPolicy extends core.Data<DsSchedulingPolicyArgs> {
  @core.attr(String)
  public arn!: string | core.StringOut;

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

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

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

  @core.attr(String, { computed: true, kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  constructor(name: string, args?: DsSchedulingPolicyArgs) {
    super(name, "aws_batch_scheduling_policy", args);
  }

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