<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/exchange/v1/keyapis_exchange_message_v1.proto

namespace Keyapis\Exchange\V1;

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

/**
 * Поток отправляемых событий
 *
 * Generated from protobuf message <code>keyapis.exchange.v1.PostMessageFullDuplexRequest</code>
 */
class PostMessageFullDuplexRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор запроса
     *
     * Generated from protobuf field <code>string request_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $request_id = '';
    protected $task;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $request_id
     *           Идентификатор запроса
     *     @type \Keyapis\Exchange\V1\PostMessagePushCallRequest $post_message_push_call
     *           Отправка звонкового сообщения
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Exchange\V1\KeyapisExchangeMessageV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор запроса
     *
     * Generated from protobuf field <code>string request_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * Идентификатор запроса
     *
     * Generated from protobuf field <code>string request_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

    /**
     * Отправка звонкового сообщения
     *
     * Generated from protobuf field <code>.keyapis.exchange.v1.PostMessagePushCallRequest post_message_push_call = 2;</code>
     * @return \Keyapis\Exchange\V1\PostMessagePushCallRequest|null
     */
    public function getPostMessagePushCall()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Отправка звонкового сообщения
     *
     * Generated from protobuf field <code>.keyapis.exchange.v1.PostMessagePushCallRequest post_message_push_call = 2;</code>
     * @param \Keyapis\Exchange\V1\PostMessagePushCallRequest $var
     * @return $this
     */
    public function setPostMessagePushCall($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Exchange\V1\PostMessagePushCallRequest::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

