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

namespace Google\Cloud\TextToSpeech\V1\CustomPronunciationParams;

use UnexpectedValueException;

/**
 * The phonetic encoding of the phrase.
 *
 * Protobuf type <code>google.cloud.texttospeech.v1.CustomPronunciationParams.PhoneticEncoding</code>
 */
class PhoneticEncoding
{
    /**
     * Not specified.
     *
     * Generated from protobuf enum <code>PHONETIC_ENCODING_UNSPECIFIED = 0;</code>
     */
    const PHONETIC_ENCODING_UNSPECIFIED = 0;
    /**
     * IPA. (e.g. apple -> ˈæpəl )
     * https://en.wikipedia.org/wiki/International_Phonetic_Alphabet
     *
     * Generated from protobuf enum <code>PHONETIC_ENCODING_IPA = 1;</code>
     */
    const PHONETIC_ENCODING_IPA = 1;
    /**
     * X-SAMPA (e.g. apple -> "{p&#64;l" )
     * https://en.wikipedia.org/wiki/X-SAMPA
     *
     * Generated from protobuf enum <code>PHONETIC_ENCODING_X_SAMPA = 2;</code>
     */
    const PHONETIC_ENCODING_X_SAMPA = 2;

    private static $valueToName = [
        self::PHONETIC_ENCODING_UNSPECIFIED => 'PHONETIC_ENCODING_UNSPECIFIED',
        self::PHONETIC_ENCODING_IPA => 'PHONETIC_ENCODING_IPA',
        self::PHONETIC_ENCODING_X_SAMPA => 'PHONETIC_ENCODING_X_SAMPA',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(PhoneticEncoding::class, \Google\Cloud\TextToSpeech\V1\CustomPronunciationParams_PhoneticEncoding::class);

