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

export interface ExecutionPropertyArgs extends core.SchemaArgs {
  maxConcurrentRuns?: number | core.NumberOut;
}

export class ExecutionProperty extends core.Schema<ExecutionPropertyArgs> {
  @core.attr(Number)
  public maxConcurrentRuns?: number | core.NumberOut;
}

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

  pythonVersion?: string | core.StringOut;

  scriptLocation: string | core.StringOut;
}

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

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

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

export interface NotificationPropertyArgs extends core.SchemaArgs {
  notifyDelayAfter?: number | core.NumberOut;
}

export class NotificationProperty extends core.Schema<NotificationPropertyArgs> {
  @core.attr(Number)
  public notifyDelayAfter?: number | core.NumberOut;
}

export interface JobArgs extends core.ResourceArgs {
  command: Command;

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

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

  description?: string | core.StringOut;

  executionClass?: string | core.StringOut;

  executionProperty?: ExecutionProperty;

  glueVersion?: string | core.StringOut;

  maxCapacity?: number | core.NumberOut;

  maxRetries?: number | core.NumberOut;

  name: string | core.StringOut;

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

  notificationProperty?: NotificationProperty;

  numberOfWorkers?: number | core.NumberOut;

  roleArn: string | core.StringOut;

  securityConfiguration?: string | core.StringOut;

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

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

  timeout?: number | core.NumberOut;

  workerType?: string | core.StringOut;
}

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

  @core.attr(Command)
  public command!: Command;

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

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

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

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

  @core.attr(ExecutionProperty, { computed: true })
  public executionProperty?: ExecutionProperty;

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

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

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

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

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

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

  @core.attr(NotificationProperty, { computed: true })
  public notificationProperty?: NotificationProperty;

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

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

  @core.attr(String)
  public securityConfiguration?: 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(Number, { computed: true })
  public timeout?: number | core.NumberOut;

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

  constructor(name: string, args?: JobArgs) {
    super(name, "aws_glue_job", args);
  }

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