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

export interface DataResourceArgs extends core.SchemaArgs {
  type: string | core.StringOut;

  values: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class DataResource extends core.Schema<DataResourceArgs> {
  @core.attr(String)
  public type!: string | core.StringOut;

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

export interface EventSelectorArgs extends core.SchemaArgs {
  dataResource?: core.Array<DataResource> | core.ArrayOut<DataResource>;

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

  includeManagementEvents?: boolean | core.BooleanOut;

  readWriteType?: string | core.StringOut;
}

export class EventSelector extends core.Schema<EventSelectorArgs> {
  @core.attr(DataResource, { kind: "array" })
  public dataResource?: core.Array<DataResource> | core.ArrayOut<DataResource>;

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

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

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

export interface InsightSelectorArgs extends core.SchemaArgs {
  insightType: string | core.StringOut;
}

export class InsightSelector extends core.Schema<InsightSelectorArgs> {
  @core.attr(String)
  public insightType!: string | core.StringOut;
}

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

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

  field: string | core.StringOut;

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

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

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

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

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

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

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

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

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

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

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

export interface AdvancedEventSelectorArgs extends core.SchemaArgs {
  fieldSelector: core.Array<FieldSelector> | core.ArrayOut<FieldSelector>;

  name?: string | core.StringOut;
}

export class AdvancedEventSelector extends core.Schema<AdvancedEventSelectorArgs> {
  @core.attr(FieldSelector, { kind: "array" })
  public fieldSelector!:
    | core.Array<FieldSelector>
    | core.ArrayOut<FieldSelector>;

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

export interface MainArgs extends core.ResourceArgs {
  advancedEventSelector?:
    | core.Array<AdvancedEventSelector>
    | core.ArrayOut<AdvancedEventSelector>;

  cloudWatchLogsGroupArn?: string | core.StringOut;

  cloudWatchLogsRoleArn?: string | core.StringOut;

  enableLogFileValidation?: boolean | core.BooleanOut;

  enableLogging?: boolean | core.BooleanOut;

  eventSelector?: core.Array<EventSelector> | core.ArrayOut<EventSelector>;

  includeGlobalServiceEvents?: boolean | core.BooleanOut;

  insightSelector?:
    | core.Array<InsightSelector>
    | core.ArrayOut<InsightSelector>;

  isMultiRegionTrail?: boolean | core.BooleanOut;

  isOrganizationTrail?: boolean | core.BooleanOut;

  kmsKeyId?: string | core.StringOut;

  name: string | core.StringOut;

  s3BucketName: string | core.StringOut;

  s3KeyPrefix?: string | core.StringOut;

  snsTopicName?: string | core.StringOut;

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

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

export class Main extends core.Resource<MainArgs> {
  @core.attr(AdvancedEventSelector, { kind: "array" })
  public advancedEventSelector?:
    | core.Array<AdvancedEventSelector>
    | core.ArrayOut<AdvancedEventSelector>;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(String)
  public snsTopicName?: 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?: MainArgs) {
    super(name, "aws_cloudtrail", args);
  }

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