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

commonMain.google.api.http.converter.kt Maven / Gradle / Ivy

The newest version!
// Transform from google/api/http.proto
@file:GeneratorVersion(version = "0.6.0")

package google.api

import google.protobuf.Any
import java.lang.IllegalStateException
import kr.jadekim.protobuf.`annotation`.GeneratorVersion
import kr.jadekim.protobuf.converter.ProtobufConverter
import kr.jadekim.protobuf.converter.parseProtobuf

public expect object HttpConverter : ProtobufConverter

public fun Http.toAny(): Any = Any(Http.TYPE_URL, with(HttpConverter) { toByteArray() })

public fun Any.parse(converter: ProtobufConverter = HttpConverter): Http {
  if (typeUrl != Http.TYPE_URL) throw IllegalStateException("Please check the type_url")
  return value.parseProtobuf(converter)
}

public val Http.Companion.converter: HttpConverter
  get() = HttpConverter

public expect object HttpRuleConverter : ProtobufConverter

public fun HttpRule.toAny(): Any = Any(HttpRule.TYPE_URL, with(HttpRuleConverter) { toByteArray() })

public fun Any.parse(converter: ProtobufConverter = HttpRuleConverter): HttpRule {
  if (typeUrl != HttpRule.TYPE_URL) throw IllegalStateException("Please check the type_url")
  return value.parseProtobuf(converter)
}

public val HttpRule.Companion.converter: HttpRuleConverter
  get() = HttpRuleConverter

public expect object CustomHttpPatternConverter : ProtobufConverter

public fun CustomHttpPattern.toAny(): Any = Any(CustomHttpPattern.TYPE_URL, with(CustomHttpPatternConverter) { toByteArray() })

public fun Any.parse(converter: ProtobufConverter = CustomHttpPatternConverter): CustomHttpPattern {
  if (typeUrl != CustomHttpPattern.TYPE_URL) throw IllegalStateException("Please check the type_url")
  return value.parseProtobuf(converter)
}

public val CustomHttpPattern.Companion.converter: CustomHttpPatternConverter
  get() = CustomHttpPatternConverter




© 2015 - 2025 Weber Informatics LLC | Privacy Policy