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

namespace Google\Cloud\NetApp\V1;

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

/**
 * QuotaRule specifies the maximum disk space a user or group can use within a
 * volume. They can be used for creating default and individual quota rules.
 *
 * Generated from protobuf message <code>google.cloud.netapp.v1.QuotaRule</code>
 */
class QuotaRule extends \Google\Protobuf\Internal\Message
{
    /**
     * Identifier. The resource name of the quota rule.
     * Format:
     * `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     */
    protected $name = '';
    /**
     * Optional. The quota rule applies to the specified user or group, identified
     * by a Unix UID/GID, Windows SID, or null for default.
     *
     * Generated from protobuf field <code>string target = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $target = '';
    /**
     * Required. The type of quota rule.
     *
     * Generated from protobuf field <code>.google.cloud.netapp.v1.QuotaRule.Type type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $type = 0;
    /**
     * Required. The maximum allowed disk space in MiB.
     *
     * Generated from protobuf field <code>int32 disk_limit_mib = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $disk_limit_mib = 0;
    /**
     * Output only. State of the quota rule
     *
     * Generated from protobuf field <code>.google.cloud.netapp.v1.QuotaRule.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state = 0;
    /**
     * Output only. State details of the quota rule
     *
     * Generated from protobuf field <code>string state_details = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $state_details = '';
    /**
     * Output only. Create time of the quota rule
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $create_time = null;
    /**
     * Optional. Description of the quota rule
     *
     * Generated from protobuf field <code>string description = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $description = '';
    /**
     * Optional. Labels of the quota rule
     *
     * Generated from protobuf field <code>map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $labels;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Identifier. The resource name of the quota rule.
     *           Format:
     *           `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
     *     @type string $target
     *           Optional. The quota rule applies to the specified user or group, identified
     *           by a Unix UID/GID, Windows SID, or null for default.
     *     @type int $type
     *           Required. The type of quota rule.
     *     @type int $disk_limit_mib
     *           Required. The maximum allowed disk space in MiB.
     *     @type int $state
     *           Output only. State of the quota rule
     *     @type string $state_details
     *           Output only. State details of the quota rule
     *     @type \Google\Protobuf\Timestamp $create_time
     *           Output only. Create time of the quota rule
     *     @type string $description
     *           Optional. Description of the quota rule
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Optional. Labels of the quota rule
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Netapp\V1\QuotaRule::initOnce();
        parent::__construct($data);
    }

    /**
     * Identifier. The resource name of the quota rule.
     * Format:
     * `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Identifier. The resource name of the quota rule.
     * Format:
     * `projects/{project_number}/locations/{location_id}/volumes/volumes/{volume_id}/quotaRules/{quota_rule_id}`.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = IDENTIFIER];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. The quota rule applies to the specified user or group, identified
     * by a Unix UID/GID, Windows SID, or null for default.
     *
     * Generated from protobuf field <code>string target = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getTarget()
    {
        return $this->target;
    }

    /**
     * Optional. The quota rule applies to the specified user or group, identified
     * by a Unix UID/GID, Windows SID, or null for default.
     *
     * Generated from protobuf field <code>string target = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setTarget($var)
    {
        GPBUtil::checkString($var, True);
        $this->target = $var;

        return $this;
    }

    /**
     * Required. The type of quota rule.
     *
     * Generated from protobuf field <code>.google.cloud.netapp.v1.QuotaRule.Type type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Required. The type of quota rule.
     *
     * Generated from protobuf field <code>.google.cloud.netapp.v1.QuotaRule.Type type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\NetApp\V1\QuotaRule\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Required. The maximum allowed disk space in MiB.
     *
     * Generated from protobuf field <code>int32 disk_limit_mib = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getDiskLimitMib()
    {
        return $this->disk_limit_mib;
    }

    /**
     * Required. The maximum allowed disk space in MiB.
     *
     * Generated from protobuf field <code>int32 disk_limit_mib = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setDiskLimitMib($var)
    {
        GPBUtil::checkInt32($var);
        $this->disk_limit_mib = $var;

        return $this;
    }

    /**
     * Output only. State of the quota rule
     *
     * Generated from protobuf field <code>.google.cloud.netapp.v1.QuotaRule.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getState()
    {
        return $this->state;
    }

    /**
     * Output only. State of the quota rule
     *
     * Generated from protobuf field <code>.google.cloud.netapp.v1.QuotaRule.State state = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setState($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\NetApp\V1\QuotaRule\State::class);
        $this->state = $var;

        return $this;
    }

    /**
     * Output only. State details of the quota rule
     *
     * Generated from protobuf field <code>string state_details = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getStateDetails()
    {
        return $this->state_details;
    }

    /**
     * Output only. State details of the quota rule
     *
     * Generated from protobuf field <code>string state_details = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setStateDetails($var)
    {
        GPBUtil::checkString($var, True);
        $this->state_details = $var;

        return $this;
    }

    /**
     * Output only. Create time of the quota rule
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreateTime()
    {
        return $this->create_time;
    }

    public function hasCreateTime()
    {
        return isset($this->create_time);
    }

    public function clearCreateTime()
    {
        unset($this->create_time);
    }

    /**
     * Output only. Create time of the quota rule
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp create_time = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->create_time = $var;

        return $this;
    }

    /**
     * Optional. Description of the quota rule
     *
     * Generated from protobuf field <code>string description = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Optional. Description of the quota rule
     *
     * Generated from protobuf field <code>string description = 9 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;

        return $this;
    }

    /**
     * Optional. Labels of the quota rule
     *
     * Generated from protobuf field <code>map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Optional. Labels of the quota rule
     *
     * Generated from protobuf field <code>map<string, string> labels = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

}

