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

export interface EncryptionKeyArgs extends core.SchemaArgs {
  id: string | core.StringOut;

  type: string | core.StringOut;
}

export class EncryptionKey extends core.Schema<EncryptionKeyArgs> {
  @core.attr(String)
  public id!: string | core.StringOut;

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

export interface ArtifactStoreArgs extends core.SchemaArgs {
  encryptionKey?: EncryptionKey;

  location: string | core.StringOut;

  region?: string | core.StringOut;

  type: string | core.StringOut;
}

export class ArtifactStore extends core.Schema<ArtifactStoreArgs> {
  @core.attr(EncryptionKey)
  public encryptionKey?: EncryptionKey;

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

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

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

export interface ActionArgs extends core.SchemaArgs {
  category: string | core.StringOut;

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

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

  name: string | core.StringOut;

  namespace?: string | core.StringOut;

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

  owner: string | core.StringOut;

  provider: string | core.StringOut;

  region?: string | core.StringOut;

  roleArn?: string | core.StringOut;

  runOrder?: number | core.NumberOut;

  version: string | core.StringOut;
}

export class Action extends core.Schema<ActionArgs> {
  @core.attr(String)
  public category!: string | core.StringOut;

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

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

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

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

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

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

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

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

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

  @core.attr(Number, { computed: true })
  public runOrder?: number | core.NumberOut;

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

export interface StageArgs extends core.SchemaArgs {
  action: core.Array<Action> | core.ArrayOut<Action>;

  name: string | core.StringOut;
}

export class Stage extends core.Schema<StageArgs> {
  @core.attr(Action, { kind: "array" })
  public action!: core.Array<Action> | core.ArrayOut<Action>;

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

export interface MainArgs extends core.ResourceArgs {
  artifactStore: core.Array<ArtifactStore> | core.ArrayOut<ArtifactStore>;

  /**
   * (Required) The name of the pipeline.
   */
  name: string | core.StringOut;

  /**
   * (Required) A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make
   * calls to AWS services on your behalf.
   */
  roleArn: string | core.StringOut;

  stage: core.Array<Stage> | core.ArrayOut<Stage>;

  /**
   * (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` co
   * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co
   * nfiguration-block) present, tags with matching keys will overwrite those defined at the provider-lev
   * el.
   */
  tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * A map of tags assigned to the resource, including those inherited from the provider [`default_tags`
   * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-
   * configuration-block).
   */
  tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;
}

export class Main extends core.Resource<MainArgs> {
  /**
   * The codepipeline ARN.
   */
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(ArtifactStore, { kind: "array" })
  public artifactStore!:
    | core.Array<ArtifactStore>
    | core.ArrayOut<ArtifactStore>;

  /**
   * (Required) The KMS key ARN or ID
   */
  @core.attr(String, { computed: true })
  public id!: string | core.StringOut;

  /**
   * (Required) The name of the pipeline.
   */
  @core.attr(String)
  public name!: string | core.StringOut;

  /**
   * (Required) A service role Amazon Resource Name (ARN) that grants AWS CodePipeline permission to make
   * calls to AWS services on your behalf.
   */
  @core.attr(String)
  public roleArn!: string | core.StringOut;

  @core.attr(Stage, { kind: "array" })
  public stage!: core.Array<Stage> | core.ArrayOut<Stage>;

  /**
   * (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` co
   * nfiguration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-co
   * nfiguration-block) present, tags with matching keys will overwrite those defined at the provider-lev
   * el.
   */
  @core.attr(String, { kind: "map" })
  public tags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  /**
   * A map of tags assigned to the resource, including those inherited from the provider [`default_tags`
   * configuration block](https://registry.terraform.io/providers/hashicorp/aws/latest/docs#default_tags-
   * configuration-block).
   */
  @core.attr(String, { computed: true, kind: "map" })
  public tagsAll?: core.Map<string, string> | core.MapOut<core.StringOut>;

  constructor(name: string, args?: MainArgs) {
    super(name, "aws_codepipeline", args);
  }

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