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

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 ActionsArgs extends core.SchemaArgs {
  arguments?: core.Map<string, string> | core.MapOut<core.StringOut>;

  crawlerName?: string | core.StringOut;

  jobName?: string | core.StringOut;

  notificationProperty?: NotificationProperty;

  securityConfiguration?: string | core.StringOut;

  timeout?: number | core.NumberOut;
}

export class Actions extends core.Schema<ActionsArgs> {
  @core.attr(String, { kind: "map" })
  public arguments?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

  @core.attr(NotificationProperty)
  public notificationProperty?: NotificationProperty;

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

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

export interface ConditionsArgs extends core.SchemaArgs {
  crawlState?: string | core.StringOut;

  crawlerName?: string | core.StringOut;

  jobName?: string | core.StringOut;

  logicalOperator?: string | core.StringOut;

  state?: string | core.StringOut;
}

export class Conditions extends core.Schema<ConditionsArgs> {
  @core.attr(String)
  public crawlState?: string | core.StringOut;

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

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

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

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

export interface PredicateArgs extends core.SchemaArgs {
  conditions: core.Array<Conditions> | core.ArrayOut<Conditions>;

  logical?: string | core.StringOut;
}

export class Predicate extends core.Schema<PredicateArgs> {
  @core.attr(Conditions, { kind: "array" })
  public conditions!: core.Array<Conditions> | core.ArrayOut<Conditions>;

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

export interface EventBatchingConditionArgs extends core.SchemaArgs {
  batchSize: number | core.NumberOut;

  batchWindow?: number | core.NumberOut;
}

export class EventBatchingCondition extends core.Schema<EventBatchingConditionArgs> {
  @core.attr(Number)
  public batchSize!: number | core.NumberOut;

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

export interface TriggerArgs extends core.ResourceArgs {
  actions: core.Array<Actions> | core.ArrayOut<Actions>;

  description?: string | core.StringOut;

  enabled?: boolean | core.BooleanOut;

  eventBatchingCondition?:
    | core.Array<EventBatchingCondition>
    | core.ArrayOut<EventBatchingCondition>;

  name: string | core.StringOut;

  predicate?: Predicate;

  schedule?: string | core.StringOut;

  startOnCreation?: boolean | core.BooleanOut;

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

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

  type: string | core.StringOut;

  workflowName?: string | core.StringOut;
}

export class Trigger extends core.Resource<TriggerArgs> {
  @core.attr(Actions, { kind: "array" })
  public actions!: core.Array<Actions> | core.ArrayOut<Actions>;

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

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

  @core.attr(Boolean)
  public enabled?: boolean | core.BooleanOut;

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

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

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

  @core.attr(Predicate)
  public predicate?: Predicate;

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

  @core.attr(Boolean)
  public startOnCreation?: boolean | core.BooleanOut;

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

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

  constructor(name: string, args?: TriggerArgs) {
    super(name, "aws_glue_trigger", args);
  }

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