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

namespace Google\Cloud\Tpu\V1;

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

/**
 * Request for [CreateNode][google.cloud.tpu.v1.Tpu.CreateNode].
 *
 * Generated from protobuf message <code>google.cloud.tpu.v1.CreateNodeRequest</code>
 */
class CreateNodeRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The parent resource name.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * The unqualified resource name.
     *
     * Generated from protobuf field <code>string node_id = 2;</code>
     */
    private $node_id = '';
    /**
     * Required. The node.
     *
     * Generated from protobuf field <code>.google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $node = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The parent resource name.
     *     @type string $node_id
     *           The unqualified resource name.
     *     @type \Google\Cloud\Tpu\V1\Node $node
     *           Required. The node.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Tpu\V1\CloudTpu::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The parent resource name.
     *
     * 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 parent resource name.
     *
     * 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;
    }

    /**
     * The unqualified resource name.
     *
     * Generated from protobuf field <code>string node_id = 2;</code>
     * @return string
     */
    public function getNodeId()
    {
        return $this->node_id;
    }

    /**
     * The unqualified resource name.
     *
     * Generated from protobuf field <code>string node_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setNodeId($var)
    {
        GPBUtil::checkString($var, True);
        $this->node_id = $var;

        return $this;
    }

    /**
     * Required. The node.
     *
     * Generated from protobuf field <code>.google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Tpu\V1\Node|null
     */
    public function getNode()
    {
        return $this->node;
    }

    public function hasNode()
    {
        return isset($this->node);
    }

    public function clearNode()
    {
        unset($this->node);
    }

    /**
     * Required. The node.
     *
     * Generated from protobuf field <code>.google.cloud.tpu.v1.Node node = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Tpu\V1\Node $var
     * @return $this
     */
    public function setNode($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Tpu\V1\Node::class);
        $this->node = $var;

        return $this;
    }

}

