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

namespace Google\Cloud\DeviceStreaming\V1;

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

/**
 * Request message for DirectAccessService.CreateDeviceSession.
 *
 * Generated from protobuf message <code>google.cloud.devicestreaming.v1.CreateDeviceSessionRequest</code>
 */
class CreateDeviceSessionRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The Compute Engine project under which this device will be
     * allocated. "projects/{project_id}"
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    protected $parent = '';
    /**
     * Required. A DeviceSession to create.
     *
     * Generated from protobuf field <code>.google.cloud.devicestreaming.v1.DeviceSession device_session = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $device_session = null;
    /**
     * Optional. The ID to use for the DeviceSession, which will become the final
     * component of the DeviceSession's resource name.
     * This value should be 4-63 characters, and valid characters
     * are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string device_session_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $device_session_id = '';

    /**
     * @param string                                         $parent          Required. The Compute Engine project under which this device will be
     *                                                                        allocated. "projects/{project_id}"
     *                                                                        Please see {@see DirectAccessServiceClient::projectName()} for help formatting this field.
     * @param \Google\Cloud\DeviceStreaming\V1\DeviceSession $deviceSession   Required. A DeviceSession to create.
     * @param string                                         $deviceSessionId Optional. The ID to use for the DeviceSession, which will become the final
     *                                                                        component of the DeviceSession's resource name.
     *
     *                                                                        This value should be 4-63 characters, and valid characters
     *                                                                        are /[a-z][0-9]-/.
     *
     * @return \Google\Cloud\DeviceStreaming\V1\CreateDeviceSessionRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\DeviceStreaming\V1\DeviceSession $deviceSession, string $deviceSessionId): self
    {
        return (new self())
            ->setParent($parent)
            ->setDeviceSession($deviceSession)
            ->setDeviceSessionId($deviceSessionId);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The Compute Engine project under which this device will be
     *           allocated. "projects/{project_id}"
     *     @type \Google\Cloud\DeviceStreaming\V1\DeviceSession $device_session
     *           Required. A DeviceSession to create.
     *     @type string $device_session_id
     *           Optional. The ID to use for the DeviceSession, which will become the final
     *           component of the DeviceSession's resource name.
     *           This value should be 4-63 characters, and valid characters
     *           are /[a-z][0-9]-/.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Devicestreaming\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The Compute Engine project under which this device will be
     * allocated. "projects/{project_id}"
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The Compute Engine project under which this device will be
     * allocated. "projects/{project_id}"
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. A DeviceSession to create.
     *
     * Generated from protobuf field <code>.google.cloud.devicestreaming.v1.DeviceSession device_session = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\DeviceStreaming\V1\DeviceSession|null
     */
    public function getDeviceSession()
    {
        return $this->device_session;
    }

    public function hasDeviceSession()
    {
        return isset($this->device_session);
    }

    public function clearDeviceSession()
    {
        unset($this->device_session);
    }

    /**
     * Required. A DeviceSession to create.
     *
     * Generated from protobuf field <code>.google.cloud.devicestreaming.v1.DeviceSession device_session = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\DeviceStreaming\V1\DeviceSession $var
     * @return $this
     */
    public function setDeviceSession($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DeviceStreaming\V1\DeviceSession::class);
        $this->device_session = $var;

        return $this;
    }

    /**
     * Optional. The ID to use for the DeviceSession, which will become the final
     * component of the DeviceSession's resource name.
     * This value should be 4-63 characters, and valid characters
     * are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string device_session_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDeviceSessionId()
    {
        return $this->device_session_id;
    }

    /**
     * Optional. The ID to use for the DeviceSession, which will become the final
     * component of the DeviceSession's resource name.
     * This value should be 4-63 characters, and valid characters
     * are /[a-z][0-9]-/.
     *
     * Generated from protobuf field <code>string device_session_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDeviceSessionId($var)
    {
        GPBUtil::checkString($var, True);
        $this->device_session_id = $var;

        return $this;
    }

}

