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

export interface ScalingParametersArgs extends core.SchemaArgs {
  desiredInstanceType?: string | core.StringOut;

  desiredPartitionCount?: number | core.NumberOut;

  desiredReplicationCount?: number | core.NumberOut;
}

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

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

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

export interface IndexFieldArgs extends core.SchemaArgs {
  analysisScheme?: string | core.StringOut;

  defaultValue?: string | core.StringOut;

  facet?: boolean | core.BooleanOut;

  highlight?: boolean | core.BooleanOut;

  name: string | core.StringOut;

  return?: boolean | core.BooleanOut;

  search?: boolean | core.BooleanOut;

  sort?: boolean | core.BooleanOut;

  sourceFields?: string | core.StringOut;

  type: string | core.StringOut;
}

export class IndexField extends core.Schema<IndexFieldArgs> {
  @core.attr(String)
  public analysisScheme?: string | core.StringOut;

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

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

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

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

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

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

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

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

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

export interface EndpointOptionsArgs extends core.SchemaArgs {
  enforceHttps?: boolean | core.BooleanOut;

  tlsSecurityPolicy?: string | core.StringOut;
}

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

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

export interface DomainArgs extends core.ResourceArgs {
  endpointOptions?: EndpointOptions;

  indexField?: core.Array<IndexField> | core.ArrayOut<IndexField>;

  multiAz?: boolean | core.BooleanOut;

  name: string | core.StringOut;

  scalingParameters?: ScalingParameters;
}

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

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

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

  @core.attr(EndpointOptions, { computed: true })
  public endpointOptions?: EndpointOptions;

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

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

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

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

  @core.attr(ScalingParameters, { computed: true })
  public scalingParameters?: ScalingParameters;

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

  constructor(name: string, args?: DomainArgs) {
    super(name, "aws_cloudsearch_domain", args);
  }

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