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

export interface AwsLambdaArgs extends core.SchemaArgs {
  functionArn: string | core.StringOut;

  functionPayload?: string | core.StringOut;
}

export class AwsLambda extends core.Schema<AwsLambdaArgs> {
  @core.attr(String)
  public functionArn!: string | core.StringOut;

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

export interface ContentTransformationArgs extends core.SchemaArgs {
  awsLambda: AwsLambda;
}

export class ContentTransformation extends core.Schema<ContentTransformationArgs> {
  @core.attr(AwsLambda)
  public awsLambda!: AwsLambda;
}

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

  contentTransformation: ContentTransformation;
}

export class TransformationConfiguration extends core.Schema<TransformationConfigurationArgs> {
  @core.attr(String, { kind: "array" })
  public actions!: core.Array<string> | core.ArrayOut<core.StringOut>;

  @core.attr(ContentTransformation)
  public contentTransformation!: ContentTransformation;
}

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

  cloudWatchMetricsEnabled?: boolean | core.BooleanOut;

  supportingAccessPoint: string | core.StringOut;

  transformationConfiguration:
    | core.Array<TransformationConfiguration>
    | core.ArrayOut<TransformationConfiguration>;
}

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

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

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

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

export interface ObjectLambdaAccessPointArgs extends core.ResourceArgs {
  accountId?: string | core.StringOut;

  configuration: Configuration;

  name: string | core.StringOut;
}

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

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

  @core.attr(Configuration)
  public configuration!: Configuration;

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

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

  constructor(name: string, args?: ObjectLambdaAccessPointArgs) {
    super(name, "aws_s3control_object_lambda_access_point", args);
  }

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