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

namespace Google\Cloud\ApigeeConnect\V1;

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

/**
 * Payload for EgressRequest.
 *
 * Generated from protobuf message <code>google.cloud.apigeeconnect.v1.Payload</code>
 */
class Payload extends \Google\Protobuf\Internal\Message
{
    protected $kind;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\ApigeeConnect\V1\HttpRequest $http_request
     *           The HttpRequest proto.
     *     @type \Google\Cloud\ApigeeConnect\V1\StreamInfo $stream_info
     *           The information of stream.
     *     @type int $action
     *           The action taken by agent.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Apigeeconnect\V1\Tether::initOnce();
        parent::__construct($data);
    }

    /**
     * The HttpRequest proto.
     *
     * Generated from protobuf field <code>.google.cloud.apigeeconnect.v1.HttpRequest http_request = 1;</code>
     * @return \Google\Cloud\ApigeeConnect\V1\HttpRequest|null
     */
    public function getHttpRequest()
    {
        return $this->readOneof(1);
    }

    public function hasHttpRequest()
    {
        return $this->hasOneof(1);
    }

    /**
     * The HttpRequest proto.
     *
     * Generated from protobuf field <code>.google.cloud.apigeeconnect.v1.HttpRequest http_request = 1;</code>
     * @param \Google\Cloud\ApigeeConnect\V1\HttpRequest $var
     * @return $this
     */
    public function setHttpRequest($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ApigeeConnect\V1\HttpRequest::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The information of stream.
     *
     * Generated from protobuf field <code>.google.cloud.apigeeconnect.v1.StreamInfo stream_info = 2;</code>
     * @return \Google\Cloud\ApigeeConnect\V1\StreamInfo|null
     */
    public function getStreamInfo()
    {
        return $this->readOneof(2);
    }

    public function hasStreamInfo()
    {
        return $this->hasOneof(2);
    }

    /**
     * The information of stream.
     *
     * Generated from protobuf field <code>.google.cloud.apigeeconnect.v1.StreamInfo stream_info = 2;</code>
     * @param \Google\Cloud\ApigeeConnect\V1\StreamInfo $var
     * @return $this
     */
    public function setStreamInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ApigeeConnect\V1\StreamInfo::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * The action taken by agent.
     *
     * Generated from protobuf field <code>.google.cloud.apigeeconnect.v1.Action action = 3;</code>
     * @return int
     */
    public function getAction()
    {
        return $this->readOneof(3);
    }

    public function hasAction()
    {
        return $this->hasOneof(3);
    }

    /**
     * The action taken by agent.
     *
     * Generated from protobuf field <code>.google.cloud.apigeeconnect.v1.Action action = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setAction($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\ApigeeConnect\V1\Action::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

