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

export interface CustomFieldArgs extends core.SchemaArgs {
  name?: string | core.StringOut;

  type?: string | core.StringOut;
}

export class CustomField extends core.Schema<CustomFieldArgs> {
  @core.attr(String)
  public name?: string | core.StringOut;

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

export interface ManagedFieldArgs extends core.SchemaArgs {
  name?: string | core.StringOut;

  type?: string | core.StringOut;
}

export class ManagedField extends core.Schema<ManagedFieldArgs> {
  @core.attr(String)
  public name?: string | core.StringOut;

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

export interface ThingIndexingConfigurationArgs extends core.SchemaArgs {
  customField?: core.Array<CustomField> | core.ArrayOut<CustomField>;

  deviceDefenderIndexingMode?: string | core.StringOut;

  managedField?: core.Array<ManagedField> | core.ArrayOut<ManagedField>;

  namedShadowIndexingMode?: string | core.StringOut;

  thingConnectivityIndexingMode?: string | core.StringOut;

  thingIndexingMode: string | core.StringOut;
}

export class ThingIndexingConfiguration extends core.Schema<ThingIndexingConfigurationArgs> {
  @core.attr(CustomField, { kind: "array" })
  public customField?: core.Array<CustomField> | core.ArrayOut<CustomField>;

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

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

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

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

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

export interface ThingGroupIndexingConfigurationArgs extends core.SchemaArgs {
  customField?: core.Array<CustomField> | core.ArrayOut<CustomField>;

  managedField?: core.Array<ManagedField> | core.ArrayOut<ManagedField>;

  thingGroupIndexingMode: string | core.StringOut;
}

export class ThingGroupIndexingConfiguration extends core.Schema<ThingGroupIndexingConfigurationArgs> {
  @core.attr(CustomField, { kind: "array" })
  public customField?: core.Array<CustomField> | core.ArrayOut<CustomField>;

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

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

export interface IndexingConfigurationArgs extends core.ResourceArgs {
  thingGroupIndexingConfiguration?: ThingGroupIndexingConfiguration;

  thingIndexingConfiguration?: ThingIndexingConfiguration;
}

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

  @core.attr(ThingGroupIndexingConfiguration, { computed: true })
  public thingGroupIndexingConfiguration?: ThingGroupIndexingConfiguration;

  @core.attr(ThingIndexingConfiguration, { computed: true })
  public thingIndexingConfiguration?: ThingIndexingConfiguration;

  constructor(name: string, args?: IndexingConfigurationArgs) {
    super(name, "aws_iot_indexing_configuration", args);
  }

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