<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/channel/v1/offers.proto

namespace Google\Cloud\Channel\V1;

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

/**
 * Represents the price of the Offer.
 *
 * Generated from protobuf message <code>google.cloud.channel.v1.Price</code>
 */
class Price extends \Google\Protobuf\Internal\Message
{
    /**
     * Base price.
     *
     * Generated from protobuf field <code>.google.type.Money base_price = 1;</code>
     */
    private $base_price = null;
    /**
     * Discount percentage, represented as decimal.
     * For example, a 20% discount will be represent as 0.2.
     *
     * Generated from protobuf field <code>double discount = 2;</code>
     */
    private $discount = 0.0;
    /**
     * Effective Price after applying the discounts.
     *
     * Generated from protobuf field <code>.google.type.Money effective_price = 3;</code>
     */
    private $effective_price = null;
    /**
     * Link to external price list, such as link to Google Voice rate card.
     *
     * Generated from protobuf field <code>string external_price_uri = 4;</code>
     */
    private $external_price_uri = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Type\Money $base_price
     *           Base price.
     *     @type float $discount
     *           Discount percentage, represented as decimal.
     *           For example, a 20% discount will be represent as 0.2.
     *     @type \Google\Type\Money $effective_price
     *           Effective Price after applying the discounts.
     *     @type string $external_price_uri
     *           Link to external price list, such as link to Google Voice rate card.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Channel\V1\Offers::initOnce();
        parent::__construct($data);
    }

    /**
     * Base price.
     *
     * Generated from protobuf field <code>.google.type.Money base_price = 1;</code>
     * @return \Google\Type\Money|null
     */
    public function getBasePrice()
    {
        return $this->base_price;
    }

    public function hasBasePrice()
    {
        return isset($this->base_price);
    }

    public function clearBasePrice()
    {
        unset($this->base_price);
    }

    /**
     * Base price.
     *
     * Generated from protobuf field <code>.google.type.Money base_price = 1;</code>
     * @param \Google\Type\Money $var
     * @return $this
     */
    public function setBasePrice($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Money::class);
        $this->base_price = $var;

        return $this;
    }

    /**
     * Discount percentage, represented as decimal.
     * For example, a 20% discount will be represent as 0.2.
     *
     * Generated from protobuf field <code>double discount = 2;</code>
     * @return float
     */
    public function getDiscount()
    {
        return $this->discount;
    }

    /**
     * Discount percentage, represented as decimal.
     * For example, a 20% discount will be represent as 0.2.
     *
     * Generated from protobuf field <code>double discount = 2;</code>
     * @param float $var
     * @return $this
     */
    public function setDiscount($var)
    {
        GPBUtil::checkDouble($var);
        $this->discount = $var;

        return $this;
    }

    /**
     * Effective Price after applying the discounts.
     *
     * Generated from protobuf field <code>.google.type.Money effective_price = 3;</code>
     * @return \Google\Type\Money|null
     */
    public function getEffectivePrice()
    {
        return $this->effective_price;
    }

    public function hasEffectivePrice()
    {
        return isset($this->effective_price);
    }

    public function clearEffectivePrice()
    {
        unset($this->effective_price);
    }

    /**
     * Effective Price after applying the discounts.
     *
     * Generated from protobuf field <code>.google.type.Money effective_price = 3;</code>
     * @param \Google\Type\Money $var
     * @return $this
     */
    public function setEffectivePrice($var)
    {
        GPBUtil::checkMessage($var, \Google\Type\Money::class);
        $this->effective_price = $var;

        return $this;
    }

    /**
     * Link to external price list, such as link to Google Voice rate card.
     *
     * Generated from protobuf field <code>string external_price_uri = 4;</code>
     * @return string
     */
    public function getExternalPriceUri()
    {
        return $this->external_price_uri;
    }

    /**
     * Link to external price list, such as link to Google Voice rate card.
     *
     * Generated from protobuf field <code>string external_price_uri = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setExternalPriceUri($var)
    {
        GPBUtil::checkString($var, True);
        $this->external_price_uri = $var;

        return $this;
    }

}

