<?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
{
    /**
     * The new values for the device registry. 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;</code>
     */
    private $device = null;
    /**
     * 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;</code>
     */
    private $update_mask = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Iot\V1\Device $device
     *           The new values for the device registry. 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
     *           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);
    }

    /**
     * The new values for the device registry. 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;</code>
     * @return \Google\Cloud\Iot\V1\Device
     */
    public function getDevice()
    {
        return $this->device;
    }

    /**
     * The new values for the device registry. 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;</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;
    }

    /**
     * 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;</code>
     * @return \Google\Protobuf\FieldMask
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    /**
     * 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;</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;
    }

}

