<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/managedkafka/v1/resources.proto

namespace Google\Cloud\ManagedKafka\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Metadata for a consumer group corresponding to a specific partition.
 *
 * Generated from protobuf message <code>google.cloud.managedkafka.v1.ConsumerPartitionMetadata</code>
 */
class ConsumerPartitionMetadata extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The current offset for this partition, or 0 if no offset has been
     * committed.
     *
     * Generated from protobuf field <code>int64 offset = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $offset = 0;
    /**
     * Optional. The associated metadata for this partition, or empty if it does
     * not exist.
     *
     * Generated from protobuf field <code>string metadata = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $metadata = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $offset
     *           Required. The current offset for this partition, or 0 if no offset has been
     *           committed.
     *     @type string $metadata
     *           Optional. The associated metadata for this partition, or empty if it does
     *           not exist.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Managedkafka\V1\Resources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The current offset for this partition, or 0 if no offset has been
     * committed.
     *
     * Generated from protobuf field <code>int64 offset = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int|string
     */
    public function getOffset()
    {
        return $this->offset;
    }

    /**
     * Required. The current offset for this partition, or 0 if no offset has been
     * committed.
     *
     * Generated from protobuf field <code>int64 offset = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int|string $var
     * @return $this
     */
    public function setOffset($var)
    {
        GPBUtil::checkInt64($var);
        $this->offset = $var;

        return $this;
    }

    /**
     * Optional. The associated metadata for this partition, or empty if it does
     * not exist.
     *
     * Generated from protobuf field <code>string metadata = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getMetadata()
    {
        return $this->metadata;
    }

    /**
     * Optional. The associated metadata for this partition, or empty if it does
     * not exist.
     *
     * Generated from protobuf field <code>string metadata = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setMetadata($var)
    {
        GPBUtil::checkString($var, True);
        $this->metadata = $var;

        return $this;
    }

}

