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

namespace Google\Cloud\TextToSpeech\V1;

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

/**
 * Pronunciation customization for a phrase.
 *
 * Generated from protobuf message <code>google.cloud.texttospeech.v1.CustomPronunciationParams</code>
 */
class CustomPronunciationParams extends \Google\Protobuf\Internal\Message
{
    /**
     * The phrase to which the customization will be applied.
     * The phrase can be multiple words (in the case of proper nouns etc), but
     * should not span to a whole sentence.
     *
     * Generated from protobuf field <code>optional string phrase = 1;</code>
     */
    private $phrase = null;
    /**
     * The phonetic encoding of the phrase.
     *
     * Generated from protobuf field <code>optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2;</code>
     */
    private $phonetic_encoding = null;
    /**
     * The pronunciation of the phrase. This must be in the phonetic encoding
     * specified above.
     *
     * Generated from protobuf field <code>optional string pronunciation = 3;</code>
     */
    private $pronunciation = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $phrase
     *           The phrase to which the customization will be applied.
     *           The phrase can be multiple words (in the case of proper nouns etc), but
     *           should not span to a whole sentence.
     *     @type int $phonetic_encoding
     *           The phonetic encoding of the phrase.
     *     @type string $pronunciation
     *           The pronunciation of the phrase. This must be in the phonetic encoding
     *           specified above.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Texttospeech\V1\CloudTts::initOnce();
        parent::__construct($data);
    }

    /**
     * The phrase to which the customization will be applied.
     * The phrase can be multiple words (in the case of proper nouns etc), but
     * should not span to a whole sentence.
     *
     * Generated from protobuf field <code>optional string phrase = 1;</code>
     * @return string
     */
    public function getPhrase()
    {
        return isset($this->phrase) ? $this->phrase : '';
    }

    public function hasPhrase()
    {
        return isset($this->phrase);
    }

    public function clearPhrase()
    {
        unset($this->phrase);
    }

    /**
     * The phrase to which the customization will be applied.
     * The phrase can be multiple words (in the case of proper nouns etc), but
     * should not span to a whole sentence.
     *
     * Generated from protobuf field <code>optional string phrase = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPhrase($var)
    {
        GPBUtil::checkString($var, True);
        $this->phrase = $var;

        return $this;
    }

    /**
     * The phonetic encoding of the phrase.
     *
     * Generated from protobuf field <code>optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2;</code>
     * @return int
     */
    public function getPhoneticEncoding()
    {
        return isset($this->phonetic_encoding) ? $this->phonetic_encoding : 0;
    }

    public function hasPhoneticEncoding()
    {
        return isset($this->phonetic_encoding);
    }

    public function clearPhoneticEncoding()
    {
        unset($this->phonetic_encoding);
    }

    /**
     * The phonetic encoding of the phrase.
     *
     * Generated from protobuf field <code>optional .google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding phonetic_encoding = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setPhoneticEncoding($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams\PhoneticEncoding::class);
        $this->phonetic_encoding = $var;

        return $this;
    }

    /**
     * The pronunciation of the phrase. This must be in the phonetic encoding
     * specified above.
     *
     * Generated from protobuf field <code>optional string pronunciation = 3;</code>
     * @return string
     */
    public function getPronunciation()
    {
        return isset($this->pronunciation) ? $this->pronunciation : '';
    }

    public function hasPronunciation()
    {
        return isset($this->pronunciation);
    }

    public function clearPronunciation()
    {
        unset($this->pronunciation);
    }

    /**
     * The pronunciation of the phrase. This must be in the phonetic encoding
     * specified above.
     *
     * Generated from protobuf field <code>optional string pronunciation = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setPronunciation($var)
    {
        GPBUtil::checkString($var, True);
        $this->pronunciation = $var;

        return $this;
    }

}

