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

namespace Google\Cloud\Compute\V1;

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

/**
 * Additional details for quota exceeded error for resource quota.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.QuotaExceededInfo</code>
 */
class QuotaExceededInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * The map holding related quota dimensions.
     *
     * Generated from protobuf field <code>map<string, string> dimensions = 414334925;</code>
     */
    private $dimensions;
    /**
     * Current effective quota limit. The limit's unit depends on the quota type or metric.
     *
     * Generated from protobuf field <code>optional double limit = 102976443;</code>
     */
    private $limit = null;
    /**
     * The name of the quota limit.
     *
     * Generated from protobuf field <code>optional string limit_name = 398197903;</code>
     */
    private $limit_name = null;
    /**
     * The Compute Engine quota metric name.
     *
     * Generated from protobuf field <code>optional string metric_name = 409881530;</code>
     */
    private $metric_name = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array|\Google\Protobuf\Internal\MapField $dimensions
     *           The map holding related quota dimensions.
     *     @type float $limit
     *           Current effective quota limit. The limit's unit depends on the quota type or metric.
     *     @type string $limit_name
     *           The name of the quota limit.
     *     @type string $metric_name
     *           The Compute Engine quota metric name.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * The map holding related quota dimensions.
     *
     * Generated from protobuf field <code>map<string, string> dimensions = 414334925;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getDimensions()
    {
        return $this->dimensions;
    }

    /**
     * The map holding related quota dimensions.
     *
     * Generated from protobuf field <code>map<string, string> dimensions = 414334925;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setDimensions($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->dimensions = $arr;

        return $this;
    }

    /**
     * Current effective quota limit. The limit's unit depends on the quota type or metric.
     *
     * Generated from protobuf field <code>optional double limit = 102976443;</code>
     * @return float
     */
    public function getLimit()
    {
        return isset($this->limit) ? $this->limit : 0.0;
    }

    public function hasLimit()
    {
        return isset($this->limit);
    }

    public function clearLimit()
    {
        unset($this->limit);
    }

    /**
     * Current effective quota limit. The limit's unit depends on the quota type or metric.
     *
     * Generated from protobuf field <code>optional double limit = 102976443;</code>
     * @param float $var
     * @return $this
     */
    public function setLimit($var)
    {
        GPBUtil::checkDouble($var);
        $this->limit = $var;

        return $this;
    }

    /**
     * The name of the quota limit.
     *
     * Generated from protobuf field <code>optional string limit_name = 398197903;</code>
     * @return string
     */
    public function getLimitName()
    {
        return isset($this->limit_name) ? $this->limit_name : '';
    }

    public function hasLimitName()
    {
        return isset($this->limit_name);
    }

    public function clearLimitName()
    {
        unset($this->limit_name);
    }

    /**
     * The name of the quota limit.
     *
     * Generated from protobuf field <code>optional string limit_name = 398197903;</code>
     * @param string $var
     * @return $this
     */
    public function setLimitName($var)
    {
        GPBUtil::checkString($var, True);
        $this->limit_name = $var;

        return $this;
    }

    /**
     * The Compute Engine quota metric name.
     *
     * Generated from protobuf field <code>optional string metric_name = 409881530;</code>
     * @return string
     */
    public function getMetricName()
    {
        return isset($this->metric_name) ? $this->metric_name : '';
    }

    public function hasMetricName()
    {
        return isset($this->metric_name);
    }

    public function clearMetricName()
    {
        unset($this->metric_name);
    }

    /**
     * The Compute Engine quota metric name.
     *
     * Generated from protobuf field <code>optional string metric_name = 409881530;</code>
     * @param string $var
     * @return $this
     */
    public function setMetricName($var)
    {
        GPBUtil::checkString($var, True);
        $this->metric_name = $var;

        return $this;
    }

}

