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

export interface ConditionArgs extends core.SchemaArgs {
  test: string | core.StringOut;

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

  variable: string | core.StringOut;
}

export class Condition extends core.Schema<ConditionArgs> {
  @core.attr(String)
  public test!: string | core.StringOut;

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

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

export interface NotPrincipalsArgs extends core.SchemaArgs {
  identifiers: core.Array<string> | core.ArrayOut<core.StringOut>;

  type: string | core.StringOut;
}

export class NotPrincipals extends core.Schema<NotPrincipalsArgs> {
  @core.attr(String, { kind: "array" })
  public identifiers!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

export interface PrincipalsArgs extends core.SchemaArgs {
  identifiers: core.Array<string> | core.ArrayOut<core.StringOut>;

  type: string | core.StringOut;
}

export class Principals extends core.Schema<PrincipalsArgs> {
  @core.attr(String, { kind: "array" })
  public identifiers!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

  condition?: core.Array<Condition> | core.ArrayOut<Condition>;

  effect?: string | core.StringOut;

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

  notPrincipals?: core.Array<NotPrincipals> | core.ArrayOut<NotPrincipals>;

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

  principals?: core.Array<Principals> | core.ArrayOut<Principals>;

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

  sid?: string | core.StringOut;
}

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

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

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

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

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

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

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

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

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

export interface DsPolicyDocumentArgs {
  overrideJson?: string | core.StringOut;

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

  policyId?: string | core.StringOut;

  sourceJson?: string | core.StringOut;

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

  statement?: core.Array<Statement> | core.ArrayOut<Statement>;

  version?: string | core.StringOut;
}

export class DsPolicyDocument extends core.Data<DsPolicyDocumentArgs> {
  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

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

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

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

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

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

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

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

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

  constructor(name: string, args?: DsPolicyDocumentArgs) {
    super(name, "aws_iam_policy_document", args);
  }

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