30 #ifndef GOOGLE_DATAFLOW_API_STATUS_H_ 31 #define GOOGLE_DATAFLOW_API_STATUS_H_ 34 #include "googleapis/base/integral_types.h" 35 #include "googleapis/base/macros.h" 36 #include "googleapis/client/data/jsoncpp_data.h" 37 #include "googleapis/strings/stringpiece.h" 57 class Status :
public client::JsonCppData {
71 explicit Status(
const Json::Value& storage);
78 explicit Status(Json::Value* storage);
91 return StringPiece(
"google_dataflow_api::Status");
100 return Storage().isMember(
"code");
107 MutableStorage()->removeMember(
"code");
115 const Json::Value& storage = Storage(
"code");
116 return client::JsonValueToCppValueHelper<int32 >(storage);
127 client::SetJsonValueFromCppValueHelper<int32 >(
128 value, MutableStorage(
"code"));
137 return Storage().isMember(
"details");
144 MutableStorage()->removeMember(
"details");
151 const client::JsonCppArray<client::JsonCppAssociativeArray<client::JsonCppData > >
get_details()
const {
152 const Json::Value& storage = Storage(
"details");
153 return client::JsonValueToCppValueHelper<client::JsonCppArray<client::JsonCppAssociativeArray<client::JsonCppData > > >(storage);
164 client::JsonCppArray<client::JsonCppAssociativeArray<client::JsonCppData > >
mutable_details() {
165 Json::Value* storage = MutableStorage(
"details");
166 return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<client::JsonCppAssociativeArray<client::JsonCppData > > >(storage);
175 return Storage().isMember(
"message");
182 MutableStorage()->removeMember(
"message");
190 const Json::Value& v = Storage(
"message");
191 if (v == Json::Value::null)
return StringPiece(
"");
192 return StringPiece(v.asCString());
205 *MutableStorage(
"message") = value.data();
209 void operator=(
const Status&);
212 #endif // GOOGLE_DATAFLOW_API_STATUS_H_ bool has_code() const
Definition: status.h:99
client::JsonCppArray< client::JsonCppAssociativeArray< client::JsonCppData > > mutable_details()
Definition: status.h:164
bool has_message() const
Definition: status.h:174
const StringPiece GetTypeName() const
Definition: status.h:90
void clear_details()
Definition: status.h:143
int32 get_code() const
Definition: status.h:114
void set_code(int32 value)
Definition: status.h:126
Definition: approximate_progress.h:40
void clear_code()
Definition: status.h:106
bool has_details() const
Definition: status.h:136
Definition: approximate_progress.cc:42
const StringPiece get_message() const
Definition: status.h:189
void clear_message()
Definition: status.h:181
const client::JsonCppArray< client::JsonCppAssociativeArray< client::JsonCppData > > get_details() const
Definition: status.h:151
void set_message(const StringPiece &value)
Definition: status.h:204