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

/**
 * The pickup cost of the item.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.PickupCost</code>
 */
class PickupCost extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The flat rate pickup cost of the item.
     *
     * Generated from protobuf field <code>optional .google.shopping.type.Price flat_rate = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $flat_rate = null;
    /**
     * Optional. The price threshold above which pickup is free of charge.
     *
     * Generated from protobuf field <code>optional .google.shopping.type.Price free_threshold = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $free_threshold = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Shopping\Type\Price $flat_rate
     *           Required. The flat rate pickup cost of the item.
     *     @type \Google\Shopping\Type\Price $free_threshold
     *           Optional. The price threshold above which pickup is free of charge.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The flat rate pickup cost of the item.
     *
     * Generated from protobuf field <code>optional .google.shopping.type.Price flat_rate = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Shopping\Type\Price|null
     */
    public function getFlatRate()
    {
        return $this->flat_rate;
    }

    public function hasFlatRate()
    {
        return isset($this->flat_rate);
    }

    public function clearFlatRate()
    {
        unset($this->flat_rate);
    }

    /**
     * Required. The flat rate pickup cost of the item.
     *
     * Generated from protobuf field <code>optional .google.shopping.type.Price flat_rate = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Shopping\Type\Price $var
     * @return $this
     */
    public function setFlatRate($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class);
        $this->flat_rate = $var;

        return $this;
    }

    /**
     * Optional. The price threshold above which pickup is free of charge.
     *
     * Generated from protobuf field <code>optional .google.shopping.type.Price free_threshold = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Shopping\Type\Price|null
     */
    public function getFreeThreshold()
    {
        return $this->free_threshold;
    }

    public function hasFreeThreshold()
    {
        return isset($this->free_threshold);
    }

    public function clearFreeThreshold()
    {
        unset($this->free_threshold);
    }

    /**
     * Optional. The price threshold above which pickup is free of charge.
     *
     * Generated from protobuf field <code>optional .google.shopping.type.Price free_threshold = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Shopping\Type\Price $var
     * @return $this
     */
    public function setFreeThreshold($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class);
        $this->free_threshold = $var;

        return $this;
    }

}

