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

export interface LaunchPermissionArgs extends core.SchemaArgs {
  organizationArns: core.Array<string> | core.ArrayOut<core.StringOut>;

  organizationalUnitArns: core.Array<string> | core.ArrayOut<core.StringOut>;

  userGroups: core.Array<string> | core.ArrayOut<core.StringOut>;

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

export class LaunchPermission extends core.Schema<LaunchPermissionArgs> {
  @core.attr(String, { computed: true, kind: "array" })
  public organizationArns!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "array" })
  public organizationalUnitArns!:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "array" })
  public userGroups!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(String, { computed: true, kind: "array" })
  public userIds!: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface AmiDistributionConfigurationArgs extends core.SchemaArgs {
  amiTags?: core.Map<string, string> | core.MapOut<core.StringOut>;

  description: string | core.StringOut;

  kmsKeyId: string | core.StringOut;

  launchPermission:
    | core.Array<LaunchPermission>
    | core.ArrayOut<LaunchPermission>;

  name: string | core.StringOut;

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

export class AmiDistributionConfiguration extends core.Schema<AmiDistributionConfigurationArgs> {
  @core.attr(String, { computed: true, kind: "map" })
  public amiTags?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

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

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

  @core.attr(String, { computed: true, kind: "array" })
  public targetAccountIds!: core.Array<string> | core.ArrayOut<core.StringOut>;
}

export interface TargetRepositoryArgs extends core.SchemaArgs {
  repositoryName: string | core.StringOut;

  service: string | core.StringOut;
}

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

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

export interface ContainerDistributionConfigurationArgs
  extends core.SchemaArgs {
  containerTags: core.Array<string> | core.ArrayOut<core.StringOut>;

  description: string | core.StringOut;

  targetRepository:
    | core.Array<TargetRepository>
    | core.ArrayOut<TargetRepository>;
}

export class ContainerDistributionConfiguration extends core.Schema<ContainerDistributionConfigurationArgs> {
  @core.attr(String, { computed: true, kind: "array" })
  public containerTags!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

export interface SnapshotConfigurationArgs extends core.SchemaArgs {
  targetResourceCount: number | core.NumberOut;
}

export class SnapshotConfiguration extends core.Schema<SnapshotConfigurationArgs> {
  @core.attr(Number, { computed: true })
  public targetResourceCount!: number | core.NumberOut;
}

export interface LaunchTemplateArgs extends core.SchemaArgs {
  launchTemplateId: string | core.StringOut;

  launchTemplateName: string | core.StringOut;

  launchTemplateVersion: string | core.StringOut;
}

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

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

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

export interface FastLaunchConfigurationArgs extends core.SchemaArgs {
  accountId: string | core.StringOut;

  enabled: boolean | core.BooleanOut;

  launchTemplate: core.Array<LaunchTemplate> | core.ArrayOut<LaunchTemplate>;

  maxParallelLaunches: number | core.NumberOut;

  snapshotConfiguration:
    | core.Array<SnapshotConfiguration>
    | core.ArrayOut<SnapshotConfiguration>;
}

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

  @core.attr(Boolean, { computed: true })
  public enabled!: boolean | core.BooleanOut;

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

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

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

export interface LaunchTemplateConfigurationArgs extends core.SchemaArgs {
  accountId: string | core.StringOut;

  default: boolean | core.BooleanOut;

  launchTemplateId: string | core.StringOut;
}

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

  @core.attr(Boolean, { computed: true })
  public default!: boolean | core.BooleanOut;

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

export interface DistributionArgs extends core.SchemaArgs {
  amiDistributionConfiguration:
    | core.Array<AmiDistributionConfiguration>
    | core.ArrayOut<AmiDistributionConfiguration>;

  containerDistributionConfiguration:
    | core.Array<ContainerDistributionConfiguration>
    | core.ArrayOut<ContainerDistributionConfiguration>;

  fastLaunchConfiguration:
    | core.Array<FastLaunchConfiguration>
    | core.ArrayOut<FastLaunchConfiguration>;

  launchTemplateConfiguration:
    | core.Array<LaunchTemplateConfiguration>
    | core.ArrayOut<LaunchTemplateConfiguration>;

  licenseConfigurationArns: core.Array<string> | core.ArrayOut<core.StringOut>;

  region: string | core.StringOut;
}

export class Distribution extends core.Schema<DistributionArgs> {
  @core.attr(AmiDistributionConfiguration, { computed: true, kind: "array" })
  public amiDistributionConfiguration!:
    | core.Array<AmiDistributionConfiguration>
    | core.ArrayOut<AmiDistributionConfiguration>;

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

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

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

  @core.attr(String, { computed: true, kind: "array" })
  public licenseConfigurationArns!:
    | core.Array<string>
    | core.ArrayOut<core.StringOut>;

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

export interface DsDistributionConfigurationArgs {
  arn: string | core.StringOut;

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

export class DsDistributionConfiguration extends core.Data<DsDistributionConfigurationArgs> {
  @core.attr(String)
  public arn!: string | core.StringOut;

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

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

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

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

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

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

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

  constructor(name: string, args?: DsDistributionConfigurationArgs) {
    super(name, "aws_imagebuilder_distribution_configuration", args);
  }

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