Skip to content

Commit

Permalink
feat(specs): add secrets authentications to ingestion (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4054

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed Oct 30, 2024
1 parent 8ddb3e6 commit 8dea972
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import kotlin.jvm.JvmInline
* - [AuthBasic]
* - [AuthGoogleServiceAccount]
* - [AuthOAuth]
* - [Map<kotlin.String, String>] - *[AuthInput.of]*
*/
@Serializable(AuthInputSerializer::class)
public sealed interface AuthInput {
Expand Down Expand Up @@ -47,6 +48,10 @@ public sealed interface AuthInput {
@JvmInline
public value class AuthAlgoliaInsightsValue(public val value: AuthAlgoliaInsights) : AuthInput

@Serializable
@JvmInline
public value class MapOfkotlinStringStringValue(public val value: Map<kotlin.String, String>) : AuthInput

public companion object {

public fun of(value: AuthOAuth): AuthInput {
Expand All @@ -67,6 +72,9 @@ public sealed interface AuthInput {
public fun of(value: AuthAlgoliaInsights): AuthInput {
return AuthAlgoliaInsightsValue(value)
}
public fun of(value: Map<kotlin.String, String>): AuthInput {
return MapOfkotlinStringStringValue(value)
}
}
}

Expand All @@ -79,6 +87,7 @@ internal class AuthInputSerializer : JsonContentPolymorphicSerializer<AuthInput>
element is JsonObject && element.containsKey("key") -> AuthAPIKey.serializer()
element is JsonObject -> AuthAlgolia.serializer()
element is JsonObject -> AuthAlgoliaInsights.serializer()
element is JsonObject -> AuthInput.MapOfkotlinStringStringValue.serializer()
else -> throw AlgoliaClientException("Failed to deserialize json element: $element")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ public enum class AuthenticationType(public val value: kotlin.String) {
Algolia("algolia"),

@SerialName(value = "algoliaInsights")
AlgoliaInsights("algoliaInsights");
AlgoliaInsights("algoliaInsights"),

@SerialName(value = "secrets")
Secrets("secrets");

override fun toString(): kotlin.String = value
}

0 comments on commit 8dea972

Please sign in to comment.