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

namespace Keyapis\Ad\V1;

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

/**
 * Маркетплейс
 *
 * Generated from protobuf message <code>keyapis.ad.v1.Marketplace</code>
 */
class Marketplace 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>.keyapis.ad.v1.Marketplace.Type type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $type = 0;
    /**
     * Выключен ли маркетплейс
     *
     * Generated from protobuf field <code>bool is_disabled = 4;</code>
     */
    protected $is_disabled = false;
    /**
     * Ссылка на карточку товара ключа в маркетплейсе
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue card_url = 5;</code>
     */
    protected $card_url = null;
    /**
     * Дата создания
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $created_at = null;
    /**
     * Дата последнего изменения.
     * Заполняется и обновляется сервером.
     * Заполняется при создании и изменении.
     * Является версией объекта
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp changed_at = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $changed_at = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $id
     *           Идентификатор
     *     @type string $title
     *           Название
     *     @type int $type
     *           Тип маркетплейса
     *     @type bool $is_disabled
     *           Выключен ли маркетплейс
     *     @type \Google\Protobuf\StringValue $card_url
     *           Ссылка на карточку товара ключа в маркетплейсе
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата создания
     *     @type \Google\Protobuf\Timestamp $changed_at
     *           Дата последнего изменения.
     *           Заполняется и обновляется сервером.
     *           Заполняется при создании и изменении.
     *           Является версией объекта
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Ad\V1\KeyapisAdMarketplaceV1::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>.keyapis.ad.v1.Marketplace.Type type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Тип маркетплейса
     *
     * Generated from protobuf field <code>.keyapis.ad.v1.Marketplace.Type type = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Keyapis\Ad\V1\Marketplace\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * Выключен ли маркетплейс
     *
     * Generated from protobuf field <code>bool is_disabled = 4;</code>
     * @return bool
     */
    public function getIsDisabled()
    {
        return $this->is_disabled;
    }

    /**
     * Выключен ли маркетплейс
     *
     * Generated from protobuf field <code>bool is_disabled = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setIsDisabled($var)
    {
        GPBUtil::checkBool($var);
        $this->is_disabled = $var;

        return $this;
    }

    /**
     * Ссылка на карточку товара ключа в маркетплейсе
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue card_url = 5;</code>
     * @return \Google\Protobuf\StringValue|null
     */
    public function getCardUrl()
    {
        return $this->card_url;
    }

    public function hasCardUrl()
    {
        return isset($this->card_url);
    }

    public function clearCardUrl()
    {
        unset($this->card_url);
    }

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

     * Ссылка на карточку товара ключа в маркетплейсе
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue card_url = 5;</code>
     * @return string|null
     */
    public function getCardUrlUnwrapped()
    {
        return $this->readWrapperValue("card_url");
    }

    /**
     * Ссылка на карточку товара ключа в маркетплейсе
     *
     * Generated from protobuf field <code>.google.protobuf.StringValue card_url = 5;</code>
     * @param \Google\Protobuf\StringValue $var
     * @return $this
     */
    public function setCardUrl($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\StringValue::class);
        $this->card_url = $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 card_url = 5;</code>
     * @param string|null $var
     * @return $this
     */
    public function setCardUrlUnwrapped($var)
    {
        $this->writeWrapperValue("card_url", $var);
        return $this;}

    /**
     * Дата создания
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 6 [(.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 = 6 [(.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 = 7 [(.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 = 7 [(.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;
    }

}

