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

export interface DeploymentTargetsArgs extends core.SchemaArgs {
  organizationalUnitIds?: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export class DeploymentTargets extends core.Schema<DeploymentTargetsArgs> {
  @core.attr(String, { kind: "array" })
  public organizationalUnitIds?:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;
}

export interface OperationPreferencesArgs extends core.SchemaArgs {
  failureToleranceCount?: number | core.NumberOut;

  failureTolerancePercentage?: number | core.NumberOut;

  maxConcurrentCount?: number | core.NumberOut;

  maxConcurrentPercentage?: number | core.NumberOut;

  regionConcurrencyType?: string | core.StringOut;

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

export class OperationPreferences extends core.Schema<OperationPreferencesArgs> {
  @core.attr(Number)
  public failureToleranceCount?: number | core.NumberOut;

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

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

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

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

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

export interface StackSetInstanceArgs extends core.ResourceArgs {
  accountId?: string | core.StringOut;

  callAs?: string | core.StringOut;

  deploymentTargets?: DeploymentTargets;

  operationPreferences?: OperationPreferences;

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

  region?: string | core.StringOut;

  retainStack?: boolean | core.BooleanOut;

  stackSetName: string | core.StringOut;
}

export class StackSetInstance extends core.Resource<StackSetInstanceArgs> {
  @core.attr(String, { computed: true })
  public accountId?: string | core.StringOut;

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

  @core.attr(DeploymentTargets)
  public deploymentTargets?: DeploymentTargets;

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

  @core.attr(OperationPreferences)
  public operationPreferences?: OperationPreferences;

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

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

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

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

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

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

  constructor(name: string, args?: StackSetInstanceArgs) {
    super(name, "aws_cloudformation_stack_set_instance", args);
  }

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