<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/hypercomputecluster/v1beta/hypercompute_cluster.proto

namespace Google\Cloud\HypercomputeCluster\V1beta;

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

/**
 * Describes how a compute resource should be created at runtime.
 *
 * Generated from protobuf message <code>google.cloud.hypercomputecluster.v1beta.ComputeResourceConfig</code>
 */
class ComputeResourceConfig extends \Google\Protobuf\Internal\Message
{
    protected $config;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\HypercomputeCluster\V1beta\NewOnDemandInstancesConfig $new_on_demand_instances
     *           Optional. Immutable. If set, indicates that this resource should use
     *           on-demand VMs.
     *     @type \Google\Cloud\HypercomputeCluster\V1beta\NewSpotInstancesConfig $new_spot_instances
     *           Optional. Immutable. If set, indicates that this resource should use spot
     *           VMs.
     *     @type \Google\Cloud\HypercomputeCluster\V1beta\NewReservedInstancesConfig $new_reserved_instances
     *           Optional. Immutable. If set, indicates that this resource should use
     *           reserved VMs.
     *     @type \Google\Cloud\HypercomputeCluster\V1beta\NewFlexStartInstancesConfig $new_flex_start_instances
     *           Optional. Immutable. If set, indicates that this resource should use
     *           flex-start VMs.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Hypercomputecluster\V1Beta\HypercomputeCluster::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Immutable. If set, indicates that this resource should use
     * on-demand VMs.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NewOnDemandInstancesConfig new_on_demand_instances = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return \Google\Cloud\HypercomputeCluster\V1beta\NewOnDemandInstancesConfig|null
     */
    public function getNewOnDemandInstances()
    {
        return $this->readOneof(1);
    }

    public function hasNewOnDemandInstances()
    {
        return $this->hasOneof(1);
    }

    /**
     * Optional. Immutable. If set, indicates that this resource should use
     * on-demand VMs.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NewOnDemandInstancesConfig new_on_demand_instances = 1 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param \Google\Cloud\HypercomputeCluster\V1beta\NewOnDemandInstancesConfig $var
     * @return $this
     */
    public function setNewOnDemandInstances($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1beta\NewOnDemandInstancesConfig::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Optional. Immutable. If set, indicates that this resource should use spot
     * VMs.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NewSpotInstancesConfig new_spot_instances = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return \Google\Cloud\HypercomputeCluster\V1beta\NewSpotInstancesConfig|null
     */
    public function getNewSpotInstances()
    {
        return $this->readOneof(2);
    }

    public function hasNewSpotInstances()
    {
        return $this->hasOneof(2);
    }

    /**
     * Optional. Immutable. If set, indicates that this resource should use spot
     * VMs.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NewSpotInstancesConfig new_spot_instances = 2 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param \Google\Cloud\HypercomputeCluster\V1beta\NewSpotInstancesConfig $var
     * @return $this
     */
    public function setNewSpotInstances($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1beta\NewSpotInstancesConfig::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Optional. Immutable. If set, indicates that this resource should use
     * reserved VMs.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NewReservedInstancesConfig new_reserved_instances = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return \Google\Cloud\HypercomputeCluster\V1beta\NewReservedInstancesConfig|null
     */
    public function getNewReservedInstances()
    {
        return $this->readOneof(3);
    }

    public function hasNewReservedInstances()
    {
        return $this->hasOneof(3);
    }

    /**
     * Optional. Immutable. If set, indicates that this resource should use
     * reserved VMs.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NewReservedInstancesConfig new_reserved_instances = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param \Google\Cloud\HypercomputeCluster\V1beta\NewReservedInstancesConfig $var
     * @return $this
     */
    public function setNewReservedInstances($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1beta\NewReservedInstancesConfig::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Optional. Immutable. If set, indicates that this resource should use
     * flex-start VMs.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NewFlexStartInstancesConfig new_flex_start_instances = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return \Google\Cloud\HypercomputeCluster\V1beta\NewFlexStartInstancesConfig|null
     */
    public function getNewFlexStartInstances()
    {
        return $this->readOneof(5);
    }

    public function hasNewFlexStartInstances()
    {
        return $this->hasOneof(5);
    }

    /**
     * Optional. Immutable. If set, indicates that this resource should use
     * flex-start VMs.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NewFlexStartInstancesConfig new_flex_start_instances = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param \Google\Cloud\HypercomputeCluster\V1beta\NewFlexStartInstancesConfig $var
     * @return $this
     */
    public function setNewFlexStartInstances($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1beta\NewFlexStartInstancesConfig::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getConfig()
    {
        return $this->whichOneof("config");
    }

}

