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

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

export class S3Logs extends core.Schema<S3LogsArgs> {
  @core.attr(Boolean)
  public autoEnable!: 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 {
  autoEnable: boolean | core.BooleanOut;
}

export class EbsVolumes extends core.Schema<EbsVolumesArgs> {
  @core.attr(Boolean)
  public autoEnable!: 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 OrganizationConfigurationArgs extends core.ResourceArgs {
  autoEnable: boolean | core.BooleanOut;

  datasources?: Datasources;

  detectorId: string | core.StringOut;
}

export class OrganizationConfiguration extends core.Resource<OrganizationConfigurationArgs> {
  @core.attr(Boolean)
  public autoEnable!: boolean | core.BooleanOut;

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

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

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

  constructor(name: string, args?: OrganizationConfigurationArgs) {
    super(name, "aws_guardduty_organization_configuration", args);
  }

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