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

commonMain.media.node.GetCapacityResponse.kt Maven / Gradle / Ivy

Go to download

KMP package which exports compiled protobuf entities to be used by other repos

There is a newer version: 2.89.0
Show newest version
// Code generated by Wire protocol buffer compiler, do not edit.
// Source: media.node.GetCapacityResponse in media/hub_node.proto
package media.node

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.PROTO_3
import com.squareup.wire.WireField
import kotlin.Any
import kotlin.AssertionError
import kotlin.Boolean
import kotlin.Deprecated
import kotlin.DeprecationLevel
import kotlin.Int
import kotlin.Long
import kotlin.Nothing
import kotlin.String
import kotlin.Unit
import okio.ByteString

public class GetCapacityResponse(
  @field:WireField(
    tag = 1,
    adapter = "com.squareup.wire.ProtoAdapter#INT64",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "reservedCapacityUnits",
  )
  public val reserved_capacity_units: Long = 0L,
  @field:WireField(
    tag = 2,
    adapter = "com.squareup.wire.ProtoAdapter#INT64",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "availableCapacityUnits",
  )
  public val available_capacity_units: Long = 0L,
  @field:WireField(
    tag = 3,
    adapter = "com.squareup.wire.ProtoAdapter#INT64",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "usedCapacityUnits",
  )
  public val used_capacity_units: Long = 0L,
  @field:WireField(
    tag = 4,
    adapter = "com.squareup.wire.ProtoAdapter#INT64",
    label = WireField.Label.OMIT_IDENTITY,
    jsonName = "currentUsagePercent",
  )
  public val current_usage_percent: Long = 0L,
  @field:WireField(
    tag = 5,
    adapter = "com.squareup.wire.ProtoAdapter#INT64",
    jsonName = "currentMemoryUsage",
  )
  public val current_memory_usage: Long? = null,
  unknownFields: ByteString = ByteString.EMPTY,
) : Message(ADAPTER, unknownFields) {
  @Deprecated(
    message = "Shouldn't be used in Kotlin",
    level = DeprecationLevel.HIDDEN,
  )
  public override fun newBuilder(): Nothing = throw
      AssertionError("Builders are deprecated and only available in a javaInterop build; see https://square.github.io/wire/wire_compiler/#kotlin")

  public override fun equals(other: Any?): Boolean {
    if (other === this) return true
    if (other !is GetCapacityResponse) return false
    if (unknownFields != other.unknownFields) return false
    if (reserved_capacity_units != other.reserved_capacity_units) return false
    if (available_capacity_units != other.available_capacity_units) return false
    if (used_capacity_units != other.used_capacity_units) return false
    if (current_usage_percent != other.current_usage_percent) return false
    if (current_memory_usage != other.current_memory_usage) return false
    return true
  }

  public override fun hashCode(): Int {
    var result = super.hashCode
    if (result == 0) {
      result = unknownFields.hashCode()
      result = result * 37 + reserved_capacity_units.hashCode()
      result = result * 37 + available_capacity_units.hashCode()
      result = result * 37 + used_capacity_units.hashCode()
      result = result * 37 + current_usage_percent.hashCode()
      result = result * 37 + (current_memory_usage?.hashCode() ?: 0)
      super.hashCode = result
    }
    return result
  }

  public override fun toString(): String {
    val result = mutableListOf()
    result += """reserved_capacity_units=$reserved_capacity_units"""
    result += """available_capacity_units=$available_capacity_units"""
    result += """used_capacity_units=$used_capacity_units"""
    result += """current_usage_percent=$current_usage_percent"""
    if (current_memory_usage != null) result += """current_memory_usage=$current_memory_usage"""
    return result.joinToString(prefix = "GetCapacityResponse{", separator = ", ", postfix = "}")
  }

  public fun copy(
    reserved_capacity_units: Long = this.reserved_capacity_units,
    available_capacity_units: Long = this.available_capacity_units,
    used_capacity_units: Long = this.used_capacity_units,
    current_usage_percent: Long = this.current_usage_percent,
    current_memory_usage: Long? = this.current_memory_usage,
    unknownFields: ByteString = this.unknownFields,
  ): GetCapacityResponse = GetCapacityResponse(reserved_capacity_units, available_capacity_units,
      used_capacity_units, current_usage_percent, current_memory_usage, unknownFields)

  public companion object {
    public val ADAPTER: ProtoAdapter = object :
        ProtoAdapter(
      FieldEncoding.LENGTH_DELIMITED, 
      GetCapacityResponse::class, 
      "type.googleapis.com/media.node.GetCapacityResponse", 
      PROTO_3, 
      null, 
      "media/hub_node.proto"
    ) {
      public override fun encodedSize(`value`: GetCapacityResponse): Int {
        var size = value.unknownFields.size
        if (value.reserved_capacity_units != 0L) size += ProtoAdapter.INT64.encodedSizeWithTag(1,
            value.reserved_capacity_units)
        if (value.available_capacity_units != 0L) size += ProtoAdapter.INT64.encodedSizeWithTag(2,
            value.available_capacity_units)
        if (value.used_capacity_units != 0L) size += ProtoAdapter.INT64.encodedSizeWithTag(3,
            value.used_capacity_units)
        if (value.current_usage_percent != 0L) size += ProtoAdapter.INT64.encodedSizeWithTag(4,
            value.current_usage_percent)
        size += ProtoAdapter.INT64.encodedSizeWithTag(5, value.current_memory_usage)
        return size
      }

      public override fun encode(writer: ProtoWriter, `value`: GetCapacityResponse): Unit {
        if (value.reserved_capacity_units != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 1,
            value.reserved_capacity_units)
        if (value.available_capacity_units != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 2,
            value.available_capacity_units)
        if (value.used_capacity_units != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 3,
            value.used_capacity_units)
        if (value.current_usage_percent != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 4,
            value.current_usage_percent)
        ProtoAdapter.INT64.encodeWithTag(writer, 5, value.current_memory_usage)
        writer.writeBytes(value.unknownFields)
      }

      public override fun encode(writer: ReverseProtoWriter, `value`: GetCapacityResponse): Unit {
        writer.writeBytes(value.unknownFields)
        ProtoAdapter.INT64.encodeWithTag(writer, 5, value.current_memory_usage)
        if (value.current_usage_percent != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 4,
            value.current_usage_percent)
        if (value.used_capacity_units != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 3,
            value.used_capacity_units)
        if (value.available_capacity_units != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 2,
            value.available_capacity_units)
        if (value.reserved_capacity_units != 0L) ProtoAdapter.INT64.encodeWithTag(writer, 1,
            value.reserved_capacity_units)
      }

      public override fun decode(reader: ProtoReader): GetCapacityResponse {
        var reserved_capacity_units: Long = 0L
        var available_capacity_units: Long = 0L
        var used_capacity_units: Long = 0L
        var current_usage_percent: Long = 0L
        var current_memory_usage: Long? = null
        val unknownFields = reader.forEachTag { tag ->
          when (tag) {
            1 -> reserved_capacity_units = ProtoAdapter.INT64.decode(reader)
            2 -> available_capacity_units = ProtoAdapter.INT64.decode(reader)
            3 -> used_capacity_units = ProtoAdapter.INT64.decode(reader)
            4 -> current_usage_percent = ProtoAdapter.INT64.decode(reader)
            5 -> current_memory_usage = ProtoAdapter.INT64.decode(reader)
            else -> reader.readUnknownField(tag)
          }
        }
        return GetCapacityResponse(
          reserved_capacity_units = reserved_capacity_units,
          available_capacity_units = available_capacity_units,
          used_capacity_units = used_capacity_units,
          current_usage_percent = current_usage_percent,
          current_memory_usage = current_memory_usage,
          unknownFields = unknownFields
        )
      }

      public override fun redact(`value`: GetCapacityResponse): GetCapacityResponse = value.copy(
        unknownFields = ByteString.EMPTY
      )
    }

    private const val serialVersionUID: Long = 0L
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy