diff --git a/Dialogflow/metadata/V2/Agent.php b/Dialogflow/metadata/V2/Agent.php index 32a1d6602e0b..e4883ad04b35 100644 --- a/Dialogflow/metadata/V2/Agent.php +++ b/Dialogflow/metadata/V2/Agent.php @@ -94,7 +94,7 @@ public static function initOnce() { "75642f6469616c6f67666c6f772f76323b6469616c6f67666c6f77f80101" . "a202024446aa021a476f6f676c652e436c6f75642e4469616c6f67666c6f" . "772e5632620670726f746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/Dialogflow/metadata/V2/Context.php b/Dialogflow/metadata/V2/Context.php index a705f2073d0a..389b24ae5ea7 100644 --- a/Dialogflow/metadata/V2/Context.php +++ b/Dialogflow/metadata/V2/Context.php @@ -85,7 +85,7 @@ public static function initOnce() { "6c6f67666c6f772f76323b6469616c6f67666c6f77f80101a202024446aa" . "021a476f6f676c652e436c6f75642e4469616c6f67666c6f772e56326206" . "70726f746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/Dialogflow/metadata/V2/EntityType.php b/Dialogflow/metadata/V2/EntityType.php index 4b086ff98c30..36fe99276c06 100644 --- a/Dialogflow/metadata/V2/EntityType.php +++ b/Dialogflow/metadata/V2/EntityType.php @@ -159,7 +159,7 @@ public static function initOnce() { "69732f636c6f75642f6469616c6f67666c6f772f76323b6469616c6f6766" . "6c6f77f80101a202024446aa021a476f6f676c652e436c6f75642e446961" . "6c6f67666c6f772e5632620670726f746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/Dialogflow/metadata/V2/Intent.php b/Dialogflow/metadata/V2/Intent.php index 81e9a5ae97bc..5073380f0899 100644 --- a/Dialogflow/metadata/V2/Intent.php +++ b/Dialogflow/metadata/V2/Intent.php @@ -260,7 +260,7 @@ public static function initOnce() { "2f6469616c6f67666c6f772f76323b6469616c6f67666c6f77f80101a202" . "024446aa021a476f6f676c652e436c6f75642e4469616c6f67666c6f772e" . "5632620670726f746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/Dialogflow/metadata/V2/Session.php b/Dialogflow/metadata/V2/Session.php index e95ac8c6d789..47eb9ed1764a 100644 --- a/Dialogflow/metadata/V2/Session.php +++ b/Dialogflow/metadata/V2/Session.php @@ -139,7 +139,7 @@ public static function initOnce() { "617069732f636c6f75642f6469616c6f67666c6f772f76323b6469616c6f" . "67666c6f77f80101a202024446aa021a476f6f676c652e436c6f75642e44" . "69616c6f67666c6f772e5632620670726f746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/Dialogflow/metadata/V2/SessionEntityType.php b/Dialogflow/metadata/V2/SessionEntityType.php index b59696f173f6..7560f404a26b 100644 --- a/Dialogflow/metadata/V2/SessionEntityType.php +++ b/Dialogflow/metadata/V2/SessionEntityType.php @@ -98,7 +98,7 @@ public static function initOnce() { "2f636c6f75642f6469616c6f67666c6f772f76323b6469616c6f67666c6f" . "77f80101a202024446aa021a476f6f676c652e436c6f75642e4469616c6f" . "67666c6f772e5632620670726f746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/Dialogflow/metadata/V2/Webhook.php b/Dialogflow/metadata/V2/Webhook.php index 669500ca8f9f..919a7b6d332d 100644 --- a/Dialogflow/metadata/V2/Webhook.php +++ b/Dialogflow/metadata/V2/Webhook.php @@ -54,7 +54,7 @@ public static function initOnce() { "617069732f636c6f75642f6469616c6f67666c6f772f76323b6469616c6f" . "67666c6f77f80101a202024446aa021a476f6f676c652e436c6f75642e44" . "69616c6f67666c6f772e5632620670726f746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/Dialogflow/src/V2/Agent/MatchMode.php b/Dialogflow/src/V2/Agent/MatchMode.php index 11c4be8ee583..1e30c2c3c2bf 100644 --- a/Dialogflow/src/V2/Agent/MatchMode.php +++ b/Dialogflow/src/V2/Agent/MatchMode.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2\Agent; +use UnexpectedValueException; + /** * Match mode determines how intents are detected from user queries. * @@ -31,6 +33,32 @@ class MatchMode * Generated from protobuf enum MATCH_MODE_ML_ONLY = 2; */ const MATCH_MODE_ML_ONLY = 2; + + private static $valueToName = [ + self::MATCH_MODE_UNSPECIFIED => 'MATCH_MODE_UNSPECIFIED', + self::MATCH_MODE_HYBRID => 'MATCH_MODE_HYBRID', + self::MATCH_MODE_ML_ONLY => 'MATCH_MODE_ML_ONLY', + ]; + + 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. diff --git a/Dialogflow/src/V2/AudioEncoding.php b/Dialogflow/src/V2/AudioEncoding.php index de817a1f20a6..1329f523f94f 100644 --- a/Dialogflow/src/V2/AudioEncoding.php +++ b/Dialogflow/src/V2/AudioEncoding.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2; +use UnexpectedValueException; + /** * Audio encoding of the audio content sent in the conversational query request. * Refer to the [Cloud Speech API documentation](/speech/docs/basics) for more @@ -79,5 +81,36 @@ class AudioEncoding * Generated from protobuf enum AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; */ const AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; + + private static $valueToName = [ + self::AUDIO_ENCODING_UNSPECIFIED => 'AUDIO_ENCODING_UNSPECIFIED', + self::AUDIO_ENCODING_LINEAR_16 => 'AUDIO_ENCODING_LINEAR_16', + self::AUDIO_ENCODING_FLAC => 'AUDIO_ENCODING_FLAC', + self::AUDIO_ENCODING_MULAW => 'AUDIO_ENCODING_MULAW', + self::AUDIO_ENCODING_AMR => 'AUDIO_ENCODING_AMR', + self::AUDIO_ENCODING_AMR_WB => 'AUDIO_ENCODING_AMR_WB', + self::AUDIO_ENCODING_OGG_OPUS => 'AUDIO_ENCODING_OGG_OPUS', + self::AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE => 'AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE', + ]; + + 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); + } } diff --git a/Dialogflow/src/V2/EntityType/AutoExpansionMode.php b/Dialogflow/src/V2/EntityType/AutoExpansionMode.php index 39ada3360492..77ac68085257 100644 --- a/Dialogflow/src/V2/EntityType/AutoExpansionMode.php +++ b/Dialogflow/src/V2/EntityType/AutoExpansionMode.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2\EntityType; +use UnexpectedValueException; + /** * Represents different entity type expansion modes. Automated expansion * allows an agent to recognize values that have not been explicitly listed in @@ -26,6 +28,31 @@ class AutoExpansionMode * Generated from protobuf enum AUTO_EXPANSION_MODE_DEFAULT = 1; */ const AUTO_EXPANSION_MODE_DEFAULT = 1; + + private static $valueToName = [ + self::AUTO_EXPANSION_MODE_UNSPECIFIED => 'AUTO_EXPANSION_MODE_UNSPECIFIED', + self::AUTO_EXPANSION_MODE_DEFAULT => 'AUTO_EXPANSION_MODE_DEFAULT', + ]; + + 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. diff --git a/Dialogflow/src/V2/EntityType/Kind.php b/Dialogflow/src/V2/EntityType/Kind.php index c35e6a189516..66b7261a3796 100644 --- a/Dialogflow/src/V2/EntityType/Kind.php +++ b/Dialogflow/src/V2/EntityType/Kind.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2\EntityType; +use UnexpectedValueException; + /** * Represents kinds of entities. * @@ -32,6 +34,32 @@ class Kind * Generated from protobuf enum KIND_LIST = 2; */ const KIND_LIST = 2; + + private static $valueToName = [ + self::KIND_UNSPECIFIED => 'KIND_UNSPECIFIED', + self::KIND_MAP => 'KIND_MAP', + self::KIND_LIST => 'KIND_LIST', + ]; + + 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. diff --git a/Dialogflow/src/V2/Intent/Message/Platform.php b/Dialogflow/src/V2/Intent/Message/Platform.php index 5076d01a626f..003d85d30c88 100644 --- a/Dialogflow/src/V2/Intent/Message/Platform.php +++ b/Dialogflow/src/V2/Intent/Message/Platform.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2\Intent\Message; +use UnexpectedValueException; + /** * Represents different platforms that a rich message can be intended for. * @@ -125,6 +127,38 @@ class Platform * Generated from protobuf enum ACTIONS_ON_GOOGLE = 8; */ const ACTIONS_ON_GOOGLE = 8; + + private static $valueToName = [ + self::PLATFORM_UNSPECIFIED => 'PLATFORM_UNSPECIFIED', + self::FACEBOOK => 'FACEBOOK', + self::SLACK => 'SLACK', + self::TELEGRAM => 'TELEGRAM', + self::KIK => 'KIK', + self::SKYPE => 'SKYPE', + self::LINE => 'LINE', + self::VIBER => 'VIBER', + self::ACTIONS_ON_GOOGLE => 'ACTIONS_ON_GOOGLE', + ]; + + 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. diff --git a/Dialogflow/src/V2/Intent/TrainingPhrase/Type.php b/Dialogflow/src/V2/Intent/TrainingPhrase/Type.php index d530b5e021f5..85578c2ff950 100644 --- a/Dialogflow/src/V2/Intent/TrainingPhrase/Type.php +++ b/Dialogflow/src/V2/Intent/TrainingPhrase/Type.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2\Intent\TrainingPhrase; +use UnexpectedValueException; + /** * Represents different types of training phrases. * @@ -31,6 +33,32 @@ class Type * Generated from protobuf enum TEMPLATE = 2; */ const TEMPLATE = 2; + + private static $valueToName = [ + self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED', + self::EXAMPLE => 'EXAMPLE', + self::TEMPLATE => 'TEMPLATE', + ]; + + 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. diff --git a/Dialogflow/src/V2/Intent/WebhookState.php b/Dialogflow/src/V2/Intent/WebhookState.php index ad804207b6ba..7282b5d28d99 100644 --- a/Dialogflow/src/V2/Intent/WebhookState.php +++ b/Dialogflow/src/V2/Intent/WebhookState.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2\Intent; +use UnexpectedValueException; + /** * Represents the different states that webhooks can be in. * @@ -30,6 +32,32 @@ class WebhookState * Generated from protobuf enum WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2; */ const WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2; + + private static $valueToName = [ + self::WEBHOOK_STATE_UNSPECIFIED => 'WEBHOOK_STATE_UNSPECIFIED', + self::WEBHOOK_STATE_ENABLED => 'WEBHOOK_STATE_ENABLED', + self::WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING => 'WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING', + ]; + + 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. diff --git a/Dialogflow/src/V2/IntentView.php b/Dialogflow/src/V2/IntentView.php index e5c15f114be4..916e50e6b7db 100644 --- a/Dialogflow/src/V2/IntentView.php +++ b/Dialogflow/src/V2/IntentView.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2; +use UnexpectedValueException; + /** * Represents the options for views of an intent. * An intent can be a sizable object. Therefore, we provide a resource view that @@ -25,5 +27,30 @@ class IntentView * Generated from protobuf enum INTENT_VIEW_FULL = 1; */ const INTENT_VIEW_FULL = 1; + + private static $valueToName = [ + self::INTENT_VIEW_UNSPECIFIED => 'INTENT_VIEW_UNSPECIFIED', + self::INTENT_VIEW_FULL => 'INTENT_VIEW_FULL', + ]; + + 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); + } } diff --git a/Dialogflow/src/V2/SessionEntityType/EntityOverrideMode.php b/Dialogflow/src/V2/SessionEntityType/EntityOverrideMode.php index af553004ed2b..af5a026dbdda 100644 --- a/Dialogflow/src/V2/SessionEntityType/EntityOverrideMode.php +++ b/Dialogflow/src/V2/SessionEntityType/EntityOverrideMode.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2\SessionEntityType; +use UnexpectedValueException; + /** * The types of modifications for a session entity type. * @@ -35,6 +37,32 @@ class EntityOverrideMode * Generated from protobuf enum ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; */ const ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2; + + private static $valueToName = [ + self::ENTITY_OVERRIDE_MODE_UNSPECIFIED => 'ENTITY_OVERRIDE_MODE_UNSPECIFIED', + self::ENTITY_OVERRIDE_MODE_OVERRIDE => 'ENTITY_OVERRIDE_MODE_OVERRIDE', + self::ENTITY_OVERRIDE_MODE_SUPPLEMENT => 'ENTITY_OVERRIDE_MODE_SUPPLEMENT', + ]; + + 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. diff --git a/Dialogflow/src/V2/StreamingRecognitionResult/MessageType.php b/Dialogflow/src/V2/StreamingRecognitionResult/MessageType.php index 1e48b773d846..91db6b179001 100644 --- a/Dialogflow/src/V2/StreamingRecognitionResult/MessageType.php +++ b/Dialogflow/src/V2/StreamingRecognitionResult/MessageType.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Dialogflow\V2\StreamingRecognitionResult; +use UnexpectedValueException; + /** * Type of the response message. * @@ -35,6 +37,32 @@ class MessageType * Generated from protobuf enum END_OF_SINGLE_UTTERANCE = 2; */ const END_OF_SINGLE_UTTERANCE = 2; + + private static $valueToName = [ + self::MESSAGE_TYPE_UNSPECIFIED => 'MESSAGE_TYPE_UNSPECIFIED', + self::TRANSCRIPT => 'TRANSCRIPT', + self::END_OF_SINGLE_UTTERANCE => 'END_OF_SINGLE_UTTERANCE', + ]; + + 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. diff --git a/Dialogflow/synth.metadata b/Dialogflow/synth.metadata index f64db519b816..24e496bd2929 100644 --- a/Dialogflow/synth.metadata +++ b/Dialogflow/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-28T10:00:21.107191Z", + "updateTime": "2019-03-29T10:00:11.614693Z", "sources": [ { "generator": { "name": "artman", - "version": "0.16.20", - "dockerImage": "googleapis/artman@sha256:e3c054a2fb85a12481c722af616c7fb6f1d02d862248385eecbec3e4240ebd1e" + "version": "0.16.21", + "dockerImage": "googleapis/artman@sha256:854131ec1af7b3a313253474c24748dc0acd217a58a0b74dbfb559f340a15d78" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "6a84b3267b0a95e922608b9891219075047eee29", - "internalRef": "240640999" + "sha": "37386f1ebcaed51bcb7d15d00124d22c38606e45", + "internalRef": "240841842" } } ],