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

export interface IdpArgs extends core.SchemaArgs {
  entityId: string | core.StringOut;

  metadataContent: string | core.StringOut;
}

export class Idp extends core.Schema<IdpArgs> {
  @core.attr(String)
  public entityId!: string | core.StringOut;

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

export interface SamlOptionsArgs extends core.SchemaArgs {
  enabled?: boolean | core.BooleanOut;

  idp?: Idp;

  masterBackendRole?: string | core.StringOut;

  masterUserName?: string | core.StringOut;

  rolesKey?: string | core.StringOut;

  sessionTimeoutMinutes?: number | core.NumberOut;

  subjectKey?: string | core.StringOut;
}

export class SamlOptions extends core.Schema<SamlOptionsArgs> {
  @core.attr(Boolean)
  public enabled?: boolean | core.BooleanOut;

  @core.attr(Idp)
  public idp?: Idp;

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

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

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

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

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

export interface DomainSamlOptionsArgs extends core.ResourceArgs {
  domainName: string | core.StringOut;

  samlOptions?: SamlOptions;
}

export class DomainSamlOptions extends core.Resource<DomainSamlOptionsArgs> {
  @core.attr(String)
  public domainName!: string | core.StringOut;

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

  @core.attr(SamlOptions)
  public samlOptions?: SamlOptions;

  constructor(name: string, args?: DomainSamlOptionsArgs) {
    super(name, "aws_elasticsearch_domain_saml_options", args);
  }

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