diff --git a/metadata/V2/Controller.php b/metadata/V2/Controller.php index dbf94ed..3ceb171 100644 --- a/metadata/V2/Controller.php +++ b/metadata/V2/Controller.php @@ -72,7 +72,7 @@ public static function initOnce() { "65627567676572aa0218476f6f676c652e436c6f75642e44656275676765" . "722e5632ca0218476f6f676c655c436c6f75645c44656275676765725c56" . "32620670726f746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/metadata/V2/Data.php b/metadata/V2/Data.php index bdcc0eb..2937e84 100644 --- a/metadata/V2/Data.php +++ b/metadata/V2/Data.php @@ -113,7 +113,7 @@ public static function initOnce() { "01aa0218476f6f676c652e436c6f75642e44656275676765722e5632ca02" . "18476f6f676c655c436c6f75645c44656275676765725c5632620670726f" . "746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/metadata/V2/Debugger.php b/metadata/V2/Debugger.php index b11960c..3e9bc84 100644 --- a/metadata/V2/Debugger.php +++ b/metadata/V2/Debugger.php @@ -101,7 +101,7 @@ public static function initOnce() { "676765722f76323b636c6f75646465627567676572aa0218476f6f676c65" . "2e436c6f75642e44656275676765722e5632ca0218476f6f676c655c436c" . "6f75645c44656275676765725c5632620670726f746f33" - )); + ), true); static::$is_initialized = true; } diff --git a/src/V2/Breakpoint/Action.php b/src/V2/Breakpoint/Action.php index 5186650..5d6b5da 100644 --- a/src/V2/Breakpoint/Action.php +++ b/src/V2/Breakpoint/Action.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Debugger\V2\Breakpoint; +use UnexpectedValueException; + /** * Actions that can be taken when a breakpoint hits. * Agents should reject breakpoints with unsupported or unknown action values. @@ -27,6 +29,31 @@ class Action * Generated from protobuf enum LOG = 1; */ const LOG = 1; + + private static $valueToName = [ + self::CAPTURE => 'CAPTURE', + self::LOG => 'LOG', + ]; + + 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/src/V2/Breakpoint/LogLevel.php b/src/V2/Breakpoint/LogLevel.php index 6b20a83..29e4052 100644 --- a/src/V2/Breakpoint/LogLevel.php +++ b/src/V2/Breakpoint/LogLevel.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Debugger\V2\Breakpoint; +use UnexpectedValueException; + /** * Log severity levels. * @@ -29,6 +31,32 @@ class LogLevel * Generated from protobuf enum ERROR = 2; */ const ERROR = 2; + + private static $valueToName = [ + self::INFO => 'INFO', + self::WARNING => 'WARNING', + self::ERROR => 'ERROR', + ]; + + 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/src/V2/StatusMessage/Reference.php b/src/V2/StatusMessage/Reference.php index 851c2e6..e7ac49f 100644 --- a/src/V2/StatusMessage/Reference.php +++ b/src/V2/StatusMessage/Reference.php @@ -4,6 +4,8 @@ namespace Google\Cloud\Debugger\V2\StatusMessage; +use UnexpectedValueException; + /** * Enumerates references to which the message applies. * @@ -53,6 +55,36 @@ class Reference * Generated from protobuf enum VARIABLE_VALUE = 6; */ const VARIABLE_VALUE = 6; + + private static $valueToName = [ + self::UNSPECIFIED => 'UNSPECIFIED', + self::BREAKPOINT_SOURCE_LOCATION => 'BREAKPOINT_SOURCE_LOCATION', + self::BREAKPOINT_CONDITION => 'BREAKPOINT_CONDITION', + self::BREAKPOINT_EXPRESSION => 'BREAKPOINT_EXPRESSION', + self::BREAKPOINT_AGE => 'BREAKPOINT_AGE', + self::VARIABLE_NAME => 'VARIABLE_NAME', + self::VARIABLE_VALUE => 'VARIABLE_VALUE', + ]; + + 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/src/V2/Variable.php b/src/V2/Variable.php index 08441af..472e30f 100644 --- a/src/V2/Variable.php +++ b/src/V2/Variable.php @@ -317,6 +317,22 @@ public function getVarTableIndex() return $this->var_table_index; } + /** + * Returns the unboxed value from getVarTableIndex() + + * Reference to a variable in the shared variable table. More than + * one variable can reference the same variable in the table. The + * `var_table_index` field is an index into `variable_table` in Breakpoint. + * + * Generated from protobuf field .google.protobuf.Int32Value var_table_index = 4; + * @return int|null + */ + public function getVarTableIndexValue() + { + $wrapper = $this->getVarTableIndex(); + return is_null($wrapper) ? null : $wrapper->getValue(); + } + /** * Reference to a variable in the shared variable table. More than * one variable can reference the same variable in the table. The @@ -334,6 +350,23 @@ public function setVarTableIndex($var) return $this; } + /** + * Sets the field by wrapping a primitive type in a Google\Protobuf\Int32Value object. + + * Reference to a variable in the shared variable table. More than + * one variable can reference the same variable in the table. The + * `var_table_index` field is an index into `variable_table` in Breakpoint. + * + * Generated from protobuf field .google.protobuf.Int32Value var_table_index = 4; + * @param int|null $var + * @return $this + */ + public function setVarTableIndexValue($var) + { + $wrappedVar = is_null($var) ? null : new \Google\Protobuf\Int32Value(['value' => $var]); + return $this->setVarTableIndex($wrappedVar); + } + /** * Status associated with the variable. This field will usually stay * unset. A status of a single variable only applies to that variable or diff --git a/synth.metadata b/synth.metadata index 26eb0d5..70e3efd 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,19 +1,19 @@ { - "updateTime": "2019-03-28T09:59:59.062664Z", + "updateTime": "2019-03-29T09:59:52.525827Z", "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" } } ],