<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: keyapis/subscription/v1/keyapis_subscription_plan_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.Plan</code>
 */
class Plan extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор
     *
     * Generated from protobuf field <code>int32 id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $id = 0;
    /**
     * Название
     *
     * Generated from protobuf field <code>string title = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $title = '';
    /**
     * Описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 3;</code>
     */
    protected $description = null;
    /**
     * Дата создания записи.
     * Заполняется сервером
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $created_at = null;
    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении.
     * Является версией объекта
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $changed_at = null;
    /**
     * Идентификаторы родительских технологических планов(ТП)
     *
     * Generated from protobuf field <code>repeated int32 parent_ids = 6;</code>
     */
    private $parent_ids;
    /**
     * Идентификаторы регионов, в которых доступен технологический план(ТП)
     *
     * Generated from protobuf field <code>repeated int32 rf_ids = 7;</code>
     */
    private $rf_ids;
    /**
     * Краткое описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue summary = 8;</code>
     */
    protected $summary = null;
    /**
     * Тип иконки
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Plan.IconType icon_type = 9;</code>
     */
    protected $icon_type = 0;
    /**
     * Описание опций
     *
     * Generated from protobuf field <code>repeated .keyapis.subscription.v1.Plan.OptionDescription option_descriptions = 10;</code>
     */
    private $option_descriptions;
    /**
     * Привилегии.
     * Массив услуг доступных по технологическому плану
     *
     * Generated from protobuf field <code>repeated .keyapis.subscription.v1.Privilege.Type privilege_types = 11;</code>
     */
    private $privilege_types;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор
     *     @type string $title
     *           Название
     *     @type \Google\Protobuf\StringValue $description
     *           Описание
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата создания записи.
     *           Заполняется сервером
     *     @type \Google\Protobuf\Timestamp $changed_at
     *           Дата последнего изменения.
     *           Заполняется и обновляется сервером.
     *           Заполняется при создании и изменении.
     *           Является версией объекта
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $parent_ids
     *           Идентификаторы родительских технологических планов(ТП)
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $rf_ids
     *           Идентификаторы регионов, в которых доступен технологический план(ТП)
     *     @type \Google\Protobuf\StringValue $summary
     *           Краткое описание
     *     @type int $icon_type
     *           Тип иконки
     *     @type array<\Keyapis\Subscription\V1\Plan\OptionDescription>|\Google\Protobuf\Internal\RepeatedField $option_descriptions
     *           Описание опций
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $privilege_types
     *           Привилегии.
     *           Массив услуг доступных по технологическому плану
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Subscription\V1\KeyapisSubscriptionPlanV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор
     *
     * Generated from protobuf field <code>int32 id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return int
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор
     *
     * Generated from protobuf field <code>int32 id = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param int $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkInt32($var);
        $this->id = $var;

        return $this;
    }

    /**
     * Название
     *
     * Generated from protobuf field <code>string title = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getTitle()
    {
        return $this->title;
    }

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

        return $this;
    }

    /**
     * Описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 3;</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>

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

    /**
     * Описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue description = 3;</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.

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

    /**
     * Дата создания записи.
     * Заполняется сервером
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 4 [(.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);
    }

    /**
     * Дата создания записи.
     * Заполняется сервером
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 4 [(.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;
    }

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

    public function hasChangedAt()
    {
        return isset($this->changed_at);
    }

    public function clearChangedAt()
    {
        unset($this->changed_at);
    }

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

        return $this;
    }

    /**
     * Идентификаторы родительских технологических планов(ТП)
     *
     * Generated from protobuf field <code>repeated int32 parent_ids = 6;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getParentIds()
    {
        return $this->parent_ids;
    }

    /**
     * Идентификаторы родительских технологических планов(ТП)
     *
     * Generated from protobuf field <code>repeated int32 parent_ids = 6;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setParentIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->parent_ids = $arr;

        return $this;
    }

    /**
     * Идентификаторы регионов, в которых доступен технологический план(ТП)
     *
     * Generated from protobuf field <code>repeated int32 rf_ids = 7;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRfIds()
    {
        return $this->rf_ids;
    }

    /**
     * Идентификаторы регионов, в которых доступен технологический план(ТП)
     *
     * Generated from protobuf field <code>repeated int32 rf_ids = 7;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRfIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::INT32);
        $this->rf_ids = $arr;

        return $this;
    }

    /**
     * Краткое описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue summary = 8;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getSummary()
    {
        return $this->summary;
    }

    public function hasSummary()
    {
        return isset($this->summary);
    }

    public function clearSummary()
    {
        unset($this->summary);
    }

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

     * Краткое описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue summary = 8;</code>
     * @return string|null
     */
    public function getSummaryUnwrapped()
    {
        return $this->readWrapperValue("summary");
    }

    /**
     * Краткое описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue summary = 8;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setSummary($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->summary = $var;

        return $this;
    }

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

     * Краткое описание
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue summary = 8;</code>
     * @param string|null $var
     * @return $this
     */
    public function setSummaryUnwrapped($var)
    {
        $this->writeWrapperValue("summary", $var);
        return $this;}

    /**
     * Тип иконки
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Plan.IconType icon_type = 9;</code>
     * @return int
     */
    public function getIconType()
    {
        return $this->icon_type;
    }

    /**
     * Тип иконки
     *
     * Generated from protobuf field <code>.keyapis.subscription.v1.Plan.IconType icon_type = 9;</code>
     * @param int $var
     * @return $this
     */
    public function setIconType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Subscription\V1\Plan\IconType::class);
        $this->icon_type = $var;

        return $this;
    }

    /**
     * Описание опций
     *
     * Generated from protobuf field <code>repeated .keyapis.subscription.v1.Plan.OptionDescription option_descriptions = 10;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getOptionDescriptions()
    {
        return $this->option_descriptions;
    }

    /**
     * Описание опций
     *
     * Generated from protobuf field <code>repeated .keyapis.subscription.v1.Plan.OptionDescription option_descriptions = 10;</code>
     * @param array<\Keyapis\Subscription\V1\Plan\OptionDescription>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setOptionDescriptions($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Keyapis\Subscription\V1\Plan\OptionDescription::class);
        $this->option_descriptions = $arr;

        return $this;
    }

    /**
     * Привилегии.
     * Массив услуг доступных по технологическому плану
     *
     * Generated from protobuf field <code>repeated .keyapis.subscription.v1.Privilege.Type privilege_types = 11;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getPrivilegeTypes()
    {
        return $this->privilege_types;
    }

    /**
     * Привилегии.
     * Массив услуг доступных по технологическому плану
     *
     * Generated from protobuf field <code>repeated .keyapis.subscription.v1.Privilege.Type privilege_types = 11;</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setPrivilegeTypes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::ENUM, \Keyapis\Subscription\V1\Privilege\Type::class);
        $this->privilege_types = $arr;

        return $this;
    }

}

