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

export interface ScopeArgs extends core.SchemaArgs {
  complianceResourceId?: string | core.StringOut;

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

  tagKey?: string | core.StringOut;

  tagValue?: string | core.StringOut;
}

export class Scope extends core.Schema<ScopeArgs> {
  @core.attr(String)
  public complianceResourceId?: string | core.StringOut;

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

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

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

export interface CustomPolicyDetailsArgs extends core.SchemaArgs {
  enableDebugLogDelivery?: boolean | core.BooleanOut;

  policyRuntime: string | core.StringOut;

  policyText: string | core.StringOut;
}

export class CustomPolicyDetails extends core.Schema<CustomPolicyDetailsArgs> {
  @core.attr(Boolean)
  public enableDebugLogDelivery?: boolean | core.BooleanOut;

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

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

export interface SourceDetailArgs extends core.SchemaArgs {
  eventSource?: string | core.StringOut;

  maximumExecutionFrequency?: string | core.StringOut;

  messageType?: string | core.StringOut;
}

export class SourceDetail extends core.Schema<SourceDetailArgs> {
  @core.attr(String)
  public eventSource?: string | core.StringOut;

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

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

export interface SourceArgs extends core.SchemaArgs {
  customPolicyDetails?: CustomPolicyDetails;

  owner: string | core.StringOut;

  sourceDetail?: core.Array<SourceDetail> | core.ArrayOut<SourceDetail>;

  sourceIdentifier?: string | core.StringOut;
}

export class Source extends core.Schema<SourceArgs> {
  @core.attr(CustomPolicyDetails)
  public customPolicyDetails?: CustomPolicyDetails;

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

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

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

export interface ConfigRuleArgs extends core.ResourceArgs {
  description?: string | core.StringOut;

  inputParameters?: string | core.StringOut;

  maximumExecutionFrequency?: string | core.StringOut;

  name: string | core.StringOut;

  scope?: Scope;

  source: Source;

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

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

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

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

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

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

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

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

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

  @core.attr(Scope)
  public scope?: Scope;

  @core.attr(Source)
  public source!: Source;

  @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?: ConfigRuleArgs) {
    super(name, "aws_config_config_rule", args);
  }

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