cloudbilling  v1
policy.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_POLICY_H_
31 #define GOOGLE_CLOUDBILLING_API_POLICY_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 #include "google/cloudbilling_api/audit_config.h"
40 #include "google/cloudbilling_api/binding.h"
41 
42 namespace Json {
43 class Value;
44 } // namespace Json
45 
46 namespace google_cloudbilling_api {
47 using namespace googleapis;
48 
135 class Policy : public client::JsonCppData {
136  public:
142  static Policy* New();
143 
149  explicit Policy(const Json::Value& storage);
150 
156  explicit Policy(Json::Value* storage);
157 
161  virtual ~Policy();
162 
168  const StringPiece GetTypeName() const {
169  return StringPiece("google_cloudbilling_api::Policy");
170  }
171 
177  bool has_audit_configs() const {
178  return Storage().isMember("auditConfigs");
179  }
180 
185  MutableStorage()->removeMember("auditConfigs");
186  }
187 
188 
192  const client::JsonCppArray<AuditConfig > get_audit_configs() const;
193 
202  client::JsonCppArray<AuditConfig > mutable_auditConfigs();
203 
209  bool has_bindings() const {
210  return Storage().isMember("bindings");
211  }
212 
216  void clear_bindings() {
217  MutableStorage()->removeMember("bindings");
218  }
219 
220 
224  const client::JsonCppArray<Binding > get_bindings() const;
225 
236  client::JsonCppArray<Binding > mutable_bindings();
237 
243  bool has_etag() const {
244  return Storage().isMember("etag");
245  }
246 
250  void clear_etag() {
251  MutableStorage()->removeMember("etag");
252  }
253 
254 
258  const StringPiece get_etag() const {
259  const Json::Value& v = Storage("etag");
260  if (v == Json::Value::null) return StringPiece("");
261  return StringPiece(v.asCString());
262  }
263 
287  void set_etag(const StringPiece& value) {
288  *MutableStorage("etag") = value.data();
289  }
290 
296  bool has_version() const {
297  return Storage().isMember("version");
298  }
299 
303  void clear_version() {
304  MutableStorage()->removeMember("version");
305  }
306 
307 
311  int32 get_version() const {
312  const Json::Value& storage = Storage("version");
313  return client::JsonValueToCppValueHelper<int32 >(storage);
314  }
315 
343  void set_version(int32 value) {
344  client::SetJsonValueFromCppValueHelper<int32 >(
345  value, MutableStorage("version"));
346  }
347 
348  private:
349  void operator=(const Policy&);
350 }; // Policy
351 } // namespace google_cloudbilling_api
352 #endif // GOOGLE_CLOUDBILLING_API_POLICY_H_
bool has_etag() const
Definition: policy.h:243
Definition: policy.h:135
void set_version(int32 value)
Definition: policy.h:343
void clear_audit_configs()
Definition: policy.h:184
const StringPiece GetTypeName() const
Definition: policy.h:168
const StringPiece get_etag() const
Definition: policy.h:258
bool has_bindings() const
Definition: policy.h:209
void clear_bindings()
Definition: policy.h:216
void clear_version()
Definition: policy.h:303
int32 get_version() const
Definition: policy.h:311
Definition: aggregation_info.h:39
void clear_etag()
Definition: policy.h:250
bool has_audit_configs() const
Definition: policy.h:177
bool has_version() const
Definition: policy.h:296
Definition: aggregation_info.cc:42
void set_etag(const StringPiece &value)
Definition: policy.h:287