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

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, { computed: true, kind: "array" })
  public endsWith?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

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

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

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

  @core.attr(String, { computed: true, 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, { computed: true, kind: "array" })
  public fieldSelector?:
    | core.Array<FieldSelector>
    | core.ArrayOut<FieldSelector>;

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

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

  multiRegionEnabled?: boolean | core.BooleanOut;

  name: string | core.StringOut;

  organizationEnabled?: boolean | core.BooleanOut;

  retentionPeriod?: number | core.NumberOut;

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

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

  terminationProtectionEnabled?: boolean | core.BooleanOut;
}

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

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

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

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

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

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

  @core.attr(Number)
  public retentionPeriod?: 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(Boolean)
  public terminationProtectionEnabled?: boolean | core.BooleanOut;

  constructor(name: string, args?: EventDataStoreArgs) {
    super(name, "aws_cloudtrail_event_data_store", args);
  }

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