<?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\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * 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 array<\Google\Cloud\Container\V1\SoleTenantConfig\NodeAffinity>|\Google\Protobuf\Internal\RepeatedField $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 \Google\Protobuf\Internal\RepeatedField
     */
    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 array<\Google\Cloud\Container\V1\SoleTenantConfig\NodeAffinity>|\Google\Protobuf\Internal\RepeatedField $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;
    }

}

