All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.http4k.connect.amazon.iamidentitycenter.KotshiIAMIdentityCenterJsonAdapterFactory.kt Maven / Gradle / Ivy

// Code generated by Kotshi. Do not edit.
@file:Suppress(
  "EXPERIMENTAL_IS_NOT_ENABLED",
  "REDUNDANT_PROJECTION",
)

package org.http4k.connect.amazon.iamidentitycenter

import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.Moshi
import com.squareup.moshi.Types.getRawType
import java.lang.Class
import java.lang.reflect.Type
import kotlin.Annotation
import kotlin.OptIn
import kotlin.Suppress
import kotlin.collections.Set
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.AuthorizationStarted
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.CreateToken
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.DeviceToken
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.KotshiAuthorizationStartedJsonAdapter
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.KotshiCreateTokenJsonAdapter
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.KotshiDeviceTokenJsonAdapter
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.KotshiRegisterClientJsonAdapter
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.KotshiRegisteredClientJsonAdapter
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.KotshiStartDeviceAuthorizationJsonAdapter
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.RegisterClient
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.RegisteredClient
import org.http4k.connect.amazon.iamidentitycenter.oidc.action.StartDeviceAuthorization
import org.http4k.connect.amazon.iamidentitycenter.sso.action.FederatedCredentials
import org.http4k.connect.amazon.iamidentitycenter.sso.action.KotshiFederatedCredentialsJsonAdapter
import org.http4k.connect.amazon.iamidentitycenter.sso.action.KotshiRoleCredentialsJsonAdapter
import org.http4k.connect.amazon.iamidentitycenter.sso.action.RoleCredentials
import se.ansman.kotshi.InternalKotshiApi

@OptIn(InternalKotshiApi::class)
internal object KotshiIAMIdentityCenterJsonAdapterFactory : JsonAdapter.Factory {
  override fun create(
    type: Type,
    annotations: Set,
    moshi: Moshi,
  ): JsonAdapter<*>? {
    val rawType: Class<*> = getRawType(type)
    if (annotations.isNotEmpty()) return null

    return when (rawType) {
      AuthorizationStarted::class.java ->
          KotshiAuthorizationStartedJsonAdapter(
            moshi = moshi
          )
      CreateToken::class.java ->
          KotshiCreateTokenJsonAdapter(
            moshi = moshi
          )
      DeviceToken::class.java ->
          KotshiDeviceTokenJsonAdapter(
            moshi = moshi
          )
      RegisterClient::class.java ->
          KotshiRegisterClientJsonAdapter(
            moshi = moshi
          )
      RegisteredClient::class.java ->
          KotshiRegisteredClientJsonAdapter(
            moshi = moshi
          )
      StartDeviceAuthorization::class.java ->
          KotshiStartDeviceAuthorizationJsonAdapter(
            moshi = moshi
          )
      FederatedCredentials::class.java ->
          KotshiFederatedCredentialsJsonAdapter(
            moshi = moshi
          )
      RoleCredentials::class.java ->
          KotshiRoleCredentialsJsonAdapter(
            moshi = moshi
          )
      else -> null
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy