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

namespace Google\Cloud\Retail\V2;

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

/**
 * Promotion information.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.Promotion</code>
 */
class Promotion extends \Google\Protobuf\Internal\Message
{
    /**
     * ID of the promotion. For example, "free gift".
     * The value must be a UTF-8 encoded string with a length limit of 128
     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
     * returned.
     * Google Merchant Center property
     * [promotion](https://support.google.com/merchants/answer/7050148).
     *
     * Generated from protobuf field <code>string promotion_id = 1;</code>
     */
    private $promotion_id = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $promotion_id
     *           ID of the promotion. For example, "free gift".
     *           The value must be a UTF-8 encoded string with a length limit of 128
     *           characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
     *           id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
     *           returned.
     *           Google Merchant Center property
     *           [promotion](https://support.google.com/merchants/answer/7050148).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\Promotion::initOnce();
        parent::__construct($data);
    }

    /**
     * ID of the promotion. For example, "free gift".
     * The value must be a UTF-8 encoded string with a length limit of 128
     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
     * returned.
     * Google Merchant Center property
     * [promotion](https://support.google.com/merchants/answer/7050148).
     *
     * Generated from protobuf field <code>string promotion_id = 1;</code>
     * @return string
     */
    public function getPromotionId()
    {
        return $this->promotion_id;
    }

    /**
     * ID of the promotion. For example, "free gift".
     * The value must be a UTF-8 encoded string with a length limit of 128
     * characters, and match the pattern: `[a-zA-Z][a-zA-Z0-9_]*`. For example,
     * id0LikeThis or ID_1_LIKE_THIS. Otherwise, an INVALID_ARGUMENT error is
     * returned.
     * Google Merchant Center property
     * [promotion](https://support.google.com/merchants/answer/7050148).
     *
     * Generated from protobuf field <code>string promotion_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPromotionId($var)
    {
        GPBUtil::checkString($var, True);
        $this->promotion_id = $var;

        return $this;
    }

}

