<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/merchant/products/v1/products_common.proto

namespace Google\Shopping\Merchant\Products\V1;

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

/**
 * The ShippingDimension of the product.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.ShippingDimension</code>
 */
class ShippingDimension extends \Google\Protobuf\Internal\Message
{
    /**
     * The dimension of the product used to calculate the shipping cost of the
     * item.
     *
     * Generated from protobuf field <code>double value = 1;</code>
     */
    protected $value = 0.0;
    /**
     * The unit of value.
     *
     * Generated from protobuf field <code>string unit = 2;</code>
     */
    protected $unit = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $value
     *           The dimension of the product used to calculate the shipping cost of the
     *           item.
     *     @type string $unit
     *           The unit of value.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * The dimension of the product used to calculate the shipping cost of the
     * item.
     *
     * Generated from protobuf field <code>double value = 1;</code>
     * @return float
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * The dimension of the product used to calculate the shipping cost of the
     * item.
     *
     * Generated from protobuf field <code>double value = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkDouble($var);
        $this->value = $var;

        return $this;
    }

    /**
     * The unit of value.
     *
     * Generated from protobuf field <code>string unit = 2;</code>
     * @return string
     */
    public function getUnit()
    {
        return $this->unit;
    }

    /**
     * The unit of value.
     *
     * Generated from protobuf field <code>string unit = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setUnit($var)
    {
        GPBUtil::checkString($var, True);
        $this->unit = $var;

        return $this;
    }

}

