<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: deviceapis/device/v1/deviceapis_device_code_v1.proto

namespace Deviceapis\Device\V1;

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

/**
 * Запрос создания кода доступа
 *
 * Generated from protobuf message <code>deviceapis.device.v1.SaveCodeRequest</code>
 */
class SaveCodeRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Код доступа
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Code data = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $data = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Deviceapis\Device\V1\Code $data
     *           Код доступа
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Deviceapis\Device\V1\DeviceapisDeviceCodeV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Код доступа
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Code data = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Deviceapis\Device\V1\Code|null
     */
    public function getData()
    {
        return $this->data;
    }

    public function hasData()
    {
        return isset($this->data);
    }

    public function clearData()
    {
        unset($this->data);
    }

    /**
     * Код доступа
     *
     * Generated from protobuf field <code>.deviceapis.device.v1.Code data = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Deviceapis\Device\V1\Code $var
     * @return $this
     */
    public function setData($var)
    {
        GPBUtil::checkMessage($var, \Deviceapis\Device\V1\Code::class);
        $this->data = $var;

        return $this;
    }

}

