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)
  public shareIdentifier!: string | core.StringOut;

  @core.attr(Number)
  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)
  public computeReservation?: number | core.NumberOut;

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

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

export interface SchedulingPolicyArgs extends core.ResourceArgs {
  fairSharePolicy?: FairSharePolicy;

  name: string | core.StringOut;

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

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

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

  @core.attr(FairSharePolicy)
  public fairSharePolicy?: FairSharePolicy;

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

  @core.attr(String)
  public name!: 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?: SchedulingPolicyArgs) {
    super(name, "aws_batch_scheduling_policy", args);
  }

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