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

export interface InlinePolicyArgs extends core.SchemaArgs {
  name?: string | core.StringOut;

  policy?: string | core.StringOut;
}

export class InlinePolicy extends core.Schema<InlinePolicyArgs> {
  @core.attr(String)
  public name?: string | core.StringOut;

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

export interface RoleArgs extends core.ResourceArgs {
  assumeRolePolicy: string | core.StringOut;

  description?: string | core.StringOut;

  forceDetachPolicies?: boolean | core.BooleanOut;

  inlinePolicy?: core.Array<InlinePolicy> | core.ArrayOut<InlinePolicy>;

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

  maxSessionDuration?: number | core.NumberOut;

  name?: string | core.StringOut;

  namePrefix?: string | core.StringOut;

  path?: string | core.StringOut;

  permissionsBoundary?: string | core.StringOut;

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

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

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

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

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

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

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

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

  @core.attr(InlinePolicy, { computed: true, kind: "array" })
  public inlinePolicy?: core.Array<InlinePolicy> | core.ArrayOut<InlinePolicy>;

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

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

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

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

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

  @core.attr(String)
  public permissionsBoundary?: 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>;

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

  constructor(name: string, args?: RoleArgs) {
    super(name, "aws_iam_role", args);
  }

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