30 #ifndef GOOGLE_CLOUDBILLING_API_MONEY_H_ 31 #define GOOGLE_CLOUDBILLING_API_MONEY_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" 51 class Money :
public client::JsonCppData {
65 explicit Money(
const Json::Value& storage);
72 explicit Money(Json::Value* storage);
85 return StringPiece(
"google_cloudbilling_api::Money");
94 return Storage().isMember(
"currencyCode");
101 MutableStorage()->removeMember(
"currencyCode");
109 const Json::Value& v = Storage(
"currencyCode");
110 if (v == Json::Value::null)
return StringPiece(
"");
111 return StringPiece(v.asCString());
122 *MutableStorage(
"currencyCode") = value.data();
131 return Storage().isMember(
"nanos");
138 MutableStorage()->removeMember(
"nanos");
146 const Json::Value& storage = Storage(
"nanos");
147 return client::JsonValueToCppValueHelper<int32 >(storage);
163 client::SetJsonValueFromCppValueHelper<int32 >(
164 value, MutableStorage(
"nanos"));
173 return Storage().isMember(
"units");
180 MutableStorage()->removeMember(
"units");
188 const Json::Value& storage = Storage(
"units");
189 return client::JsonValueToCppValueHelper<int64 >(storage);
201 client::SetJsonValueFromCppValueHelper<int64 >(
202 value, MutableStorage(
"units"));
206 void operator=(
const Money&);
209 #endif // GOOGLE_CLOUDBILLING_API_MONEY_H_ void set_nanos(int32 value)
Definition: money.h:162
void clear_currency_code()
Definition: money.h:100
void set_currency_code(const StringPiece &value)
Definition: money.h:121
int64 get_units() const
Definition: money.h:187
void clear_nanos()
Definition: money.h:137
bool has_units() const
Definition: money.h:172
bool has_currency_code() const
Definition: money.h:93
void clear_units()
Definition: money.h:179
Definition: aggregation_info.h:39
int32 get_nanos() const
Definition: money.h:145
const StringPiece GetTypeName() const
Definition: money.h:84
const StringPiece get_currency_code() const
Definition: money.h:108
bool has_nanos() const
Definition: money.h:130
void set_units(int64 value)
Definition: money.h:200
Definition: aggregation_info.cc:42