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

namespace Google\Cloud\DiscoveryEngine\V1;

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

/**
 * Request message for
 * [SiteSearchEngineService.UpdateTargetSite][google.cloud.discoveryengine.v1.SiteSearchEngineService.UpdateTargetSite]
 * method.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1.UpdateTargetSiteRequest</code>
 */
class UpdateTargetSiteRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The target site to update.
     * If the caller does not have permission to update the
     * [TargetSite][google.cloud.discoveryengine.v1.TargetSite], regardless of
     * whether or not it exists, a PERMISSION_DENIED error is returned.
     * If the [TargetSite][google.cloud.discoveryengine.v1.TargetSite] to update
     * does not exist, a NOT_FOUND error is returned.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.TargetSite target_site = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $target_site = null;

    /**
     * @param \Google\Cloud\DiscoveryEngine\V1\TargetSite $targetSite Required. The target site to update.
     *                                                                If the caller does not have permission to update the
     *                                                                [TargetSite][google.cloud.discoveryengine.v1.TargetSite], regardless of
     *                                                                whether or not it exists, a PERMISSION_DENIED error is returned.
     *
     *                                                                If the [TargetSite][google.cloud.discoveryengine.v1.TargetSite] to update
     *                                                                does not exist, a NOT_FOUND error is returned.
     *
     * @return \Google\Cloud\DiscoveryEngine\V1\UpdateTargetSiteRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\DiscoveryEngine\V1\TargetSite $targetSite): self
    {
        return (new self())
            ->setTargetSite($targetSite);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DiscoveryEngine\V1\TargetSite $target_site
     *           Required. The target site to update.
     *           If the caller does not have permission to update the
     *           [TargetSite][google.cloud.discoveryengine.v1.TargetSite], regardless of
     *           whether or not it exists, a PERMISSION_DENIED error is returned.
     *           If the [TargetSite][google.cloud.discoveryengine.v1.TargetSite] to update
     *           does not exist, a NOT_FOUND error is returned.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1\SiteSearchEngineService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The target site to update.
     * If the caller does not have permission to update the
     * [TargetSite][google.cloud.discoveryengine.v1.TargetSite], regardless of
     * whether or not it exists, a PERMISSION_DENIED error is returned.
     * If the [TargetSite][google.cloud.discoveryengine.v1.TargetSite] to update
     * does not exist, a NOT_FOUND error is returned.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.TargetSite target_site = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\DiscoveryEngine\V1\TargetSite|null
     */
    public function getTargetSite()
    {
        return $this->target_site;
    }

    public function hasTargetSite()
    {
        return isset($this->target_site);
    }

    public function clearTargetSite()
    {
        unset($this->target_site);
    }

    /**
     * Required. The target site to update.
     * If the caller does not have permission to update the
     * [TargetSite][google.cloud.discoveryengine.v1.TargetSite], regardless of
     * whether or not it exists, a PERMISSION_DENIED error is returned.
     * If the [TargetSite][google.cloud.discoveryengine.v1.TargetSite] to update
     * does not exist, a NOT_FOUND error is returned.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1.TargetSite target_site = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\DiscoveryEngine\V1\TargetSite $var
     * @return $this
     */
    public function setTargetSite($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1\TargetSite::class);
        $this->target_site = $var;

        return $this;
    }

}

