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

export interface ParallelismArgs extends core.SchemaArgs {
  count?: number | core.NumberOut;
}

export class Parallelism extends core.Schema<ParallelismArgs> {
  @core.attr(Number, { computed: true })
  public count?: number | core.NumberOut;
}

export interface KinesisFirehoseArgs extends core.SchemaArgs {
  resourceArn: string | core.StringOut;

  roleArn: string | core.StringOut;
}

export class KinesisFirehose extends core.Schema<KinesisFirehoseArgs> {
  @core.attr(String)
  public resourceArn!: string | core.StringOut;

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

export interface KinesisStreamArgs extends core.SchemaArgs {
  resourceArn: string | core.StringOut;

  roleArn: string | core.StringOut;
}

export class KinesisStream extends core.Schema<KinesisStreamArgs> {
  @core.attr(String)
  public resourceArn!: string | core.StringOut;

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

export interface StartingPositionConfigurationArgs extends core.SchemaArgs {
  startingPosition?: string | core.StringOut;
}

export class StartingPositionConfiguration extends core.Schema<StartingPositionConfigurationArgs> {
  @core.attr(String, { computed: true })
  public startingPosition?: string | core.StringOut;
}

export interface LambdaArgs extends core.SchemaArgs {
  resourceArn: string | core.StringOut;

  roleArn: string | core.StringOut;
}

export class Lambda extends core.Schema<LambdaArgs> {
  @core.attr(String)
  public resourceArn!: string | core.StringOut;

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

export interface ProcessingConfigurationArgs extends core.SchemaArgs {
  lambda: Lambda;
}

export class ProcessingConfiguration extends core.Schema<ProcessingConfigurationArgs> {
  @core.attr(Lambda)
  public lambda!: Lambda;
}

export interface RecordColumnsArgs extends core.SchemaArgs {
  mapping?: string | core.StringOut;

  name: string | core.StringOut;

  sqlType: string | core.StringOut;
}

export class RecordColumns extends core.Schema<RecordColumnsArgs> {
  @core.attr(String)
  public mapping?: string | core.StringOut;

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

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

export interface CsvArgs extends core.SchemaArgs {
  recordColumnDelimiter: string | core.StringOut;

  recordRowDelimiter: string | core.StringOut;
}

export class Csv extends core.Schema<CsvArgs> {
  @core.attr(String)
  public recordColumnDelimiter!: string | core.StringOut;

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

export interface JsonArgs extends core.SchemaArgs {
  recordRowPath: string | core.StringOut;
}

export class Json extends core.Schema<JsonArgs> {
  @core.attr(String)
  public recordRowPath!: string | core.StringOut;
}

export interface MappingParametersArgs extends core.SchemaArgs {
  csv?: Csv;

  json?: Json;
}

export class MappingParameters extends core.Schema<MappingParametersArgs> {
  @core.attr(Csv)
  public csv?: Csv;

  @core.attr(Json)
  public json?: Json;
}

export interface RecordFormatArgs extends core.SchemaArgs {
  mappingParameters?: MappingParameters;

  recordFormatType: string | core.StringOut;
}

export class RecordFormat extends core.Schema<RecordFormatArgs> {
  @core.attr(MappingParameters)
  public mappingParameters?: MappingParameters;

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

export interface InputsSchemaArgs extends core.SchemaArgs {
  recordColumns: core.Array<RecordColumns> | core.ArrayOut<RecordColumns>;

  recordEncoding?: string | core.StringOut;

  recordFormat: RecordFormat;
}

export class InputsSchema extends core.Schema<InputsSchemaArgs> {
  @core.attr(RecordColumns, { kind: "array" })
  public recordColumns!:
    | core.Array<RecordColumns>
    | core.ArrayOut<RecordColumns>;

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

  @core.attr(RecordFormat)
  public recordFormat!: RecordFormat;
}

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

  kinesisFirehose?: KinesisFirehose;

  kinesisStream?: KinesisStream;

  namePrefix: string | core.StringOut;

  parallelism?: Parallelism;

  processingConfiguration?: ProcessingConfiguration;

  schema: InputsSchema;

  startingPositionConfiguration?:
    | core.Array<StartingPositionConfiguration>
    | core.ArrayOut<StartingPositionConfiguration>;

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

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

  @core.attr(KinesisFirehose)
  public kinesisFirehose?: KinesisFirehose;

  @core.attr(KinesisStream)
  public kinesisStream?: KinesisStream;

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

  @core.attr(Parallelism, { computed: true })
  public parallelism?: Parallelism;

  @core.attr(ProcessingConfiguration)
  public processingConfiguration?: ProcessingConfiguration;

  @core.attr(InputsSchema)
  public schema!: InputsSchema;

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

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

export interface S3Args extends core.SchemaArgs {
  bucketArn: string | core.StringOut;

  fileKey: string | core.StringOut;

  roleArn: string | core.StringOut;
}

export class S3 extends core.Schema<S3Args> {
  @core.attr(String)
  public bucketArn!: string | core.StringOut;

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

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

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

  s3: S3;

  schema: InputsSchema;

  tableName: string | core.StringOut;
}

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

  @core.attr(S3)
  public s3!: S3;

  @core.attr(InputsSchema)
  public schema!: InputsSchema;

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

export interface OutputsSchemaArgs extends core.SchemaArgs {
  recordFormatType: string | core.StringOut;
}

export class OutputsSchema extends core.Schema<OutputsSchemaArgs> {
  @core.attr(String)
  public recordFormatType!: string | core.StringOut;
}

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

  kinesisFirehose?: KinesisFirehose;

  kinesisStream?: KinesisStream;

  lambda?: Lambda;

  name: string | core.StringOut;

  schema: OutputsSchema;
}

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

  @core.attr(KinesisFirehose)
  public kinesisFirehose?: KinesisFirehose;

  @core.attr(KinesisStream)
  public kinesisStream?: KinesisStream;

  @core.attr(Lambda)
  public lambda?: Lambda;

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

  @core.attr(OutputsSchema)
  public schema!: OutputsSchema;
}

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

  logStreamArn: string | core.StringOut;

  roleArn: string | core.StringOut;
}

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

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

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

export interface ApplicationArgs extends core.ResourceArgs {
  cloudwatchLoggingOptions?: CloudwatchLoggingOptions;

  code?: string | core.StringOut;

  description?: string | core.StringOut;

  inputs?: Inputs;

  name: string | core.StringOut;

  outputs?: core.Array<Outputs> | core.ArrayOut<Outputs>;

  referenceDataSources?: ReferenceDataSources;

  startApplication?: boolean | core.BooleanOut;

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

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

export class Application extends core.Resource<ApplicationArgs> {
  @core.attr(String, { computed: true })
  public arn!: string | core.StringOut;

  @core.attr(CloudwatchLoggingOptions)
  public cloudwatchLoggingOptions?: CloudwatchLoggingOptions;

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

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

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

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

  @core.attr(Inputs)
  public inputs?: Inputs;

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

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

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

  @core.attr(ReferenceDataSources)
  public referenceDataSources?: ReferenceDataSources;

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

  @core.attr(String, { computed: true })
  public status!: 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>;

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

  constructor(name: string, args?: ApplicationArgs) {
    super(name, "aws_kinesis_analytics_application", args);
  }

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