<?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 product fee attribute containing type and amount.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.ProductAttributes.ProductFee</code>
 */
class ProductFee extends \Google\Protobuf\Internal\Message
{
    /**
     * The type of product fee.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.ProductFee.FeeType type = 1;</code>
     */
    protected $type = 0;
    /**
     * The amount of product fee.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price amount = 2;</code>
     */
    protected $amount = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           The type of product fee.
     *     @type \Google\Shopping\Type\Price $amount
     *           The amount of product fee.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * The type of product fee.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.ProductFee.FeeType type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * The type of product fee.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.products.v1.ProductAttributes.ProductFee.FeeType type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1\ProductAttributes\ProductFee\FeeType::class);
        $this->type = $var;

        return $this;
    }

    /**
     * The amount of product fee.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price amount = 2;</code>
     * @return \Google\Shopping\Type\Price|null
     */
    public function getAmount()
    {
        return $this->amount;
    }

    public function hasAmount()
    {
        return isset($this->amount);
    }

    public function clearAmount()
    {
        unset($this->amount);
    }

    /**
     * The amount of product fee.
     *
     * Generated from protobuf field <code>.google.shopping.type.Price amount = 2;</code>
     * @param \Google\Shopping\Type\Price $var
     * @return $this
     */
    public function setAmount($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class);
        $this->amount = $var;

        return $this;
    }

}

