<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/baremetalsolution/v2/instance.proto

namespace Google\Cloud\BareMetalSolution\V2;

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

/**
 * Message requesting to updating a server.
 *
 * Generated from protobuf message <code>google.cloud.baremetalsolution.v2.UpdateInstanceRequest</code>
 */
class UpdateInstanceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The server to update.
     * The `name` field is used to identify the instance to update.
     * Format: projects/{project}/locations/{location}/instances/{instance}
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $instance = null;
    /**
     * The list of fields to update.
     * The currently supported fields are:
     *   `labels`
     *   `hyperthreading_enabled`
     *   `os_image`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</code>
     */
    private $update_mask = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\BareMetalSolution\V2\Instance $instance
     *           Required. The server to update.
     *           The `name` field is used to identify the instance to update.
     *           Format: projects/{project}/locations/{location}/instances/{instance}
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           The list of fields to update.
     *           The currently supported fields are:
     *             `labels`
     *             `hyperthreading_enabled`
     *             `os_image`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Baremetalsolution\V2\Instance::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The server to update.
     * The `name` field is used to identify the instance to update.
     * Format: projects/{project}/locations/{location}/instances/{instance}
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\BareMetalSolution\V2\Instance|null
     */
    public function getInstance()
    {
        return $this->instance;
    }

    public function hasInstance()
    {
        return isset($this->instance);
    }

    public function clearInstance()
    {
        unset($this->instance);
    }

    /**
     * Required. The server to update.
     * The `name` field is used to identify the instance to update.
     * Format: projects/{project}/locations/{location}/instances/{instance}
     *
     * Generated from protobuf field <code>.google.cloud.baremetalsolution.v2.Instance instance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\BareMetalSolution\V2\Instance $var
     * @return $this
     */
    public function setInstance($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\BareMetalSolution\V2\Instance::class);
        $this->instance = $var;

        return $this;
    }

    /**
     * The list of fields to update.
     * The currently supported fields are:
     *   `labels`
     *   `hyperthreading_enabled`
     *   `os_image`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</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);
    }

    /**
     * The list of fields to update.
     * The currently supported fields are:
     *   `labels`
     *   `hyperthreading_enabled`
     *   `os_image`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2;</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;
    }

}

