discovery  v1
discovery_service.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 //------------------------------------------------------------------------------
16 // This code was generated by google-apis-code-generator 1.5.1
17 // Build date: 2018-10-08 17:45:39 UTC
18 // on: 2020-03-06, 06:51:28 UTC
19 // C++ generator version: 0.1.4
20 //
21 // Changes to this file may cause incorrect behavior and will be lost if
22 // the code is regenerated.
23 //------------------------------------------------------------------------------
24 #ifndef GOOGLE_DISCOVERY_API_DISCOVERY_SERVICE_H_
25 #define GOOGLE_DISCOVERY_API_DISCOVERY_SERVICE_H_
26 
27 #include <string>
28 #include "googleapis/base/macros.h"
29 #include "googleapis/client/service/client_service.h"
30 #include "googleapis/client/util/status.h"
31 #include "googleapis/client/util/uri_template.h"
32 
33 #include "google/discovery_api/directory_list.h"
34 #include "google/discovery_api/rest_description.h"
35 
36 
37 namespace google_discovery_api {
38 using namespace googleapis;
69 class DiscoveryService;
70 
79  : public client::ClientServiceRequest {
80  public:
103  const client::ClientService* service,
104  client::AuthorizationCredential* credential,
105  client::HttpRequest::HttpMethod method,
106  const StringPiece& uri_template);
107 
111  virtual ~DiscoveryServiceBaseRequest();
112 
113 
117  void clear_alt() {
118  _have_alt_ = false;
119  client::ClearCppValueHelper(&alt_);
120  }
121 
122 
128  const string& get_alt() const { return alt_; }
129 
135  string* mutable_alt() {
136  _have_alt_ = true;
137  return &alt_;
138  }
139 
140 
146  void set_alt(const string& value) {
147  _have_alt_ = true;
148  alt_ = value;
149  }
150 
151 
152 
156  void clear_fields() {
157  _have_fields_ = false;
158  client::ClearCppValueHelper(&fields_);
159  }
160 
161 
167  const string& get_fields() const { return fields_; }
168 
174  string* mutable_fields() {
175  _have_fields_ = true;
176  return &fields_;
177  }
178 
179 
186  void set_fields(const string& value) {
187  _have_fields_ = true;
188  fields_ = value;
189  }
190 
191 
192 
196  void clear_key() {
197  _have_key_ = false;
198  client::ClearCppValueHelper(&key_);
199  }
200 
201 
207  const string& get_key() const { return key_; }
208 
214  string* mutable_key() {
215  _have_key_ = true;
216  return &key_;
217  }
218 
219 
227  void set_key(const string& value) {
228  _have_key_ = true;
229  key_ = value;
230  }
231 
232 
233 
238  _have_oauth_token_ = false;
239  client::ClearCppValueHelper(&oauth_token_);
240  }
241 
242 
248  const string& get_oauth_token() const { return oauth_token_; }
249 
256  string* mutable_oauthToken() {
257  _have_oauth_token_ = true;
258  return &oauth_token_;
259  }
260 
261 
267  void set_oauth_token(const string& value) {
268  _have_oauth_token_ = true;
269  oauth_token_ = value;
270  }
271 
272 
273 
278  _have_pretty_print_ = false;
279  client::ClearCppValueHelper(&pretty_print_);
280  }
281 
282 
288  bool get_pretty_print() const { return pretty_print_; }
289 
295  void set_pretty_print(bool value) {
296  _have_pretty_print_ = true;
297  pretty_print_ = value;
298  }
299 
304  _have_quota_user_ = false;
305  client::ClearCppValueHelper(&quota_user_);
306  }
307 
308 
314  const string& get_quota_user() const { return quota_user_; }
315 
322  string* mutable_quotaUser() {
323  _have_quota_user_ = true;
324  return &quota_user_;
325  }
326 
327 
334  void set_quota_user(const string& value) {
335  _have_quota_user_ = true;
336  quota_user_ = value;
337  }
338 
339 
340 
344  void clear_user_ip() {
345  _have_user_ip_ = false;
346  client::ClearCppValueHelper(&user_ip_);
347  }
348 
349 
355  const string& get_user_ip() const { return user_ip_; }
356 
362  string* mutable_userIp() {
363  _have_user_ip_ = true;
364  return &user_ip_;
365  }
366 
367 
374  void set_user_ip(const string& value) {
375  _have_user_ip_ = true;
376  user_ip_ = value;
377  }
378 
389  virtual util::Status AppendVariable(
390  const StringPiece& variable_name,
391  const client::UriTemplateConfig& config,
392  string* target);
393 
399  virtual util::Status AppendOptionalQueryParameters(string* target);
400 
401 
402  protected:
408  void AddJsonContentToRequest(const client::JsonCppData *content);
409 
410  private:
411  string alt_;
412  string fields_;
413  string key_;
414  string oauth_token_;
415  bool pretty_print_;
416  string quota_user_;
417  string user_ip_;
418  bool _have_alt_ : 1;
419  bool _have_fields_ : 1;
420  bool _have_key_ : 1;
421  bool _have_oauth_token_ : 1;
422  bool _have_pretty_print_ : 1;
423  bool _have_quota_user_ : 1;
424  bool _have_user_ip_ : 1;
425 
426  DISALLOW_COPY_AND_ASSIGN(DiscoveryServiceBaseRequest);
427 };
428 
429 
430 
443  public:
454  const DiscoveryService* _service_,
455  client::AuthorizationCredential* _credential_,
456  const absl::string_view& api,
457  const absl::string_view& version);
458 
462  virtual ~ApisResource_GetRestMethod();
463 
464 
474  virtual util::Status AppendVariable(
475  const StringPiece& variable_name,
476  const client::UriTemplateConfig& config,
477  string* target);
478 
479 
491  RestDescription* data) {
492  return DiscoveryServiceBaseRequest::ExecuteAndParseResponse(data);
493  }
494 
495  private:
496  string api_;
497  string version_;
498  DISALLOW_COPY_AND_ASSIGN(ApisResource_GetRestMethod);
499 };
500 
513  public:
522  const DiscoveryService* _service_,
523  client::AuthorizationCredential* _credential_);
524 
528  virtual ~ApisResource_ListMethod();
529 
530 
534  void clear_name() {
535  _have_name_ = false;
536  client::ClearCppValueHelper(&name_);
537  }
538 
539 
545  const string& get_name() const { return name_; }
546 
552  string* mutable_name() {
553  _have_name_ = true;
554  return &name_;
555  }
556 
557 
563  void set_name(const string& value) {
564  _have_name_ = true;
565  name_ = value;
566  }
567 
568 
569 
574  _have_preferred_ = false;
575  client::ClearCppValueHelper(&preferred_);
576  }
577 
578 
584  bool get_preferred() const { return preferred_; }
585 
591  void set_preferred(bool value) {
592  _have_preferred_ = true;
593  preferred_ = value;
594  }
595 
605  virtual util::Status AppendVariable(
606  const StringPiece& variable_name,
607  const client::UriTemplateConfig& config,
608  string* target);
609 
615  virtual util::Status AppendOptionalQueryParameters(string* target);
616 
617 
629  DirectoryList* data) {
630  return DiscoveryServiceBaseRequest::ExecuteAndParseResponse(data);
631  }
632 
633  private:
634  string name_;
635  bool preferred_;
636  bool _have_name_ : 1;
637  bool _have_preferred_ : 1;
638  DISALLOW_COPY_AND_ASSIGN(ApisResource_ListMethod);
639 };
640 
641 
642 
651 class DiscoveryService : public client::ClientService {
652  public:
656  static const char googleapis_API_NAME[];
657 
661  static const char googleapis_API_VERSION[];
662 
666  static const char googleapis_API_GENERATOR[];
667 
668 
674  class ApisResource {
675  public:
683  explicit ApisResource(DiscoveryService* service);
684 
689 
690 
701  ApisResource_GetRestMethod* NewGetRestMethod(
702  client::AuthorizationCredential* _credential_,
703  const absl::string_view& api,
704  const absl::string_view& version) const;
705 
714  ApisResource_ListMethod* NewListMethod(
715  client::AuthorizationCredential* _credential_) const;
716 
717  private:
718  DiscoveryService* service_;
719 
720  DISALLOW_COPY_AND_ASSIGN(ApisResource);
721  };
722 
723 
724 
731  explicit DiscoveryService(client::HttpTransport* transport);
732 
736  virtual ~DiscoveryService();
737 
743  const ApisResource& get_apis() const {
744  return apis_;
745  }
746 
747 
748 
749  private:
750  ApisResource apis_;
751 
752  DISALLOW_COPY_AND_ASSIGN(DiscoveryService);
753 };
754 
755 
786 } // namespace google_discovery_api
787 #endif // GOOGLE_DISCOVERY_API_DISCOVERY_SERVICE_H_
const ApisResource & get_apis() const
Definition: discovery_service.h:743
string * mutable_key()
Definition: discovery_service.h:214
bool get_preferred() const
Definition: discovery_service.h:584
void set_preferred(bool value)
Definition: discovery_service.h:591
Definition: rest_description.h:54
string * mutable_fields()
Definition: discovery_service.h:174
void set_oauth_token(const string &value)
Definition: discovery_service.h:267
void clear_pretty_print()
Definition: discovery_service.h:277
const string & get_oauth_token() const
Definition: discovery_service.h:248
Definition: discovery_service.h:442
~ApisResource()
Definition: discovery_service.h:688
const string & get_key() const
Definition: discovery_service.h:207
void set_alt(const string &value)
Definition: discovery_service.h:146
void clear_name()
Definition: discovery_service.h:534
string * mutable_oauthToken()
Definition: discovery_service.h:256
const string & get_user_ip() const
Definition: discovery_service.h:355
Definition: discovery_service.h:674
void clear_user_ip()
Definition: discovery_service.h:344
const string & get_name() const
Definition: discovery_service.h:545
void clear_preferred()
Definition: discovery_service.h:573
string * mutable_name()
Definition: discovery_service.h:552
util::Status ExecuteAndParseResponse(DirectoryList *data)
Definition: discovery_service.h:628
bool get_pretty_print() const
Definition: discovery_service.h:288
void clear_oauth_token()
Definition: discovery_service.h:237
string * mutable_quotaUser()
Definition: discovery_service.h:322
const string & get_quota_user() const
Definition: discovery_service.h:314
Definition: discovery_service.h:78
void set_pretty_print(bool value)
Definition: discovery_service.h:295
void set_quota_user(const string &value)
Definition: discovery_service.h:334
void clear_quota_user()
Definition: discovery_service.h:303
void set_name(const string &value)
Definition: discovery_service.h:563
Definition: directory_list.h:50
Definition: discovery_service.h:651
Definition: directory_list.cc:40
void clear_fields()
Definition: discovery_service.h:156
string * mutable_userIp()
Definition: discovery_service.h:362
void set_user_ip(const string &value)
Definition: discovery_service.h:374
util::Status ExecuteAndParseResponse(RestDescription *data)
Definition: discovery_service.h:490
Definition: discovery_service.h:512
void clear_key()
Definition: discovery_service.h:196
string * mutable_alt()
Definition: discovery_service.h:135
const string & get_fields() const
Definition: discovery_service.h:167
void clear_alt()
Definition: discovery_service.h:117
const string & get_alt() const
Definition: discovery_service.h:128
void set_fields(const string &value)
Definition: discovery_service.h:186
void set_key(const string &value)
Definition: discovery_service.h:227