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

/**
 * A message that represents loyalty points.
 *
 * Generated from protobuf message <code>google.shopping.merchant.products.v1beta.LoyaltyPoints</code>
 */
class LoyaltyPoints extends \Google\Protobuf\Internal\Message
{
    /**
     * Name of loyalty points program. It is recommended to limit the name to
     * 12 full-width characters or 24 Roman characters.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     */
    protected $name = '';
    /**
     * The retailer's loyalty points in absolute value.
     *
     * Generated from protobuf field <code>int64 points_value = 2;</code>
     */
    protected $points_value = 0;
    /**
     * The ratio of a point when converted to currency. Google assumes currency
     * based on Merchant Center settings. If ratio is left out, it defaults to
     * 1.0.
     *
     * Generated from protobuf field <code>double ratio = 3;</code>
     */
    protected $ratio = 0.0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Name of loyalty points program. It is recommended to limit the name to
     *           12 full-width characters or 24 Roman characters.
     *     @type int|string $points_value
     *           The retailer's loyalty points in absolute value.
     *     @type float $ratio
     *           The ratio of a point when converted to currency. Google assumes currency
     *           based on Merchant Center settings. If ratio is left out, it defaults to
     *           1.0.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Products\V1Beta\ProductsCommon::initOnce();
        parent::__construct($data);
    }

    /**
     * Name of loyalty points program. It is recommended to limit the name to
     * 12 full-width characters or 24 Roman characters.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Name of loyalty points program. It is recommended to limit the name to
     * 12 full-width characters or 24 Roman characters.
     *
     * Generated from protobuf field <code>string name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * The retailer's loyalty points in absolute value.
     *
     * Generated from protobuf field <code>int64 points_value = 2;</code>
     * @return int|string
     */
    public function getPointsValue()
    {
        return $this->points_value;
    }

    /**
     * The retailer's loyalty points in absolute value.
     *
     * Generated from protobuf field <code>int64 points_value = 2;</code>
     * @param int|string $var
     * @return $this
     */
    public function setPointsValue($var)
    {
        GPBUtil::checkInt64($var);
        $this->points_value = $var;

        return $this;
    }

    /**
     * The ratio of a point when converted to currency. Google assumes currency
     * based on Merchant Center settings. If ratio is left out, it defaults to
     * 1.0.
     *
     * Generated from protobuf field <code>double ratio = 3;</code>
     * @return float
     */
    public function getRatio()
    {
        return $this->ratio;
    }

    /**
     * The ratio of a point when converted to currency. Google assumes currency
     * based on Merchant Center settings. If ratio is left out, it defaults to
     * 1.0.
     *
     * Generated from protobuf field <code>double ratio = 3;</code>
     * @param float $var
     * @return $this
     */
    public function setRatio($var)
    {
        GPBUtil::checkDouble($var);
        $this->ratio = $var;

        return $this;
    }

}

