Skip to content

Commit ef0804f

Browse files
algolia-botraed667
andcommitted
feat(specs): add (optional) _automaticInsights to search result (generated)
algolia/api-clients-automation#3688 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Raed <[email protected]>
1 parent 812b00c commit ef0804f

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

client/src/commonMain/kotlin/com/algolia/client/model/recommend/RecommendationsResults.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import kotlinx.serialization.json.*
3636
* @param serverUsed Host name of the server that processed the request.
3737
* @param userData An object with custom data. You can store up to 32kB as custom data.
3838
* @param queryID Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
39+
* @param automaticInsights Whether automatic events collection is enabled for the application.
3940
*/
4041
@Serializable
4142
public data class RecommendationsResults(
@@ -125,4 +126,7 @@ public data class RecommendationsResults(
125126

126127
/** Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/). */
127128
@SerialName(value = "queryID") val queryID: String? = null,
129+
130+
/** Whether automatic events collection is enabled for the application. */
131+
@SerialName(value = "_automaticInsights") val automaticInsights: Boolean? = null,
128132
)

client/src/commonMain/kotlin/com/algolia/client/model/search/BrowseResponse.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import kotlinx.serialization.json.*
3434
* @param serverUsed Host name of the server that processed the request.
3535
* @param userData An object with custom data. You can store up to 32kB as custom data.
3636
* @param queryID Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
37+
* @param automaticInsights Whether automatic events collection is enabled for the application.
3738
* @param page Page of search results to retrieve.
3839
* @param nbHits Number of results (hits).
3940
* @param nbPages Number of pages of results.
@@ -124,6 +125,9 @@ public data class BrowseResponse(
124125
/** Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/). */
125126
@SerialName(value = "queryID") val queryID: String? = null,
126127

128+
/** Whether automatic events collection is enabled for the application. */
129+
@SerialName(value = "_automaticInsights") val automaticInsights: Boolean? = null,
130+
127131
/** Page of search results to retrieve. */
128132
@SerialName(value = "page") val page: Int? = null,
129133

client/src/commonMain/kotlin/com/algolia/client/model/search/SearchResponse.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import kotlinx.serialization.json.*
4141
* @param serverUsed Host name of the server that processed the request.
4242
* @param userData An object with custom data. You can store up to 32kB as custom data.
4343
* @param queryID Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/).
44+
* @param automaticInsights Whether automatic events collection is enabled for the application.
4445
*/
4546
@Serializable(SearchResponseSerializer::class)
4647
public data class SearchResponse(
@@ -138,6 +139,9 @@ public data class SearchResponse(
138139
/** Unique identifier for the query. This is used for [click analytics](https://www.algolia.com/doc/guides/analytics/click-analytics/). */
139140
val queryID: String? = null,
140141

142+
/** Whether automatic events collection is enabled for the application. */
143+
val automaticInsights: Boolean? = null,
144+
141145
val additionalProperties: Map<String, JsonElement>? = null,
142146
) : SearchResult
143147

@@ -175,6 +179,7 @@ internal object SearchResponseSerializer : KSerializer<SearchResponse> {
175179
element<String>("serverUsed", isOptional = true)
176180
element<JsonObject>("userData", isOptional = true)
177181
element<String>("queryID", isOptional = true)
182+
element<Boolean>("_automaticInsights", isOptional = true)
178183
}
179184

180185
override fun deserialize(decoder: Decoder): SearchResponse {
@@ -212,6 +217,7 @@ internal object SearchResponseSerializer : KSerializer<SearchResponse> {
212217
serverUsed = tree["serverUsed"]?.let { input.json.decodeFromJsonElement(it) },
213218
userData = tree["userData"]?.let { input.json.decodeFromJsonElement(it) },
214219
queryID = tree["queryID"]?.let { input.json.decodeFromJsonElement(it) },
220+
automaticInsights = tree["_automaticInsights"]?.let { input.json.decodeFromJsonElement(it) },
215221
additionalProperties = tree.filterKeys { it !in descriptor.elementNames },
216222
)
217223
}
@@ -250,6 +256,7 @@ internal object SearchResponseSerializer : KSerializer<SearchResponse> {
250256
value.serverUsed?.let { put("serverUsed", output.json.encodeToJsonElement(it)) }
251257
value.userData?.let { put("userData", output.json.encodeToJsonElement(it)) }
252258
value.queryID?.let { put("queryID", output.json.encodeToJsonElement(it)) }
259+
value.automaticInsights?.let { put("_automaticInsights", output.json.encodeToJsonElement(it)) }
253260
value.additionalProperties?.onEach { (key, element) -> put(key, element) }
254261
}
255262
(encoder as JsonEncoder).encodeJsonElement(json)

0 commit comments

Comments
 (0)