cloudbilling  v1
money.h
1 // Copyright 2010 Google Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
13 // the License.
14 
15 // This code was generated by google-apis-code-generator 1.5.1
16 // Build date: 2018-10-08 17:45:39 UTC
17 // on: 2020-03-24, 00:22:17 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Cloud Billing API (cloudbilling/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 56
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_CLOUDBILLING_API_MONEY_H_
31 #define GOOGLE_CLOUDBILLING_API_MONEY_H_
32 
33 #include <string>
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"
38 
39 namespace Json {
40 class Value;
41 } // namespace Json
42 
43 namespace google_cloudbilling_api {
44 using namespace googleapis;
45 
51 class Money : public client::JsonCppData {
52  public:
58  static Money* New();
59 
65  explicit Money(const Json::Value& storage);
66 
72  explicit Money(Json::Value* storage);
73 
77  virtual ~Money();
78 
84  const StringPiece GetTypeName() const {
85  return StringPiece("google_cloudbilling_api::Money");
86  }
87 
93  bool has_currency_code() const {
94  return Storage().isMember("currencyCode");
95  }
96 
101  MutableStorage()->removeMember("currencyCode");
102  }
103 
104 
108  const StringPiece get_currency_code() const {
109  const Json::Value& v = Storage("currencyCode");
110  if (v == Json::Value::null) return StringPiece("");
111  return StringPiece(v.asCString());
112  }
113 
121  void set_currency_code(const StringPiece& value) {
122  *MutableStorage("currencyCode") = value.data();
123  }
124 
130  bool has_nanos() const {
131  return Storage().isMember("nanos");
132  }
133 
137  void clear_nanos() {
138  MutableStorage()->removeMember("nanos");
139  }
140 
141 
145  int32 get_nanos() const {
146  const Json::Value& storage = Storage("nanos");
147  return client::JsonValueToCppValueHelper<int32 >(storage);
148  }
149 
162  void set_nanos(int32 value) {
163  client::SetJsonValueFromCppValueHelper<int32 >(
164  value, MutableStorage("nanos"));
165  }
166 
172  bool has_units() const {
173  return Storage().isMember("units");
174  }
175 
179  void clear_units() {
180  MutableStorage()->removeMember("units");
181  }
182 
183 
187  int64 get_units() const {
188  const Json::Value& storage = Storage("units");
189  return client::JsonValueToCppValueHelper<int64 >(storage);
190  }
191 
200  void set_units(int64 value) {
201  client::SetJsonValueFromCppValueHelper<int64 >(
202  value, MutableStorage("units"));
203  }
204 
205  private:
206  void operator=(const Money&);
207 }; // Money
208 } // namespace google_cloudbilling_api
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
Definition: money.h:51
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