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

/**
 * A resource representing a network that connects the various components of a
 * cluster together.
 *
 * Generated from protobuf message <code>google.cloud.hypercomputecluster.v1beta.NetworkResource</code>
 */
class NetworkResource extends \Google\Protobuf\Internal\Message
{
    /**
     * Immutable. Configuration for this network resource, which describes how it
     * should be created or imported. This field only controls how the network
     * resource is initially created or imported. Subsequent changes to the
     * network resource should be made via the resource's API and will not be
     * reflected in the configuration.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NetworkResourceConfig config = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $config = null;
    protected $reference;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\HypercomputeCluster\V1beta\NetworkReference $network
     *           Reference to a network in Google Compute Engine.
     *     @type \Google\Cloud\HypercomputeCluster\V1beta\NetworkResourceConfig $config
     *           Immutable. Configuration for this network resource, which describes how it
     *           should be created or imported. This field only controls how the network
     *           resource is initially created or imported. Subsequent changes to the
     *           network resource should be made via the resource's API and will not be
     *           reflected in the configuration.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Hypercomputecluster\V1Beta\HypercomputeCluster::initOnce();
        parent::__construct($data);
    }

    /**
     * Reference to a network in Google Compute Engine.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NetworkReference network = 3;</code>
     * @return \Google\Cloud\HypercomputeCluster\V1beta\NetworkReference|null
     */
    public function getNetwork()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Reference to a network in Google Compute Engine.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NetworkReference network = 3;</code>
     * @param \Google\Cloud\HypercomputeCluster\V1beta\NetworkReference $var
     * @return $this
     */
    public function setNetwork($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1beta\NetworkReference::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Immutable. Configuration for this network resource, which describes how it
     * should be created or imported. This field only controls how the network
     * resource is initially created or imported. Subsequent changes to the
     * network resource should be made via the resource's API and will not be
     * reflected in the configuration.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NetworkResourceConfig config = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @return \Google\Cloud\HypercomputeCluster\V1beta\NetworkResourceConfig|null
     */
    public function getConfig()
    {
        return $this->config;
    }

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

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

    /**
     * Immutable. Configuration for this network resource, which describes how it
     * should be created or imported. This field only controls how the network
     * resource is initially created or imported. Subsequent changes to the
     * network resource should be made via the resource's API and will not be
     * reflected in the configuration.
     *
     * Generated from protobuf field <code>.google.cloud.hypercomputecluster.v1beta.NetworkResourceConfig config = 2 [(.google.api.field_behavior) = IMMUTABLE];</code>
     * @param \Google\Cloud\HypercomputeCluster\V1beta\NetworkResourceConfig $var
     * @return $this
     */
    public function setConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\HypercomputeCluster\V1beta\NetworkResourceConfig::class);
        $this->config = $var;

        return $this;
    }

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

}

