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

export interface RunConfigArgs extends core.SchemaArgs {
  activeTracing?: boolean | core.BooleanOut;

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

  memoryInMb?: number | core.NumberOut;

  timeoutInSeconds?: number | core.NumberOut;
}

export class RunConfig extends core.Schema<RunConfigArgs> {
  @core.attr(Boolean)
  public activeTracing?: boolean | core.BooleanOut;

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

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

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

export interface VpcConfigArgs extends core.SchemaArgs {
  securityGroupIds?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

  vpcId: string | core.StringOut;
}

export class VpcConfig extends core.Schema<VpcConfigArgs> {
  @core.attr(String, { kind: "array" })
  public securityGroupIds?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

export interface ScheduleArgs extends core.SchemaArgs {
  durationInSeconds?: number | core.NumberOut;

  expression: string | core.StringOut;
}

export class Schedule extends core.Schema<ScheduleArgs> {
  @core.attr(Number)
  public durationInSeconds?: number | core.NumberOut;

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

export interface S3EncryptionArgs extends core.SchemaArgs {
  encryptionMode?: string | core.StringOut;

  kmsKeyArn?: string | core.StringOut;
}

export class S3Encryption extends core.Schema<S3EncryptionArgs> {
  @core.attr(String)
  public encryptionMode?: string | core.StringOut;

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

export interface ArtifactConfigArgs extends core.SchemaArgs {
  s3Encryption?: S3Encryption;
}

export class ArtifactConfig extends core.Schema<ArtifactConfigArgs> {
  @core.attr(S3Encryption)
  public s3Encryption?: S3Encryption;
}

export interface TimelineArgs extends core.SchemaArgs {
  created: string | core.StringOut;

  lastModified: string | core.StringOut;

  lastStarted: string | core.StringOut;

  lastStopped: string | core.StringOut;
}

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

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

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

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

export interface CanaryArgs extends core.ResourceArgs {
  artifactConfig?: ArtifactConfig;

  artifactS3Location: string | core.StringOut;

  deleteLambda?: boolean | core.BooleanOut;

  executionRoleArn: string | core.StringOut;

  failureRetentionPeriod?: number | core.NumberOut;

  handler: string | core.StringOut;

  name: string | core.StringOut;

  runConfig?: RunConfig;

  runtimeVersion: string | core.StringOut;

  s3Bucket?: string | core.StringOut;

  s3Key?: string | core.StringOut;

  s3Version?: string | core.StringOut;

  schedule: Schedule;

  startCanary?: boolean | core.BooleanOut;

  successRetentionPeriod?: number | core.NumberOut;

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

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

  vpcConfig?: VpcConfig;

  zipFile?: string | core.StringOut;
}

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

  @core.attr(ArtifactConfig)
  public artifactConfig?: ArtifactConfig;

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

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

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

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

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

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

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

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

  @core.attr(RunConfig, { computed: true })
  public runConfig?: RunConfig;

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

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

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

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

  @core.attr(Schedule)
  public schedule!: Schedule;

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

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

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

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

  @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(Timeline, { computed: true, kind: "array" })
  public timeline!: core.Array<Timeline> | core.ArrayOut<Timeline>;

  @core.attr(VpcConfig)
  public vpcConfig?: VpcConfig;

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

  constructor(name: string, args?: CanaryArgs) {
    super(name, "aws_synthetics_canary", args);
  }

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