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

namespace Google\Shopping\Merchant\Products\V1beta;

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

/**
 * The dimension of the product.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1beta.ProductDimension</code>
 */
class ProductDimension extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The dimension value represented as a number. The value can have a
     * maximum precision of four decimal places.
     *
     * Generated from protobuf field <code>double value = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $value = 0.0;
    /**
     * Required. The dimension units.
     * Acceptable values are:
     *   * "`in`"
     *   * "`cm`"
     *
     * Generated from protobuf field <code>string unit = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $unit = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $value
     *           Required. The dimension value represented as a number. The value can have a
     *           maximum precision of four decimal places.
     *     @type string $unit
     *           Required. The dimension units.
     *           Acceptable values are:
     *             * "`in`"
     *             * "`cm`"
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The dimension value represented as a number. The value can have a
     * maximum precision of four decimal places.
     *
     * Generated from protobuf field <code>double value = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return float
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * Required. The dimension value represented as a number. The value can have a
     * maximum precision of four decimal places.
     *
     * Generated from protobuf field <code>double value = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param float $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkDouble($var);
        $this->value = $var;

        return $this;
    }

    /**
     * Required. The dimension units.
     * Acceptable values are:
     *   * "`in`"
     *   * "`cm`"
     *
     * Generated from protobuf field <code>string unit = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getUnit()
    {
        return $this->unit;
    }

    /**
     * Required. The dimension units.
     * Acceptable values are:
     *   * "`in`"
     *   * "`cm`"
     *
     * Generated from protobuf field <code>string unit = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setUnit($var)
    {
        GPBUtil::checkString($var, True);
        $this->unit = $var;

        return $this;
    }

}

