<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/recaptchaenterprise/v1/recaptchaenterprise.proto

namespace Google\Cloud\RecaptchaEnterprise\V1\TransactionData;

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

/**
 * Line items being purchased in this transaction.
 *
 * Generated from protobuf message <code>google.cloud.recaptchaenterprise.v1.TransactionData.Item</code>
 */
class Item extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. The full name of the item.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $name = '';
    /**
     * Optional. The value per item that the user is paying, in the transaction
     * currency, after discounts.
     *
     * Generated from protobuf field <code>double value = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $value = 0.0;
    /**
     * Optional. The quantity of this item that is being purchased.
     *
     * Generated from protobuf field <code>int64 quantity = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $quantity = 0;
    /**
     * Optional. When a merchant is specified, its corresponding account_id.
     * Necessary to populate marketplace-style transactions.
     *
     * Generated from protobuf field <code>string merchant_account_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $merchant_account_id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Optional. The full name of the item.
     *     @type float $value
     *           Optional. The value per item that the user is paying, in the transaction
     *           currency, after discounts.
     *     @type int|string $quantity
     *           Optional. The quantity of this item that is being purchased.
     *     @type string $merchant_account_id
     *           Optional. When a merchant is specified, its corresponding account_id.
     *           Necessary to populate marketplace-style transactions.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Recaptchaenterprise\V1\Recaptchaenterprise::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. The full name of the item.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Optional. The full name of the item.
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Optional. The value per item that the user is paying, in the transaction
     * currency, after discounts.
     *
     * Generated from protobuf field <code>double value = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return float
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * Optional. The value per item that the user is paying, in the transaction
     * currency, after discounts.
     *
     * Generated from protobuf field <code>double value = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param float $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkDouble($var);
        $this->value = $var;

        return $this;
    }

    /**
     * Optional. The quantity of this item that is being purchased.
     *
     * Generated from protobuf field <code>int64 quantity = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int|string
     */
    public function getQuantity()
    {
        return $this->quantity;
    }

    /**
     * Optional. The quantity of this item that is being purchased.
     *
     * Generated from protobuf field <code>int64 quantity = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int|string $var
     * @return $this
     */
    public function setQuantity($var)
    {
        GPBUtil::checkInt64($var);
        $this->quantity = $var;

        return $this;
    }

    /**
     * Optional. When a merchant is specified, its corresponding account_id.
     * Necessary to populate marketplace-style transactions.
     *
     * Generated from protobuf field <code>string merchant_account_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getMerchantAccountId()
    {
        return $this->merchant_account_id;
    }

    /**
     * Optional. When a merchant is specified, its corresponding account_id.
     * Necessary to populate marketplace-style transactions.
     *
     * Generated from protobuf field <code>string merchant_account_id = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setMerchantAccountId($var)
    {
        GPBUtil::checkString($var, True);
        $this->merchant_account_id = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Item::class, \Google\Cloud\RecaptchaEnterprise\V1\TransactionData_Item::class);

