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

namespace Google\Cloud\Filestore\V1;

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

/**
 * NFS export options specifications.
 *
 * Generated from protobuf message <code>google.cloud.filestore.v1.NfsExportOptions</code>
 */
class NfsExportOptions extends \Google\Protobuf\Internal\Message
{
    /**
     * List of either an IPv4 addresses in the format
     * `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format
     * `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the
     * file share.
     * Overlapping IP ranges are not allowed, both within and across
     * NfsExportOptions. An error will be returned.
     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
     * NfsExportOptions.
     *
     * Generated from protobuf field <code>repeated string ip_ranges = 1;</code>
     */
    private $ip_ranges;
    /**
     * Either READ_ONLY, for allowing only read requests on the exported
     * directory, or READ_WRITE, for allowing both read and write requests.
     * The default is READ_WRITE.
     *
     * Generated from protobuf field <code>.google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2;</code>
     */
    private $access_mode = 0;
    /**
     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
     * or ROOT_SQUASH, for not allowing root access. The default is
     * NO_ROOT_SQUASH.
     *
     * Generated from protobuf field <code>.google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3;</code>
     */
    private $squash_mode = 0;
    /**
     * An integer representing the anonymous user id with a default value of
     * 65534.
     * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
     * returned if this field is specified for other squash_mode settings.
     *
     * Generated from protobuf field <code>int64 anon_uid = 4;</code>
     */
    private $anon_uid = 0;
    /**
     * An integer representing the anonymous group id with a default value of
     * 65534.
     * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
     * returned if this field is specified for other squash_mode settings.
     *
     * Generated from protobuf field <code>int64 anon_gid = 5;</code>
     */
    private $anon_gid = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $ip_ranges
     *           List of either an IPv4 addresses in the format
     *           `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format
     *           `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the
     *           file share.
     *           Overlapping IP ranges are not allowed, both within and across
     *           NfsExportOptions. An error will be returned.
     *           The limit is 64 IP ranges/addresses for each FileShareConfig among all
     *           NfsExportOptions.
     *     @type int $access_mode
     *           Either READ_ONLY, for allowing only read requests on the exported
     *           directory, or READ_WRITE, for allowing both read and write requests.
     *           The default is READ_WRITE.
     *     @type int $squash_mode
     *           Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
     *           or ROOT_SQUASH, for not allowing root access. The default is
     *           NO_ROOT_SQUASH.
     *     @type int|string $anon_uid
     *           An integer representing the anonymous user id with a default value of
     *           65534.
     *           Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
     *           returned if this field is specified for other squash_mode settings.
     *     @type int|string $anon_gid
     *           An integer representing the anonymous group id with a default value of
     *           65534.
     *           Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
     *           returned if this field is specified for other squash_mode settings.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Filestore\V1\CloudFilestoreService::initOnce();
        parent::__construct($data);
    }

    /**
     * List of either an IPv4 addresses in the format
     * `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format
     * `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the
     * file share.
     * Overlapping IP ranges are not allowed, both within and across
     * NfsExportOptions. An error will be returned.
     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
     * NfsExportOptions.
     *
     * Generated from protobuf field <code>repeated string ip_ranges = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getIpRanges()
    {
        return $this->ip_ranges;
    }

    /**
     * List of either an IPv4 addresses in the format
     * `{octet1}.{octet2}.{octet3}.{octet4}` or CIDR ranges in the format
     * `{octet1}.{octet2}.{octet3}.{octet4}/{mask size}` which may mount the
     * file share.
     * Overlapping IP ranges are not allowed, both within and across
     * NfsExportOptions. An error will be returned.
     * The limit is 64 IP ranges/addresses for each FileShareConfig among all
     * NfsExportOptions.
     *
     * Generated from protobuf field <code>repeated string ip_ranges = 1;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setIpRanges($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->ip_ranges = $arr;

        return $this;
    }

    /**
     * Either READ_ONLY, for allowing only read requests on the exported
     * directory, or READ_WRITE, for allowing both read and write requests.
     * The default is READ_WRITE.
     *
     * Generated from protobuf field <code>.google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2;</code>
     * @return int
     */
    public function getAccessMode()
    {
        return $this->access_mode;
    }

    /**
     * Either READ_ONLY, for allowing only read requests on the exported
     * directory, or READ_WRITE, for allowing both read and write requests.
     * The default is READ_WRITE.
     *
     * Generated from protobuf field <code>.google.cloud.filestore.v1.NfsExportOptions.AccessMode access_mode = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setAccessMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Filestore\V1\NfsExportOptions\AccessMode::class);
        $this->access_mode = $var;

        return $this;
    }

    /**
     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
     * or ROOT_SQUASH, for not allowing root access. The default is
     * NO_ROOT_SQUASH.
     *
     * Generated from protobuf field <code>.google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3;</code>
     * @return int
     */
    public function getSquashMode()
    {
        return $this->squash_mode;
    }

    /**
     * Either NO_ROOT_SQUASH, for allowing root access on the exported directory,
     * or ROOT_SQUASH, for not allowing root access. The default is
     * NO_ROOT_SQUASH.
     *
     * Generated from protobuf field <code>.google.cloud.filestore.v1.NfsExportOptions.SquashMode squash_mode = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setSquashMode($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Filestore\V1\NfsExportOptions\SquashMode::class);
        $this->squash_mode = $var;

        return $this;
    }

    /**
     * An integer representing the anonymous user id with a default value of
     * 65534.
     * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
     * returned if this field is specified for other squash_mode settings.
     *
     * Generated from protobuf field <code>int64 anon_uid = 4;</code>
     * @return int|string
     */
    public function getAnonUid()
    {
        return $this->anon_uid;
    }

    /**
     * An integer representing the anonymous user id with a default value of
     * 65534.
     * Anon_uid may only be set with squash_mode of ROOT_SQUASH.  An error will be
     * returned if this field is specified for other squash_mode settings.
     *
     * Generated from protobuf field <code>int64 anon_uid = 4;</code>
     * @param int|string $var
     * @return $this
     */
    public function setAnonUid($var)
    {
        GPBUtil::checkInt64($var);
        $this->anon_uid = $var;

        return $this;
    }

    /**
     * An integer representing the anonymous group id with a default value of
     * 65534.
     * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
     * returned if this field is specified for other squash_mode settings.
     *
     * Generated from protobuf field <code>int64 anon_gid = 5;</code>
     * @return int|string
     */
    public function getAnonGid()
    {
        return $this->anon_gid;
    }

    /**
     * An integer representing the anonymous group id with a default value of
     * 65534.
     * Anon_gid may only be set with squash_mode of ROOT_SQUASH.  An error will be
     * returned if this field is specified for other squash_mode settings.
     *
     * Generated from protobuf field <code>int64 anon_gid = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setAnonGid($var)
    {
        GPBUtil::checkInt64($var);
        $this->anon_gid = $var;

        return $this;
    }

}

