<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/merchant/products/v1beta/products_common.proto

namespace Google\Shopping\Merchant\Products\V1beta;

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

/**
 * The Tax of the product.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1beta.Tax</code>
 */
class Tax extends \Google\Protobuf\Internal\Message
{
    /**
     * The percentage of tax rate that applies to the item price.
     *
     * Generated from protobuf field <code>double rate = 1;</code>
     */
    protected $rate = 0.0;
    /**
     * The country within which the item is taxed, specified as a [CLDR
     * territory
     * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml).
     *
     * Generated from protobuf field <code>string country = 2;</code>
     */
    protected $country = '';
    /**
     * The geographic region to which the tax rate applies.
     *
     * Generated from protobuf field <code>string region = 3;</code>
     */
    protected $region = '';
    /**
     * Set to true if tax is charged on shipping.
     *
     * Generated from protobuf field <code>bool tax_ship = 4;</code>
     */
    protected $tax_ship = false;
    /**
     * The numeric ID of a location that the tax rate applies to as defined in
     * the [AdWords
     * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting).
     *
     * Generated from protobuf field <code>int64 location_id = 5;</code>
     */
    protected $location_id = 0;
    /**
     * The postal code range that the tax rate applies to, represented by
     * a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP
     * codes or two ZIP code prefixes of equal length.
     * Examples: 94114, 94*, 94002-95460, 94*-95*.
     *
     * Generated from protobuf field <code>string postal_code = 6;</code>
     */
    protected $postal_code = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type float $rate
     *           The percentage of tax rate that applies to the item price.
     *     @type string $country
     *           The country within which the item is taxed, specified as a [CLDR
     *           territory
     *           code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml).
     *     @type string $region
     *           The geographic region to which the tax rate applies.
     *     @type bool $tax_ship
     *           Set to true if tax is charged on shipping.
     *     @type int|string $location_id
     *           The numeric ID of a location that the tax rate applies to as defined in
     *           the [AdWords
     *           API](https://developers.google.com/adwords/api/docs/appendix/geotargeting).
     *     @type string $postal_code
     *           The postal code range that the tax rate applies to, represented by
     *           a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP
     *           codes or two ZIP code prefixes of equal length.
     *           Examples: 94114, 94*, 94002-95460, 94*-95*.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * The percentage of tax rate that applies to the item price.
     *
     * Generated from protobuf field <code>double rate = 1;</code>
     * @return float
     */
    public function getRate()
    {
        return $this->rate;
    }

    /**
     * The percentage of tax rate that applies to the item price.
     *
     * Generated from protobuf field <code>double rate = 1;</code>
     * @param float $var
     * @return $this
     */
    public function setRate($var)
    {
        GPBUtil::checkDouble($var);
        $this->rate = $var;

        return $this;
    }

    /**
     * The country within which the item is taxed, specified as a [CLDR
     * territory
     * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml).
     *
     * Generated from protobuf field <code>string country = 2;</code>
     * @return string
     */
    public function getCountry()
    {
        return $this->country;
    }

    /**
     * The country within which the item is taxed, specified as a [CLDR
     * territory
     * code](http://www.unicode.org/repos/cldr/tags/latest/common/main/en.xml).
     *
     * Generated from protobuf field <code>string country = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setCountry($var)
    {
        GPBUtil::checkString($var, True);
        $this->country = $var;

        return $this;
    }

    /**
     * The geographic region to which the tax rate applies.
     *
     * Generated from protobuf field <code>string region = 3;</code>
     * @return string
     */
    public function getRegion()
    {
        return $this->region;
    }

    /**
     * The geographic region to which the tax rate applies.
     *
     * Generated from protobuf field <code>string region = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setRegion($var)
    {
        GPBUtil::checkString($var, True);
        $this->region = $var;

        return $this;
    }

    /**
     * Set to true if tax is charged on shipping.
     *
     * Generated from protobuf field <code>bool tax_ship = 4;</code>
     * @return bool
     */
    public function getTaxShip()
    {
        return $this->tax_ship;
    }

    /**
     * Set to true if tax is charged on shipping.
     *
     * Generated from protobuf field <code>bool tax_ship = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setTaxShip($var)
    {
        GPBUtil::checkBool($var);
        $this->tax_ship = $var;

        return $this;
    }

    /**
     * The numeric ID of a location that the tax rate applies to as defined in
     * the [AdWords
     * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting).
     *
     * Generated from protobuf field <code>int64 location_id = 5;</code>
     * @return int|string
     */
    public function getLocationId()
    {
        return $this->location_id;
    }

    /**
     * The numeric ID of a location that the tax rate applies to as defined in
     * the [AdWords
     * API](https://developers.google.com/adwords/api/docs/appendix/geotargeting).
     *
     * Generated from protobuf field <code>int64 location_id = 5;</code>
     * @param int|string $var
     * @return $this
     */
    public function setLocationId($var)
    {
        GPBUtil::checkInt64($var);
        $this->location_id = $var;

        return $this;
    }

    /**
     * The postal code range that the tax rate applies to, represented by
     * a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP
     * codes or two ZIP code prefixes of equal length.
     * Examples: 94114, 94*, 94002-95460, 94*-95*.
     *
     * Generated from protobuf field <code>string postal_code = 6;</code>
     * @return string
     */
    public function getPostalCode()
    {
        return $this->postal_code;
    }

    /**
     * The postal code range that the tax rate applies to, represented by
     * a ZIP code, a ZIP code prefix using * wildcard, a range between two ZIP
     * codes or two ZIP code prefixes of equal length.
     * Examples: 94114, 94*, 94002-95460, 94*-95*.
     *
     * Generated from protobuf field <code>string postal_code = 6;</code>
     * @param string $var
     * @return $this
     */
    public function setPostalCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->postal_code = $var;

        return $this;
    }

}

