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

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

/**
 * The warranty of the vehicle.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.ProductAttributes.Warranty</code>
 */
class Warranty extends \Google\Protobuf\Internal\Message
{
    /**
     * The warranty duration in months.
     *
     * Generated from protobuf field <code>int64 duration = 1;</code>
     */
    protected $duration = 0;
    /**
     * The warranty mileage.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.Mileage mileage = 2;</code>
     */
    protected $mileage = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $duration
     *           The warranty duration in months.
     *     @type \Google\Shopping\Merchant\Products\V1\ProductAttributes\Mileage $mileage
     *           The warranty mileage.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * The warranty duration in months.
     *
     * Generated from protobuf field <code>int64 duration = 1;</code>
     * @return int|string
     */
    public function getDuration()
    {
        return $this->duration;
    }

    /**
     * The warranty duration in months.
     *
     * Generated from protobuf field <code>int64 duration = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setDuration($var)
    {
        GPBUtil::checkInt64($var);
        $this->duration = $var;

        return $this;
    }

    /**
     * The warranty mileage.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.Mileage mileage = 2;</code>
     * @return \Google\Shopping\Merchant\Products\V1\ProductAttributes\Mileage|null
     */
    public function getMileage()
    {
        return $this->mileage;
    }

    public function hasMileage()
    {
        return isset($this->mileage);
    }

    public function clearMileage()
    {
        unset($this->mileage);
    }

    /**
     * The warranty mileage.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.Mileage mileage = 2;</code>
     * @param \Google\Shopping\Merchant\Products\V1\ProductAttributes\Mileage $var
     * @return $this
     */
    public function setMileage($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Merchant\Products\V1\ProductAttributes\Mileage::class);
        $this->mileage = $var;

        return $this;
    }

}

