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

export interface NetworkConfigurationArgs extends core.SchemaArgs {
  assignPublicIp?: boolean | core.BooleanOut;

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

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

export class NetworkConfiguration extends core.Schema<NetworkConfigurationArgs> {
  @core.attr(Boolean)
  public assignPublicIp?: boolean | core.BooleanOut;

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

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

export interface PlacementConstraintArgs extends core.SchemaArgs {
  expression?: string | core.StringOut;

  type: string | core.StringOut;
}

export class PlacementConstraint extends core.Schema<PlacementConstraintArgs> {
  @core.attr(String)
  public expression?: string | core.StringOut;

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

export interface EcsTargetArgs extends core.SchemaArgs {
  enableEcsManagedTags?: boolean | core.BooleanOut;

  enableExecuteCommand?: boolean | core.BooleanOut;

  group?: string | core.StringOut;

  launchType?: string | core.StringOut;

  networkConfiguration?: NetworkConfiguration;

  placementConstraint?:
    | core.Array<PlacementConstraint>
    | core.ArrayOut<PlacementConstraint>;

  platformVersion?: string | core.StringOut;

  propagateTags?: string | core.StringOut;

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

  taskCount?: number | core.NumberOut;

  taskDefinitionArn: string | core.StringOut;
}

export class EcsTarget extends core.Schema<EcsTargetArgs> {
  @core.attr(Boolean)
  public enableEcsManagedTags?: boolean | core.BooleanOut;

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

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

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

  @core.attr(NetworkConfiguration)
  public networkConfiguration?: NetworkConfiguration;

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

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

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

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

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

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

export interface DeadLetterConfigArgs extends core.SchemaArgs {
  arn?: string | core.StringOut;
}

export class DeadLetterConfig extends core.Schema<DeadLetterConfigArgs> {
  @core.attr(String)
  public arn?: string | core.StringOut;
}

export interface KinesisTargetArgs extends core.SchemaArgs {
  partitionKeyPath?: string | core.StringOut;
}

export class KinesisTarget extends core.Schema<KinesisTargetArgs> {
  @core.attr(String)
  public partitionKeyPath?: string | core.StringOut;
}

export interface RedshiftTargetArgs extends core.SchemaArgs {
  database: string | core.StringOut;

  dbUser?: string | core.StringOut;

  secretsManagerArn?: string | core.StringOut;

  sql?: string | core.StringOut;

  statementName?: string | core.StringOut;

  withEvent?: boolean | core.BooleanOut;
}

export class RedshiftTarget extends core.Schema<RedshiftTargetArgs> {
  @core.attr(String)
  public database!: string | core.StringOut;

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

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

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

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

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

export interface InputTransformerArgs extends core.SchemaArgs {
  inputPaths?: core.Map<string, string> | core.MapOut<core.StringOut>;

  inputTemplate: string | core.StringOut;
}

export class InputTransformer extends core.Schema<InputTransformerArgs> {
  @core.attr(String, { kind: "map" })
  public inputPaths?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

export interface BatchTargetArgs extends core.SchemaArgs {
  arraySize?: number | core.NumberOut;

  jobAttempts?: number | core.NumberOut;

  jobDefinition: string | core.StringOut;

  jobName: string | core.StringOut;
}

export class BatchTarget extends core.Schema<BatchTargetArgs> {
  @core.attr(Number)
  public arraySize?: number | core.NumberOut;

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

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

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

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

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

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

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

export interface HttpTargetArgs extends core.SchemaArgs {
  headerParameters?: core.Map<string, string> | core.MapOut<core.StringOut>;

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

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

export class HttpTarget extends core.Schema<HttpTargetArgs> {
  @core.attr(String, { kind: "map" })
  public headerParameters?:
    | core.Map<string, string>
    | core.MapOut<core.StringOut>;

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

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

export interface SqsTargetArgs extends core.SchemaArgs {
  messageGroupId?: string | core.StringOut;
}

export class SqsTarget extends core.Schema<SqsTargetArgs> {
  @core.attr(String)
  public messageGroupId?: string | core.StringOut;
}

export interface RetryPolicyArgs extends core.SchemaArgs {
  maximumEventAgeInSeconds?: number | core.NumberOut;

  maximumRetryAttempts?: number | core.NumberOut;
}

export class RetryPolicy extends core.Schema<RetryPolicyArgs> {
  @core.attr(Number)
  public maximumEventAgeInSeconds?: number | core.NumberOut;

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

export interface CloudwatchEventTargetArgs extends core.ResourceArgs {
  arn: string | core.StringOut;

  batchTarget?: BatchTarget;

  deadLetterConfig?: DeadLetterConfig;

  ecsTarget?: EcsTarget;

  eventBusName?: string | core.StringOut;

  httpTarget?: HttpTarget;

  input?: string | core.StringOut;

  inputPath?: string | core.StringOut;

  inputTransformer?: InputTransformer;

  kinesisTarget?: KinesisTarget;

  redshiftTarget?: RedshiftTarget;

  retryPolicy?: RetryPolicy;

  roleArn?: string | core.StringOut;

  rule: string | core.StringOut;

  runCommandTargets?:
    | core.Array<RunCommandTargets>
    | core.ArrayOut<RunCommandTargets>;

  sqsTarget?: SqsTarget;

  targetId?: string | core.StringOut;
}

export class CloudwatchEventTarget extends core.Resource<CloudwatchEventTargetArgs> {
  @core.attr(String)
  public arn!: string | core.StringOut;

  @core.attr(BatchTarget)
  public batchTarget?: BatchTarget;

  @core.attr(DeadLetterConfig)
  public deadLetterConfig?: DeadLetterConfig;

  @core.attr(EcsTarget)
  public ecsTarget?: EcsTarget;

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

  @core.attr(HttpTarget)
  public httpTarget?: HttpTarget;

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

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

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

  @core.attr(InputTransformer)
  public inputTransformer?: InputTransformer;

  @core.attr(KinesisTarget)
  public kinesisTarget?: KinesisTarget;

  @core.attr(RedshiftTarget)
  public redshiftTarget?: RedshiftTarget;

  @core.attr(RetryPolicy)
  public retryPolicy?: RetryPolicy;

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

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

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

  @core.attr(SqsTarget)
  public sqsTarget?: SqsTarget;

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

  constructor(name: string, args?: CloudwatchEventTargetArgs) {
    super(name, "aws_cloudwatch_event_target", args);
  }

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