@@ -20,6 +20,7 @@ import kotlin.jvm.JvmInline
20
20
* - [AuthBasic]
21
21
* - [AuthGoogleServiceAccount]
22
22
* - [AuthOAuth]
23
+ * - [Map<kotlin.String, String>] - *[AuthInput.of]*
23
24
*/
24
25
@Serializable(AuthInputSerializer ::class )
25
26
public sealed interface AuthInput {
@@ -47,6 +48,10 @@ public sealed interface AuthInput {
47
48
@JvmInline
48
49
public value class AuthAlgoliaInsightsValue (public val value : AuthAlgoliaInsights ) : AuthInput
49
50
51
+ @Serializable
52
+ @JvmInline
53
+ public value class MapOfkotlinStringStringValue (public val value : Map <kotlin.String , String >) : AuthInput
54
+
50
55
public companion object {
51
56
52
57
public fun of (value : AuthOAuth ): AuthInput {
@@ -67,6 +72,9 @@ public sealed interface AuthInput {
67
72
public fun of (value : AuthAlgoliaInsights ): AuthInput {
68
73
return AuthAlgoliaInsightsValue (value)
69
74
}
75
+ public fun of (value : Map <kotlin.String , String >): AuthInput {
76
+ return MapOfkotlinStringStringValue (value)
77
+ }
70
78
}
71
79
}
72
80
@@ -79,6 +87,7 @@ internal class AuthInputSerializer : JsonContentPolymorphicSerializer<AuthInput>
79
87
element is JsonObject && element.containsKey(" key" ) -> AuthAPIKey .serializer()
80
88
element is JsonObject -> AuthAlgolia .serializer()
81
89
element is JsonObject -> AuthAlgoliaInsights .serializer()
90
+ element is JsonObject -> AuthInput .MapOfkotlinStringStringValue .serializer()
82
91
else -> throw AlgoliaClientException (" Failed to deserialize json element: $element " )
83
92
}
84
93
}
0 commit comments