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

namespace Google\Cloud\DiscoveryEngine\V1beta;

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

/**
 * Request message for
 * [DocumentService.UpdateDocument][google.cloud.discoveryengine.v1beta.DocumentService.UpdateDocument]
 * method.
 *
 * Generated from protobuf message <code>google.cloud.discoveryengine.v1beta.UpdateDocumentRequest</code>
 */
class UpdateDocumentRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The document to update/create.
     * If the caller does not have permission to update the
     * [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
     * If the [Document][google.cloud.discoveryengine.v1beta.Document] to update
     * does not exist and
     * [allow_missing][google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing]
     * is not set, a `NOT_FOUND` error is returned.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.Document document = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $document = null;
    /**
     * If set to true, and the
     * [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a
     * new [Document][google.cloud.discoveryengine.v1beta.Document] will be
     * created.
     *
     * Generated from protobuf field <code>bool allow_missing = 2;</code>
     */
    protected $allow_missing = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\DiscoveryEngine\V1beta\Document $document
     *           Required. The document to update/create.
     *           If the caller does not have permission to update the
     *           [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
     *           whether or not it exists, a `PERMISSION_DENIED` error is returned.
     *           If the [Document][google.cloud.discoveryengine.v1beta.Document] to update
     *           does not exist and
     *           [allow_missing][google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing]
     *           is not set, a `NOT_FOUND` error is returned.
     *     @type bool $allow_missing
     *           If set to true, and the
     *           [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a
     *           new [Document][google.cloud.discoveryengine.v1beta.Document] will be
     *           created.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Discoveryengine\V1Beta\DocumentService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The document to update/create.
     * If the caller does not have permission to update the
     * [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
     * If the [Document][google.cloud.discoveryengine.v1beta.Document] to update
     * does not exist and
     * [allow_missing][google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing]
     * is not set, a `NOT_FOUND` error is returned.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.Document document = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\DiscoveryEngine\V1beta\Document|null
     */
    public function getDocument()
    {
        return $this->document;
    }

    public function hasDocument()
    {
        return isset($this->document);
    }

    public function clearDocument()
    {
        unset($this->document);
    }

    /**
     * Required. The document to update/create.
     * If the caller does not have permission to update the
     * [Document][google.cloud.discoveryengine.v1beta.Document], regardless of
     * whether or not it exists, a `PERMISSION_DENIED` error is returned.
     * If the [Document][google.cloud.discoveryengine.v1beta.Document] to update
     * does not exist and
     * [allow_missing][google.cloud.discoveryengine.v1beta.UpdateDocumentRequest.allow_missing]
     * is not set, a `NOT_FOUND` error is returned.
     *
     * Generated from protobuf field <code>.google.cloud.discoveryengine.v1beta.Document document = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\DiscoveryEngine\V1beta\Document $var
     * @return $this
     */
    public function setDocument($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\DiscoveryEngine\V1beta\Document::class);
        $this->document = $var;

        return $this;
    }

    /**
     * If set to true, and the
     * [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a
     * new [Document][google.cloud.discoveryengine.v1beta.Document] will be
     * created.
     *
     * Generated from protobuf field <code>bool allow_missing = 2;</code>
     * @return bool
     */
    public function getAllowMissing()
    {
        return $this->allow_missing;
    }

    /**
     * If set to true, and the
     * [Document][google.cloud.discoveryengine.v1beta.Document] is not found, a
     * new [Document][google.cloud.discoveryengine.v1beta.Document] will be
     * created.
     *
     * Generated from protobuf field <code>bool allow_missing = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setAllowMissing($var)
    {
        GPBUtil::checkBool($var);
        $this->allow_missing = $var;

        return $this;
    }

}

