<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/translate/v3/translation_service.proto

namespace Google\Cloud\Translate\V3;

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

/**
 * Request message for CreateGlossaryEntry
 *
 * Generated from protobuf message <code>google.cloud.translation.v3.CreateGlossaryEntryRequest</code>
 */
class CreateGlossaryEntryRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. The resource name of the glossary to create the entry under.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $parent = '';
    /**
     * Required. The glossary entry to create
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.GlossaryEntry glossary_entry = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $glossary_entry = null;

    /**
     * @param string                                   $parent        Required. The resource name of the glossary to create the entry under. Please see
     *                                                                {@see TranslationServiceClient::glossaryName()} for help formatting this field.
     * @param \Google\Cloud\Translate\V3\GlossaryEntry $glossaryEntry Required. The glossary entry to create
     *
     * @return \Google\Cloud\Translate\V3\CreateGlossaryEntryRequest
     *
     * @experimental
     */
    public static function build(string $parent, \Google\Cloud\Translate\V3\GlossaryEntry $glossaryEntry): self
    {
        return (new self())
            ->setParent($parent)
            ->setGlossaryEntry($glossaryEntry);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $parent
     *           Required. The resource name of the glossary to create the entry under.
     *     @type \Google\Cloud\Translate\V3\GlossaryEntry $glossary_entry
     *           Required. The glossary entry to create
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Translate\V3\TranslationService::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. The resource name of the glossary to create the entry under.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getParent()
    {
        return $this->parent;
    }

    /**
     * Required. The resource name of the glossary to create the entry under.
     *
     * Generated from protobuf field <code>string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setParent($var)
    {
        GPBUtil::checkString($var, True);
        $this->parent = $var;

        return $this;
    }

    /**
     * Required. The glossary entry to create
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.GlossaryEntry glossary_entry = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Translate\V3\GlossaryEntry|null
     */
    public function getGlossaryEntry()
    {
        return $this->glossary_entry;
    }

    public function hasGlossaryEntry()
    {
        return isset($this->glossary_entry);
    }

    public function clearGlossaryEntry()
    {
        unset($this->glossary_entry);
    }

    /**
     * Required. The glossary entry to create
     *
     * Generated from protobuf field <code>.google.cloud.translation.v3.GlossaryEntry glossary_entry = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Translate\V3\GlossaryEntry $var
     * @return $this
     */
    public function setGlossaryEntry($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Translate\V3\GlossaryEntry::class);
        $this->glossary_entry = $var;

        return $this;
    }

}

