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

namespace Google\Cloud\DeviceStreaming\V1;

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

/**
 * A message returned from a device.
 *
 * Generated from protobuf message <code>google.cloud.devicestreaming.v1.DeviceMessage</code>
 */
class DeviceMessage extends \Google\Protobuf\Internal\Message
{
    protected $contents;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DeviceStreaming\V1\StatusUpdate $status_update
     *           Information about the device's state.
     *     @type \Google\Cloud\DeviceStreaming\V1\StreamStatus $stream_status
     *           The result of a device stream from ADB.
     *     @type \Google\Cloud\DeviceStreaming\V1\StreamData $stream_data
     *           Data from an open stream.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Devicestreaming\V1\AdbService::initOnce();
        parent::__construct($data);
    }

    /**
     * Information about the device's state.
     *
     * Generated from protobuf field <code>.google.cloud.devicestreaming.v1.StatusUpdate status_update = 1;</code>
     * @return \Google\Cloud\DeviceStreaming\V1\StatusUpdate|null
     */
    public function getStatusUpdate()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Information about the device's state.
     *
     * Generated from protobuf field <code>.google.cloud.devicestreaming.v1.StatusUpdate status_update = 1;</code>
     * @param \Google\Cloud\DeviceStreaming\V1\StatusUpdate $var
     * @return $this
     */
    public function setStatusUpdate($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DeviceStreaming\V1\StatusUpdate::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The result of a device stream from ADB.
     *
     * Generated from protobuf field <code>.google.cloud.devicestreaming.v1.StreamStatus stream_status = 2;</code>
     * @return \Google\Cloud\DeviceStreaming\V1\StreamStatus|null
     */
    public function getStreamStatus()
    {
        return $this->readOneof(2);
    }

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

    /**
     * The result of a device stream from ADB.
     *
     * Generated from protobuf field <code>.google.cloud.devicestreaming.v1.StreamStatus stream_status = 2;</code>
     * @param \Google\Cloud\DeviceStreaming\V1\StreamStatus $var
     * @return $this
     */
    public function setStreamStatus($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DeviceStreaming\V1\StreamStatus::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Data from an open stream.
     *
     * Generated from protobuf field <code>.google.cloud.devicestreaming.v1.StreamData stream_data = 3;</code>
     * @return \Google\Cloud\DeviceStreaming\V1\StreamData|null
     */
    public function getStreamData()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Data from an open stream.
     *
     * Generated from protobuf field <code>.google.cloud.devicestreaming.v1.StreamData stream_data = 3;</code>
     * @param \Google\Cloud\DeviceStreaming\V1\StreamData $var
     * @return $this
     */
    public function setStreamData($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DeviceStreaming\V1\StreamData::class);
        $this->writeOneof(3, $var);

        return $this;
    }

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

}

