<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/type/types.proto

namespace Google\Shopping\Type;

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

/**
 * The price represented as a number and currency.
 *
 * Generated from protobuf message <code>google.shopping.type.Price</code>
 */
class Price extends \Google\Protobuf\Internal\Message
{
    /**
     * The price represented as a number in micros (1 million micros is an
     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
     * micros).
     *
     * Generated from protobuf field <code>optional int64 amount_micros = 1;</code>
     */
    protected $amount_micros = null;
    /**
     * The currency of the price using three-letter acronyms according to [ISO
     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
     *
     * Generated from protobuf field <code>optional string currency_code = 2;</code>
     */
    protected $currency_code = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int|string $amount_micros
     *           The price represented as a number in micros (1 million micros is an
     *           equivalent to one's currency standard unit, for example, 1 USD = 1000000
     *           micros).
     *     @type string $currency_code
     *           The currency of the price using three-letter acronyms according to [ISO
     *           4217](http://en.wikipedia.org/wiki/ISO_4217).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Type\Types::initOnce();
        parent::__construct($data);
    }

    /**
     * The price represented as a number in micros (1 million micros is an
     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
     * micros).
     *
     * Generated from protobuf field <code>optional int64 amount_micros = 1;</code>
     * @return int|string
     */
    public function getAmountMicros()
    {
        return isset($this->amount_micros) ? $this->amount_micros : 0;
    }

    public function hasAmountMicros()
    {
        return isset($this->amount_micros);
    }

    public function clearAmountMicros()
    {
        unset($this->amount_micros);
    }

    /**
     * The price represented as a number in micros (1 million micros is an
     * equivalent to one's currency standard unit, for example, 1 USD = 1000000
     * micros).
     *
     * Generated from protobuf field <code>optional int64 amount_micros = 1;</code>
     * @param int|string $var
     * @return $this
     */
    public function setAmountMicros($var)
    {
        GPBUtil::checkInt64($var);
        $this->amount_micros = $var;

        return $this;
    }

    /**
     * The currency of the price using three-letter acronyms according to [ISO
     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
     *
     * Generated from protobuf field <code>optional string currency_code = 2;</code>
     * @return string
     */
    public function getCurrencyCode()
    {
        return isset($this->currency_code) ? $this->currency_code : '';
    }

    public function hasCurrencyCode()
    {
        return isset($this->currency_code);
    }

    public function clearCurrencyCode()
    {
        unset($this->currency_code);
    }

    /**
     * The currency of the price using three-letter acronyms according to [ISO
     * 4217](http://en.wikipedia.org/wiki/ISO_4217).
     *
     * Generated from protobuf field <code>optional string currency_code = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setCurrencyCode($var)
    {
        GPBUtil::checkString($var, True);
        $this->currency_code = $var;

        return $this;
    }

}

