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

namespace Keyapis\Subscription\V1;

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

/**
 * Шаблон КВ
 *
 * Generated from protobuf message <code>keyapis.subscription.v1.OfferTemplate</code>
 */
class OfferTemplate extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1;</code>
     */
    protected $id = '';
    /**
     * Тип сервиса
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.OfferTemplate.ServiceType service_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $service_type = 0;
    /**
     * Наименование КВ.
     * # Диапазон: 3..256
     *
     * Generated from protobuf field <code>string title = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $title = '';
    /**
     * Описание КВ.
     * # Диапазон: 3..1024
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 4;</code>
     */
    protected $description = null;
    /**
     * Статус шаблона КВ.
     * Заполняется сервером
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.OfferTemplate.StatusType status_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $status_type = 0;
    /**
     * Правила применимости Шаблона КВ
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.OfferTemplate.ApplicabilityRules applicability_rules = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $applicability_rules = null;
    /**
     * Список элементов Шаблона КВ.
     * Каждый элемент описывает технологический план и параметры создания КВ для него
     *
     * Generated from protobuf field <code>repeated .keyapis.subscription.v1.OfferTemplate.Item items = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $items;
    /**
     * Дата и время создания.
     * Заполняется сервером.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $created_at = null;
    /**
     * Дата и время последнего изменения.
     * Заполняется и обновляется сервером.
     * Является версией объекта.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp updated_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $updated_at = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           Идентификатор.
     *           # Тип: Guid
     *     @type int $service_type
     *           Тип сервиса
     *     @type string $title
     *           Наименование КВ.
     *           # Диапазон: 3..256
     *     @type \Google\Protobuf\StringValue $description
     *           Описание КВ.
     *           # Диапазон: 3..1024
     *     @type int $status_type
     *           Статус шаблона КВ.
     *           Заполняется сервером
     *     @type \Keyapis\Subscription\V1\OfferTemplate\ApplicabilityRules $applicability_rules
     *           Правила применимости Шаблона КВ
     *     @type array<\Keyapis\Subscription\V1\OfferTemplate\Item>|\Google\Protobuf\Internal\RepeatedField $items
     *           Список элементов Шаблона КВ.
     *           Каждый элемент описывает технологический план и параметры создания КВ для него
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата и время создания.
     *           Заполняется сервером.
     *           # Тип: DateTime
     *     @type \Google\Protobuf\Timestamp $updated_at
     *           Дата и время последнего изменения.
     *           Заполняется и обновляется сервером.
     *           Является версией объекта.
     *           # Тип: DateTime
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Subscription\V1\KeyapisSubscriptionOfferTemplateV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Тип сервиса
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.OfferTemplate.ServiceType service_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getServiceType()
    {
        return $this->service_type;
    }

    /**
     * Тип сервиса
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.OfferTemplate.ServiceType service_type = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setServiceType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Subscription\V1\OfferTemplate\ServiceType::class);
        $this->service_type = $var;

        return $this;
    }

    /**
     * Наименование КВ.
     * # Диапазон: 3..256
     *
     * Generated from protobuf field <code>string title = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

    /**
     * Наименование КВ.
     * # Диапазон: 3..256
     *
     * Generated from protobuf field <code>string title = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setTitle($var)
    {
        GPBUtil::checkString($var, True);
        $this->title = $var;

        return $this;
    }

    /**
     * Описание КВ.
     * # Диапазон: 3..1024
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 4;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getDescription()
    {
        return $this->description;
    }

    public function hasDescription()
    {
        return isset($this->description);
    }

    public function clearDescription()
    {
        unset($this->description);
    }

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

     * Описание КВ.
     * # Диапазон: 3..1024
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 4;</code>
     * @return string|null
     */
    public function getDescriptionUnwrapped()
    {
        return $this->readWrapperValue("description");
    }

    /**
     * Описание КВ.
     * # Диапазон: 3..1024
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 4;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->description = $var;

        return $this;
    }

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

     * Описание КВ.
     * # Диапазон: 3..1024
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 4;</code>
     * @param string|null $var
     * @return $this
     */
    public function setDescriptionUnwrapped($var)
    {
        $this->writeWrapperValue("description", $var);
        return $this;}

    /**
     * Статус шаблона КВ.
     * Заполняется сервером
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.OfferTemplate.StatusType status_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getStatusType()
    {
        return $this->status_type;
    }

    /**
     * Статус шаблона КВ.
     * Заполняется сервером
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.OfferTemplate.StatusType status_type = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setStatusType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Subscription\V1\OfferTemplate\StatusType::class);
        $this->status_type = $var;

        return $this;
    }

    /**
     * Правила применимости Шаблона КВ
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.OfferTemplate.ApplicabilityRules applicability_rules = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Keyapis\Subscription\V1\OfferTemplate\ApplicabilityRules|null
     */
    public function getApplicabilityRules()
    {
        return $this->applicability_rules;
    }

    public function hasApplicabilityRules()
    {
        return isset($this->applicability_rules);
    }

    public function clearApplicabilityRules()
    {
        unset($this->applicability_rules);
    }

    /**
     * Правила применимости Шаблона КВ
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.OfferTemplate.ApplicabilityRules applicability_rules = 6 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Keyapis\Subscription\V1\OfferTemplate\ApplicabilityRules $var
     * @return $this
     */
    public function setApplicabilityRules($var)
    {
        GPBUtil::checkMessage($var, \Keyapis\Subscription\V1\OfferTemplate\ApplicabilityRules::class);
        $this->applicability_rules = $var;

        return $this;
    }

    /**
     * Список элементов Шаблона КВ.
     * Каждый элемент описывает технологический план и параметры создания КВ для него
     *
     * Generated from protobuf field <code>repeated .keyapis.subscription.v1.OfferTemplate.Item items = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getItems()
    {
        return $this->items;
    }

    /**
     * Список элементов Шаблона КВ.
     * Каждый элемент описывает технологический план и параметры создания КВ для него
     *
     * Generated from protobuf field <code>repeated .keyapis.subscription.v1.OfferTemplate.Item items = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param array<\Keyapis\Subscription\V1\OfferTemplate\Item>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setItems($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Keyapis\Subscription\V1\OfferTemplate\Item::class);
        $this->items = $arr;

        return $this;
    }

    /**
     * Дата и время создания.
     * Заполняется сервером.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    public function hasCreatedAt()
    {
        return isset($this->created_at);
    }

    public function clearCreatedAt()
    {
        unset($this->created_at);
    }

    /**
     * Дата и время создания.
     * Заполняется сервером.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 8 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreatedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->created_at = $var;

        return $this;
    }

    /**
     * Дата и время последнего изменения.
     * Заполняется и обновляется сервером.
     * Является версией объекта.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp updated_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdatedAt()
    {
        return $this->updated_at;
    }

    public function hasUpdatedAt()
    {
        return isset($this->updated_at);
    }

    public function clearUpdatedAt()
    {
        unset($this->updated_at);
    }

    /**
     * Дата и время последнего изменения.
     * Заполняется и обновляется сервером.
     * Является версией объекта.
     * # Тип: DateTime
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp updated_at = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdatedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->updated_at = $var;

        return $this;
    }

}

