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

org.signal.protos.resumableuploads.ResumableUpload.kt Maven / Gradle / Ivy

There is a newer version: 2.15.3_unofficial_107
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: ResumableUpload in ResumableUploads.proto
package org.signal.protos.resumableuploads

import com.squareup.wire.FieldEncoding
import com.squareup.wire.Message
import com.squareup.wire.ProtoAdapter
import com.squareup.wire.ProtoReader
import com.squareup.wire.ProtoWriter
import com.squareup.wire.ReverseProtoWriter
import com.squareup.wire.Syntax
import com.squareup.wire.Syntax.PROTO_3
import com.squareup.wire.WireField
import com.squareup.wire.`internal`.checkElementsNotNull
import com.squareup.wire.`internal`.immutableCopyOf
import com.squareup.wire.`internal`.redactElements
import com.squareup.wire.`internal`.sanitize
import kotlin.Any
import kotlin.Boolean
import kotlin.Int
import kotlin.Long
import kotlin.String
import kotlin.Unit
import kotlin.collections.List
import kotlin.jvm.JvmField
import okio.ByteString

public class ResumableUpload(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val secretKey: ByteString = ByteString.EMPTY,
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#BYTES",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val iv: ByteString = ByteString.EMPTY,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val cdnKey: String = "",
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#UINT32",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val cdnNumber: Int = 0,
  @field:WireField(
    tag = 5,
    adapter = "com.squareup.wire.ProtoAdapter#STRING",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val location: String = "",
  @field:WireField(
    tag = 6,
    adapter = "com.squareup.wire.ProtoAdapter#UINT64",
    label = WireField.Label.OMIT_IDENTITY,
  )
  @JvmField
  public val timeout: Long = 0L,
  headers: List
= emptyList(), unknownFields: ByteString = ByteString.EMPTY, ) : Message(ADAPTER, unknownFields) { @field:WireField( tag = 7, adapter = "org.signal.protos.resumableuploads.ResumableUpload${'$'}Header#ADAPTER", label = WireField.Label.REPEATED, ) @JvmField public val headers: List
= immutableCopyOf("headers", headers) public override fun newBuilder(): Builder { val builder = Builder() builder.secretKey = secretKey builder.iv = iv builder.cdnKey = cdnKey builder.cdnNumber = cdnNumber builder.location = location builder.timeout = timeout builder.headers = headers builder.addUnknownFields(unknownFields) return builder } public override fun equals(other: Any?): Boolean { if (other === this) return true if (other !is ResumableUpload) return false if (unknownFields != other.unknownFields) return false if (secretKey != other.secretKey) return false if (iv != other.iv) return false if (cdnKey != other.cdnKey) return false if (cdnNumber != other.cdnNumber) return false if (location != other.location) return false if (timeout != other.timeout) return false if (headers != other.headers) return false return true } public override fun hashCode(): Int { var result = super.hashCode if (result == 0) { result = unknownFields.hashCode() result = result * 37 + secretKey.hashCode() result = result * 37 + iv.hashCode() result = result * 37 + cdnKey.hashCode() result = result * 37 + cdnNumber.hashCode() result = result * 37 + location.hashCode() result = result * 37 + timeout.hashCode() result = result * 37 + headers.hashCode() super.hashCode = result } return result } public override fun toString(): String { val result = mutableListOf() result += """secretKey=$secretKey""" result += """iv=$iv""" result += """cdnKey=${sanitize(cdnKey)}""" result += """cdnNumber=$cdnNumber""" result += """location=${sanitize(location)}""" result += """timeout=$timeout""" if (headers.isNotEmpty()) result += """headers=$headers""" return result.joinToString(prefix = "ResumableUpload{", separator = ", ", postfix = "}") } public fun copy( secretKey: ByteString = this.secretKey, iv: ByteString = this.iv, cdnKey: String = this.cdnKey, cdnNumber: Int = this.cdnNumber, location: String = this.location, timeout: Long = this.timeout, headers: List
= this.headers, unknownFields: ByteString = this.unknownFields, ): ResumableUpload = ResumableUpload(secretKey, iv, cdnKey, cdnNumber, location, timeout, headers, unknownFields) public class Builder : Message.Builder() { @JvmField public var secretKey: ByteString = ByteString.EMPTY @JvmField public var iv: ByteString = ByteString.EMPTY @JvmField public var cdnKey: String = "" @JvmField public var cdnNumber: Int = 0 @JvmField public var location: String = "" @JvmField public var timeout: Long = 0L @JvmField public var headers: List
= emptyList() public fun secretKey(secretKey: ByteString): Builder { this.secretKey = secretKey return this } public fun iv(iv: ByteString): Builder { this.iv = iv return this } public fun cdnKey(cdnKey: String): Builder { this.cdnKey = cdnKey return this } public fun cdnNumber(cdnNumber: Int): Builder { this.cdnNumber = cdnNumber return this } public fun location(location: String): Builder { this.location = location return this } public fun timeout(timeout: Long): Builder { this.timeout = timeout return this } public fun headers(headers: List
): Builder { checkElementsNotNull(headers) this.headers = headers return this } public override fun build(): ResumableUpload = ResumableUpload( secretKey = secretKey, iv = iv, cdnKey = cdnKey, cdnNumber = cdnNumber, location = location, timeout = timeout, headers = headers, unknownFields = buildUnknownFields() ) } public companion object { @JvmField public val ADAPTER: ProtoAdapter = object : ProtoAdapter( FieldEncoding.LENGTH_DELIMITED, ResumableUpload::class, "type.googleapis.com/ResumableUpload", PROTO_3, null, "ResumableUploads.proto" ) { public override fun encodedSize(`value`: ResumableUpload): Int { var size = value.unknownFields.size if (value.secretKey != ByteString.EMPTY) size += ProtoAdapter.BYTES.encodedSizeWithTag(1, value.secretKey) if (value.iv != ByteString.EMPTY) size += ProtoAdapter.BYTES.encodedSizeWithTag(2, value.iv) if (value.cdnKey != "") size += ProtoAdapter.STRING.encodedSizeWithTag(3, value.cdnKey) if (value.cdnNumber != 0) size += ProtoAdapter.UINT32.encodedSizeWithTag(4, value.cdnNumber) if (value.location != "") size += ProtoAdapter.STRING.encodedSizeWithTag(5, value.location) if (value.timeout != 0L) size += ProtoAdapter.UINT64.encodedSizeWithTag(6, value.timeout) size += Header.ADAPTER.asRepeated().encodedSizeWithTag(7, value.headers) return size } public override fun encode(writer: ProtoWriter, `value`: ResumableUpload): Unit { if (value.secretKey != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.secretKey) if (value.iv != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.iv) if (value.cdnKey != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.cdnKey) if (value.cdnNumber != 0) ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.cdnNumber) if (value.location != "") ProtoAdapter.STRING.encodeWithTag(writer, 5, value.location) if (value.timeout != 0L) ProtoAdapter.UINT64.encodeWithTag(writer, 6, value.timeout) Header.ADAPTER.asRepeated().encodeWithTag(writer, 7, value.headers) writer.writeBytes(value.unknownFields) } public override fun encode(writer: ReverseProtoWriter, `value`: ResumableUpload): Unit { writer.writeBytes(value.unknownFields) Header.ADAPTER.asRepeated().encodeWithTag(writer, 7, value.headers) if (value.timeout != 0L) ProtoAdapter.UINT64.encodeWithTag(writer, 6, value.timeout) if (value.location != "") ProtoAdapter.STRING.encodeWithTag(writer, 5, value.location) if (value.cdnNumber != 0) ProtoAdapter.UINT32.encodeWithTag(writer, 4, value.cdnNumber) if (value.cdnKey != "") ProtoAdapter.STRING.encodeWithTag(writer, 3, value.cdnKey) if (value.iv != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 2, value.iv) if (value.secretKey != ByteString.EMPTY) ProtoAdapter.BYTES.encodeWithTag(writer, 1, value.secretKey) } public override fun decode(reader: ProtoReader): ResumableUpload { var secretKey: ByteString = ByteString.EMPTY var iv: ByteString = ByteString.EMPTY var cdnKey: String = "" var cdnNumber: Int = 0 var location: String = "" var timeout: Long = 0L val headers = mutableListOf
() val unknownFields = reader.forEachTag { tag -> when (tag) { 1 -> secretKey = ProtoAdapter.BYTES.decode(reader) 2 -> iv = ProtoAdapter.BYTES.decode(reader) 3 -> cdnKey = ProtoAdapter.STRING.decode(reader) 4 -> cdnNumber = ProtoAdapter.UINT32.decode(reader) 5 -> location = ProtoAdapter.STRING.decode(reader) 6 -> timeout = ProtoAdapter.UINT64.decode(reader) 7 -> headers.add(Header.ADAPTER.decode(reader)) else -> reader.readUnknownField(tag) } } return ResumableUpload( secretKey = secretKey, iv = iv, cdnKey = cdnKey, cdnNumber = cdnNumber, location = location, timeout = timeout, headers = headers, unknownFields = unknownFields ) } public override fun redact(`value`: ResumableUpload): ResumableUpload = value.copy( headers = value.headers.redactElements(Header.ADAPTER), unknownFields = ByteString.EMPTY ) } private const val serialVersionUID: Long = 0L } public class Header( @field:WireField( tag = 1, adapter = "com.squareup.wire.ProtoAdapter#STRING", label = WireField.Label.OMIT_IDENTITY, ) @JvmField public val key: String = "", @field:WireField( tag = 2, adapter = "com.squareup.wire.ProtoAdapter#STRING", label = WireField.Label.OMIT_IDENTITY, declaredName = "value", ) @JvmField public val value_: String = "", unknownFields: ByteString = ByteString.EMPTY, ) : Message(ADAPTER, unknownFields) { public override fun newBuilder(): Builder { val builder = Builder() builder.key = key builder.value_ = value_ builder.addUnknownFields(unknownFields) return builder } public override fun equals(other: Any?): Boolean { if (other === this) return true if (other !is Header) return false if (unknownFields != other.unknownFields) return false if (key != other.key) return false if (value_ != other.value_) return false return true } public override fun hashCode(): Int { var result = super.hashCode if (result == 0) { result = unknownFields.hashCode() result = result * 37 + key.hashCode() result = result * 37 + value_.hashCode() super.hashCode = result } return result } public override fun toString(): String { val result = mutableListOf() result += """key=${sanitize(key)}""" result += """value_=${sanitize(value_)}""" return result.joinToString(prefix = "Header{", separator = ", ", postfix = "}") } public fun copy( key: String = this.key, value_: String = this.value_, unknownFields: ByteString = this.unknownFields, ): Header = Header(key, value_, unknownFields) public class Builder : Message.Builder() { @JvmField public var key: String = "" @JvmField public var value_: String = "" public fun key(key: String): Builder { this.key = key return this } public fun value_(value_: String): Builder { this.value_ = value_ return this } public override fun build(): Header = Header( key = key, value_ = value_, unknownFields = buildUnknownFields() ) } public companion object { @JvmField public val ADAPTER: ProtoAdapter
= object : ProtoAdapter
( FieldEncoding.LENGTH_DELIMITED, Header::class, "type.googleapis.com/ResumableUpload.Header", PROTO_3, null, "ResumableUploads.proto" ) { public override fun encodedSize(`value`: Header): Int { var size = value.unknownFields.size if (value.key != "") size += ProtoAdapter.STRING.encodedSizeWithTag(1, value.key) if (value.value_ != "") size += ProtoAdapter.STRING.encodedSizeWithTag(2, value.value_) return size } public override fun encode(writer: ProtoWriter, `value`: Header): Unit { if (value.key != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.key) if (value.value_ != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.value_) writer.writeBytes(value.unknownFields) } public override fun encode(writer: ReverseProtoWriter, `value`: Header): Unit { writer.writeBytes(value.unknownFields) if (value.value_ != "") ProtoAdapter.STRING.encodeWithTag(writer, 2, value.value_) if (value.key != "") ProtoAdapter.STRING.encodeWithTag(writer, 1, value.key) } public override fun decode(reader: ProtoReader): Header { var key: String = "" var value_: String = "" val unknownFields = reader.forEachTag { tag -> when (tag) { 1 -> key = ProtoAdapter.STRING.decode(reader) 2 -> value_ = ProtoAdapter.STRING.decode(reader) else -> reader.readUnknownField(tag) } } return Header( key = key, value_ = value_, unknownFields = unknownFields ) } public override fun redact(`value`: Header): Header = value.copy( unknownFields = ByteString.EMPTY ) } private const val serialVersionUID: Long = 0L } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy