<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: src/proto/grpc/testing/payloads.proto

namespace Grpc\Testing;

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

/**
 * Generated from protobuf message <code>grpc.testing.PayloadConfig</code>
 */
class PayloadConfig extends \Google\Protobuf\Internal\Message
{
    protected $payload;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Grpc\Testing\ByteBufferParams $bytebuf_params
     *     @type \Grpc\Testing\SimpleProtoParams $simple_params
     *     @type \Grpc\Testing\ComplexProtoParams $complex_params
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Src\Proto\Grpc\Testing\Payloads::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.ByteBufferParams bytebuf_params = 1;</code>
     * @return \Grpc\Testing\ByteBufferParams
     */
    public function getBytebufParams()
    {
        return $this->readOneof(1);
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.ByteBufferParams bytebuf_params = 1;</code>
     * @param \Grpc\Testing\ByteBufferParams $var
     * @return $this
     */
    public function setBytebufParams($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\ByteBufferParams::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.SimpleProtoParams simple_params = 2;</code>
     * @return \Grpc\Testing\SimpleProtoParams
     */
    public function getSimpleParams()
    {
        return $this->readOneof(2);
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.SimpleProtoParams simple_params = 2;</code>
     * @param \Grpc\Testing\SimpleProtoParams $var
     * @return $this
     */
    public function setSimpleParams($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\SimpleProtoParams::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.ComplexProtoParams complex_params = 3;</code>
     * @return \Grpc\Testing\ComplexProtoParams
     */
    public function getComplexParams()
    {
        return $this->readOneof(3);
    }

    /**
     * Generated from protobuf field <code>.grpc.testing.ComplexProtoParams complex_params = 3;</code>
     * @param \Grpc\Testing\ComplexProtoParams $var
     * @return $this
     */
    public function setComplexParams($var)
    {
        GPBUtil::checkMessage($var, \Grpc\Testing\ComplexProtoParams::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getPayload()
    {
        return $this->whichOneof("payload");
    }

}

