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

namespace Google\Cloud\Dataproc\V1;

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

/**
 * The configuration of a GKE node pool used by a [Dataproc-on-GKE
 * cluster](https://cloud.google.com/dataproc/docs/concepts/jobs/dataproc-gke#create-a-dataproc-on-gke-cluster).
 *
 * Generated from protobuf message <code>google.cloud.dataproc.v1.GkeNodePoolConfig</code>
 */
class GkeNodePoolConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The node pool configuration.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig config = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $config = null;
    /**
     * Optional. The list of Compute Engine
     * [zones](https://cloud.google.com/compute/docs/zones#available) where
     * node pool nodes associated with a Dataproc on GKE virtual cluster
     * will be located.
     * **Note:** All node pools associated with a virtual cluster
     * must be located in the same region as the virtual cluster, and they must
     * be located in the same zone within that region.
     * If a location is not specified during node pool creation, Dataproc on GKE
     * will choose the zone.
     *
     * Generated from protobuf field <code>repeated string locations = 13 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $locations;
    /**
     * Optional. The autoscaler configuration for this node pool. The autoscaler
     * is enabled only when a valid configuration is present.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig autoscaling = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $autoscaling = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dataproc\V1\GkeNodePoolConfig\GkeNodeConfig $config
     *           Optional. The node pool configuration.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $locations
     *           Optional. The list of Compute Engine
     *           [zones](https://cloud.google.com/compute/docs/zones#available) where
     *           node pool nodes associated with a Dataproc on GKE virtual cluster
     *           will be located.
     *           **Note:** All node pools associated with a virtual cluster
     *           must be located in the same region as the virtual cluster, and they must
     *           be located in the same zone within that region.
     *           If a location is not specified during node pool creation, Dataproc on GKE
     *           will choose the zone.
     *     @type \Google\Cloud\Dataproc\V1\GkeNodePoolConfig\GkeNodePoolAutoscalingConfig $autoscaling
     *           Optional. The autoscaler configuration for this node pool. The autoscaler
     *           is enabled only when a valid configuration is present.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataproc\V1\Shared::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The node pool configuration.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig config = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dataproc\V1\GkeNodePoolConfig\GkeNodeConfig|null
     */
    public function getConfig()
    {
        return $this->config;
    }

    public function hasConfig()
    {
        return isset($this->config);
    }

    public function clearConfig()
    {
        unset($this->config);
    }

    /**
     * Optional. The node pool configuration.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodeConfig config = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dataproc\V1\GkeNodePoolConfig\GkeNodeConfig $var
     * @return $this
     */
    public function setConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\GkeNodePoolConfig\GkeNodeConfig::class);
        $this->config = $var;

        return $this;
    }

    /**
     * Optional. The list of Compute Engine
     * [zones](https://cloud.google.com/compute/docs/zones#available) where
     * node pool nodes associated with a Dataproc on GKE virtual cluster
     * will be located.
     * **Note:** All node pools associated with a virtual cluster
     * must be located in the same region as the virtual cluster, and they must
     * be located in the same zone within that region.
     * If a location is not specified during node pool creation, Dataproc on GKE
     * will choose the zone.
     *
     * Generated from protobuf field <code>repeated string locations = 13 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getLocations()
    {
        return $this->locations;
    }

    /**
     * Optional. The list of Compute Engine
     * [zones](https://cloud.google.com/compute/docs/zones#available) where
     * node pool nodes associated with a Dataproc on GKE virtual cluster
     * will be located.
     * **Note:** All node pools associated with a virtual cluster
     * must be located in the same region as the virtual cluster, and they must
     * be located in the same zone within that region.
     * If a location is not specified during node pool creation, Dataproc on GKE
     * will choose the zone.
     *
     * Generated from protobuf field <code>repeated string locations = 13 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setLocations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->locations = $arr;

        return $this;
    }

    /**
     * Optional. The autoscaler configuration for this node pool. The autoscaler
     * is enabled only when a valid configuration is present.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig autoscaling = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Dataproc\V1\GkeNodePoolConfig\GkeNodePoolAutoscalingConfig|null
     */
    public function getAutoscaling()
    {
        return $this->autoscaling;
    }

    public function hasAutoscaling()
    {
        return isset($this->autoscaling);
    }

    public function clearAutoscaling()
    {
        unset($this->autoscaling);
    }

    /**
     * Optional. The autoscaler configuration for this node pool. The autoscaler
     * is enabled only when a valid configuration is present.
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1.GkeNodePoolConfig.GkeNodePoolAutoscalingConfig autoscaling = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Dataproc\V1\GkeNodePoolConfig\GkeNodePoolAutoscalingConfig $var
     * @return $this
     */
    public function setAutoscaling($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataproc\V1\GkeNodePoolConfig\GkeNodePoolAutoscalingConfig::class);
        $this->autoscaling = $var;

        return $this;
    }

}

