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

export interface AutoBranchCreationConfigArgs extends core.SchemaArgs {
  basicAuthCredentials?: string | core.StringOut;

  buildSpec?: string | core.StringOut;

  enableAutoBuild?: boolean | core.BooleanOut;

  enableBasicAuth?: boolean | core.BooleanOut;

  enablePerformanceMode?: boolean | core.BooleanOut;

  enablePullRequestPreview?: boolean | core.BooleanOut;

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

  framework?: string | core.StringOut;

  pullRequestEnvironmentName?: string | core.StringOut;

  stage?: string | core.StringOut;
}

export class AutoBranchCreationConfig extends core.Schema<AutoBranchCreationConfigArgs> {
  @core.attr(String)
  public basicAuthCredentials?: string | core.StringOut;

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

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

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

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

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

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

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

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

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

export interface CustomRuleArgs extends core.SchemaArgs {
  condition?: string | core.StringOut;

  source: string | core.StringOut;

  status?: string | core.StringOut;

  target: string | core.StringOut;
}

export class CustomRule extends core.Schema<CustomRuleArgs> {
  @core.attr(String)
  public condition?: string | core.StringOut;

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

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

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

export interface ProductionBranchArgs extends core.SchemaArgs {
  branchName: string | core.StringOut;

  lastDeployTime: string | core.StringOut;

  status: string | core.StringOut;

  thumbnailUrl: string | core.StringOut;
}

export class ProductionBranch extends core.Schema<ProductionBranchArgs> {
  @core.attr(String, { computed: true })
  public branchName!: string | core.StringOut;

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

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

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

export interface AppArgs extends core.ResourceArgs {
  accessToken?: string | core.StringOut;

  autoBranchCreationConfig?: AutoBranchCreationConfig;

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

  basicAuthCredentials?: string | core.StringOut;

  buildSpec?: string | core.StringOut;

  customRule?: core.Array<CustomRule> | core.ArrayOut<CustomRule>;

  description?: string | core.StringOut;

  enableAutoBranchCreation?: boolean | core.BooleanOut;

  enableBasicAuth?: boolean | core.BooleanOut;

  enableBranchAutoBuild?: boolean | core.BooleanOut;

  enableBranchAutoDeletion?: boolean | core.BooleanOut;

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

  iamServiceRoleArn?: string | core.StringOut;

  name: string | core.StringOut;

  oauthToken?: string | core.StringOut;

  platform?: string | core.StringOut;

  repository?: string | core.StringOut;

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

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

export class App extends core.Resource<AppArgs> {
  @core.attr(String)
  public accessToken?: string | core.StringOut;

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

  @core.attr(AutoBranchCreationConfig, { computed: true })
  public autoBranchCreationConfig?: AutoBranchCreationConfig;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  @core.attr(ProductionBranch, { computed: true, kind: "array" })
  public productionBranch!:
    | core.Array<ProductionBranch>
    | core.ArrayOut<ProductionBranch>;

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

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

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

  constructor(name: string, args?: AppArgs) {
    super(name, "aws_amplify_app", args);
  }

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