<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/iot/v1/device_manager.proto

namespace Google\Cloud\Iot\V1;

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

/**
 * Request for `UpdateDevice`.
 *
 * Generated from protobuf message <code>google.cloud.iot.v1.UpdateDeviceRequest</code>
 */
class UpdateDeviceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $device = null;
    /**
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $update_mask = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Iot\V1\Device $device
     *           Required. The new values for the device. The `id` and `num_id` fields must
     *           be empty, and the field `name` must specify the name path. For example,
     *           `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     *           `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Required. Only updates the `device` fields indicated by this mask.
     *           The field mask must not be empty, and it must not contain fields that
     *           are immutable or only set by the server.
     *           Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Iot\V1\DeviceManager::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Iot\V1\Device|null
     */
    public function getDevice()
    {
        return $this->device;
    }

    public function hasDevice()
    {
        return isset($this->device);
    }

    public function clearDevice()
    {
        unset($this->device);
    }

    /**
     * Required. The new values for the device. The `id` and `num_id` fields must
     * be empty, and the field `name` must specify the name path. For example,
     * `projects/p0/locations/us-central1/registries/registry0/devices/device0`or
     * `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
     *
     * Generated from protobuf field <code>.google.cloud.iot.v1.Device device = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Iot\V1\Device $var
     * @return $this
     */
    public function setDevice($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Iot\V1\Device::class);
        $this->device = $var;

        return $this;
    }

    /**
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Required. Only updates the `device` fields indicated by this mask.
     * The field mask must not be empty, and it must not contain fields that
     * are immutable or only set by the server.
     * Mutable top-level fields: `credentials`, `blocked`, and `metadata`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

}

