<?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 = 1141608;</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 = 0;
    /**
     * [Output Only] Creation timestamp in RFC3339 text format.
     *
     * Generated from protobuf field <code>string creation_timestamp = 30525366;</code>
     */
    private $creation_timestamp = '';
    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 154502140;</code>
     */
    private $description = '';
    /**
     * 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 = '';
    /**
     * [Output Only] The type of the resource. Always compute#nodeTemplate for node templates.
     *
     * Generated from protobuf field <code>string kind = 3292052;</code>
     */
    private $kind = '';
    /**
     * 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 = '';
    /**
     * Labels to use for node affinity, which will be used in instance scheduling.
     *
     * Generated from protobuf field <code>map<string, string> node_affinity_labels = 70571705;</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 = 197397335;</code>
     */
    private $node_type = '';
    /**
     * 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 = 46822449;</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 = '';
    /**
     * [Output Only] Server-defined URL for the resource.
     *
     * Generated from protobuf field <code>string self_link = 187779341;</code>
     */
    private $self_link = '';
    /**
     * 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 = 0;
    /**
     * [Output Only] An optional, human-readable explanation of the status.
     *
     * Generated from protobuf field <code>string status_message = 28992698;</code>
     */
    private $status_message = '';

    /**
     * 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 = 1141608;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getAccelerators()
    {
        return $this->accelerators;
    }

    /**
     * Generated from protobuf field <code>repeated .google.cloud.compute.v1.AcceleratorConfig accelerators = 1141608;</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 $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 $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 = 154502140;</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * An optional description of this resource. Provide this property when you create the resource.
     *
     * Generated from protobuf field <code>string description = 154502140;</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 $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 $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 $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 = 70571705;</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 = 70571705;</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 = 197397335;</code>
     * @return string
     */
    public function getNodeType()
    {
        return $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 = 197397335;</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 = 46822449;</code>
     * @return \Google\Cloud\Compute\V1\NodeTemplateNodeTypeFlexibility
     */
    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 = 46822449;</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 $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 = 187779341;</code>
     * @return string
     */
    public function getSelfLink()
    {
        return $this->self_link;
    }

    /**
     * [Output Only] Server-defined URL for the resource.
     *
     * Generated from protobuf field <code>string self_link = 187779341;</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
     */
    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 $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 = 28992698;</code>
     * @return string
     */
    public function getStatusMessage()
    {
        return $this->status_message;
    }

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

        return $this;
    }

}

