Skip to content

Commit f42341d

Browse files
algolia-botmillotp
andcommitted
everywhere (generated)
Co-authored-by: Pierre Millot <[email protected]>
1 parent 55c573b commit f42341d

File tree

70 files changed

+565
-895
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+565
-895
lines changed

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/abtesting/AddABTestsVariant.kt

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,16 @@ public sealed interface AddABTestsVariant {
2929

3030
public companion object {
3131

32-
public fun of(value: AbTestsVariantSearchParams): AddABTestsVariant {
33-
return AbTestsVariantSearchParamsValue(value)
34-
}
35-
public fun of(value: AbTestsVariant): AddABTestsVariant {
36-
return AbTestsVariantValue(value)
37-
}
32+
public fun of(value: AbTestsVariantSearchParams): AddABTestsVariant = AbTestsVariantSearchParamsValue(value)
33+
34+
public fun of(value: AbTestsVariant): AddABTestsVariant = AbTestsVariantValue(value)
3835
}
3936
}
4037

4138
internal class AddABTestsVariantSerializer : JsonContentPolymorphicSerializer<AddABTestsVariant>(AddABTestsVariant::class) {
42-
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<AddABTestsVariant> {
43-
return when {
44-
element is JsonObject && element.containsKey("customSearchParameters") -> AbTestsVariantSearchParams.serializer()
45-
element is JsonObject -> AbTestsVariant.serializer()
46-
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
47-
}
39+
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<AddABTestsVariant> = when {
40+
element is JsonObject && element.containsKey("customSearchParameters") -> AbTestsVariantSearchParams.serializer()
41+
element is JsonObject -> AbTestsVariant.serializer()
42+
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
4843
}
4944
}

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/analytics/GetTopHitsResponse.kt

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,19 @@ public sealed interface GetTopHitsResponse {
3434

3535
public companion object {
3636

37-
public fun of(value: TopHitsResponse): GetTopHitsResponse {
38-
return TopHitsResponseValue(value)
39-
}
40-
public fun of(value: TopHitsResponseWithAnalytics): GetTopHitsResponse {
41-
return TopHitsResponseWithAnalyticsValue(value)
42-
}
43-
public fun of(value: TopHitsResponseWithRevenueAnalytics): GetTopHitsResponse {
44-
return TopHitsResponseWithRevenueAnalyticsValue(value)
45-
}
37+
public fun of(value: TopHitsResponse): GetTopHitsResponse = TopHitsResponseValue(value)
38+
39+
public fun of(value: TopHitsResponseWithAnalytics): GetTopHitsResponse = TopHitsResponseWithAnalyticsValue(value)
40+
41+
public fun of(value: TopHitsResponseWithRevenueAnalytics): GetTopHitsResponse = TopHitsResponseWithRevenueAnalyticsValue(value)
4642
}
4743
}
4844

4945
internal class GetTopHitsResponseSerializer : JsonContentPolymorphicSerializer<GetTopHitsResponse>(GetTopHitsResponse::class) {
50-
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<GetTopHitsResponse> {
51-
return when {
52-
element is JsonObject -> TopHitsResponse.serializer()
53-
element is JsonObject -> TopHitsResponseWithAnalytics.serializer()
54-
element is JsonObject -> TopHitsResponseWithRevenueAnalytics.serializer()
55-
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
56-
}
46+
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<GetTopHitsResponse> = when {
47+
element is JsonObject -> TopHitsResponse.serializer()
48+
element is JsonObject -> TopHitsResponseWithAnalytics.serializer()
49+
element is JsonObject -> TopHitsResponseWithRevenueAnalytics.serializer()
50+
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
5751
}
5852
}

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/analytics/GetTopSearchesResponse.kt

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,19 @@ public sealed interface GetTopSearchesResponse {
3434

3535
public companion object {
3636

37-
public fun of(value: TopSearchesResponse): GetTopSearchesResponse {
38-
return TopSearchesResponseValue(value)
39-
}
40-
public fun of(value: TopSearchesResponseWithAnalytics): GetTopSearchesResponse {
41-
return TopSearchesResponseWithAnalyticsValue(value)
42-
}
43-
public fun of(value: TopSearchesResponseWithRevenueAnalytics): GetTopSearchesResponse {
44-
return TopSearchesResponseWithRevenueAnalyticsValue(value)
45-
}
37+
public fun of(value: TopSearchesResponse): GetTopSearchesResponse = TopSearchesResponseValue(value)
38+
39+
public fun of(value: TopSearchesResponseWithAnalytics): GetTopSearchesResponse = TopSearchesResponseWithAnalyticsValue(value)
40+
41+
public fun of(value: TopSearchesResponseWithRevenueAnalytics): GetTopSearchesResponse = TopSearchesResponseWithRevenueAnalyticsValue(value)
4642
}
4743
}
4844

4945
internal class GetTopSearchesResponseSerializer : JsonContentPolymorphicSerializer<GetTopSearchesResponse>(GetTopSearchesResponse::class) {
50-
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<GetTopSearchesResponse> {
51-
return when {
52-
element is JsonObject -> TopSearchesResponse.serializer()
53-
element is JsonObject -> TopSearchesResponseWithAnalytics.serializer()
54-
element is JsonObject -> TopSearchesResponseWithRevenueAnalytics.serializer()
55-
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
56-
}
46+
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<GetTopSearchesResponse> = when {
47+
element is JsonObject -> TopSearchesResponse.serializer()
48+
element is JsonObject -> TopSearchesResponseWithAnalytics.serializer()
49+
element is JsonObject -> TopSearchesResponseWithRevenueAnalytics.serializer()
50+
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
5751
}
5852
}

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/ingestion/AuthInput.kt

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -54,41 +54,31 @@ public sealed interface AuthInput {
5454

5555
public companion object {
5656

57-
public fun of(value: AuthOAuth): AuthInput {
58-
return AuthOAuthValue(value)
59-
}
60-
public fun of(value: AuthGoogleServiceAccount): AuthInput {
61-
return AuthGoogleServiceAccountValue(value)
62-
}
63-
public fun of(value: AuthBasic): AuthInput {
64-
return AuthBasicValue(value)
65-
}
66-
public fun of(value: AuthAPIKey): AuthInput {
67-
return AuthAPIKeyValue(value)
68-
}
69-
public fun of(value: AuthAlgolia): AuthInput {
70-
return AuthAlgoliaValue(value)
71-
}
72-
public fun of(value: AuthAlgoliaInsights): AuthInput {
73-
return AuthAlgoliaInsightsValue(value)
74-
}
75-
public fun of(value: Map<kotlin.String, String>): AuthInput {
76-
return MapOfkotlinStringStringValue(value)
77-
}
57+
public fun of(value: AuthOAuth): AuthInput = AuthOAuthValue(value)
58+
59+
public fun of(value: AuthGoogleServiceAccount): AuthInput = AuthGoogleServiceAccountValue(value)
60+
61+
public fun of(value: AuthBasic): AuthInput = AuthBasicValue(value)
62+
63+
public fun of(value: AuthAPIKey): AuthInput = AuthAPIKeyValue(value)
64+
65+
public fun of(value: AuthAlgolia): AuthInput = AuthAlgoliaValue(value)
66+
67+
public fun of(value: AuthAlgoliaInsights): AuthInput = AuthAlgoliaInsightsValue(value)
68+
69+
public fun of(value: Map<kotlin.String, String>): AuthInput = MapOfkotlinStringStringValue(value)
7870
}
7971
}
8072

8173
internal class AuthInputSerializer : JsonContentPolymorphicSerializer<AuthInput>(AuthInput::class) {
82-
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<AuthInput> {
83-
return when {
84-
element is JsonObject && element.containsKey("url") && element.containsKey("client_id") && element.containsKey("client_secret") -> AuthOAuth.serializer()
85-
element is JsonObject && element.containsKey("clientEmail") && element.containsKey("privateKey") -> AuthGoogleServiceAccount.serializer()
86-
element is JsonObject && element.containsKey("username") && element.containsKey("password") -> AuthBasic.serializer()
87-
element is JsonObject && element.containsKey("key") -> AuthAPIKey.serializer()
88-
element is JsonObject -> AuthAlgolia.serializer()
89-
element is JsonObject -> AuthAlgoliaInsights.serializer()
90-
element is JsonObject -> AuthInput.MapOfkotlinStringStringValue.serializer()
91-
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
92-
}
74+
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<AuthInput> = when {
75+
element is JsonObject && element.containsKey("url") && element.containsKey("client_id") && element.containsKey("client_secret") -> AuthOAuth.serializer()
76+
element is JsonObject && element.containsKey("clientEmail") && element.containsKey("privateKey") -> AuthGoogleServiceAccount.serializer()
77+
element is JsonObject && element.containsKey("username") && element.containsKey("password") -> AuthBasic.serializer()
78+
element is JsonObject && element.containsKey("key") -> AuthAPIKey.serializer()
79+
element is JsonObject -> AuthAlgolia.serializer()
80+
element is JsonObject -> AuthAlgoliaInsights.serializer()
81+
element is JsonObject -> AuthInput.MapOfkotlinStringStringValue.serializer()
82+
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
9383
}
9484
}

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/ingestion/AuthInputPartial.kt

Lines changed: 22 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -54,41 +54,31 @@ public sealed interface AuthInputPartial {
5454

5555
public companion object {
5656

57-
public fun of(value: AuthGoogleServiceAccountPartial): AuthInputPartial {
58-
return AuthGoogleServiceAccountPartialValue(value)
59-
}
60-
public fun of(value: AuthBasicPartial): AuthInputPartial {
61-
return AuthBasicPartialValue(value)
62-
}
63-
public fun of(value: AuthAPIKeyPartial): AuthInputPartial {
64-
return AuthAPIKeyPartialValue(value)
65-
}
66-
public fun of(value: AuthOAuthPartial): AuthInputPartial {
67-
return AuthOAuthPartialValue(value)
68-
}
69-
public fun of(value: AuthAlgoliaPartial): AuthInputPartial {
70-
return AuthAlgoliaPartialValue(value)
71-
}
72-
public fun of(value: AuthAlgoliaInsightsPartial): AuthInputPartial {
73-
return AuthAlgoliaInsightsPartialValue(value)
74-
}
75-
public fun of(value: Map<kotlin.String, String>): AuthInputPartial {
76-
return MapOfkotlinStringStringValue(value)
77-
}
57+
public fun of(value: AuthGoogleServiceAccountPartial): AuthInputPartial = AuthGoogleServiceAccountPartialValue(value)
58+
59+
public fun of(value: AuthBasicPartial): AuthInputPartial = AuthBasicPartialValue(value)
60+
61+
public fun of(value: AuthAPIKeyPartial): AuthInputPartial = AuthAPIKeyPartialValue(value)
62+
63+
public fun of(value: AuthOAuthPartial): AuthInputPartial = AuthOAuthPartialValue(value)
64+
65+
public fun of(value: AuthAlgoliaPartial): AuthInputPartial = AuthAlgoliaPartialValue(value)
66+
67+
public fun of(value: AuthAlgoliaInsightsPartial): AuthInputPartial = AuthAlgoliaInsightsPartialValue(value)
68+
69+
public fun of(value: Map<kotlin.String, String>): AuthInputPartial = MapOfkotlinStringStringValue(value)
7870
}
7971
}
8072

8173
internal class AuthInputPartialSerializer : JsonContentPolymorphicSerializer<AuthInputPartial>(AuthInputPartial::class) {
82-
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<AuthInputPartial> {
83-
return when {
84-
element is JsonObject && element.containsKey("clientEmail") -> AuthGoogleServiceAccountPartial.serializer()
85-
element is JsonObject && element.containsKey("username") -> AuthBasicPartial.serializer()
86-
element is JsonObject && element.containsKey("key") -> AuthAPIKeyPartial.serializer()
87-
element is JsonObject && element.containsKey("url") -> AuthOAuthPartial.serializer()
88-
element is JsonObject -> AuthAlgoliaPartial.serializer()
89-
element is JsonObject -> AuthAlgoliaInsightsPartial.serializer()
90-
element is JsonObject -> AuthInputPartial.MapOfkotlinStringStringValue.serializer()
91-
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
92-
}
74+
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<AuthInputPartial> = when {
75+
element is JsonObject && element.containsKey("clientEmail") -> AuthGoogleServiceAccountPartial.serializer()
76+
element is JsonObject && element.containsKey("username") -> AuthBasicPartial.serializer()
77+
element is JsonObject && element.containsKey("key") -> AuthAPIKeyPartial.serializer()
78+
element is JsonObject && element.containsKey("url") -> AuthOAuthPartial.serializer()
79+
element is JsonObject -> AuthAlgoliaPartial.serializer()
80+
element is JsonObject -> AuthAlgoliaInsightsPartial.serializer()
81+
element is JsonObject -> AuthInputPartial.MapOfkotlinStringStringValue.serializer()
82+
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
9383
}
9484
}

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/ingestion/DestinationInput.kt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,13 @@ public sealed interface DestinationInput {
2424

2525
public companion object {
2626

27-
public fun of(value: DestinationIndexName): DestinationInput {
28-
return DestinationIndexNameValue(value)
29-
}
27+
public fun of(value: DestinationIndexName): DestinationInput = DestinationIndexNameValue(value)
3028
}
3129
}
3230

3331
internal class DestinationInputSerializer : JsonContentPolymorphicSerializer<DestinationInput>(DestinationInput::class) {
34-
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<DestinationInput> {
35-
return when {
36-
element is JsonObject -> DestinationIndexName.serializer()
37-
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
38-
}
32+
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<DestinationInput> = when {
33+
element is JsonObject -> DestinationIndexName.serializer()
34+
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
3935
}
4036
}

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/ingestion/PlatformWithNone.kt

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,16 @@ public sealed interface PlatformWithNone {
2929

3030
public companion object {
3131

32-
public fun of(value: Platform): PlatformWithNone {
33-
return PlatformValue(value)
34-
}
35-
public fun of(value: PlatformNone): PlatformWithNone {
36-
return PlatformNoneValue(value)
37-
}
32+
public fun of(value: Platform): PlatformWithNone = PlatformValue(value)
33+
34+
public fun of(value: PlatformNone): PlatformWithNone = PlatformNoneValue(value)
3835
}
3936
}
4037

4138
internal class PlatformWithNoneSerializer : JsonContentPolymorphicSerializer<PlatformWithNone>(PlatformWithNone::class) {
42-
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<PlatformWithNone> {
43-
return when {
44-
element.isString -> Platform.serializer()
45-
element.isString -> PlatformNone.serializer()
46-
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
47-
}
39+
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<PlatformWithNone> = when {
40+
element.isString -> Platform.serializer()
41+
element.isString -> PlatformNone.serializer()
42+
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
4843
}
4944
}

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/ingestion/SourceBigQuery.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@ public data class SourceBigQuery(
3737

3838
/** Name of a column that contains a unique ID which will be used as `objectID` in Algolia. */
3939
@SerialName(value = "uniqueIDColumn") val uniqueIDColumn: String? = null,
40-
) : SourceInput, SourceUpdateInput
40+
) : SourceInput,
41+
SourceUpdateInput

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/ingestion/SourceCSV.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ public data class SourceCSV(
2929

3030
/** The character used to split the value on each line, default to a comma (\\r, \\n, 0xFFFD, and space are forbidden). */
3131
@SerialName(value = "delimiter") val delimiter: String? = null,
32-
) : SourceInput, SourceUpdateInput
32+
) : SourceInput,
33+
SourceUpdateInput

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/ingestion/SourceGA4BigQueryExport.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ public data class SourceGA4BigQueryExport(
2222

2323
/** Prefix of the tables that the BigQuery Export writes to. */
2424
@SerialName(value = "tablePrefix") val tablePrefix: String,
25-
) : SourceInput, SourceUpdateInput
25+
) : SourceInput,
26+
SourceUpdateInput

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/ingestion/SourceInput.kt

Lines changed: 25 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -59,45 +59,34 @@ public sealed interface SourceInput {
5959

6060
public companion object {
6161

62-
public fun of(value: SourceGA4BigQueryExport): SourceInput {
63-
return SourceGA4BigQueryExportValue(value)
64-
}
65-
public fun of(value: SourceDocker): SourceInput {
66-
return SourceDockerValue(value)
67-
}
68-
public fun of(value: SourceCommercetools): SourceInput {
69-
return SourceCommercetoolsValue(value)
70-
}
71-
public fun of(value: SourceBigCommerce): SourceInput {
72-
return SourceBigCommerceValue(value)
73-
}
74-
public fun of(value: SourceBigQuery): SourceInput {
75-
return SourceBigQueryValue(value)
76-
}
77-
public fun of(value: SourceShopify): SourceInput {
78-
return SourceShopifyValue(value)
79-
}
80-
public fun of(value: SourceJSON): SourceInput {
81-
return SourceJSONValue(value)
82-
}
83-
public fun of(value: SourceCSV): SourceInput {
84-
return SourceCSVValue(value)
85-
}
62+
public fun of(value: SourceGA4BigQueryExport): SourceInput = SourceGA4BigQueryExportValue(value)
63+
64+
public fun of(value: SourceDocker): SourceInput = SourceDockerValue(value)
65+
66+
public fun of(value: SourceCommercetools): SourceInput = SourceCommercetoolsValue(value)
67+
68+
public fun of(value: SourceBigCommerce): SourceInput = SourceBigCommerceValue(value)
69+
70+
public fun of(value: SourceBigQuery): SourceInput = SourceBigQueryValue(value)
71+
72+
public fun of(value: SourceShopify): SourceInput = SourceShopifyValue(value)
73+
74+
public fun of(value: SourceJSON): SourceInput = SourceJSONValue(value)
75+
76+
public fun of(value: SourceCSV): SourceInput = SourceCSVValue(value)
8677
}
8778
}
8879

8980
internal class SourceInputSerializer : JsonContentPolymorphicSerializer<SourceInput>(SourceInput::class) {
90-
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<SourceInput> {
91-
return when {
92-
element is JsonObject && element.containsKey("projectID") && element.containsKey("datasetID") && element.containsKey("tablePrefix") -> SourceGA4BigQueryExport.serializer()
93-
element is JsonObject && element.containsKey("image") && element.containsKey("configuration") -> SourceDocker.serializer()
94-
element is JsonObject && element.containsKey("projectKey") -> SourceCommercetools.serializer()
95-
element is JsonObject && element.containsKey("storeHash") -> SourceBigCommerce.serializer()
96-
element is JsonObject && element.containsKey("projectID") -> SourceBigQuery.serializer()
97-
element is JsonObject && element.containsKey("shopURL") -> SourceShopify.serializer()
98-
element is JsonObject -> SourceJSON.serializer()
99-
element is JsonObject -> SourceCSV.serializer()
100-
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
101-
}
81+
override fun selectDeserializer(element: JsonElement): DeserializationStrategy<SourceInput> = when {
82+
element is JsonObject && element.containsKey("projectID") && element.containsKey("datasetID") && element.containsKey("tablePrefix") -> SourceGA4BigQueryExport.serializer()
83+
element is JsonObject && element.containsKey("image") && element.containsKey("configuration") -> SourceDocker.serializer()
84+
element is JsonObject && element.containsKey("projectKey") -> SourceCommercetools.serializer()
85+
element is JsonObject && element.containsKey("storeHash") -> SourceBigCommerce.serializer()
86+
element is JsonObject && element.containsKey("projectID") -> SourceBigQuery.serializer()
87+
element is JsonObject && element.containsKey("shopURL") -> SourceShopify.serializer()
88+
element is JsonObject -> SourceJSON.serializer()
89+
element is JsonObject -> SourceCSV.serializer()
90+
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
10291
}
10392
}

clients/algoliasearch-client-kotlin/client/src/commonMain/kotlin/com/algolia/client/model/ingestion/SourceJSON.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ public data class SourceJSON(
2121
@SerialName(value = "uniqueIDColumn") val uniqueIDColumn: String? = null,
2222

2323
@SerialName(value = "method") val method: MethodType? = null,
24-
) : SourceInput, SourceUpdateInput
24+
) : SourceInput,
25+
SourceUpdateInput

0 commit comments

Comments
 (0)