<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/subscription/v1/keyapis_subscription_offer_template_v1.proto

namespace Keyapis\Subscription\V1\OfferTemplate;

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

/**
 * Элемент Шаблона КВ
 *
 * Generated from protobuf message <code>keyapis.subscription.v1.OfferTemplate.Item</code>
 */
class Item extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор технологического плана.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>int32 plan_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $plan_id = 0;
    /**
     * Тип коммерческой возможности
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Offer.Type type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $type = 0;
    /**
     * Подключать ли автоматическую подписку
     *
     * Generated from protobuf field <code>bool is_enable_auto_subscribe = 3;</code>
     */
    protected $is_enable_auto_subscribe = false;
    /**
     * Признак принадлежности к цифровому клиентскому пути
     *
     * Generated from protobuf field <code>bool is_digital_way = 4;</code>
     */
    protected $is_digital_way = false;
    /**
     * Адрес размещения офферты.
     * Полный url до файла.
     * # Диапазон: 0..2048
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue offer_url = 5;</code>
     */
    protected $offer_url = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $plan_id
     *           Идентификатор технологического плана.
     *           # Диапазон: 1..2147483647
     *     @type int $type
     *           Тип коммерческой возможности
     *     @type bool $is_enable_auto_subscribe
     *           Подключать ли автоматическую подписку
     *     @type bool $is_digital_way
     *           Признак принадлежности к цифровому клиентскому пути
     *     @type \Google\Protobuf\StringValue $offer_url
     *           Адрес размещения офферты.
     *           Полный url до файла.
     *           # Диапазон: 0..2048
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Subscription\V1\KeyapisSubscriptionOfferTemplateV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор технологического плана.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>int32 plan_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getPlanId()
    {
        return $this->plan_id;
    }

    /**
     * Идентификатор технологического плана.
     * # Диапазон: 1..2147483647
     *
     * Generated from protobuf field <code>int32 plan_id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setPlanId($var)
    {
        GPBUtil::checkInt32($var);
        $this->plan_id = $var;

        return $this;
    }

    /**
     * Тип коммерческой возможности
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Offer.Type type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Тип коммерческой возможности
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Offer.Type type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Subscription\V1\Offer\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Подключать ли автоматическую подписку
     *
     * Generated from protobuf field <code>bool is_enable_auto_subscribe = 3;</code>
     * @return bool
     */
    public function getIsEnableAutoSubscribe()
    {
        return $this->is_enable_auto_subscribe;
    }

    /**
     * Подключать ли автоматическую подписку
     *
     * Generated from protobuf field <code>bool is_enable_auto_subscribe = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsEnableAutoSubscribe($var)
    {
        GPBUtil::checkBool($var);
        $this->is_enable_auto_subscribe = $var;

        return $this;
    }

    /**
     * Признак принадлежности к цифровому клиентскому пути
     *
     * Generated from protobuf field <code>bool is_digital_way = 4;</code>
     * @return bool
     */
    public function getIsDigitalWay()
    {
        return $this->is_digital_way;
    }

    /**
     * Признак принадлежности к цифровому клиентскому пути
     *
     * Generated from protobuf field <code>bool is_digital_way = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsDigitalWay($var)
    {
        GPBUtil::checkBool($var);
        $this->is_digital_way = $var;

        return $this;
    }

    /**
     * Адрес размещения офферты.
     * Полный url до файла.
     * # Диапазон: 0..2048
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue offer_url = 5;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getOfferUrl()
    {
        return $this->offer_url;
    }

    public function hasOfferUrl()
    {
        return isset($this->offer_url);
    }

    public function clearOfferUrl()
    {
        unset($this->offer_url);
    }

    /**
     * Returns the unboxed value from <code>getOfferUrl()</code>

     * Адрес размещения офферты.
     * Полный url до файла.
     * # Диапазон: 0..2048
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue offer_url = 5;</code>
     * @return string|null
     */
    public function getOfferUrlUnwrapped()
    {
        return $this->readWrapperValue("offer_url");
    }

    /**
     * Адрес размещения офферты.
     * Полный url до файла.
     * # Диапазон: 0..2048
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue offer_url = 5;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setOfferUrl($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->offer_url = $var;

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\StringValue object.

     * Адрес размещения офферты.
     * Полный url до файла.
     * # Диапазон: 0..2048
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue offer_url = 5;</code>
     * @param string|null $var
     * @return $this
     */
    public function setOfferUrlUnwrapped($var)
    {
        $this->writeWrapperValue("offer_url", $var);
        return $this;}

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Item::class, \Keyapis\Subscription\V1\OfferTemplate_Item::class);

