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

/**
 * Information regarding Automated Discounts.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.AutomatedDiscounts</code>
 */
class AutomatedDiscounts extends \Google\Protobuf\Internal\Message
{
    /**
     * The price prior to the application of the first price reduction.
     * Absent if the information about the prior price of the product is not
     * available.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price prior_price = 1;</code>
     */
    protected $prior_price = null;
    /**
     * The price prior to the application of consecutive price reductions.
     * Absent if the information about the prior price of the product is not
     * available.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price prior_price_progressive = 2;</code>
     */
    protected $prior_price_progressive = null;
    /**
     * The current sale price for products with a price optimized using Google
     * Automated Discounts (GAD). Absent if the information about the GAD_price of
     * the product is not available.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price gad_price = 3;</code>
     */
    protected $gad_price = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Shopping\Type\Price $prior_price
     *           The price prior to the application of the first price reduction.
     *           Absent if the information about the prior price of the product is not
     *           available.
     *     @type \Google\Shopping\Type\Price $prior_price_progressive
     *           The price prior to the application of consecutive price reductions.
     *           Absent if the information about the prior price of the product is not
     *           available.
     *     @type \Google\Shopping\Type\Price $gad_price
     *           The current sale price for products with a price optimized using Google
     *           Automated Discounts (GAD). Absent if the information about the GAD_price of
     *           the product is not available.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * The price prior to the application of the first price reduction.
     * Absent if the information about the prior price of the product is not
     * available.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price prior_price = 1;</code>
     * @return \Google\Shopping\Type\Price|null
     */
    public function getPriorPrice()
    {
        return $this->prior_price;
    }

    public function hasPriorPrice()
    {
        return isset($this->prior_price);
    }

    public function clearPriorPrice()
    {
        unset($this->prior_price);
    }

    /**
     * The price prior to the application of the first price reduction.
     * Absent if the information about the prior price of the product is not
     * available.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price prior_price = 1;</code>
     * @param \Google\Shopping\Type\Price $var
     * @return $this
     */
    public function setPriorPrice($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class);
        $this->prior_price = $var;

        return $this;
    }

    /**
     * The price prior to the application of consecutive price reductions.
     * Absent if the information about the prior price of the product is not
     * available.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price prior_price_progressive = 2;</code>
     * @return \Google\Shopping\Type\Price|null
     */
    public function getPriorPriceProgressive()
    {
        return $this->prior_price_progressive;
    }

    public function hasPriorPriceProgressive()
    {
        return isset($this->prior_price_progressive);
    }

    public function clearPriorPriceProgressive()
    {
        unset($this->prior_price_progressive);
    }

    /**
     * The price prior to the application of consecutive price reductions.
     * Absent if the information about the prior price of the product is not
     * available.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price prior_price_progressive = 2;</code>
     * @param \Google\Shopping\Type\Price $var
     * @return $this
     */
    public function setPriorPriceProgressive($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class);
        $this->prior_price_progressive = $var;

        return $this;
    }

    /**
     * The current sale price for products with a price optimized using Google
     * Automated Discounts (GAD). Absent if the information about the GAD_price of
     * the product is not available.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price gad_price = 3;</code>
     * @return \Google\Shopping\Type\Price|null
     */
    public function getGadPrice()
    {
        return $this->gad_price;
    }

    public function hasGadPrice()
    {
        return isset($this->gad_price);
    }

    public function clearGadPrice()
    {
        unset($this->gad_price);
    }

    /**
     * The current sale price for products with a price optimized using Google
     * Automated Discounts (GAD). Absent if the information about the GAD_price of
     * the product is not available.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price gad_price = 3;</code>
     * @param \Google\Shopping\Type\Price $var
     * @return $this
     */
    public function setGadPrice($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class);
        $this->gad_price = $var;

        return $this;
    }

}

