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

export interface S3LogsArgs extends core.SchemaArgs {
  enable: boolean | core.BooleanOut;
}

export class S3Logs extends core.Schema<S3LogsArgs> {
  @core.attr(Boolean)
  public enable!: boolean | core.BooleanOut;
}

export interface AuditLogsArgs extends core.SchemaArgs {
  enable: boolean | core.BooleanOut;
}

export class AuditLogs extends core.Schema<AuditLogsArgs> {
  @core.attr(Boolean)
  public enable!: boolean | core.BooleanOut;
}

export interface KubernetesArgs extends core.SchemaArgs {
  auditLogs: AuditLogs;
}

export class Kubernetes extends core.Schema<KubernetesArgs> {
  @core.attr(AuditLogs)
  public auditLogs!: AuditLogs;
}

export interface EbsVolumesArgs extends core.SchemaArgs {
  enable: boolean | core.BooleanOut;
}

export class EbsVolumes extends core.Schema<EbsVolumesArgs> {
  @core.attr(Boolean)
  public enable!: boolean | core.BooleanOut;
}

export interface ScanEc2InstanceWithFindingsArgs extends core.SchemaArgs {
  ebsVolumes: EbsVolumes;
}

export class ScanEc2InstanceWithFindings extends core.Schema<ScanEc2InstanceWithFindingsArgs> {
  @core.attr(EbsVolumes)
  public ebsVolumes!: EbsVolumes;
}

export interface MalwareProtectionArgs extends core.SchemaArgs {
  scanEc2InstanceWithFindings: ScanEc2InstanceWithFindings;
}

export class MalwareProtection extends core.Schema<MalwareProtectionArgs> {
  @core.attr(ScanEc2InstanceWithFindings)
  public scanEc2InstanceWithFindings!: ScanEc2InstanceWithFindings;
}

export interface DatasourcesArgs extends core.SchemaArgs {
  kubernetes?: Kubernetes;

  malwareProtection?: MalwareProtection;

  s3Logs?: S3Logs;
}

export class Datasources extends core.Schema<DatasourcesArgs> {
  @core.attr(Kubernetes, { computed: true })
  public kubernetes?: Kubernetes;

  @core.attr(MalwareProtection, { computed: true })
  public malwareProtection?: MalwareProtection;

  @core.attr(S3Logs, { computed: true })
  public s3Logs?: S3Logs;
}

export interface DetectorArgs extends core.ResourceArgs {
  datasources?: Datasources;

  enable?: boolean | core.BooleanOut;

  findingPublishingFrequency?: string | core.StringOut;

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

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

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

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

  @core.attr(Datasources, { computed: true })
  public datasources?: Datasources;

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

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

  @core.attr(String, { computed: true })
  public id!: 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?: DetectorArgs) {
    super(name, "aws_guardduty_detector", args);
  }

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