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

export interface ExistingObjectReplicationArgs extends core.SchemaArgs {
  status: string | core.StringOut;
}

export class ExistingObjectReplication extends core.Schema<ExistingObjectReplicationArgs> {
  @core.attr(String)
  public status!: string | core.StringOut;
}

export interface ReplicaModificationsArgs extends core.SchemaArgs {
  status: string | core.StringOut;
}

export class ReplicaModifications extends core.Schema<ReplicaModificationsArgs> {
  @core.attr(String)
  public status!: string | core.StringOut;
}

export interface SseKmsEncryptedObjectsArgs extends core.SchemaArgs {
  status: string | core.StringOut;
}

export class SseKmsEncryptedObjects extends core.Schema<SseKmsEncryptedObjectsArgs> {
  @core.attr(String)
  public status!: string | core.StringOut;
}

export interface SourceSelectionCriteriaArgs extends core.SchemaArgs {
  replicaModifications?: ReplicaModifications;

  sseKmsEncryptedObjects?: SseKmsEncryptedObjects;
}

export class SourceSelectionCriteria extends core.Schema<SourceSelectionCriteriaArgs> {
  @core.attr(ReplicaModifications)
  public replicaModifications?: ReplicaModifications;

  @core.attr(SseKmsEncryptedObjects)
  public sseKmsEncryptedObjects?: SseKmsEncryptedObjects;
}

export interface DeleteMarkerReplicationArgs extends core.SchemaArgs {
  status: string | core.StringOut;
}

export class DeleteMarkerReplication extends core.Schema<DeleteMarkerReplicationArgs> {
  @core.attr(String)
  public status!: string | core.StringOut;
}

export interface EncryptionConfigurationArgs extends core.SchemaArgs {
  replicaKmsKeyId: string | core.StringOut;
}

export class EncryptionConfiguration extends core.Schema<EncryptionConfigurationArgs> {
  @core.attr(String)
  public replicaKmsKeyId!: string | core.StringOut;
}

export interface EventThresholdArgs extends core.SchemaArgs {
  minutes: number | core.NumberOut;
}

export class EventThreshold extends core.Schema<EventThresholdArgs> {
  @core.attr(Number)
  public minutes!: number | core.NumberOut;
}

export interface MetricsArgs extends core.SchemaArgs {
  eventThreshold?: EventThreshold;

  status: string | core.StringOut;
}

export class Metrics extends core.Schema<MetricsArgs> {
  @core.attr(EventThreshold)
  public eventThreshold?: EventThreshold;

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

export interface TimeArgs extends core.SchemaArgs {
  minutes: number | core.NumberOut;
}

export class Time extends core.Schema<TimeArgs> {
  @core.attr(Number)
  public minutes!: number | core.NumberOut;
}

export interface ReplicationTimeArgs extends core.SchemaArgs {
  status: string | core.StringOut;

  time: Time;
}

export class ReplicationTime extends core.Schema<ReplicationTimeArgs> {
  @core.attr(String)
  public status!: string | core.StringOut;

  @core.attr(Time)
  public time!: Time;
}

export interface AccessControlTranslationArgs extends core.SchemaArgs {
  owner: string | core.StringOut;
}

export class AccessControlTranslation extends core.Schema<AccessControlTranslationArgs> {
  @core.attr(String)
  public owner!: string | core.StringOut;
}

export interface DestinationArgs extends core.SchemaArgs {
  accessControlTranslation?: AccessControlTranslation;

  account?: string | core.StringOut;

  bucket: string | core.StringOut;

  encryptionConfiguration?: EncryptionConfiguration;

  metrics?: Metrics;

  replicationTime?: ReplicationTime;

  storageClass?: string | core.StringOut;
}

export class Destination extends core.Schema<DestinationArgs> {
  @core.attr(AccessControlTranslation)
  public accessControlTranslation?: AccessControlTranslation;

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

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

  @core.attr(EncryptionConfiguration)
  public encryptionConfiguration?: EncryptionConfiguration;

  @core.attr(Metrics)
  public metrics?: Metrics;

  @core.attr(ReplicationTime)
  public replicationTime?: ReplicationTime;

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

export interface AndArgs extends core.SchemaArgs {
  prefix?: string | core.StringOut;

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

export class And extends core.Schema<AndArgs> {
  @core.attr(String)
  public prefix?: string | core.StringOut;

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

export interface TagArgs extends core.SchemaArgs {
  key: string | core.StringOut;

  value: string | core.StringOut;
}

export class Tag extends core.Schema<TagArgs> {
  @core.attr(String)
  public key!: string | core.StringOut;

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

export interface FilterArgs extends core.SchemaArgs {
  and?: And;

  prefix?: string | core.StringOut;

  tag?: Tag;
}

export class Filter extends core.Schema<FilterArgs> {
  @core.attr(And)
  public and?: And;

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

  @core.attr(Tag)
  public tag?: Tag;
}

export interface RuleArgs extends core.SchemaArgs {
  deleteMarkerReplication?: DeleteMarkerReplication;

  destination: Destination;

  existingObjectReplication?: ExistingObjectReplication;

  filter?: Filter;

  id?: string | core.StringOut;

  prefix?: string | core.StringOut;

  priority?: number | core.NumberOut;

  sourceSelectionCriteria?: SourceSelectionCriteria;

  status: string | core.StringOut;
}

export class Rule extends core.Schema<RuleArgs> {
  @core.attr(DeleteMarkerReplication)
  public deleteMarkerReplication?: DeleteMarkerReplication;

  @core.attr(Destination)
  public destination!: Destination;

  @core.attr(ExistingObjectReplication)
  public existingObjectReplication?: ExistingObjectReplication;

  @core.attr(Filter)
  public filter?: Filter;

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

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

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

  @core.attr(SourceSelectionCriteria)
  public sourceSelectionCriteria?: SourceSelectionCriteria;

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

export interface BucketReplicationConfigurationArgs extends core.ResourceArgs {
  bucket: string | core.StringOut;

  role: string | core.StringOut;

  rule: core.Array<Rule> | core.ArrayOut<Rule>;

  token?: string | core.StringOut;
}

export class BucketReplicationConfiguration extends core.Resource<BucketReplicationConfigurationArgs> {
  @core.attr(String)
  public bucket!: string | core.StringOut;

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

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

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

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

  constructor(name: string, args?: BucketReplicationConfigurationArgs) {
    super(name, "aws_s3_bucket_replication_configuration", args);
  }

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