<?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 minimum order value in the cart before the checkout is permitted.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1.ProductMinimumOrderValue</code>
 */
class ProductMinimumOrderValue extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The [CLDR territory
     * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml)
     * of the country to which an item will ship.
     *
     * Generated from protobuf field <code>optional string country = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $country = null;
    /**
     * A free-form description of the service class or delivery speed.
     * This should match the service value set for the Shipping attribute.
     * See [service][google.shopping.merchant.products.v1.Shipping.service].
     *
     * Generated from protobuf field <code>optional string service = 2;</code>
     */
    protected $service = null;
    /**
     * The surface to which the minimum order value applies.
     * Defaults to `ONLINE_LOCAL` if not configured.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.products.v1.ProductMinimumOrderValue.Surface surface = 3;</code>
     */
    protected $surface = null;
    /**
     * Required. The minimum cart or basket value before the checkout is
     * permitted.
     *
     * Generated from protobuf field <code>optional .google.shopping.type.Price price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $price = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $country
     *           Required. The [CLDR territory
     *           code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml)
     *           of the country to which an item will ship.
     *     @type string $service
     *           A free-form description of the service class or delivery speed.
     *           This should match the service value set for the Shipping attribute.
     *           See [service][google.shopping.merchant.products.v1.Shipping.service].
     *     @type int $surface
     *           The surface to which the minimum order value applies.
     *           Defaults to `ONLINE_LOCAL` if not configured.
     *     @type \Google\Shopping\Type\Price $price
     *           Required. The minimum cart or basket value before the checkout is
     *           permitted.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The [CLDR territory
     * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml)
     * of the country to which an item will ship.
     *
     * Generated from protobuf field <code>optional string country = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getCountry()
    {
        return isset($this->country) ? $this->country : '';
    }

    public function hasCountry()
    {
        return isset($this->country);
    }

    public function clearCountry()
    {
        unset($this->country);
    }

    /**
     * Required. The [CLDR territory
     * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml)
     * of the country to which an item will ship.
     *
     * Generated from protobuf field <code>optional string country = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setCountry($var)
    {
        GPBUtil::checkString($var, True);
        $this->country = $var;

        return $this;
    }

    /**
     * A free-form description of the service class or delivery speed.
     * This should match the service value set for the Shipping attribute.
     * See [service][google.shopping.merchant.products.v1.Shipping.service].
     *
     * Generated from protobuf field <code>optional string service = 2;</code>
     * @return string
     */
    public function getService()
    {
        return isset($this->service) ? $this->service : '';
    }

    public function hasService()
    {
        return isset($this->service);
    }

    public function clearService()
    {
        unset($this->service);
    }

    /**
     * A free-form description of the service class or delivery speed.
     * This should match the service value set for the Shipping attribute.
     * See [service][google.shopping.merchant.products.v1.Shipping.service].
     *
     * Generated from protobuf field <code>optional string service = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setService($var)
    {
        GPBUtil::checkString($var, True);
        $this->service = $var;

        return $this;
    }

    /**
     * The surface to which the minimum order value applies.
     * Defaults to `ONLINE_LOCAL` if not configured.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.products.v1.ProductMinimumOrderValue.Surface surface = 3;</code>
     * @return int
     */
    public function getSurface()
    {
        return isset($this->surface) ? $this->surface : 0;
    }

    public function hasSurface()
    {
        return isset($this->surface);
    }

    public function clearSurface()
    {
        unset($this->surface);
    }

    /**
     * The surface to which the minimum order value applies.
     * Defaults to `ONLINE_LOCAL` if not configured.
     *
     * Generated from protobuf field <code>optional .google.shopping.merchant.products.v1.ProductMinimumOrderValue.Surface surface = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setSurface($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\Products\V1\ProductMinimumOrderValue\Surface::class);
        $this->surface = $var;

        return $this;
    }

    /**
     * Required. The minimum cart or basket value before the checkout is
     * permitted.
     *
     * Generated from protobuf field <code>optional .google.shopping.type.Price price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Shopping\Type\Price|null
     */
    public function getPrice()
    {
        return $this->price;
    }

    public function hasPrice()
    {
        return isset($this->price);
    }

    public function clearPrice()
    {
        unset($this->price);
    }

    /**
     * Required. The minimum cart or basket value before the checkout is
     * permitted.
     *
     * Generated from protobuf field <code>optional .google.shopping.type.Price price = 4 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Shopping\Type\Price $var
     * @return $this
     */
    public function setPrice($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Type\Price::class);
        $this->price = $var;

        return $this;
    }

}

