drive  v2
comment.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-19, 05:24:40 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Drive API (drive/v2)
24 // Generated from:
25 // Version: v2
26 // Revision: 393
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_DRIVE_API_COMMENT_H_
31 #define GOOGLE_DRIVE_API_COMMENT_H_
32 
33 #include <string>
34 #include "googleapis/base/macros.h"
35 #include "googleapis/client/data/jsoncpp_data.h"
36 #include "googleapis/client/util/date_time.h"
37 #include "googleapis/strings/stringpiece.h"
38 
39 #include "google/drive_api/comment_reply.h"
40 #include "google/drive_api/user.h"
41 
42 namespace Json {
43 class Value;
44 } // namespace Json
45 
46 namespace google_drive_api {
47 using namespace googleapis;
48 
54 class Comment : public client::JsonCppData {
55  public:
61  class CommentContext : public client::JsonCppData {
62  public:
68  static CommentContext* New();
69 
75  explicit CommentContext(const Json::Value& storage);
76 
82  explicit CommentContext(Json::Value* storage);
83 
87  virtual ~CommentContext();
88 
94  const StringPiece GetTypeName() const {
95  return StringPiece("google_drive_api::CommentContext");
96  }
97 
103  bool has_type() const {
104  return Storage().isMember("type");
105  }
106 
110  void clear_type() {
111  MutableStorage()->removeMember("type");
112  }
113 
114 
118  const StringPiece get_type() const {
119  const Json::Value& v = Storage("type");
120  if (v == Json::Value::null) return StringPiece("");
121  return StringPiece(v.asCString());
122  }
123 
131  void set_type(const StringPiece& value) {
132  *MutableStorage("type") = value.data();
133  }
134 
140  bool has_value() const {
141  return Storage().isMember("value");
142  }
143 
147  void clear_value() {
148  MutableStorage()->removeMember("value");
149  }
150 
151 
155  const StringPiece get_value() const {
156  const Json::Value& v = Storage("value");
157  if (v == Json::Value::null) return StringPiece("");
158  return StringPiece(v.asCString());
159  }
160 
170  void set_value(const StringPiece& value) {
171  *MutableStorage("value") = value.data();
172  }
173 
174  private:
175  void operator=(const CommentContext&);
176  }; // CommentContext
182  static Comment* New();
183 
189  explicit Comment(const Json::Value& storage);
190 
196  explicit Comment(Json::Value* storage);
197 
201  virtual ~Comment();
202 
208  const StringPiece GetTypeName() const {
209  return StringPiece("google_drive_api::Comment");
210  }
211 
217  bool has_anchor() const {
218  return Storage().isMember("anchor");
219  }
220 
224  void clear_anchor() {
225  MutableStorage()->removeMember("anchor");
226  }
227 
228 
232  const StringPiece get_anchor() const {
233  const Json::Value& v = Storage("anchor");
234  if (v == Json::Value::null) return StringPiece("");
235  return StringPiece(v.asCString());
236  }
237 
246  void set_anchor(const StringPiece& value) {
247  *MutableStorage("anchor") = value.data();
248  }
249 
255  bool has_author() const {
256  return Storage().isMember("author");
257  }
258 
262  void clear_author() {
263  MutableStorage()->removeMember("author");
264  }
265 
266 
270  const User get_author() const;
271 
280  User mutable_author();
281 
287  bool has_comment_id() const {
288  return Storage().isMember("commentId");
289  }
290 
295  MutableStorage()->removeMember("commentId");
296  }
297 
298 
302  const StringPiece get_comment_id() const {
303  const Json::Value& v = Storage("commentId");
304  if (v == Json::Value::null) return StringPiece("");
305  return StringPiece(v.asCString());
306  }
307 
315  void set_comment_id(const StringPiece& value) {
316  *MutableStorage("commentId") = value.data();
317  }
318 
324  bool has_content() const {
325  return Storage().isMember("content");
326  }
327 
331  void clear_content() {
332  MutableStorage()->removeMember("content");
333  }
334 
335 
339  const StringPiece get_content() const {
340  const Json::Value& v = Storage("content");
341  if (v == Json::Value::null) return StringPiece("");
342  return StringPiece(v.asCString());
343  }
344 
354  void set_content(const StringPiece& value) {
355  *MutableStorage("content") = value.data();
356  }
357 
363  bool has_context() const {
364  return Storage().isMember("context");
365  }
366 
370  void clear_context() {
371  MutableStorage()->removeMember("context");
372  }
373 
374 
378  const CommentContext get_context() const {
379  const Json::Value& storage = Storage("context");
380  return client::JsonValueToCppValueHelper<CommentContext >(storage);
381  }
382 
391  Json::Value* storage = MutableStorage("context");
392  return client::JsonValueToMutableCppValueHelper<CommentContext >(storage);
393  }
394 
400  bool has_created_date() const {
401  return Storage().isMember("createdDate");
402  }
403 
408  MutableStorage()->removeMember("createdDate");
409  }
410 
411 
415  client::DateTime get_created_date() const {
416  const Json::Value& storage = Storage("createdDate");
417  return client::JsonValueToCppValueHelper<client::DateTime >(storage);
418  }
419 
427  void set_created_date(client::DateTime value) {
428  client::SetJsonValueFromCppValueHelper<client::DateTime >(
429  value, MutableStorage("createdDate"));
430  }
431 
437  bool has_deleted() const {
438  return Storage().isMember("deleted");
439  }
440 
444  void clear_deleted() {
445  MutableStorage()->removeMember("deleted");
446  }
447 
448 
452  bool get_deleted() const {
453  const Json::Value& storage = Storage("deleted");
454  return client::JsonValueToCppValueHelper<bool >(storage);
455  }
456 
466  void set_deleted(bool value) {
467  client::SetJsonValueFromCppValueHelper<bool >(
468  value, MutableStorage("deleted"));
469  }
470 
476  bool has_file_id() const {
477  return Storage().isMember("fileId");
478  }
479 
483  void clear_file_id() {
484  MutableStorage()->removeMember("fileId");
485  }
486 
487 
491  const StringPiece get_file_id() const {
492  const Json::Value& v = Storage("fileId");
493  if (v == Json::Value::null) return StringPiece("");
494  return StringPiece(v.asCString());
495  }
496 
504  void set_file_id(const StringPiece& value) {
505  *MutableStorage("fileId") = value.data();
506  }
507 
513  bool has_file_title() const {
514  return Storage().isMember("fileTitle");
515  }
516 
521  MutableStorage()->removeMember("fileTitle");
522  }
523 
524 
528  const StringPiece get_file_title() const {
529  const Json::Value& v = Storage("fileTitle");
530  if (v == Json::Value::null) return StringPiece("");
531  return StringPiece(v.asCString());
532  }
533 
541  void set_file_title(const StringPiece& value) {
542  *MutableStorage("fileTitle") = value.data();
543  }
544 
550  bool has_html_content() const {
551  return Storage().isMember("htmlContent");
552  }
553 
558  MutableStorage()->removeMember("htmlContent");
559  }
560 
561 
565  const StringPiece get_html_content() const {
566  const Json::Value& v = Storage("htmlContent");
567  if (v == Json::Value::null) return StringPiece("");
568  return StringPiece(v.asCString());
569  }
570 
578  void set_html_content(const StringPiece& value) {
579  *MutableStorage("htmlContent") = value.data();
580  }
581 
587  bool has_kind() const {
588  return Storage().isMember("kind");
589  }
590 
594  void clear_kind() {
595  MutableStorage()->removeMember("kind");
596  }
597 
598 
602  const StringPiece get_kind() const {
603  const Json::Value& v = Storage("kind");
604  if (v == Json::Value::null) return StringPiece("");
605  return StringPiece(v.asCString());
606  }
607 
615  void set_kind(const StringPiece& value) {
616  *MutableStorage("kind") = value.data();
617  }
618 
624  bool has_modified_date() const {
625  return Storage().isMember("modifiedDate");
626  }
627 
632  MutableStorage()->removeMember("modifiedDate");
633  }
634 
635 
639  client::DateTime get_modified_date() const {
640  const Json::Value& storage = Storage("modifiedDate");
641  return client::JsonValueToCppValueHelper<client::DateTime >(storage);
642  }
643 
651  void set_modified_date(client::DateTime value) {
652  client::SetJsonValueFromCppValueHelper<client::DateTime >(
653  value, MutableStorage("modifiedDate"));
654  }
655 
661  bool has_replies() const {
662  return Storage().isMember("replies");
663  }
664 
668  void clear_replies() {
669  MutableStorage()->removeMember("replies");
670  }
671 
672 
676  const client::JsonCppArray<CommentReply > get_replies() const;
677 
685  client::JsonCppArray<CommentReply > mutable_replies();
686 
692  bool has_self_link() const {
693  return Storage().isMember("selfLink");
694  }
695 
700  MutableStorage()->removeMember("selfLink");
701  }
702 
703 
707  const StringPiece get_self_link() const {
708  const Json::Value& v = Storage("selfLink");
709  if (v == Json::Value::null) return StringPiece("");
710  return StringPiece(v.asCString());
711  }
712 
720  void set_self_link(const StringPiece& value) {
721  *MutableStorage("selfLink") = value.data();
722  }
723 
729  bool has_status() const {
730  return Storage().isMember("status");
731  }
732 
736  void clear_status() {
737  MutableStorage()->removeMember("status");
738  }
739 
740 
744  const StringPiece get_status() const {
745  const Json::Value& v = Storage("status");
746  if (v == Json::Value::null) return StringPiece("");
747  return StringPiece(v.asCString());
748  }
749 
765  void set_status(const StringPiece& value) {
766  *MutableStorage("status") = value.data();
767  }
768 
769  private:
770  void operator=(const Comment&);
771 }; // Comment
772 } // namespace google_drive_api
773 #endif // GOOGLE_DRIVE_API_COMMENT_H_
void clear_type()
Definition: comment.h:110
client::DateTime get_created_date() const
Definition: comment.h:415
void clear_modified_date()
Definition: comment.h:631
bool has_deleted() const
Definition: comment.h:437
void clear_file_id()
Definition: comment.h:483
void set_modified_date(client::DateTime value)
Definition: comment.h:651
void clear_content()
Definition: comment.h:331
const StringPiece get_comment_id() const
Definition: comment.h:302
const StringPiece GetTypeName() const
Definition: comment.h:94
const StringPiece get_file_id() const
Definition: comment.h:491
void clear_status()
Definition: comment.h:736
bool has_created_date() const
Definition: comment.h:400
bool has_context() const
Definition: comment.h:363
const StringPiece get_html_content() const
Definition: comment.h:565
const StringPiece get_value() const
Definition: comment.h:155
const CommentContext get_context() const
Definition: comment.h:378
const StringPiece get_file_title() const
Definition: comment.h:528
void set_html_content(const StringPiece &value)
Definition: comment.h:578
void set_content(const StringPiece &value)
Definition: comment.h:354
Definition: user.h:50
bool has_author() const
Definition: comment.h:255
void clear_html_content()
Definition: comment.h:557
void set_anchor(const StringPiece &value)
Definition: comment.h:246
void set_comment_id(const StringPiece &value)
Definition: comment.h:315
const StringPiece GetTypeName() const
Definition: comment.h:208
void clear_replies()
Definition: comment.h:668
void clear_author()
Definition: comment.h:262
bool has_file_id() const
Definition: comment.h:476
void clear_context()
Definition: comment.h:370
void set_self_link(const StringPiece &value)
Definition: comment.h:720
void clear_anchor()
Definition: comment.h:224
const StringPiece get_content() const
Definition: comment.h:339
const StringPiece get_self_link() const
Definition: comment.h:707
bool has_html_content() const
Definition: comment.h:550
bool has_type() const
Definition: comment.h:103
void set_value(const StringPiece &value)
Definition: comment.h:170
void set_file_title(const StringPiece &value)
Definition: comment.h:541
bool get_deleted() const
Definition: comment.h:452
void clear_deleted()
Definition: comment.h:444
bool has_self_link() const
Definition: comment.h:692
void clear_file_title()
Definition: comment.h:520
void clear_value()
Definition: comment.h:147
void set_kind(const StringPiece &value)
Definition: comment.h:615
bool has_file_title() const
Definition: comment.h:513
void clear_kind()
Definition: comment.h:594
bool has_kind() const
Definition: comment.h:587
void set_type(const StringPiece &value)
Definition: comment.h:131
client::DateTime get_modified_date() const
Definition: comment.h:639
const StringPiece get_status() const
Definition: comment.h:744
Definition: about.h:41
void set_deleted(bool value)
Definition: comment.h:466
const StringPiece get_anchor() const
Definition: comment.h:232
CommentContext mutable_context()
Definition: comment.h:390
bool has_value() const
Definition: comment.h:140
void clear_comment_id()
Definition: comment.h:294
bool has_replies() const
Definition: comment.h:661
const StringPiece get_type() const
Definition: comment.h:118
bool has_modified_date() const
Definition: comment.h:624
const StringPiece get_kind() const
Definition: comment.h:602
bool has_comment_id() const
Definition: comment.h:287
Definition: comment.h:54
void set_status(const StringPiece &value)
Definition: comment.h:765
void clear_created_date()
Definition: comment.h:407
void set_file_id(const StringPiece &value)
Definition: comment.h:504
bool has_content() const
Definition: comment.h:324
bool has_anchor() const
Definition: comment.h:217
void set_created_date(client::DateTime value)
Definition: comment.h:427
bool has_status() const
Definition: comment.h:729
Definition: about.cc:43
void clear_self_link()
Definition: comment.h:699