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

namespace Google\Cloud\ApiHub\V1;

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

/**
 * The
 * [UpdatePluginInstance][google.cloud.apihub.v1.ApiHubPlugin.UpdatePluginInstance]
 * method's request.
 *
 * Generated from protobuf message <code>google.cloud.apihub.v1.UpdatePluginInstanceRequest</code>
 */
class UpdatePluginInstanceRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The plugin instance to update.
     *
     * Generated from protobuf field <code>.google.cloud.apihub.v1.PluginInstance plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $plugin_instance = null;
    /**
     * Optional. The list of fields to update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $update_mask = null;

    /**
     * @param \Google\Cloud\ApiHub\V1\PluginInstance $pluginInstance Required. The plugin instance to update.
     * @param \Google\Protobuf\FieldMask             $updateMask     Optional. The list of fields to update.
     *
     * @return \Google\Cloud\ApiHub\V1\UpdatePluginInstanceRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\ApiHub\V1\PluginInstance $pluginInstance, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setPluginInstance($pluginInstance)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\ApiHub\V1\PluginInstance $plugin_instance
     *           Required. The plugin instance to update.
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Optional. The list of fields to update.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Apihub\V1\PluginService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The plugin instance to update.
     *
     * Generated from protobuf field <code>.google.cloud.apihub.v1.PluginInstance plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\ApiHub\V1\PluginInstance|null
     */
    public function getPluginInstance()
    {
        return $this->plugin_instance;
    }

    public function hasPluginInstance()
    {
        return isset($this->plugin_instance);
    }

    public function clearPluginInstance()
    {
        unset($this->plugin_instance);
    }

    /**
     * Required. The plugin instance to update.
     *
     * Generated from protobuf field <code>.google.cloud.apihub.v1.PluginInstance plugin_instance = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\ApiHub\V1\PluginInstance $var
     * @return $this
     */
    public function setPluginInstance($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\ApiHub\V1\PluginInstance::class);
        $this->plugin_instance = $var;

        return $this;
    }

    /**
     * Optional. The list of fields to update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</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);
    }

    /**
     * Optional. The list of fields to update.
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 2 [(.google.api.field_behavior) = OPTIONAL];</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;
    }

}

