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

namespace Google\Cloud\Compute\V1;

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

/**
 * Represent a sole-tenant Node Template resource.
 * You can use a template to define properties for nodes in a node group. For more information, read Creating node groups and instances. (== resource_for {$api_version}.nodeTemplates ==)
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.NodeTemplate</code>
 */
class NodeTemplate extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 269577064;</code>
     */
    private $accelerators;
    /**
     * CPU overcommit.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.NodeTemplate.CpuOvercommitType cpu_overcommit_type = 247727959;</code>
     */
    private $cpu_overcommit_type = null;
    /**
     * [Output Only] Creation timestamp in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     */
    private $creation_timestamp = null;
    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 422937596;</code>
     */
    private $description = null;
    /**
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.LocalDisk disks = 95594102;</code>
     */
    private $disks;
    /**
     * [Output Only] The unique identifier for the resource. This identifier is defined by the server.
     *
     * Generated from protobuf field <code>string id = 3355;</code>
     */
    private $id = null;
    /**
     * [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     */
    private $kind = null;
    /**
     * The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     */
    private $name = null;
    /**
     * Labels to use for node affinity, which will be used in instance scheduling.
     *
     * Generated from protobuf field <code>map<string, string> node_affinity_labels = 339007161;</code>
     */
    private $node_affinity_labels;
    /**
     * The node type to use for nodes group that are created from this template.
     *
     * Generated from protobuf field <code>string node_type = 465832791;</code>
     */
    private $node_type = null;
    /**
     * The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties.
     * This field is mutually exclusive with the node_type property; you can only define one or the other, but not both.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility node_type_flexibility = 315257905;</code>
     */
    private $node_type_flexibility = null;
    /**
     * [Output Only] The name of the region where the node template resides, such as us-central1.
     *
     * Generated from protobuf field <code>string region = 138946292;</code>
     */
    private $region = null;
    /**
     * [Output Only] Server-defined URL for the resource.
     *
     * Generated from protobuf field <code>string self_link = 456214797;</code>
     */
    private $self_link = null;
    /**
     * Sets the binding properties for the physical server. Valid values include:
     * - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server
     * - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible
     * See Sole-tenant node options for more information.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.ServerBinding server_binding = 208179593;</code>
     */
    private $server_binding = null;
    /**
     * [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.NodeTemplate.Status status = 181260274;</code>
     */
    private $status = null;
    /**
     * [Output Only] An optional, human-readable explanation of the status.
     *
     * Generated from protobuf field <code>string status_message = 297428154;</code>
     */
    private $status_message = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Compute\V1\AcceleratorConfig[]|\Google\Protobuf\Internal\RepeatedField $accelerators
     *     @type int $cpu_overcommit_type
     *           CPU overcommit.
     *     @type string $creation_timestamp
     *           [Output Only] Creation timestamp in RFC3339 text format.
     *     @type string $description
     *           An optional description of this resource. Provide this property when you create the resource.
     *     @type \Google\Cloud\Compute\V1\LocalDisk[]|\Google\Protobuf\Internal\RepeatedField $disks
     *     @type string $id
     *           [Output Only] The unique identifier for the resource. This identifier is defined by the server.
     *     @type string $kind
     *           [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
     *     @type string $name
     *           The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *     @type array|\Google\Protobuf\Internal\MapField $node_affinity_labels
     *           Labels to use for node affinity, which will be used in instance scheduling.
     *     @type string $node_type
     *           The node type to use for nodes group that are created from this template.
     *     @type \Google\Cloud\Compute\V1\NodeTemplateNodeTypeFlexibility $node_type_flexibility
     *           The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties.
     *           This field is mutually exclusive with the node_type property; you can only define one or the other, but not both.
     *     @type string $region
     *           [Output Only] The name of the region where the node template resides, such as us-central1.
     *     @type string $self_link
     *           [Output Only] Server-defined URL for the resource.
     *     @type \Google\Cloud\Compute\V1\ServerBinding $server_binding
     *           Sets the binding properties for the physical server. Valid values include:
     *           - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server
     *           - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible
     *           See Sole-tenant node options for more information.
     *     @type int $status
     *           [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
     *     @type string $status_message
     *           [Output Only] An optional, human-readable explanation of the status.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 269577064;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAccelerators()
    {
        return $this->accelerators;
    }

    /**
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 269577064;</code>
     * @param \Google\Cloud\Compute\V1\AcceleratorConfig[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setAccelerators($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\AcceleratorConfig::class);
        $this->accelerators = $arr;

        return $this;
    }

    /**
     * CPU overcommit.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.NodeTemplate.CpuOvercommitType cpu_overcommit_type = 247727959;</code>
     * @return int
     */
    public function getCpuOvercommitType()
    {
        return isset($this->cpu_overcommit_type) ? $this->cpu_overcommit_type : 0;
    }

    public function hasCpuOvercommitType()
    {
        return isset($this->cpu_overcommit_type);
    }

    public function clearCpuOvercommitType()
    {
        unset($this->cpu_overcommit_type);
    }

    /**
     * CPU overcommit.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.NodeTemplate.CpuOvercommitType cpu_overcommit_type = 247727959;</code>
     * @param int $var
     * @return $this
     */
    public function setCpuOvercommitType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\NodeTemplate\CpuOvercommitType::class);
        $this->cpu_overcommit_type = $var;

        return $this;
    }

    /**
     * [Output Only] Creation timestamp in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     * @return string
     */
    public function getCreationTimestamp()
    {
        return isset($this->creation_timestamp) ? $this->creation_timestamp : '';
    }

    public function hasCreationTimestamp()
    {
        return isset($this->creation_timestamp);
    }

    public function clearCreationTimestamp()
    {
        unset($this->creation_timestamp);
    }

    /**
     * [Output Only] Creation timestamp in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     * @param string $var
     * @return $this
     */
    public function setCreationTimestamp($var)
    {
        GPBUtil::checkString($var, True);
        $this->creation_timestamp = $var;

        return $this;
    }

    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 422937596;</code>
     * @return string
     */
    public function getDescription()
    {
        return isset($this->description) ? $this->description : '';
    }

    public function hasDescription()
    {
        return isset($this->description);
    }

    public function clearDescription()
    {
        unset($this->description);
    }

    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 422937596;</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.LocalDisk disks = 95594102;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getDisks()
    {
        return $this->disks;
    }

    /**
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.LocalDisk disks = 95594102;</code>
     * @param \Google\Cloud\Compute\V1\LocalDisk[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setDisks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Compute\V1\LocalDisk::class);
        $this->disks = $arr;

        return $this;
    }

    /**
     * [Output Only] The unique identifier for the resource. This identifier is defined by the server.
     *
     * Generated from protobuf field <code>string id = 3355;</code>
     * @return string
     */
    public function getId()
    {
        return isset($this->id) ? $this->id : '';
    }

    public function hasId()
    {
        return isset($this->id);
    }

    public function clearId()
    {
        unset($this->id);
    }

    /**
     * [Output Only] The unique identifier for the resource. This identifier is defined by the server.
     *
     * Generated from protobuf field <code>string id = 3355;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     * @return string
     */
    public function getKind()
    {
        return isset($this->kind) ? $this->kind : '';
    }

    public function hasKind()
    {
        return isset($this->kind);
    }

    public function clearKind()
    {
        unset($this->kind);
    }

    /**
     * [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     * @param string $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkString($var, True);
        $this->kind = $var;

        return $this;
    }

    /**
     * The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     * @return string
     */
    public function getName()
    {
        return isset($this->name) ? $this->name : '';
    }

    public function hasName()
    {
        return isset($this->name);
    }

    public function clearName()
    {
        unset($this->name);
    }

    /**
     * The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
     *
     * Generated from protobuf field <code>string name = 3373707;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Labels to use for node affinity, which will be used in instance scheduling.
     *
     * Generated from protobuf field <code>map<string, string> node_affinity_labels = 339007161;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getNodeAffinityLabels()
    {
        return $this->node_affinity_labels;
    }

    /**
     * Labels to use for node affinity, which will be used in instance scheduling.
     *
     * Generated from protobuf field <code>map<string, string> node_affinity_labels = 339007161;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setNodeAffinityLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->node_affinity_labels = $arr;

        return $this;
    }

    /**
     * The node type to use for nodes group that are created from this template.
     *
     * Generated from protobuf field <code>string node_type = 465832791;</code>
     * @return string
     */
    public function getNodeType()
    {
        return isset($this->node_type) ? $this->node_type : '';
    }

    public function hasNodeType()
    {
        return isset($this->node_type);
    }

    public function clearNodeType()
    {
        unset($this->node_type);
    }

    /**
     * The node type to use for nodes group that are created from this template.
     *
     * Generated from protobuf field <code>string node_type = 465832791;</code>
     * @param string $var
     * @return $this
     */
    public function setNodeType($var)
    {
        GPBUtil::checkString($var, True);
        $this->node_type = $var;

        return $this;
    }

    /**
     * The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties.
     * This field is mutually exclusive with the node_type property; you can only define one or the other, but not both.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility node_type_flexibility = 315257905;</code>
     * @return \Google\Cloud\Compute\V1\NodeTemplateNodeTypeFlexibility|null
     */
    public function getNodeTypeFlexibility()
    {
        return isset($this->node_type_flexibility) ? $this->node_type_flexibility : null;
    }

    public function hasNodeTypeFlexibility()
    {
        return isset($this->node_type_flexibility);
    }

    public function clearNodeTypeFlexibility()
    {
        unset($this->node_type_flexibility);
    }

    /**
     * The flexible properties of the desired node type. Node groups that use this node template will create nodes of a type that matches these properties.
     * This field is mutually exclusive with the node_type property; you can only define one or the other, but not both.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.NodeTemplateNodeTypeFlexibility node_type_flexibility = 315257905;</code>
     * @param \Google\Cloud\Compute\V1\NodeTemplateNodeTypeFlexibility $var
     * @return $this
     */
    public function setNodeTypeFlexibility($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\NodeTemplateNodeTypeFlexibility::class);
        $this->node_type_flexibility = $var;

        return $this;
    }

    /**
     * [Output Only] The name of the region where the node template resides, such as us-central1.
     *
     * Generated from protobuf field <code>string region = 138946292;</code>
     * @return string
     */
    public function getRegion()
    {
        return isset($this->region) ? $this->region : '';
    }

    public function hasRegion()
    {
        return isset($this->region);
    }

    public function clearRegion()
    {
        unset($this->region);
    }

    /**
     * [Output Only] The name of the region where the node template resides, such as us-central1.
     *
     * Generated from protobuf field <code>string region = 138946292;</code>
     * @param string $var
     * @return $this
     */
    public function setRegion($var)
    {
        GPBUtil::checkString($var, True);
        $this->region = $var;

        return $this;
    }

    /**
     * [Output Only] Server-defined URL for the resource.
     *
     * Generated from protobuf field <code>string self_link = 456214797;</code>
     * @return string
     */
    public function getSelfLink()
    {
        return isset($this->self_link) ? $this->self_link : '';
    }

    public function hasSelfLink()
    {
        return isset($this->self_link);
    }

    public function clearSelfLink()
    {
        unset($this->self_link);
    }

    /**
     * [Output Only] Server-defined URL for the resource.
     *
     * Generated from protobuf field <code>string self_link = 456214797;</code>
     * @param string $var
     * @return $this
     */
    public function setSelfLink($var)
    {
        GPBUtil::checkString($var, True);
        $this->self_link = $var;

        return $this;
    }

    /**
     * Sets the binding properties for the physical server. Valid values include:
     * - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server
     * - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible
     * See Sole-tenant node options for more information.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.ServerBinding server_binding = 208179593;</code>
     * @return \Google\Cloud\Compute\V1\ServerBinding|null
     */
    public function getServerBinding()
    {
        return isset($this->server_binding) ? $this->server_binding : null;
    }

    public function hasServerBinding()
    {
        return isset($this->server_binding);
    }

    public function clearServerBinding()
    {
        unset($this->server_binding);
    }

    /**
     * Sets the binding properties for the physical server. Valid values include:
     * - [Default] RESTART_NODE_ON_ANY_SERVER: Restarts VMs on any available physical server
     * - RESTART_NODE_ON_MINIMAL_SERVER: Restarts VMs on the same physical server whenever possible
     * See Sole-tenant node options for more information.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.ServerBinding server_binding = 208179593;</code>
     * @param \Google\Cloud\Compute\V1\ServerBinding $var
     * @return $this
     */
    public function setServerBinding($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Compute\V1\ServerBinding::class);
        $this->server_binding = $var;

        return $this;
    }

    /**
     * [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.NodeTemplate.Status status = 181260274;</code>
     * @return int
     */
    public function getStatus()
    {
        return isset($this->status) ? $this->status : 0;
    }

    public function hasStatus()
    {
        return isset($this->status);
    }

    public function clearStatus()
    {
        unset($this->status);
    }

    /**
     * [Output Only] The status of the node template. One of the following values: CREATING, READY, and DELETING.
     *
     * Generated from protobuf field <code>.google.cloud.compute.v1.NodeTemplate.Status status = 181260274;</code>
     * @param int $var
     * @return $this
     */
    public function setStatus($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Compute\V1\NodeTemplate\Status::class);
        $this->status = $var;

        return $this;
    }

    /**
     * [Output Only] An optional, human-readable explanation of the status.
     *
     * Generated from protobuf field <code>string status_message = 297428154;</code>
     * @return string
     */
    public function getStatusMessage()
    {
        return isset($this->status_message) ? $this->status_message : '';
    }

    public function hasStatusMessage()
    {
        return isset($this->status_message);
    }

    public function clearStatusMessage()
    {
        unset($this->status_message);
    }

    /**
     * [Output Only] An optional, human-readable explanation of the status.
     *
     * Generated from protobuf field <code>string status_message = 297428154;</code>
     * @param string $var
     * @return $this
     */
    public function setStatusMessage($var)
    {
        GPBUtil::checkString($var, True);
        $this->status_message = $var;

        return $this;
    }

}

