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

export interface AppMonitorConfigurationArgs extends core.SchemaArgs {
  allowCookies?: boolean | core.BooleanOut;

  enableXray?: boolean | core.BooleanOut;

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

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

  guestRoleArn?: string | core.StringOut;

  identityPoolId?: string | core.StringOut;

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

  sessionSampleRate?: number | core.NumberOut;

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

export class AppMonitorConfiguration extends core.Schema<AppMonitorConfigurationArgs> {
  @core.attr(Boolean)
  public allowCookies?: boolean | core.BooleanOut;

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

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

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

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

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

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

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

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

export interface AppMonitorArgs extends core.ResourceArgs {
  appMonitorConfiguration?: AppMonitorConfiguration;

  cwLogEnabled?: boolean | core.BooleanOut;

  domain: string | core.StringOut;

  name: string | core.StringOut;

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

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

export class AppMonitor extends core.Resource<AppMonitorArgs> {
  @core.attr(AppMonitorConfiguration, { computed: true })
  public appMonitorConfiguration?: AppMonitorConfiguration;

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

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

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

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

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

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

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