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

export interface MappingRuleArgs extends core.SchemaArgs {
  claim: string | core.StringOut;

  matchType: string | core.StringOut;

  roleArn: string | core.StringOut;

  value: string | core.StringOut;
}

export class MappingRule extends core.Schema<MappingRuleArgs> {
  @core.attr(String)
  public claim!: string | core.StringOut;

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

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

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

export interface RoleMappingArgs extends core.SchemaArgs {
  ambiguousRoleResolution?: string | core.StringOut;

  identityProvider: string | core.StringOut;

  mappingRule?: core.Array<MappingRule> | core.ArrayOut<MappingRule>;

  type: string | core.StringOut;
}

export class RoleMapping extends core.Schema<RoleMappingArgs> {
  @core.attr(String)
  public ambiguousRoleResolution?: string | core.StringOut;

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

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

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

export interface PoolRolesAttachmentArgs extends core.ResourceArgs {
  identityPoolId: string | core.StringOut;

  roleMapping?: core.Array<RoleMapping> | core.ArrayOut<RoleMapping>;

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

export class PoolRolesAttachment extends core.Resource<PoolRolesAttachmentArgs> {
  /**
   * The identity pool ID.
   */
  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

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

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

  @core.attr(String, { kind: "map" })
  public roles!: core.Map<string, string> | core.MapOut<core.StringOut>;

  constructor(name: string, args?: PoolRolesAttachmentArgs) {
    super(name, "aws_cognito_identity_pool_roles_attachment", args);
  }

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