<?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;

/**
 * Specify bandwidth percentages [1-100] for various traffic classes in BandwidthPercentagePolicy. The sum of all percentages must equal 100. All traffic classes must have a percentage value specified.
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.InterconnectApplicationAwareInterconnectBandwidthPercentage</code>
 */
class InterconnectApplicationAwareInterconnectBandwidthPercentage extends \Google\Protobuf\Internal\Message
{
    /**
     * Bandwidth percentage for a specific traffic class.
     *
     * Generated from protobuf field <code>optional uint32 percentage = 151909018;</code>
     */
    private $percentage = null;
    /**
     * TrafficClass whose bandwidth percentage is being specified.
     * Check the TrafficClass enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string traffic_class = 198180022;</code>
     */
    private $traffic_class = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $percentage
     *           Bandwidth percentage for a specific traffic class.
     *     @type string $traffic_class
     *           TrafficClass whose bandwidth percentage is being specified.
     *           Check the TrafficClass enum for the list of possible values.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * Bandwidth percentage for a specific traffic class.
     *
     * Generated from protobuf field <code>optional uint32 percentage = 151909018;</code>
     * @return int
     */
    public function getPercentage()
    {
        return isset($this->percentage) ? $this->percentage : 0;
    }

    public function hasPercentage()
    {
        return isset($this->percentage);
    }

    public function clearPercentage()
    {
        unset($this->percentage);
    }

    /**
     * Bandwidth percentage for a specific traffic class.
     *
     * Generated from protobuf field <code>optional uint32 percentage = 151909018;</code>
     * @param int $var
     * @return $this
     */
    public function setPercentage($var)
    {
        GPBUtil::checkUint32($var);
        $this->percentage = $var;

        return $this;
    }

    /**
     * TrafficClass whose bandwidth percentage is being specified.
     * Check the TrafficClass enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string traffic_class = 198180022;</code>
     * @return string
     */
    public function getTrafficClass()
    {
        return isset($this->traffic_class) ? $this->traffic_class : '';
    }

    public function hasTrafficClass()
    {
        return isset($this->traffic_class);
    }

    public function clearTrafficClass()
    {
        unset($this->traffic_class);
    }

    /**
     * TrafficClass whose bandwidth percentage is being specified.
     * Check the TrafficClass enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string traffic_class = 198180022;</code>
     * @param string $var
     * @return $this
     */
    public function setTrafficClass($var)
    {
        GPBUtil::checkString($var, True);
        $this->traffic_class = $var;

        return $this;
    }

}

