storage  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-14, 18:33:41 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 Storage JSON API (storage/v1)
24 // Generated from:
25 // Version: v1
26 // Revision: 171
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_STORAGE_API_POLICY_H_
31 #define GOOGLE_STORAGE_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/storage_api/expr.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_storage_api {
46 using namespace googleapis;
47 
53 class Policy : public client::JsonCppData {
54  public:
60  class PolicyBindings : public client::JsonCppData {
61  public:
67  static PolicyBindings* New();
68 
74  explicit PolicyBindings(const Json::Value& storage);
75 
81  explicit PolicyBindings(Json::Value* storage);
82 
86  virtual ~PolicyBindings();
87 
93  const StringPiece GetTypeName() const {
94  return StringPiece("google_storage_api::PolicyBindings");
95  }
96 
102  bool has_condition() const {
103  return Storage().isMember("condition");
104  }
105 
110  MutableStorage()->removeMember("condition");
111  }
112 
113 
117  const Expr get_condition() const;
118 
129  Expr mutable_condition();
130 
136  bool has_members() const {
137  return Storage().isMember("members");
138  }
139 
143  void clear_members() {
144  MutableStorage()->removeMember("members");
145  }
146 
147 
151  const client::JsonCppArray<string > get_members() const {
152  const Json::Value& storage = Storage("members");
153  return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
154  }
155 
193  client::JsonCppArray<string > mutable_members() {
194  Json::Value* storage = MutableStorage("members");
195  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
196  }
197 
203  bool has_role() const {
204  return Storage().isMember("role");
205  }
206 
210  void clear_role() {
211  MutableStorage()->removeMember("role");
212  }
213 
214 
218  const StringPiece get_role() const {
219  const Json::Value& v = Storage("role");
220  if (v == Json::Value::null) return StringPiece("");
221  return StringPiece(v.asCString());
222  }
223 
255  void set_role(const StringPiece& value) {
256  *MutableStorage("role") = value.data();
257  }
258 
259  private:
260  void operator=(const PolicyBindings&);
261  }; // PolicyBindings
267  static Policy* New();
268 
274  explicit Policy(const Json::Value& storage);
275 
281  explicit Policy(Json::Value* storage);
282 
286  virtual ~Policy();
287 
293  const StringPiece GetTypeName() const {
294  return StringPiece("google_storage_api::Policy");
295  }
296 
302  bool has_bindings() const {
303  return Storage().isMember("bindings");
304  }
305 
309  void clear_bindings() {
310  MutableStorage()->removeMember("bindings");
311  }
312 
313 
317  const client::JsonCppArray<PolicyBindings > get_bindings() const {
318  const Json::Value& storage = Storage("bindings");
319  return client::JsonValueToCppValueHelper<client::JsonCppArray<PolicyBindings > >(storage);
320  }
321 
331  client::JsonCppArray<PolicyBindings > mutable_bindings() {
332  Json::Value* storage = MutableStorage("bindings");
333  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<PolicyBindings > >(storage);
334  }
335 
341  bool has_etag() const {
342  return Storage().isMember("etag");
343  }
344 
348  void clear_etag() {
349  MutableStorage()->removeMember("etag");
350  }
351 
352 
356  const StringPiece get_etag() const {
357  const Json::Value& v = Storage("etag");
358  if (v == Json::Value::null) return StringPiece("");
359  return StringPiece(v.asCString());
360  }
361 
369  void set_etag(const StringPiece& value) {
370  *MutableStorage("etag") = value.data();
371  }
372 
378  bool has_kind() const {
379  return Storage().isMember("kind");
380  }
381 
385  void clear_kind() {
386  MutableStorage()->removeMember("kind");
387  }
388 
389 
393  const StringPiece get_kind() const {
394  const Json::Value& v = Storage("kind");
395  if (v == Json::Value::null) return StringPiece("");
396  return StringPiece(v.asCString());
397  }
398 
407  void set_kind(const StringPiece& value) {
408  *MutableStorage("kind") = value.data();
409  }
410 
416  bool has_resource_id() const {
417  return Storage().isMember("resourceId");
418  }
419 
424  MutableStorage()->removeMember("resourceId");
425  }
426 
427 
431  const StringPiece get_resource_id() const {
432  const Json::Value& v = Storage("resourceId");
433  if (v == Json::Value::null) return StringPiece("");
434  return StringPiece(v.asCString());
435  }
436 
449  void set_resource_id(const StringPiece& value) {
450  *MutableStorage("resourceId") = value.data();
451  }
452 
458  bool has_version() const {
459  return Storage().isMember("version");
460  }
461 
465  void clear_version() {
466  MutableStorage()->removeMember("version");
467  }
468 
469 
473  int32 get_version() const {
474  const Json::Value& storage = Storage("version");
475  return client::JsonValueToCppValueHelper<int32 >(storage);
476  }
477 
485  void set_version(int32 value) {
486  client::SetJsonValueFromCppValueHelper<int32 >(
487  value, MutableStorage("version"));
488  }
489 
490  private:
491  void operator=(const Policy&);
492 }; // Policy
493 } // namespace google_storage_api
494 #endif // GOOGLE_STORAGE_API_POLICY_H_
const StringPiece GetTypeName() const
Definition: policy.h:293
const StringPiece get_resource_id() const
Definition: policy.h:431
void clear_condition()
Definition: policy.h:109
bool has_condition() const
Definition: policy.h:102
int32 get_version() const
Definition: policy.h:473
const StringPiece get_etag() const
Definition: policy.h:356
bool has_resource_id() const
Definition: policy.h:416
void clear_version()
Definition: policy.h:465
const StringPiece GetTypeName() const
Definition: policy.h:93
void set_resource_id(const StringPiece &value)
Definition: policy.h:449
client::JsonCppArray< PolicyBindings > mutable_bindings()
Definition: policy.h:331
const StringPiece get_role() const
Definition: policy.h:218
bool has_bindings() const
Definition: policy.h:302
const StringPiece get_kind() const
Definition: policy.h:393
void clear_etag()
Definition: policy.h:348
void set_version(int32 value)
Definition: policy.h:485
Definition: expr.h:52
Definition: policy.h:53
void clear_bindings()
Definition: policy.h:309
void clear_role()
Definition: policy.h:210
bool has_etag() const
Definition: policy.h:341
bool has_role() const
Definition: policy.h:203
bool has_members() const
Definition: policy.h:136
Definition: bucket.h:43
void set_kind(const StringPiece &value)
Definition: policy.h:407
void set_role(const StringPiece &value)
Definition: policy.h:255
void set_etag(const StringPiece &value)
Definition: policy.h:369
void clear_members()
Definition: policy.h:143
void clear_resource_id()
Definition: policy.h:423
Definition: bucket.cc:45
const client::JsonCppArray< PolicyBindings > get_bindings() const
Definition: policy.h:317
const client::JsonCppArray< string > get_members() const
Definition: policy.h:151
client::JsonCppArray< string > mutable_members()
Definition: policy.h:193
void clear_kind()
Definition: policy.h:385
bool has_kind() const
Definition: policy.h:378
bool has_version() const
Definition: policy.h:458