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

com.vanniktech.maven.publish.nexus.CreateRepositoryResponseJsonAdapter.kt Maven / Gradle / Ivy

Go to download

APIs and tasks to help working with the Nexus API that powers OSSRH and other Sonatype repositories

The newest version!
// Code generated by moshi-kotlin-codegen. Do not edit.
@file:Suppress("DEPRECATION", "unused", "UNUSED_PARAMETER", "ClassName", "REDUNDANT_PROJECTION",
    "RedundantExplicitType", "LocalVariableName", "RedundantVisibilityModifier",
    "PLATFORM_CLASS_MAPPED_TO_KOTLIN", "IMPLICIT_NOTHING_TYPE_ARGUMENT_IN_RETURN_POSITION")

package com.vanniktech.maven.publish.nexus

import com.squareup.moshi.JsonAdapter
import com.squareup.moshi.JsonReader
import com.squareup.moshi.JsonWriter
import com.squareup.moshi.Moshi
import com.squareup.moshi.`internal`.Util
import java.lang.NullPointerException
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.emptySet
import kotlin.text.buildString

internal class CreateRepositoryResponseJsonAdapter(
  moshi: Moshi,
) : JsonAdapter() {
  private val options: JsonReader.Options = JsonReader.Options.of("data")

  private val createdRepositoryAdapter: JsonAdapter =
      moshi.adapter(CreatedRepository::class.java, emptySet(), "data")

  public override fun toString(): String = buildString(46) {
      append("GeneratedJsonAdapter(").append("CreateRepositoryResponse").append(')') }

  public override fun fromJson(reader: JsonReader): CreateRepositoryResponse {
    var data_: CreatedRepository? = null
    reader.beginObject()
    while (reader.hasNext()) {
      when (reader.selectName(options)) {
        0 -> data_ = createdRepositoryAdapter.fromJson(reader) ?: throw Util.unexpectedNull("data_",
            "data", reader)
        -1 -> {
          // Unknown name, skip it.
          reader.skipName()
          reader.skipValue()
        }
      }
    }
    reader.endObject()
    return CreateRepositoryResponse(
        `data` = data_ ?: throw Util.missingProperty("data_", "data", reader)
    )
  }

  public override fun toJson(writer: JsonWriter, value_: CreateRepositoryResponse?): Unit {
    if (value_ == null) {
      throw NullPointerException("value_ was null! Wrap in .nullSafe() to write nullable values.")
    }
    writer.beginObject()
    writer.name("data")
    createdRepositoryAdapter.toJson(writer, value_.`data`)
    writer.endObject()
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy