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, { kind: "array" })
  public organizationArns?: core.Array<string> | core.ArrayOut<core.StringOut>;

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

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

  @core.attr(String, { 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?: LaunchPermission;

  name?: string | core.StringOut;

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

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

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

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

  @core.attr(LaunchPermission)
  public launchPermission?: LaunchPermission;

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

  @core.attr(String, { 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)
  public repositoryName!: string | core.StringOut;

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

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

  description?: string | core.StringOut;

  targetRepository: TargetRepository;
}

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

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

  @core.attr(TargetRepository)
  public targetRepository!: TargetRepository;
}

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

export class SnapshotConfiguration extends core.Schema<SnapshotConfigurationArgs> {
  @core.attr(Number)
  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)
  public launchTemplateId?: string | core.StringOut;

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

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

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

  enabled: boolean | core.BooleanOut;

  launchTemplate?: LaunchTemplate;

  maxParallelLaunches?: number | core.NumberOut;

  snapshotConfiguration?: SnapshotConfiguration;
}

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

  @core.attr(Boolean)
  public enabled!: boolean | core.BooleanOut;

  @core.attr(LaunchTemplate)
  public launchTemplate?: LaunchTemplate;

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

  @core.attr(SnapshotConfiguration)
  public snapshotConfiguration?: 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)
  public accountId?: string | core.StringOut;

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

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

export interface DistributionArgs extends core.SchemaArgs {
  amiDistributionConfiguration?: AmiDistributionConfiguration;

  containerDistributionConfiguration?: 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)
  public amiDistributionConfiguration?: AmiDistributionConfiguration;

  @core.attr(ContainerDistributionConfiguration)
  public containerDistributionConfiguration?: ContainerDistributionConfiguration;

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

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

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

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

export interface DistributionConfigurationArgs extends core.ResourceArgs {
  description?: string | core.StringOut;

  distribution: core.Array<Distribution> | core.ArrayOut<Distribution>;

  name: string | core.StringOut;

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

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

export class DistributionConfiguration extends core.Resource<DistributionConfigurationArgs> {
  @core.attr(String, { computed: true })
  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)
  public description?: string | core.StringOut;

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

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

  @core.attr(String)
  public name!: 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?: DistributionConfigurationArgs) {
    super(name, "aws_imagebuilder_distribution_configuration", args);
  }

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