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

org.http4k.connect.amazon.systemsmanager.KotshiSystemsManagerJsonAdapterFactory.kt Maven / Gradle / Ivy

There is a newer version: 5.35.2.0
Show newest version
// Code generated by Kotshi. Do not edit.
@file:Suppress(
  "EXPERIMENTAL_IS_NOT_ENABLED",
  "REDUNDANT_PROJECTION",
)

package org.http4k.connect.amazon.systemsmanager

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.systemsmanager.action.DeleteParameter
import org.http4k.connect.amazon.systemsmanager.action.GetParameter
import org.http4k.connect.amazon.systemsmanager.action.KotshiDeleteParameterJsonAdapter
import org.http4k.connect.amazon.systemsmanager.action.KotshiGetParameterJsonAdapter
import org.http4k.connect.amazon.systemsmanager.action.KotshiParameterValueJsonAdapter
import org.http4k.connect.amazon.systemsmanager.action.KotshiPutParameterJsonAdapter
import org.http4k.connect.amazon.systemsmanager.action.KotshiPutParameterResultJsonAdapter
import org.http4k.connect.amazon.systemsmanager.action.ParameterValue
import org.http4k.connect.amazon.systemsmanager.action.PutParameter
import org.http4k.connect.amazon.systemsmanager.action.PutParameterResult
import org.http4k.connect.amazon.systemsmanager.model.KotshiParameterJsonAdapter
import org.http4k.connect.amazon.systemsmanager.model.KotshiParameterTypeJsonAdapter
import org.http4k.connect.amazon.systemsmanager.model.Parameter
import org.http4k.connect.amazon.systemsmanager.model.ParameterType
import se.ansman.kotshi.InternalKotshiApi

@OptIn(InternalKotshiApi::class)
internal object KotshiSystemsManagerJsonAdapterFactory : 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) {
      DeleteParameter::class.java ->
          KotshiDeleteParameterJsonAdapter(
            moshi = moshi
          )
      GetParameter::class.java ->
          KotshiGetParameterJsonAdapter(
            moshi = moshi
          )
      ParameterValue::class.java ->
          KotshiParameterValueJsonAdapter(
            moshi = moshi
          )
      PutParameter::class.java ->
          KotshiPutParameterJsonAdapter(
            moshi = moshi
          )
      PutParameterResult::class.java ->
          KotshiPutParameterResultJsonAdapter()
      Parameter::class.java ->
          KotshiParameterJsonAdapter(
            moshi = moshi
          )
      ParameterType::class.java ->
          KotshiParameterTypeJsonAdapter()
      else -> null
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy