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

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

There is a newer version: 5.35.2.0
Show newest version
package org.http4k.connect.amazon.systemsmanager

import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.Moshi
import org.http4k.connect.amazon.systemsmanager.model.SSMParameterName
import org.http4k.format.AutoMappingConfiguration
import org.http4k.format.AwsCoreJsonAdapterFactory
import org.http4k.format.ConfigurableMoshi
import org.http4k.format.ListAdapter
import org.http4k.format.MapAdapter
import org.http4k.format.asConfigurable
import org.http4k.format.value
import org.http4k.format.withAwsCoreMappings
import org.http4k.format.withStandardMappings
import se.ansman.kotshi.KotshiJsonAdapterFactory

object SystemsManagerMoshi : ConfigurableMoshi(
    Moshi.Builder()
        .add(SystemsManagerJsonAdapterFactory)
        .add(AwsCoreJsonAdapterFactory())
        .add(MapAdapter)
        .add(ListAdapter)
        .asConfigurable()
        .withStandardMappings()
        .withAwsCoreMappings()
        .withSystemsManagerMappings()
        .done()
)

fun  AutoMappingConfiguration.withSystemsManagerMappings() = apply {
    value(SSMParameterName)
}

@KotshiJsonAdapterFactory
object SystemsManagerJsonAdapterFactory : JsonAdapter.Factory by KotshiSystemsManagerJsonAdapterFactory




© 2015 - 2024 Weber Informatics LLC | Privacy Policy