<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/baremetalsolution/v2/provisioning.proto

namespace Google\Cloud\BareMetalSolution\V2\VolumeConfig;

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

/**
 * A NFS export entry.
 *
 * Generated from protobuf message <code>google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport</code>
 */
class NfsExport extends \Google\Protobuf\Internal\Message
{
    /**
     * Network to use to publish the export.
     *
     * Generated from protobuf field <code>string network_id = 1;</code>
     */
    protected $network_id = '';
    /**
     * Export permissions.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport.Permissions permissions = 4;</code>
     */
    protected $permissions = 0;
    /**
     * Disable root squashing, which is a feature of NFS.
     * Root squash is a special mapping of the remote superuser (root) identity
     * when using identity authentication.
     *
     * Generated from protobuf field <code>bool no_root_squash = 5;</code>
     */
    protected $no_root_squash = false;
    /**
     * Allow the setuid flag.
     *
     * Generated from protobuf field <code>bool allow_suid = 6;</code>
     */
    protected $allow_suid = false;
    /**
     * Allow dev flag in NfsShare AllowedClientsRequest.
     *
     * Generated from protobuf field <code>bool allow_dev = 7;</code>
     */
    protected $allow_dev = false;
    protected $client;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $network_id
     *           Network to use to publish the export.
     *     @type string $machine_id
     *           Either a single machine, identified by an ID, or a comma-separated
     *           list of machine IDs.
     *     @type string $cidr
     *           A CIDR range.
     *     @type int $permissions
     *           Export permissions.
     *     @type bool $no_root_squash
     *           Disable root squashing, which is a feature of NFS.
     *           Root squash is a special mapping of the remote superuser (root) identity
     *           when using identity authentication.
     *     @type bool $allow_suid
     *           Allow the setuid flag.
     *     @type bool $allow_dev
     *           Allow dev flag in NfsShare AllowedClientsRequest.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Provisioning::initOnce();
        parent::__construct($data);
    }

    /**
     * Network to use to publish the export.
     *
     * Generated from protobuf field <code>string network_id = 1;</code>
     * @return string
     */
    public function getNetworkId()
    {
        return $this->network_id;
    }

    /**
     * Network to use to publish the export.
     *
     * Generated from protobuf field <code>string network_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setNetworkId($var)
    {
        GPBUtil::checkString($var, True);
        $this->network_id = $var;

        return $this;
    }

    /**
     * Either a single machine, identified by an ID, or a comma-separated
     * list of machine IDs.
     *
     * Generated from protobuf field <code>string machine_id = 2;</code>
     * @return string
     */
    public function getMachineId()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Either a single machine, identified by an ID, or a comma-separated
     * list of machine IDs.
     *
     * Generated from protobuf field <code>string machine_id = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setMachineId($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * A CIDR range.
     *
     * Generated from protobuf field <code>string cidr = 3;</code>
     * @return string
     */
    public function getCidr()
    {
        return $this->readOneof(3);
    }

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

    /**
     * A CIDR range.
     *
     * Generated from protobuf field <code>string cidr = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setCidr($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Export permissions.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport.Permissions permissions = 4;</code>
     * @return int
     */
    public function getPermissions()
    {
        return $this->permissions;
    }

    /**
     * Export permissions.
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.VolumeConfig.NfsExport.Permissions permissions = 4;</code>
     * @param int $var
     * @return $this
     */
    public function setPermissions($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\BareMetalSolution\V2\VolumeConfig\NfsExport\Permissions::class);
        $this->permissions = $var;

        return $this;
    }

    /**
     * Disable root squashing, which is a feature of NFS.
     * Root squash is a special mapping of the remote superuser (root) identity
     * when using identity authentication.
     *
     * Generated from protobuf field <code>bool no_root_squash = 5;</code>
     * @return bool
     */
    public function getNoRootSquash()
    {
        return $this->no_root_squash;
    }

    /**
     * Disable root squashing, which is a feature of NFS.
     * Root squash is a special mapping of the remote superuser (root) identity
     * when using identity authentication.
     *
     * Generated from protobuf field <code>bool no_root_squash = 5;</code>
     * @param bool $var
     * @return $this
     */
    public function setNoRootSquash($var)
    {
        GPBUtil::checkBool($var);
        $this->no_root_squash = $var;

        return $this;
    }

    /**
     * Allow the setuid flag.
     *
     * Generated from protobuf field <code>bool allow_suid = 6;</code>
     * @return bool
     */
    public function getAllowSuid()
    {
        return $this->allow_suid;
    }

    /**
     * Allow the setuid flag.
     *
     * Generated from protobuf field <code>bool allow_suid = 6;</code>
     * @param bool $var
     * @return $this
     */
    public function setAllowSuid($var)
    {
        GPBUtil::checkBool($var);
        $this->allow_suid = $var;

        return $this;
    }

    /**
     * Allow dev flag in NfsShare AllowedClientsRequest.
     *
     * Generated from protobuf field <code>bool allow_dev = 7;</code>
     * @return bool
     */
    public function getAllowDev()
    {
        return $this->allow_dev;
    }

    /**
     * Allow dev flag in NfsShare AllowedClientsRequest.
     *
     * Generated from protobuf field <code>bool allow_dev = 7;</code>
     * @param bool $var
     * @return $this
     */
    public function setAllowDev($var)
    {
        GPBUtil::checkBool($var);
        $this->allow_dev = $var;

        return $this;
    }

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

}

