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

namespace Google\Cloud\Container\V1;

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

/**
 * SoleTenantConfig contains the NodeAffinities to specify what shared sole
 * tenant node groups should back the node pool.
 *
 * Generated from protobuf message <code>google.container.v1.SoleTenantConfig</code>
 */
class SoleTenantConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * NodeAffinities used to match to a shared sole tenant node group.
     *
     * Generated from protobuf field <code>repeated .google.container.v1.SoleTenantConfig.NodeAffinity node_affinities = 1;</code>
     */
    private $node_affinities;
    /**
     * Optional. The minimum number of virtual CPUs this instance will consume
     * when running on a sole-tenant node. This field can only be set if the node
     * pool is created in a shared sole-tenant node group.
     *
     * Generated from protobuf field <code>optional int32 min_node_cpus = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $min_node_cpus = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Container\V1\SoleTenantConfig\NodeAffinity[] $node_affinities
     *           NodeAffinities used to match to a shared sole tenant node group.
     *     @type int $min_node_cpus
     *           Optional. The minimum number of virtual CPUs this instance will consume
     *           when running on a sole-tenant node. This field can only be set if the node
     *           pool is created in a shared sole-tenant node group.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * NodeAffinities used to match to a shared sole tenant node group.
     *
     * Generated from protobuf field <code>repeated .google.container.v1.SoleTenantConfig.NodeAffinity node_affinities = 1;</code>
     * @return RepeatedField<\Google\Cloud\Container\V1\SoleTenantConfig\NodeAffinity>
     */
    public function getNodeAffinities()
    {
        return $this->node_affinities;
    }

    /**
     * NodeAffinities used to match to a shared sole tenant node group.
     *
     * Generated from protobuf field <code>repeated .google.container.v1.SoleTenantConfig.NodeAffinity node_affinities = 1;</code>
     * @param \Google\Cloud\Container\V1\SoleTenantConfig\NodeAffinity[] $var
     * @return $this
     */
    public function setNodeAffinities($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Container\V1\SoleTenantConfig\NodeAffinity::class);
        $this->node_affinities = $arr;

        return $this;
    }

    /**
     * Optional. The minimum number of virtual CPUs this instance will consume
     * when running on a sole-tenant node. This field can only be set if the node
     * pool is created in a shared sole-tenant node group.
     *
     * Generated from protobuf field <code>optional int32 min_node_cpus = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getMinNodeCpus()
    {
        return isset($this->min_node_cpus) ? $this->min_node_cpus : 0;
    }

    public function hasMinNodeCpus()
    {
        return isset($this->min_node_cpus);
    }

    public function clearMinNodeCpus()
    {
        unset($this->min_node_cpus);
    }

    /**
     * Optional. The minimum number of virtual CPUs this instance will consume
     * when running on a sole-tenant node. This field can only be set if the node
     * pool is created in a shared sole-tenant node group.
     *
     * Generated from protobuf field <code>optional int32 min_node_cpus = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setMinNodeCpus($var)
    {
        GPBUtil::checkInt32($var);
        $this->min_node_cpus = $var;

        return $this;
    }

}

