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

export interface MetricsArgs extends core.SchemaArgs {
  minutes?: number | core.NumberOut;

  status?: string | core.StringOut;
}

export class Metrics extends core.Schema<MetricsArgs> {
  @core.attr(Number)
  public minutes?: number | core.NumberOut;

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

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 ReplicationTimeArgs extends core.SchemaArgs {
  minutes?: number | core.NumberOut;

  status?: string | core.StringOut;
}

export class ReplicationTime extends core.Schema<ReplicationTimeArgs> {
  @core.attr(Number)
  public minutes?: number | core.NumberOut;

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

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

  accountId?: string | core.StringOut;

  bucket: string | core.StringOut;

  metrics?: Metrics;

  replicaKmsKeyId?: string | core.StringOut;

  replicationTime?: ReplicationTime;

  storageClass?: string | core.StringOut;
}

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

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

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

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

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

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

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

export interface SseKmsEncryptedObjectsArgs extends core.SchemaArgs {
  enabled: boolean | core.BooleanOut;
}

export class SseKmsEncryptedObjects extends core.Schema<SseKmsEncryptedObjectsArgs> {
  @core.attr(Boolean)
  public enabled!: boolean | core.BooleanOut;
}

export interface SourceSelectionCriteriaArgs extends core.SchemaArgs {
  sseKmsEncryptedObjects?: SseKmsEncryptedObjects;
}

export class SourceSelectionCriteria extends core.Schema<SourceSelectionCriteriaArgs> {
  @core.attr(SseKmsEncryptedObjects)
  public sseKmsEncryptedObjects?: SseKmsEncryptedObjects;
}

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

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

export class Filter extends core.Schema<FilterArgs> {
  @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 RulesArgs extends core.SchemaArgs {
  deleteMarkerReplicationStatus?: string | core.StringOut;

  destination: Destination;

  filter?: Filter;

  id?: string | core.StringOut;

  prefix?: string | core.StringOut;

  priority?: number | core.NumberOut;

  sourceSelectionCriteria?: SourceSelectionCriteria;

  status: string | core.StringOut;
}

export class Rules extends core.Schema<RulesArgs> {
  @core.attr(String)
  public deleteMarkerReplicationStatus?: string | core.StringOut;

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

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

  @core.attr(String)
  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 ReplicationConfigurationArgs extends core.SchemaArgs {
  role: string | core.StringOut;

  rules: core.Array<Rules> | core.ArrayOut<Rules>;
}

export class ReplicationConfiguration extends core.Schema<ReplicationConfigurationArgs> {
  @core.attr(String)
  public role!: string | core.StringOut;

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

export interface LoggingArgs extends core.SchemaArgs {
  targetBucket: string | core.StringOut;

  targetPrefix?: string | core.StringOut;
}

export class Logging extends core.Schema<LoggingArgs> {
  @core.attr(String)
  public targetBucket!: string | core.StringOut;

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

export interface TransitionArgs extends core.SchemaArgs {
  date?: string | core.StringOut;

  days?: number | core.NumberOut;

  storageClass: string | core.StringOut;
}

export class Transition extends core.Schema<TransitionArgs> {
  @core.attr(String)
  public date?: string | core.StringOut;

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

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

export interface ExpirationArgs extends core.SchemaArgs {
  date?: string | core.StringOut;

  days?: number | core.NumberOut;

  expiredObjectDeleteMarker?: boolean | core.BooleanOut;
}

export class Expiration extends core.Schema<ExpirationArgs> {
  @core.attr(String)
  public date?: string | core.StringOut;

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

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

export interface NoncurrentVersionTransitionArgs extends core.SchemaArgs {
  days?: number | core.NumberOut;

  storageClass: string | core.StringOut;
}

export class NoncurrentVersionTransition extends core.Schema<NoncurrentVersionTransitionArgs> {
  @core.attr(Number)
  public days?: number | core.NumberOut;

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

export interface NoncurrentVersionExpirationArgs extends core.SchemaArgs {
  days?: number | core.NumberOut;
}

export class NoncurrentVersionExpiration extends core.Schema<NoncurrentVersionExpirationArgs> {
  @core.attr(Number)
  public days?: number | core.NumberOut;
}

export interface LifecycleRuleArgs extends core.SchemaArgs {
  abortIncompleteMultipartUploadDays?: number | core.NumberOut;

  enabled: boolean | core.BooleanOut;

  expiration?: Expiration;

  id?: string | core.StringOut;

  noncurrentVersionExpiration?: NoncurrentVersionExpiration;

  noncurrentVersionTransition?:
    | core.Array<NoncurrentVersionTransition>
    | core.ArrayOut<NoncurrentVersionTransition>;

  prefix?: string | core.StringOut;

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

  transition?: core.Array<Transition> | core.ArrayOut<Transition>;
}

export class LifecycleRule extends core.Schema<LifecycleRuleArgs> {
  @core.attr(Number)
  public abortIncompleteMultipartUploadDays?: number | core.NumberOut;

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

  @core.attr(Expiration)
  public expiration?: Expiration;

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

  @core.attr(NoncurrentVersionExpiration)
  public noncurrentVersionExpiration?: NoncurrentVersionExpiration;

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

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

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

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

export interface DefaultRetentionArgs extends core.SchemaArgs {
  days?: number | core.NumberOut;

  mode: string | core.StringOut;

  years?: number | core.NumberOut;
}

export class DefaultRetention extends core.Schema<DefaultRetentionArgs> {
  @core.attr(Number)
  public days?: number | core.NumberOut;

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

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

export interface ObjectLockConfigurationRuleArgs extends core.SchemaArgs {
  defaultRetention: DefaultRetention;
}

export class ObjectLockConfigurationRule extends core.Schema<ObjectLockConfigurationRuleArgs> {
  @core.attr(DefaultRetention)
  public defaultRetention!: DefaultRetention;
}

export interface ObjectLockConfigurationArgs extends core.SchemaArgs {
  objectLockEnabled?: string | core.StringOut;

  rule?: ObjectLockConfigurationRule;
}

export class ObjectLockConfiguration extends core.Schema<ObjectLockConfigurationArgs> {
  @core.attr(String)
  public objectLockEnabled?: string | core.StringOut;

  @core.attr(ObjectLockConfigurationRule)
  public rule?: ObjectLockConfigurationRule;
}

export interface ApplyServerSideEncryptionByDefaultArgs
  extends core.SchemaArgs {
  kmsMasterKeyId?: string | core.StringOut;

  sseAlgorithm: string | core.StringOut;
}

export class ApplyServerSideEncryptionByDefault extends core.Schema<ApplyServerSideEncryptionByDefaultArgs> {
  @core.attr(String)
  public kmsMasterKeyId?: string | core.StringOut;

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

export interface ServerSideEncryptionConfigurationRuleArgs
  extends core.SchemaArgs {
  applyServerSideEncryptionByDefault: ApplyServerSideEncryptionByDefault;

  bucketKeyEnabled?: boolean | core.BooleanOut;
}

export class ServerSideEncryptionConfigurationRule extends core.Schema<ServerSideEncryptionConfigurationRuleArgs> {
  @core.attr(ApplyServerSideEncryptionByDefault)
  public applyServerSideEncryptionByDefault!: ApplyServerSideEncryptionByDefault;

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

export interface ServerSideEncryptionConfigurationArgs extends core.SchemaArgs {
  rule: ServerSideEncryptionConfigurationRule;
}

export class ServerSideEncryptionConfiguration extends core.Schema<ServerSideEncryptionConfigurationArgs> {
  @core.attr(ServerSideEncryptionConfigurationRule)
  public rule!: ServerSideEncryptionConfigurationRule;
}

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

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

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

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

  maxAgeSeconds?: number | core.NumberOut;
}

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

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

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

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

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

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

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

  type: string | core.StringOut;

  uri?: string | core.StringOut;
}

export class Grant extends core.Schema<GrantArgs> {
  @core.attr(String)
  public id?: string | core.StringOut;

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

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

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

export interface VersioningArgs extends core.SchemaArgs {
  enabled?: boolean | core.BooleanOut;

  mfaDelete?: boolean | core.BooleanOut;
}

export class Versioning extends core.Schema<VersioningArgs> {
  @core.attr(Boolean)
  public enabled?: boolean | core.BooleanOut;

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

export interface WebsiteArgs extends core.SchemaArgs {
  errorDocument?: string | core.StringOut;

  indexDocument?: string | core.StringOut;

  redirectAllRequestsTo?: string | core.StringOut;

  routingRules?: string | core.StringOut;
}

export class Website extends core.Schema<WebsiteArgs> {
  @core.attr(String)
  public errorDocument?: string | core.StringOut;

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

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

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

export interface BucketArgs extends core.ResourceArgs {
  accelerationStatus?: string | core.StringOut;

  acl?: string | core.StringOut;

  arn?: string | core.StringOut;

  bucket?: string | core.StringOut;

  bucketPrefix?: string | core.StringOut;

  corsRule?: core.Array<CorsRule> | core.ArrayOut<CorsRule>;

  forceDestroy?: boolean | core.BooleanOut;

  grant?: core.Array<Grant> | core.ArrayOut<Grant>;

  hostedZoneId?: string | core.StringOut;

  lifecycleRule?: core.Array<LifecycleRule> | core.ArrayOut<LifecycleRule>;

  logging?: Logging;

  objectLockConfiguration?: ObjectLockConfiguration;

  objectLockEnabled?: boolean | core.BooleanOut;

  policy?: string | core.StringOut;

  replicationConfiguration?: ReplicationConfiguration;

  requestPayer?: string | core.StringOut;

  serverSideEncryptionConfiguration?: ServerSideEncryptionConfiguration;

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

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

  versioning?: Versioning;

  website?: Website;
}

export class Bucket extends core.Resource<BucketArgs> {
  @core.attr(String, { computed: true })
  public accelerationStatus?: string | core.StringOut;

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

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

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

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

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

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

  @core.attr(CorsRule, { computed: true, kind: "array" })
  public corsRule?: core.Array<CorsRule> | core.ArrayOut<CorsRule>;

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

  @core.attr(Grant, { computed: true, kind: "array" })
  public grant?: core.Array<Grant> | core.ArrayOut<Grant>;

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

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

  @core.attr(LifecycleRule, { computed: true, kind: "array" })
  public lifecycleRule?:
    | core.Array<LifecycleRule>
    | core.ArrayOut<LifecycleRule>;

  @core.attr(Logging, { computed: true })
  public logging?: Logging;

  @core.attr(ObjectLockConfiguration, { computed: true })
  public objectLockConfiguration?: ObjectLockConfiguration;

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

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

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

  @core.attr(ReplicationConfiguration, { computed: true })
  public replicationConfiguration?: ReplicationConfiguration;

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

  @core.attr(ServerSideEncryptionConfiguration, { computed: true })
  public serverSideEncryptionConfiguration?: ServerSideEncryptionConfiguration;

  @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(Versioning, { computed: true })
  public versioning?: Versioning;

  @core.attr(Website, { computed: true })
  public website?: Website;

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

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

  constructor(name: string, args?: BucketArgs) {
    super(name, "aws_s3_bucket", args);
  }

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