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

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

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

  vpcConfigurationId: string | core.StringOut;

  vpcId: string | core.StringOut;
}

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

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

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

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

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

  fileKey: string | core.StringOut;

  objectVersion?: string | core.StringOut;
}

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

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

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

export interface CodeContentArgs extends core.SchemaArgs {
  s3ContentLocation?: S3ContentLocation;

  textContent?: string | core.StringOut;
}

export class CodeContent extends core.Schema<CodeContentArgs> {
  @core.attr(S3ContentLocation)
  public s3ContentLocation?: S3ContentLocation;

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

export interface ApplicationCodeConfigurationArgs extends core.SchemaArgs {
  codeContent?: CodeContent;

  codeContentType: string | core.StringOut;
}

export class ApplicationCodeConfiguration extends core.Schema<ApplicationCodeConfigurationArgs> {
  @core.attr(CodeContent)
  public codeContent?: CodeContent;

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

export interface ApplicationSnapshotConfigurationArgs extends core.SchemaArgs {
  snapshotsEnabled: boolean | core.BooleanOut;
}

export class ApplicationSnapshotConfiguration extends core.Schema<ApplicationSnapshotConfigurationArgs> {
  @core.attr(Boolean)
  public snapshotsEnabled!: boolean | core.BooleanOut;
}

export interface PropertyGroupArgs extends core.SchemaArgs {
  propertyGroupId: string | core.StringOut;

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

export class PropertyGroup extends core.Schema<PropertyGroupArgs> {
  @core.attr(String)
  public propertyGroupId!: string | core.StringOut;

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

export interface EnvironmentPropertiesArgs extends core.SchemaArgs {
  propertyGroup: core.Array<PropertyGroup> | core.ArrayOut<PropertyGroup>;
}

export class EnvironmentProperties extends core.Schema<EnvironmentPropertiesArgs> {
  @core.attr(PropertyGroup, { kind: "array" })
  public propertyGroup!:
    | core.Array<PropertyGroup>
    | core.ArrayOut<PropertyGroup>;
}

export interface MonitoringConfigurationArgs extends core.SchemaArgs {
  configurationType: string | core.StringOut;

  logLevel?: string | core.StringOut;

  metricsLevel?: string | core.StringOut;
}

export class MonitoringConfiguration extends core.Schema<MonitoringConfigurationArgs> {
  @core.attr(String)
  public configurationType!: string | core.StringOut;

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

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

export interface ParallelismConfigurationArgs extends core.SchemaArgs {
  autoScalingEnabled?: boolean | core.BooleanOut;

  configurationType: string | core.StringOut;

  parallelism?: number | core.NumberOut;

  parallelismPerKpu?: number | core.NumberOut;
}

export class ParallelismConfiguration extends core.Schema<ParallelismConfigurationArgs> {
  @core.attr(Boolean, { computed: true })
  public autoScalingEnabled?: boolean | core.BooleanOut;

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

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

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

export interface CheckpointConfigurationArgs extends core.SchemaArgs {
  checkpointInterval?: number | core.NumberOut;

  checkpointingEnabled?: boolean | core.BooleanOut;

  configurationType: string | core.StringOut;

  minPauseBetweenCheckpoints?: number | core.NumberOut;
}

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

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

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

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

export interface FlinkApplicationConfigurationArgs extends core.SchemaArgs {
  checkpointConfiguration?: CheckpointConfiguration;

  monitoringConfiguration?: MonitoringConfiguration;

  parallelismConfiguration?: ParallelismConfiguration;
}

export class FlinkApplicationConfiguration extends core.Schema<FlinkApplicationConfigurationArgs> {
  @core.attr(CheckpointConfiguration, { computed: true })
  public checkpointConfiguration?: CheckpointConfiguration;

  @core.attr(MonitoringConfiguration, { computed: true })
  public monitoringConfiguration?: MonitoringConfiguration;

  @core.attr(ParallelismConfiguration, { computed: true })
  public parallelismConfiguration?: ParallelismConfiguration;
}

export interface ApplicationRestoreConfigurationArgs extends core.SchemaArgs {
  applicationRestoreType?: string | core.StringOut;

  snapshotName?: string | core.StringOut;
}

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

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

export interface FlinkRunConfigurationArgs extends core.SchemaArgs {
  allowNonRestoredState?: boolean | core.BooleanOut;
}

export class FlinkRunConfiguration extends core.Schema<FlinkRunConfigurationArgs> {
  @core.attr(Boolean, { computed: true })
  public allowNonRestoredState?: boolean | core.BooleanOut;
}

export interface RunConfigurationArgs extends core.SchemaArgs {
  applicationRestoreConfiguration?: ApplicationRestoreConfiguration;

  flinkRunConfiguration?: FlinkRunConfiguration;
}

export class RunConfiguration extends core.Schema<RunConfigurationArgs> {
  @core.attr(ApplicationRestoreConfiguration, { computed: true })
  public applicationRestoreConfiguration?: ApplicationRestoreConfiguration;

  @core.attr(FlinkRunConfiguration, { computed: true })
  public flinkRunConfiguration?: FlinkRunConfiguration;
}

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

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

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

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

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

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

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

  name: string | core.StringOut;

  sqlType: string | core.StringOut;
}

export class RecordColumn extends core.Schema<RecordColumnArgs> {
  @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 CsvMappingParametersArgs extends core.SchemaArgs {
  recordColumnDelimiter: string | core.StringOut;

  recordRowDelimiter: string | core.StringOut;
}

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

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

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

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

export interface MappingParametersArgs extends core.SchemaArgs {
  csvMappingParameters?: CsvMappingParameters;

  jsonMappingParameters?: JsonMappingParameters;
}

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

  @core.attr(JsonMappingParameters)
  public jsonMappingParameters?: JsonMappingParameters;
}

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)
  public recordFormatType!: string | core.StringOut;
}

export interface InputSchemaArgs extends core.SchemaArgs {
  recordColumn: core.Array<RecordColumn> | core.ArrayOut<RecordColumn>;

  recordEncoding?: string | core.StringOut;

  recordFormat: RecordFormat;
}

export class InputSchema extends core.Schema<InputSchemaArgs> {
  @core.attr(RecordColumn, { kind: "array" })
  public recordColumn!: core.Array<RecordColumn> | core.ArrayOut<RecordColumn>;

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

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

export interface InputStartingPositionConfigurationArgs
  extends core.SchemaArgs {
  inputStartingPosition?: string | core.StringOut;
}

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

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

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

export interface InputProcessingConfigurationArgs extends core.SchemaArgs {
  inputLambdaProcessor: InputLambdaProcessor;
}

export class InputProcessingConfiguration extends core.Schema<InputProcessingConfigurationArgs> {
  @core.attr(InputLambdaProcessor)
  public inputLambdaProcessor!: InputLambdaProcessor;
}

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

  inputId: string | core.StringOut;

  inputParallelism?: InputParallelism;

  inputProcessingConfiguration?: InputProcessingConfiguration;

  inputSchema: InputSchema;

  inputStartingPositionConfiguration?:
    | core.Array<InputStartingPositionConfiguration>
    | core.ArrayOut<InputStartingPositionConfiguration>;

  kinesisFirehoseInput?: KinesisFirehoseInput;

  kinesisStreamsInput?: KinesisStreamsInput;

  namePrefix: string | core.StringOut;
}

export class Input extends core.Schema<InputArgs> {
  @core.attr(String, { computed: true, kind: "array" })
  public inAppStreamNames!: core.Array<string> | core.ArrayOut<core.StringOut>;

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

  @core.attr(InputParallelism, { computed: true })
  public inputParallelism?: InputParallelism;

  @core.attr(InputProcessingConfiguration)
  public inputProcessingConfiguration?: InputProcessingConfiguration;

  @core.attr(InputSchema)
  public inputSchema!: InputSchema;

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

  @core.attr(KinesisFirehoseInput)
  public kinesisFirehoseInput?: KinesisFirehoseInput;

  @core.attr(KinesisStreamsInput)
  public kinesisStreamsInput?: KinesisStreamsInput;

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

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

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

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

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

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

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

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

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

export interface OutputArgs extends core.SchemaArgs {
  destinationSchema: DestinationSchema;

  kinesisFirehoseOutput?: KinesisFirehoseOutput;

  kinesisStreamsOutput?: KinesisStreamsOutput;

  lambdaOutput?: LambdaOutput;

  name: string | core.StringOut;

  outputId: string | core.StringOut;
}

export class Output extends core.Schema<OutputArgs> {
  @core.attr(DestinationSchema)
  public destinationSchema!: DestinationSchema;

  @core.attr(KinesisFirehoseOutput)
  public kinesisFirehoseOutput?: KinesisFirehoseOutput;

  @core.attr(KinesisStreamsOutput)
  public kinesisStreamsOutput?: KinesisStreamsOutput;

  @core.attr(LambdaOutput)
  public lambdaOutput?: LambdaOutput;

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

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

export interface ReferenceSchemaArgs extends core.SchemaArgs {
  recordColumn: core.Array<RecordColumn> | core.ArrayOut<RecordColumn>;

  recordEncoding?: string | core.StringOut;

  recordFormat: RecordFormat;
}

export class ReferenceSchema extends core.Schema<ReferenceSchemaArgs> {
  @core.attr(RecordColumn, { kind: "array" })
  public recordColumn!: core.Array<RecordColumn> | core.ArrayOut<RecordColumn>;

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

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

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

  fileKey: string | core.StringOut;
}

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

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

export interface ReferenceDataSourceArgs extends core.SchemaArgs {
  referenceId: string | core.StringOut;

  referenceSchema: ReferenceSchema;

  s3ReferenceDataSource: S3ReferenceDataSource;

  tableName: string | core.StringOut;
}

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

  @core.attr(ReferenceSchema)
  public referenceSchema!: ReferenceSchema;

  @core.attr(S3ReferenceDataSource)
  public s3ReferenceDataSource!: S3ReferenceDataSource;

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

export interface SqlApplicationConfigurationArgs extends core.SchemaArgs {
  input?: Input;

  output?: core.Array<Output> | core.ArrayOut<Output>;

  referenceDataSource?: ReferenceDataSource;
}

export class SqlApplicationConfiguration extends core.Schema<SqlApplicationConfigurationArgs> {
  @core.attr(Input)
  public input?: Input;

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

  @core.attr(ReferenceDataSource)
  public referenceDataSource?: ReferenceDataSource;
}

export interface ApplicationConfigurationArgs extends core.SchemaArgs {
  applicationCodeConfiguration: ApplicationCodeConfiguration;

  applicationSnapshotConfiguration?: ApplicationSnapshotConfiguration;

  environmentProperties?: EnvironmentProperties;

  flinkApplicationConfiguration?: FlinkApplicationConfiguration;

  runConfiguration?: RunConfiguration;

  sqlApplicationConfiguration?: SqlApplicationConfiguration;

  vpcConfiguration?: VpcConfiguration;
}

export class ApplicationConfiguration extends core.Schema<ApplicationConfigurationArgs> {
  @core.attr(ApplicationCodeConfiguration)
  public applicationCodeConfiguration!: ApplicationCodeConfiguration;

  @core.attr(ApplicationSnapshotConfiguration, { computed: true })
  public applicationSnapshotConfiguration?: ApplicationSnapshotConfiguration;

  @core.attr(EnvironmentProperties)
  public environmentProperties?: EnvironmentProperties;

  @core.attr(FlinkApplicationConfiguration, { computed: true })
  public flinkApplicationConfiguration?: FlinkApplicationConfiguration;

  @core.attr(RunConfiguration, { computed: true })
  public runConfiguration?: RunConfiguration;

  @core.attr(SqlApplicationConfiguration)
  public sqlApplicationConfiguration?: SqlApplicationConfiguration;

  @core.attr(VpcConfiguration)
  public vpcConfiguration?: VpcConfiguration;
}

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

  logStreamArn: string | core.StringOut;
}

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

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

export interface ApplicationArgs extends core.ResourceArgs {
  applicationConfiguration?: ApplicationConfiguration;

  cloudwatchLoggingOptions?: CloudwatchLoggingOptions;

  description?: string | core.StringOut;

  forceStop?: boolean | core.BooleanOut;

  name: string | core.StringOut;

  runtimeEnvironment: string | core.StringOut;

  serviceExecutionRole: string | core.StringOut;

  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(ApplicationConfiguration, { computed: true })
  public applicationConfiguration?: ApplicationConfiguration;

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

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

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

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

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

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

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

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

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

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

  @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 versionId!: number | core.NumberOut;

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

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