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

export interface CognitoIdentityProvidersArgs extends core.SchemaArgs {
  clientId?: string | core.StringOut;

  providerName?: string | core.StringOut;

  serverSideTokenCheck?: boolean | core.BooleanOut;
}

export class CognitoIdentityProviders extends core.Schema<CognitoIdentityProvidersArgs> {
  @core.attr(String)
  public clientId?: string | core.StringOut;

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

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

export interface PoolArgs extends core.ResourceArgs {
  allowClassicFlow?: boolean | core.BooleanOut;

  allowUnauthenticatedIdentities?: boolean | core.BooleanOut;

  cognitoIdentityProviders?:
    | core.Array<CognitoIdentityProviders>
    | core.ArrayOut<CognitoIdentityProviders>;

  developerProviderName?: string | core.StringOut;

  identityPoolName: string | core.StringOut;

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

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

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

  /**
   * (Optional) A map of tags to assign to the Identity Pool. If configured with a provider [`default_tag
   * s` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_ta
   * gs-configuration-block) present, tags with matching keys will overwrite those defined at the provide
   * r-level.
   */
  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * A map of tags assigned to the resource, including those inherited from the provider [`default_tags`
   * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-
   * configuration-block).
   */
  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;
}

export class Pool extends core.Resource<PoolArgs> {
  @core.attr(Boolean)
  public allowClassicFlow?: boolean | core.BooleanOut;

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

  /**
   * The ARN of the identity pool.
   */
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

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

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

  /**
   * An identity pool ID, e.g. `us-west-2_abc123`.
   */
  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

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

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

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

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

  /**
   * (Optional) A map of tags to assign to the Identity Pool. If configured with a provider [`default_tag
   * s` configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_ta
   * gs-configuration-block) present, tags with matching keys will overwrite those defined at the provide
   * r-level.
   */
  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * A map of tags assigned to the resource, including those inherited from the provider [`default_tags`
   * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-
   * configuration-block).
   */
  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  constructor(name: string, args?: PoolArgs) {
    super(name, "aws_cognito_identity_pool", args);
  }

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