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

namespace Google\Shopping\Css\V1;

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

/**
 * The dimension of the product.
 *
 * Generated from protobuf message <code>google.shopping.css.v1.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\Css\V1\CssProductCommon::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;
    }

}

