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

export interface ParameterArgs extends core.SchemaArgs {
  name: string | core.StringOut;

  value: string | core.StringOut;
}

export class Parameter extends core.Schema<ParameterArgs> {
  @core.attr(String)
  public name!: string | core.StringOut;

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

export interface ComponentArgs extends core.SchemaArgs {
  componentArn: string | core.StringOut;

  parameter?: core.Array<Parameter> | core.ArrayOut<Parameter>;
}

export class Component extends core.Schema<ComponentArgs> {
  @core.attr(String)
  public componentArn!: string | core.StringOut;

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

export interface EbsArgs extends core.SchemaArgs {
  deleteOnTermination?: string | core.StringOut;

  encrypted?: string | core.StringOut;

  iops?: number | core.NumberOut;

  kmsKeyId?: string | core.StringOut;

  snapshotId?: string | core.StringOut;

  throughput?: number | core.NumberOut;

  volumeSize?: number | core.NumberOut;

  volumeType?: string | core.StringOut;
}

export class Ebs extends core.Schema<EbsArgs> {
  @core.attr(String)
  public deleteOnTermination?: string | core.StringOut;

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

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

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

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

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

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

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

export interface BlockDeviceMappingArgs extends core.SchemaArgs {
  deviceName?: string | core.StringOut;

  ebs?: Ebs;

  noDevice?: boolean | core.BooleanOut;

  virtualName?: string | core.StringOut;
}

export class BlockDeviceMapping extends core.Schema<BlockDeviceMappingArgs> {
  @core.attr(String)
  public deviceName?: string | core.StringOut;

  @core.attr(Ebs)
  public ebs?: Ebs;

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

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

export interface SystemsManagerAgentArgs extends core.SchemaArgs {
  uninstallAfterBuild: boolean | core.BooleanOut;
}

export class SystemsManagerAgent extends core.Schema<SystemsManagerAgentArgs> {
  @core.attr(Boolean)
  public uninstallAfterBuild!: boolean | core.BooleanOut;
}

export interface ImageRecipeArgs extends core.ResourceArgs {
  blockDeviceMapping?:
    | core.Array<BlockDeviceMapping>
    | core.ArrayOut<BlockDeviceMapping>;

  component: core.Array<Component> | core.ArrayOut<Component>;

  description?: string | core.StringOut;

  name: string | core.StringOut;

  parentImage: string | core.StringOut;

  systemsManagerAgent?: SystemsManagerAgent;

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

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

  userDataBase64?: string | core.StringOut;

  version: string | core.StringOut;

  workingDirectory?: string | core.StringOut;
}

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

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

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

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

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

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

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

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

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

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

  @core.attr(SystemsManagerAgent, { computed: true })
  public systemsManagerAgent?: SystemsManagerAgent;

  @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>;

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

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

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

  constructor(name: string, args?: ImageRecipeArgs) {
    super(name, "aws_imagebuilder_image_recipe", args);
  }

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