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

export interface OidcConfigArgs extends core.SchemaArgs {
  authorizationEndpoint: string | core.StringOut;

  clientId: string | core.StringOut;

  clientSecret: string | core.StringOut;

  issuer: string | core.StringOut;

  jwksUri: string | core.StringOut;

  logoutEndpoint: string | core.StringOut;

  tokenEndpoint: string | core.StringOut;

  userInfoEndpoint: string | core.StringOut;
}

export class OidcConfig extends core.Schema<OidcConfigArgs> {
  @core.attr(String)
  public authorizationEndpoint!: string | core.StringOut;

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

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

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

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

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

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

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

export interface SourceIpConfigArgs extends core.SchemaArgs {
  cidrs: core.Array<string> | core.ArrayOut<core.StringOut>;
}

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

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

  userPool: string | core.StringOut;
}

export class CognitoConfig extends core.Schema<CognitoConfigArgs> {
  @core.attr(String)
  public clientId!: string | core.StringOut;

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

export interface WorkforceArgs extends core.ResourceArgs {
  cognitoConfig?: CognitoConfig;

  oidcConfig?: OidcConfig;

  sourceIpConfig?: SourceIpConfig;

  workforceName: string | core.StringOut;
}

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

  @core.attr(CognitoConfig)
  public cognitoConfig?: CognitoConfig;

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

  @core.attr(OidcConfig)
  public oidcConfig?: OidcConfig;

  @core.attr(SourceIpConfig, { computed: true })
  public sourceIpConfig?: SourceIpConfig;

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

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

  constructor(name: string, args?: WorkforceArgs) {
    super(name, "aws_sagemaker_workforce", args);
  }

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