Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// Generated by protokt version 1.0.0-alpha.8. Do not modify.
// Source: google/rpc/error_details.proto
@file:Suppress("DEPRECATION")
package protokt.v1.google.rpc
import protokt.v1.AbstractKtDeserializer
import protokt.v1.AbstractKtMessage
import protokt.v1.Collections.copyList
import protokt.v1.Collections.copyMap
import protokt.v1.Collections.unmodifiableList
import protokt.v1.Collections.unmodifiableMap
import protokt.v1.KtBuilderDsl
import protokt.v1.KtMessageDeserializer
import protokt.v1.KtMessageSerializer
import protokt.v1.SizeCodecs.sizeOf
import protokt.v1.UnknownFieldSet
import protokt.v1.google.protobuf.Duration
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.collections.MutableList
import kotlin.collections.MutableMap
import kotlin.jvm.JvmStatic
import com.toasttab.protokt.rt.KtGeneratedMessage as RtKtGeneratedMessage
import protokt.v1.KtGeneratedMessage as V1KtGeneratedMessage
/**
* Describes the cause of the error with structured details.
*
* Example of an error when contacting the "pubsub.googleapis.com" API when it is not enabled:
*
* { "reason": "API_DISABLED" "domain": "googleapis.com" "metadata": {
* "resource": "projects/123", "service": "pubsub.googleapis.com" } }
*
* This response indicates that the pubsub.googleapis.com API is not enabled.
*
* Example of an error that is returned when attempting to create a Spanner instance in a region
* that is out of stock:
*
* { "reason": "STOCKOUT" "domain": "spanner.googleapis.com", "metadata": {
* "availableRegions": "us-central1,us-east2" } }
*/
@V1KtGeneratedMessage("google.rpc.ErrorInfo")
@RtKtGeneratedMessage("google.rpc.ErrorInfo")
public class ErrorInfo private constructor(
/**
* The reason of the error. This is a constant value that identifies the proximate cause of the
* error. Error reasons are unique within a particular domain of errors. This should be at most 63
* characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents
* UPPER_SNAKE_CASE.
*/
public val reason: String,
/**
* The logical grouping to which the "reason" belongs. The error domain is typically the
* registered service name of the tool or product that generates the error. Example:
* "pubsub.googleapis.com". If the error is generated by some common infrastructure, the error domain
* must be a globally unique value that identifies the infrastructure. For Google API infrastructure,
* the error domain is "googleapis.com".
*/
public val domain: String,
/**
* Additional structured details about this error.
*
* Keys should match /[a-zA-Z0-9-_]/ and be limited to 64 characters in length. When identifying
* the current value of an exceeded limit, the units should be contained in the key, not the value.
* For example, rather than {"instanceLimit": "100/request"}, should be returned as,
* {"instanceLimitPerRequest": "100"}, if the client exceeds the number of instances that can be
* created in a single (batch) request.
*/
public val metadata: Map,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (reason.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(reason)
}
if (domain.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(domain)
}
if (metadata.isNotEmpty()) {
result +=
sizeOf(metadata, 26u) { k, v ->
MetadataEntry.entrySize(k, v)
}
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (reason.isNotEmpty()) {
serializer.writeTag(10u).write(reason)
}
if (domain.isNotEmpty()) {
serializer.writeTag(18u).write(domain)
}
metadata.entries.forEach {
serializer.writeTag(26u).write(MetadataEntry(it.key, it.value))
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is ErrorInfo &&
other.reason == reason &&
other.domain == domain &&
other.metadata == metadata &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + reason.hashCode()
result = 31 * result + domain.hashCode()
result = 31 * result + metadata.hashCode()
return result
}
override fun toString(): String =
"ErrorInfo(" +
"reason=$reason, " +
"domain=$domain, " +
"metadata=$metadata" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): ErrorInfo =
Builder().apply {
reason = [email protected]
domain = [email protected]
metadata = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var reason: String = ""
public var domain: String = ""
public var metadata: Map = emptyMap()
set(newValue) {
field = copyMap(newValue)
}
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): ErrorInfo =
ErrorInfo(
reason,
domain,
unmodifiableMap(metadata),
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): ErrorInfo {
var reason = ""
var domain = ""
var metadata: MutableMap? = null
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return ErrorInfo(
reason,
domain,
unmodifiableMap(metadata),
UnknownFieldSet.from(unknownFields)
)
10 -> reason = deserializer.readString()
18 -> domain = deserializer.readString()
26 ->
metadata =
(metadata ?: mutableMapOf()).apply {
deserializer.readRepeated(false) {
deserializer.readMessage(MetadataEntry).let {
put(it.key, it.value)
}
}
}
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): ErrorInfo = Builder().apply(dsl).build()
}
private class MetadataEntry(
public val key: String,
public val `value`: String
) : AbstractKtMessage() {
override val messageSize: Int
get() = entrySize(key, value)
override fun serialize(serializer: KtMessageSerializer) {
serializer.writeTag(10u).write(key)
serializer.writeTag(18u).write(`value`)
}
public companion object Deserializer : AbstractKtDeserializer() {
public fun entrySize(
key: String,
`value`: String
): Int =
sizeOf(10u) + sizeOf(key) +
sizeOf(18u) + sizeOf(`value`)
override fun deserialize(deserializer: KtMessageDeserializer): MetadataEntry {
var key = ""
var value = ""
while (true) {
when (deserializer.readTag()) {
0 -> return MetadataEntry(key, value)
10 -> key = deserializer.readString()
18 -> value = deserializer.readString()
}
}
}
}
}
}
/**
* Describes when the clients can retry a failed request. Clients could ignore the recommendation
* here or retry when this information is missing from error responses.
*
* It's always recommended that clients should use exponential backoff when retrying.
*
* Clients should wait until `retry_delay` amount of time has passed since receiving the error
* response before retrying. If retrying requests also fail, clients should use an exponential backoff
* scheme to gradually increase the delay between retries based on `retry_delay`, until either a
* maximum number of retries have been reached or a maximum retry delay cap has been reached.
*/
@V1KtGeneratedMessage("google.rpc.RetryInfo")
@RtKtGeneratedMessage("google.rpc.RetryInfo")
public class RetryInfo private constructor(
/**
* Clients should wait at least this long between retrying the same request.
*/
public val retryDelay: Duration?,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (retryDelay != null) {
result += sizeOf(10u) + sizeOf(retryDelay)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (retryDelay != null) {
serializer.writeTag(10u).write(retryDelay)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is RetryInfo &&
other.retryDelay == retryDelay &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + retryDelay.hashCode()
return result
}
override fun toString(): String =
"RetryInfo(" +
"retryDelay=$retryDelay" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): RetryInfo =
Builder().apply {
retryDelay = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var retryDelay: Duration? = null
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): RetryInfo =
RetryInfo(
retryDelay,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): RetryInfo {
var retryDelay: Duration? = null
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return RetryInfo(
retryDelay,
UnknownFieldSet.from(unknownFields)
)
10 -> retryDelay = deserializer.readMessage(Duration)
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): RetryInfo = Builder().apply(dsl).build()
}
}
/**
* Describes additional debugging info.
*/
@V1KtGeneratedMessage("google.rpc.DebugInfo")
@RtKtGeneratedMessage("google.rpc.DebugInfo")
public class DebugInfo private constructor(
/**
* The stack trace entries indicating where the error occurred.
*/
public val stackEntries: List,
/**
* Additional debugging information provided by the server.
*/
public val detail: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (stackEntries.isNotEmpty()) {
result += (sizeOf(10u) * stackEntries.size) + stackEntries.sumOf { sizeOf(it) }
}
if (detail.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(detail)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
stackEntries.forEach { serializer.writeTag(10u).write(it) }
if (detail.isNotEmpty()) {
serializer.writeTag(18u).write(detail)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is DebugInfo &&
other.stackEntries == stackEntries &&
other.detail == detail &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + stackEntries.hashCode()
result = 31 * result + detail.hashCode()
return result
}
override fun toString(): String =
"DebugInfo(" +
"stackEntries=$stackEntries, " +
"detail=$detail" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): DebugInfo =
Builder().apply {
stackEntries = [email protected]
detail = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var stackEntries: List = emptyList()
set(newValue) {
field = copyList(newValue)
}
public var detail: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): DebugInfo =
DebugInfo(
unmodifiableList(stackEntries),
detail,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): DebugInfo {
var stackEntries: MutableList? = null
var detail = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return DebugInfo(
unmodifiableList(stackEntries),
detail,
UnknownFieldSet.from(unknownFields)
)
10 ->
stackEntries =
(stackEntries ?: mutableListOf()).apply {
deserializer.readRepeated(false) {
add(deserializer.readString())
}
}
18 -> detail = deserializer.readString()
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): DebugInfo = Builder().apply(dsl).build()
}
}
/**
* Describes how a quota check failed.
*
* For example if a daily limit was exceeded for the calling project, a service could respond with
* a QuotaFailure detail containing the project id and the description of the quota limit that was
* exceeded. If the calling project hasn't enabled the service in the developer console, then a
* service could respond with the project id and set `service_disabled` to true.
*
* Also see RetryInfo and Help types for other details about handling a quota failure.
*/
@V1KtGeneratedMessage("google.rpc.QuotaFailure")
@RtKtGeneratedMessage("google.rpc.QuotaFailure")
public class QuotaFailure private constructor(
/**
* Describes all quota violations.
*/
public val violations: List,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (violations.isNotEmpty()) {
result += (sizeOf(10u) * violations.size) + violations.sumOf { sizeOf(it) }
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
violations.forEach { serializer.writeTag(10u).write(it) }
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is QuotaFailure &&
other.violations == violations &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + violations.hashCode()
return result
}
override fun toString(): String =
"QuotaFailure(" +
"violations=$violations" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): QuotaFailure =
Builder().apply {
violations = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var violations: List = emptyList()
set(newValue) {
field = copyList(newValue)
}
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): QuotaFailure =
QuotaFailure(
unmodifiableList(violations),
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): QuotaFailure {
var violations: MutableList? = null
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return QuotaFailure(
unmodifiableList(violations),
UnknownFieldSet.from(unknownFields)
)
10 ->
violations =
(violations ?: mutableListOf()).apply {
deserializer.readRepeated(false) {
add(deserializer.readMessage(Violation))
}
}
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): QuotaFailure = Builder().apply(dsl).build()
}
/**
* A message type used to describe a single quota violation. For example, a daily quota or a
* custom quota that was exceeded.
*/
@V1KtGeneratedMessage("google.rpc.Violation")
@RtKtGeneratedMessage("google.rpc.Violation")
public class Violation private constructor(
/**
* The subject on which the quota check failed. For example, "clientip:"
* or "project:".
*/
public val subject: String,
/**
* A description of how the quota check failed. Clients can use this description to find more
* about the quota configuration in the service's public documentation, or find the relevant quota
* limit to adjust through developer console.
*
* For example: "Service disabled" or "Daily Limit for read operations exceeded".
*/
public val description: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (subject.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(subject)
}
if (description.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(description)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (subject.isNotEmpty()) {
serializer.writeTag(10u).write(subject)
}
if (description.isNotEmpty()) {
serializer.writeTag(18u).write(description)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is Violation &&
other.subject == subject &&
other.description == description &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + subject.hashCode()
result = 31 * result + description.hashCode()
return result
}
override fun toString(): String =
"Violation(" +
"subject=$subject, " +
"description=$description" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): Violation =
Builder().apply {
subject = [email protected]
description = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var subject: String = ""
public var description: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): Violation =
Violation(
subject,
description,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): Violation {
var subject = ""
var description = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return Violation(
subject,
description,
UnknownFieldSet.from(unknownFields)
)
10 -> subject = deserializer.readString()
18 -> description = deserializer.readString()
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): Violation = Builder().apply(dsl).build()
}
}
}
/**
* Describes what preconditions have failed.
*
* For example, if an RPC failed because it required the Terms of Service to be acknowledged, it
* could list the terms of service violation in the PreconditionFailure message.
*/
@V1KtGeneratedMessage("google.rpc.PreconditionFailure")
@RtKtGeneratedMessage("google.rpc.PreconditionFailure")
public class PreconditionFailure private constructor(
/**
* Describes all precondition violations.
*/
public val violations: List,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (violations.isNotEmpty()) {
result += (sizeOf(10u) * violations.size) + violations.sumOf { sizeOf(it) }
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
violations.forEach { serializer.writeTag(10u).write(it) }
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is PreconditionFailure &&
other.violations == violations &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + violations.hashCode()
return result
}
override fun toString(): String =
"PreconditionFailure(" +
"violations=$violations" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): PreconditionFailure =
Builder().apply {
violations = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var violations: List = emptyList()
set(newValue) {
field = copyList(newValue)
}
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): PreconditionFailure =
PreconditionFailure(
unmodifiableList(violations),
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): PreconditionFailure {
var violations: MutableList? = null
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return PreconditionFailure(
unmodifiableList(violations),
UnknownFieldSet.from(unknownFields)
)
10 ->
violations =
(violations ?: mutableListOf()).apply {
deserializer.readRepeated(false) {
add(deserializer.readMessage(Violation))
}
}
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): PreconditionFailure = Builder().apply(dsl).build()
}
/**
* A message type used to describe a single precondition failure.
*/
@V1KtGeneratedMessage("google.rpc.Violation")
@RtKtGeneratedMessage("google.rpc.Violation")
public class Violation private constructor(
/**
* The type of PreconditionFailure. We recommend using a service-specific enum type to define
* the supported precondition violation subjects. For example, "TOS" for "Terms of Service
* violation".
*/
public val type: String,
/**
* The subject, relative to the type, that failed. For example, "google.com/cloud" relative to
* the "TOS" type would indicate which terms of service is being referenced.
*/
public val subject: String,
/**
* A description of how the precondition failed. Developers can use this description to
* understand how to fix the failure.
*
* For example: "Terms of service not accepted".
*/
public val description: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (type.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(type)
}
if (subject.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(subject)
}
if (description.isNotEmpty()) {
result += sizeOf(26u) + sizeOf(description)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (type.isNotEmpty()) {
serializer.writeTag(10u).write(type)
}
if (subject.isNotEmpty()) {
serializer.writeTag(18u).write(subject)
}
if (description.isNotEmpty()) {
serializer.writeTag(26u).write(description)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is Violation &&
other.type == type &&
other.subject == subject &&
other.description == description &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + type.hashCode()
result = 31 * result + subject.hashCode()
result = 31 * result + description.hashCode()
return result
}
override fun toString(): String =
"Violation(" +
"type=$type, " +
"subject=$subject, " +
"description=$description" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): Violation =
Builder().apply {
type = [email protected]
subject = [email protected]
description = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var type: String = ""
public var subject: String = ""
public var description: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): Violation =
Violation(
type,
subject,
description,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): Violation {
var type = ""
var subject = ""
var description = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return Violation(
type,
subject,
description,
UnknownFieldSet.from(unknownFields)
)
10 -> type = deserializer.readString()
18 -> subject = deserializer.readString()
26 -> description = deserializer.readString()
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): Violation = Builder().apply(dsl).build()
}
}
}
/**
* Describes violations in a client request. This error type focuses on the syntactic aspects of the
* request.
*/
@V1KtGeneratedMessage("google.rpc.BadRequest")
@RtKtGeneratedMessage("google.rpc.BadRequest")
public class BadRequest private constructor(
/**
* Describes all violations in a client request.
*/
public val fieldViolations: List,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (fieldViolations.isNotEmpty()) {
result += (sizeOf(10u) * fieldViolations.size) + fieldViolations.sumOf { sizeOf(it) }
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
fieldViolations.forEach { serializer.writeTag(10u).write(it) }
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is BadRequest &&
other.fieldViolations == fieldViolations &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + fieldViolations.hashCode()
return result
}
override fun toString(): String =
"BadRequest(" +
"fieldViolations=$fieldViolations" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): BadRequest =
Builder().apply {
fieldViolations = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var fieldViolations: List = emptyList()
set(newValue) {
field = copyList(newValue)
}
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): BadRequest =
BadRequest(
unmodifiableList(fieldViolations),
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): BadRequest {
var fieldViolations: MutableList? = null
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return BadRequest(
unmodifiableList(fieldViolations),
UnknownFieldSet.from(unknownFields)
)
10 ->
fieldViolations =
(fieldViolations ?: mutableListOf()).apply {
deserializer.readRepeated(false) {
add(deserializer.readMessage(FieldViolation))
}
}
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): BadRequest = Builder().apply(dsl).build()
}
/**
* A message type used to describe a single bad request field.
*/
@V1KtGeneratedMessage("google.rpc.FieldViolation")
@RtKtGeneratedMessage("google.rpc.FieldViolation")
public class FieldViolation private constructor(
/**
* A path that leads to a field in the request body. The value will be a sequence of
* dot-separated identifiers that identify a protocol buffer field.
*
* Consider the following:
*
* message CreateContactRequest { message EmailAddress { enum Type {
* TYPE_UNSPECIFIED = 0; HOME = 1; WORK = 2; }
*
* optional string email = 1; repeated EmailType type = 2; }
*
* string full_name = 1; repeated EmailAddress email_addresses = 2; }
*
* In this example, in proto `field` could take one of the following values:
*
* * `full_name` for a violation in the `full_name` value * `email_addresses[1].email` for a
* violation in the `email` field of the first `email_addresses` message *
* `email_addresses[3].type[2]` for a violation in the second `type` value in the third
* `email_addresses` message.
*
* In JSON, the same values are represented as:
*
* * `fullName` for a violation in the `fullName` value * `emailAddresses[1].email` for a
* violation in the `email` field of the first `emailAddresses` message *
* `emailAddresses[3].type[2]` for a violation in the second `type` value in the third
* `emailAddresses` message.
*/
public val `field`: String,
/**
* A description of why the request element is bad.
*/
public val description: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (`field`.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(`field`)
}
if (description.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(description)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (`field`.isNotEmpty()) {
serializer.writeTag(10u).write(`field`)
}
if (description.isNotEmpty()) {
serializer.writeTag(18u).write(description)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is FieldViolation &&
other.`field` == `field` &&
other.description == description &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + `field`.hashCode()
result = 31 * result + description.hashCode()
return result
}
override fun toString(): String =
"FieldViolation(" +
"`field`=$`field`, " +
"description=$description" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): FieldViolation =
Builder().apply {
`field` = this@FieldViolation.`field`
description = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var `field`: String = ""
public var description: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): FieldViolation =
FieldViolation(
`field`,
description,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): FieldViolation {
var `field` = ""
var description = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return FieldViolation(
`field`,
description,
UnknownFieldSet.from(unknownFields)
)
10 -> `field` = deserializer.readString()
18 -> description = deserializer.readString()
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): FieldViolation = Builder().apply(dsl).build()
}
}
}
/**
* Contains metadata about the request that clients can attach when filing a bug or providing other
* forms of feedback.
*/
@V1KtGeneratedMessage("google.rpc.RequestInfo")
@RtKtGeneratedMessage("google.rpc.RequestInfo")
public class RequestInfo private constructor(
/**
* An opaque string that should only be interpreted by the service generating it. For example, it
* can be used to identify requests in the service's logs.
*/
public val requestId: String,
/**
* Any data that was used to serve this request. For example, an encrypted stack trace that can be
* sent back to the service provider for debugging.
*/
public val servingData: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (requestId.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(requestId)
}
if (servingData.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(servingData)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (requestId.isNotEmpty()) {
serializer.writeTag(10u).write(requestId)
}
if (servingData.isNotEmpty()) {
serializer.writeTag(18u).write(servingData)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is RequestInfo &&
other.requestId == requestId &&
other.servingData == servingData &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + requestId.hashCode()
result = 31 * result + servingData.hashCode()
return result
}
override fun toString(): String =
"RequestInfo(" +
"requestId=$requestId, " +
"servingData=$servingData" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): RequestInfo =
Builder().apply {
requestId = [email protected]
servingData = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var requestId: String = ""
public var servingData: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): RequestInfo =
RequestInfo(
requestId,
servingData,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): RequestInfo {
var requestId = ""
var servingData = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return RequestInfo(
requestId,
servingData,
UnknownFieldSet.from(unknownFields)
)
10 -> requestId = deserializer.readString()
18 -> servingData = deserializer.readString()
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): RequestInfo = Builder().apply(dsl).build()
}
}
/**
* Describes the resource that is being accessed.
*/
@V1KtGeneratedMessage("google.rpc.ResourceInfo")
@RtKtGeneratedMessage("google.rpc.ResourceInfo")
public class ResourceInfo private constructor(
/**
* A name for the type of resource being accessed, e.g. "sql table", "cloud storage bucket",
* "file", "Google calendar"; or the type URL of the resource: e.g.
* "type.googleapis.com/google.pubsub.v1.Topic".
*/
public val resourceType: String,
/**
* The name of the resource being accessed. For example, a shared calendar name:
* "[email protected]", if the current error is
* [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED].
*/
public val resourceName: String,
/**
* The owner of the resource (optional). For example, "user:" or "project:".
*/
public val owner: String,
/**
* Describes what error is encountered when accessing this resource. For example, updating a cloud
* project may require the `writer` permission on the developer console project.
*/
public val description: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (resourceType.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(resourceType)
}
if (resourceName.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(resourceName)
}
if (owner.isNotEmpty()) {
result += sizeOf(26u) + sizeOf(owner)
}
if (description.isNotEmpty()) {
result += sizeOf(34u) + sizeOf(description)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (resourceType.isNotEmpty()) {
serializer.writeTag(10u).write(resourceType)
}
if (resourceName.isNotEmpty()) {
serializer.writeTag(18u).write(resourceName)
}
if (owner.isNotEmpty()) {
serializer.writeTag(26u).write(owner)
}
if (description.isNotEmpty()) {
serializer.writeTag(34u).write(description)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is ResourceInfo &&
other.resourceType == resourceType &&
other.resourceName == resourceName &&
other.owner == owner &&
other.description == description &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + resourceType.hashCode()
result = 31 * result + resourceName.hashCode()
result = 31 * result + owner.hashCode()
result = 31 * result + description.hashCode()
return result
}
override fun toString(): String =
"ResourceInfo(" +
"resourceType=$resourceType, " +
"resourceName=$resourceName, " +
"owner=$owner, " +
"description=$description" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): ResourceInfo =
Builder().apply {
resourceType = [email protected]
resourceName = [email protected]
owner = [email protected]
description = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var resourceType: String = ""
public var resourceName: String = ""
public var owner: String = ""
public var description: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): ResourceInfo =
ResourceInfo(
resourceType,
resourceName,
owner,
description,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): ResourceInfo {
var resourceType = ""
var resourceName = ""
var owner = ""
var description = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return ResourceInfo(
resourceType,
resourceName,
owner,
description,
UnknownFieldSet.from(unknownFields)
)
10 -> resourceType = deserializer.readString()
18 -> resourceName = deserializer.readString()
26 -> owner = deserializer.readString()
34 -> description = deserializer.readString()
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): ResourceInfo = Builder().apply(dsl).build()
}
}
/**
* Provides links to documentation or for performing an out of band action.
*
* For example, if a quota check failed with an error indicating the calling project hasn't enabled
* the accessed service, this can contain a URL pointing directly to the right place in the developer
* console to flip the bit.
*/
@V1KtGeneratedMessage("google.rpc.Help")
@RtKtGeneratedMessage("google.rpc.Help")
public class Help private constructor(
/**
* URL(s) pointing to additional information on handling the current error.
*/
public val links: List,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (links.isNotEmpty()) {
result += (sizeOf(10u) * links.size) + links.sumOf { sizeOf(it) }
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
links.forEach { serializer.writeTag(10u).write(it) }
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is Help &&
other.links == links &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + links.hashCode()
return result
}
override fun toString(): String =
"Help(" +
"links=$links" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): Help =
Builder().apply {
links = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var links: List = emptyList()
set(newValue) {
field = copyList(newValue)
}
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): Help =
Help(
unmodifiableList(links),
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): Help {
var links: MutableList? = null
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return Help(
unmodifiableList(links),
UnknownFieldSet.from(unknownFields)
)
10 ->
links =
(links ?: mutableListOf()).apply {
deserializer.readRepeated(false) {
add(deserializer.readMessage(Link))
}
}
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): Help = Builder().apply(dsl).build()
}
/**
* Describes a URL link.
*/
@V1KtGeneratedMessage("google.rpc.Link")
@RtKtGeneratedMessage("google.rpc.Link")
public class Link private constructor(
/**
* Describes what the link offers.
*/
public val description: String,
/**
* The URL of the link.
*/
public val url: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (description.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(description)
}
if (url.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(url)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (description.isNotEmpty()) {
serializer.writeTag(10u).write(description)
}
if (url.isNotEmpty()) {
serializer.writeTag(18u).write(url)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is Link &&
other.description == description &&
other.url == url &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + description.hashCode()
result = 31 * result + url.hashCode()
return result
}
override fun toString(): String =
"Link(" +
"description=$description, " +
"url=$url" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): Link =
Builder().apply {
description = [email protected]
url = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var description: String = ""
public var url: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): Link =
Link(
description,
url,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): Link {
var description = ""
var url = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return Link(
description,
url,
UnknownFieldSet.from(unknownFields)
)
10 -> description = deserializer.readString()
18 -> url = deserializer.readString()
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): Link = Builder().apply(dsl).build()
}
}
}
/**
* Provides a localized error message that is safe to return to the user which can be attached to an
* RPC error.
*/
@V1KtGeneratedMessage("google.rpc.LocalizedMessage")
@RtKtGeneratedMessage("google.rpc.LocalizedMessage")
public class LocalizedMessage private constructor(
/**
* The locale used following the specification defined at
* https://www.rfc-editor.org/rfc/bcp/bcp47.txt. Examples are: "en-US", "fr-CH", "es-MX"
*/
public val locale: String,
/**
* The localized error message in the above locale.
*/
public val message: String,
public val unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
) : AbstractKtMessage() {
override val messageSize: Int by lazy { messageSize() }
private fun messageSize(): Int {
var result = 0
if (locale.isNotEmpty()) {
result += sizeOf(10u) + sizeOf(locale)
}
if (message.isNotEmpty()) {
result += sizeOf(18u) + sizeOf(message)
}
result += unknownFields.size()
return result
}
override fun serialize(serializer: KtMessageSerializer) {
if (locale.isNotEmpty()) {
serializer.writeTag(10u).write(locale)
}
if (message.isNotEmpty()) {
serializer.writeTag(18u).write(message)
}
serializer.writeUnknown(unknownFields)
}
override fun equals(other: Any?): Boolean =
other is LocalizedMessage &&
other.locale == locale &&
other.message == message &&
other.unknownFields == unknownFields
override fun hashCode(): Int {
var result = unknownFields.hashCode()
result = 31 * result + locale.hashCode()
result = 31 * result + message.hashCode()
return result
}
override fun toString(): String =
"LocalizedMessage(" +
"locale=$locale, " +
"message=$message" +
if (unknownFields.isEmpty()) ")" else ", unknownFields=$unknownFields)"
public fun copy(builder: Builder.() -> Unit): LocalizedMessage =
Builder().apply {
locale = [email protected]
message = [email protected]
unknownFields = [email protected]
builder()
}.build()
@KtBuilderDsl
public class Builder {
public var locale: String = ""
public var message: String = ""
public var unknownFields: UnknownFieldSet = UnknownFieldSet.empty()
public fun build(): LocalizedMessage =
LocalizedMessage(
locale,
message,
unknownFields
)
}
public companion object Deserializer : AbstractKtDeserializer() {
@JvmStatic
override fun deserialize(deserializer: KtMessageDeserializer): LocalizedMessage {
var locale = ""
var message = ""
var unknownFields: UnknownFieldSet.Builder? = null
while (true) {
when (deserializer.readTag()) {
0 -> return LocalizedMessage(
locale,
message,
UnknownFieldSet.from(unknownFields)
)
10 -> locale = deserializer.readString()
18 -> message = deserializer.readString()
else ->
unknownFields =
(unknownFields ?: UnknownFieldSet.Builder()).also {
it.add(deserializer.readUnknown())
}
}
}
}
@JvmStatic
public operator fun invoke(dsl: Builder.() -> Unit): LocalizedMessage = Builder().apply(dsl).build()
}
}