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

export interface AppSourceArgs extends core.SchemaArgs {
  password?: string | core.StringOut;

  revision?: string | core.StringOut;

  sshKey?: string | core.StringOut;

  type: string | core.StringOut;

  url?: string | core.StringOut;

  username?: string | core.StringOut;
}

export class AppSource extends core.Schema<AppSourceArgs> {
  @core.attr(String)
  public password?: string | core.StringOut;

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

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

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

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

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

export interface EnvironmentArgs extends core.SchemaArgs {
  key: string | core.StringOut;

  secure?: boolean | core.BooleanOut;

  value: string | core.StringOut;
}

export class Environment extends core.Schema<EnvironmentArgs> {
  @core.attr(String)
  public key!: string | core.StringOut;

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

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

export interface SslConfigurationArgs extends core.SchemaArgs {
  certificate: string | core.StringOut;

  chain?: string | core.StringOut;

  privateKey: string | core.StringOut;
}

export class SslConfiguration extends core.Schema<SslConfigurationArgs> {
  @core.attr(String)
  public certificate!: string | core.StringOut;

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

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

export interface ApplicationArgs extends core.ResourceArgs {
  appSource?: core.Array<AppSource> | core.ArrayOut<AppSource>;

  autoBundleOnDeploy?: string | core.StringOut;

  awsFlowRubySettings?: string | core.StringOut;

  dataSourceArn?: string | core.StringOut;

  dataSourceDatabaseName?: string | core.StringOut;

  dataSourceType?: string | core.StringOut;

  description?: string | core.StringOut;

  documentRoot?: string | core.StringOut;

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

  enableSsl?: boolean | core.BooleanOut;

  environment?: core.Array<Environment> | core.ArrayOut<Environment>;

  name: string | core.StringOut;

  railsEnv?: string | core.StringOut;

  shortName?: string | core.StringOut;

  sslConfiguration?:
    | core.Array<SslConfiguration>
    | core.ArrayOut<SslConfiguration>;

  stackId: string | core.StringOut;

  type: string | core.StringOut;
}

export class Application extends core.Resource<ApplicationArgs> {
  @core.attr(AppSource, { computed: true, kind: "array" })
  public appSource?: core.Array<AppSource> | core.ArrayOut<AppSource>;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  constructor(name: string, args?: ApplicationArgs) {
    super(name, "aws_opsworks_application", args);
  }

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