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

namespace Google\Cloud\AIPlatform\V1;

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

/**
 * Represents the spec of a group of resources of the same type,
 * for example machine type, disk, and accelerators, in a PersistentResource.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.ResourcePool</code>
 */
class ResourcePool extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. The unique ID in a PersistentResource for referring to this
     * resource pool. User can specify it if necessary. Otherwise, it's generated
     * automatically.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $id = '';
    /**
     * Required. Immutable. The specification of a single machine.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.MachineSpec machine_spec = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $machine_spec = null;
    /**
     * Optional. The total number of machines to use for this resource pool.
     *
     * Generated from protobuf field <code>optional int64 replica_count = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $replica_count = null;
    /**
     * Optional. Disk spec for the machine in this node pool.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.DiskSpec disk_spec = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $disk_spec = null;
    /**
     * Output only. The number of machines currently in use by training jobs for
     * this resource pool. Will replace idle_replica_count.
     *
     * Generated from protobuf field <code>int64 used_replica_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $used_replica_count = 0;
    /**
     * Optional. Optional spec to configure GKE or Ray-on-Vertex autoscaling
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ResourcePool.AutoscalingSpec autoscaling_spec = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $autoscaling_spec = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           Immutable. The unique ID in a PersistentResource for referring to this
     *           resource pool. User can specify it if necessary. Otherwise, it's generated
     *           automatically.
     *     @type \Google\Cloud\AIPlatform\V1\MachineSpec $machine_spec
     *           Required. Immutable. The specification of a single machine.
     *     @type int|string $replica_count
     *           Optional. The total number of machines to use for this resource pool.
     *     @type \Google\Cloud\AIPlatform\V1\DiskSpec $disk_spec
     *           Optional. Disk spec for the machine in this node pool.
     *     @type int|string $used_replica_count
     *           Output only. The number of machines currently in use by training jobs for
     *           this resource pool. Will replace idle_replica_count.
     *     @type \Google\Cloud\AIPlatform\V1\ResourcePool\AutoscalingSpec $autoscaling_spec
     *           Optional. Optional spec to configure GKE or Ray-on-Vertex autoscaling
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\PersistentResource::initOnce();
        parent::__construct($data);
    }

    /**
     * Immutable. The unique ID in a PersistentResource for referring to this
     * resource pool. User can specify it if necessary. Otherwise, it's generated
     * automatically.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Immutable. The unique ID in a PersistentResource for referring to this
     * resource pool. User can specify it if necessary. Otherwise, it's generated
     * automatically.
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Required. Immutable. The specification of a single machine.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.MachineSpec machine_spec = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return \Google\Cloud\AIPlatform\V1\MachineSpec|null
     */
    public function getMachineSpec()
    {
        return $this->machine_spec;
    }

    public function hasMachineSpec()
    {
        return isset($this->machine_spec);
    }

    public function clearMachineSpec()
    {
        unset($this->machine_spec);
    }

    /**
     * Required. Immutable. The specification of a single machine.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.MachineSpec machine_spec = 2 [(.google.api.field_behavior) = REQUIRED, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param \Google\Cloud\AIPlatform\V1\MachineSpec $var
     * @return $this
     */
    public function setMachineSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\MachineSpec::class);
        $this->machine_spec = $var;

        return $this;
    }

    /**
     * Optional. The total number of machines to use for this resource pool.
     *
     * Generated from protobuf field <code>optional int64 replica_count = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int|string
     */
    public function getReplicaCount()
    {
        return isset($this->replica_count) ? $this->replica_count : 0;
    }

    public function hasReplicaCount()
    {
        return isset($this->replica_count);
    }

    public function clearReplicaCount()
    {
        unset($this->replica_count);
    }

    /**
     * Optional. The total number of machines to use for this resource pool.
     *
     * Generated from protobuf field <code>optional int64 replica_count = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int|string $var
     * @return $this
     */
    public function setReplicaCount($var)
    {
        GPBUtil::checkInt64($var);
        $this->replica_count = $var;

        return $this;
    }

    /**
     * Optional. Disk spec for the machine in this node pool.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.DiskSpec disk_spec = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\DiskSpec|null
     */
    public function getDiskSpec()
    {
        return $this->disk_spec;
    }

    public function hasDiskSpec()
    {
        return isset($this->disk_spec);
    }

    public function clearDiskSpec()
    {
        unset($this->disk_spec);
    }

    /**
     * Optional. Disk spec for the machine in this node pool.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.DiskSpec disk_spec = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\DiskSpec $var
     * @return $this
     */
    public function setDiskSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\DiskSpec::class);
        $this->disk_spec = $var;

        return $this;
    }

    /**
     * Output only. The number of machines currently in use by training jobs for
     * this resource pool. Will replace idle_replica_count.
     *
     * Generated from protobuf field <code>int64 used_replica_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int|string
     */
    public function getUsedReplicaCount()
    {
        return $this->used_replica_count;
    }

    /**
     * Output only. The number of machines currently in use by training jobs for
     * this resource pool. Will replace idle_replica_count.
     *
     * Generated from protobuf field <code>int64 used_replica_count = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int|string $var
     * @return $this
     */
    public function setUsedReplicaCount($var)
    {
        GPBUtil::checkInt64($var);
        $this->used_replica_count = $var;

        return $this;
    }

    /**
     * Optional. Optional spec to configure GKE or Ray-on-Vertex autoscaling
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ResourcePool.AutoscalingSpec autoscaling_spec = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\AIPlatform\V1\ResourcePool\AutoscalingSpec|null
     */
    public function getAutoscalingSpec()
    {
        return $this->autoscaling_spec;
    }

    public function hasAutoscalingSpec()
    {
        return isset($this->autoscaling_spec);
    }

    public function clearAutoscalingSpec()
    {
        unset($this->autoscaling_spec);
    }

    /**
     * Optional. Optional spec to configure GKE or Ray-on-Vertex autoscaling
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ResourcePool.AutoscalingSpec autoscaling_spec = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\AIPlatform\V1\ResourcePool\AutoscalingSpec $var
     * @return $this
     */
    public function setAutoscalingSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\ResourcePool\AutoscalingSpec::class);
        $this->autoscaling_spec = $var;

        return $this;
    }

}

