Reads a JSON value with the given name from a parent JSON value.
| 229 | |
| 230 | /// Reads a JSON value with the given name from a parent JSON value. |
| 231 | Status GetValue(const Json::Value& parent, const char* name, |
| 232 | Json::Value* result) { |
| 233 | *result = parent.get(name, Json::Value::null); |
| 234 | if (result->isNull()) { |
| 235 | return errors::Internal("The field '", name, |
| 236 | "' was expected in the JSON response."); |
| 237 | } |
| 238 | return Status::OK(); |
| 239 | } |
| 240 | |
| 241 | /// Reads a string JSON value with the given name from a parent JSON value. |
| 242 | Status GetStringValue(const Json::Value& parent, const char* name, |
no test coverage detected