bigquery  v2
query_response.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-07, 23:51: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 // BigQuery API (bigquery/v2)
24 // Generated from:
25 // Version: v2
26 // Revision: 459
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_BIGQUERY_API_QUERY_RESPONSE_H_
31 #define GOOGLE_BIGQUERY_API_QUERY_RESPONSE_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/bigquery_api/error_proto.h"
40 #include "google/bigquery_api/job_reference.h"
41 #include "google/bigquery_api/table_row.h"
42 #include "google/bigquery_api/table_schema.h"
43 
44 namespace Json {
45 class Value;
46 } // namespace Json
47 
48 namespace google_bigquery_api {
49 using namespace googleapis;
50 
56 class QueryResponse : public client::JsonCppData {
57  public:
63  static QueryResponse* New();
64 
70  explicit QueryResponse(const Json::Value& storage);
71 
77  explicit QueryResponse(Json::Value* storage);
78 
82  virtual ~QueryResponse();
83 
89  const StringPiece GetTypeName() const {
90  return StringPiece("google_bigquery_api::QueryResponse");
91  }
92 
98  bool has_cache_hit() const {
99  return Storage().isMember("cacheHit");
100  }
101 
106  MutableStorage()->removeMember("cacheHit");
107  }
108 
109 
113  bool get_cache_hit() const {
114  const Json::Value& storage = Storage("cacheHit");
115  return client::JsonValueToCppValueHelper<bool >(storage);
116  }
117 
125  void set_cache_hit(bool value) {
126  client::SetJsonValueFromCppValueHelper<bool >(
127  value, MutableStorage("cacheHit"));
128  }
129 
135  bool has_errors() const {
136  return Storage().isMember("errors");
137  }
138 
142  void clear_errors() {
143  MutableStorage()->removeMember("errors");
144  }
145 
146 
150  const client::JsonCppArray<ErrorProto > get_errors() const;
151 
162  client::JsonCppArray<ErrorProto > mutable_errors();
163 
169  bool has_job_complete() const {
170  return Storage().isMember("jobComplete");
171  }
172 
177  MutableStorage()->removeMember("jobComplete");
178  }
179 
180 
184  bool get_job_complete() const {
185  const Json::Value& storage = Storage("jobComplete");
186  return client::JsonValueToCppValueHelper<bool >(storage);
187  }
188 
198  void set_job_complete(bool value) {
199  client::SetJsonValueFromCppValueHelper<bool >(
200  value, MutableStorage("jobComplete"));
201  }
202 
208  bool has_job_reference() const {
209  return Storage().isMember("jobReference");
210  }
211 
216  MutableStorage()->removeMember("jobReference");
217  }
218 
219 
223  const JobReference get_job_reference() const;
224 
237  JobReference mutable_jobReference();
238 
244  bool has_kind() const {
245  return Storage().isMember("kind");
246  }
247 
251  void clear_kind() {
252  MutableStorage()->removeMember("kind");
253  }
254 
255 
259  const StringPiece get_kind() const {
260  const Json::Value& v = Storage("kind");
261  if (v == Json::Value::null) return StringPiece("");
262  return StringPiece(v.asCString());
263  }
264 
272  void set_kind(const StringPiece& value) {
273  *MutableStorage("kind") = value.data();
274  }
275 
282  return Storage().isMember("numDmlAffectedRows");
283  }
284 
289  MutableStorage()->removeMember("numDmlAffectedRows");
290  }
291 
292 
297  const Json::Value& storage = Storage("numDmlAffectedRows");
298  return client::JsonValueToCppValueHelper<int64 >(storage);
299  }
300 
309  void set_num_dml_affected_rows(int64 value) {
310  client::SetJsonValueFromCppValueHelper<int64 >(
311  value, MutableStorage("numDmlAffectedRows"));
312  }
313 
319  bool has_page_token() const {
320  return Storage().isMember("pageToken");
321  }
322 
327  MutableStorage()->removeMember("pageToken");
328  }
329 
330 
334  const StringPiece get_page_token() const {
335  const Json::Value& v = Storage("pageToken");
336  if (v == Json::Value::null) return StringPiece("");
337  return StringPiece(v.asCString());
338  }
339 
347  void set_page_token(const StringPiece& value) {
348  *MutableStorage("pageToken") = value.data();
349  }
350 
356  bool has_rows() const {
357  return Storage().isMember("rows");
358  }
359 
363  void clear_rows() {
364  MutableStorage()->removeMember("rows");
365  }
366 
367 
371  const client::JsonCppArray<TableRow > get_rows() const;
372 
382  client::JsonCppArray<TableRow > mutable_rows();
383 
389  bool has_schema() const {
390  return Storage().isMember("schema");
391  }
392 
396  void clear_schema() {
397  MutableStorage()->removeMember("schema");
398  }
399 
400 
404  const TableSchema get_schema() const;
405 
414  TableSchema mutable_schema();
415 
422  return Storage().isMember("totalBytesProcessed");
423  }
424 
429  MutableStorage()->removeMember("totalBytesProcessed");
430  }
431 
432 
437  const Json::Value& storage = Storage("totalBytesProcessed");
438  return client::JsonValueToCppValueHelper<int64 >(storage);
439  }
440 
450  void set_total_bytes_processed(int64 value) {
451  client::SetJsonValueFromCppValueHelper<int64 >(
452  value, MutableStorage("totalBytesProcessed"));
453  }
454 
460  bool has_total_rows() const {
461  return Storage().isMember("totalRows");
462  }
463 
468  MutableStorage()->removeMember("totalRows");
469  }
470 
471 
475  uint64 get_total_rows() const {
476  const Json::Value& storage = Storage("totalRows");
477  return client::JsonValueToCppValueHelper<uint64 >(storage);
478  }
479 
488  void set_total_rows(uint64 value) {
489  client::SetJsonValueFromCppValueHelper<uint64 >(
490  value, MutableStorage("totalRows"));
491  }
492 
493  private:
494  void operator=(const QueryResponse&);
495 }; // QueryResponse
496 } // namespace google_bigquery_api
497 #endif // GOOGLE_BIGQUERY_API_QUERY_RESPONSE_H_
void set_job_complete(bool value)
Definition: query_response.h:198
Definition: query_response.h:56
bool has_total_bytes_processed() const
Definition: query_response.h:421
Definition: table_schema.h:51
bool has_num_dml_affected_rows() const
Definition: query_response.h:281
Definition: aggregate_classification_metrics.cc:39
void clear_total_bytes_processed()
Definition: query_response.h:428
void clear_job_complete()
Definition: query_response.h:176
int64 get_total_bytes_processed() const
Definition: query_response.h:436
uint64 get_total_rows() const
Definition: query_response.h:475
const StringPiece GetTypeName() const
Definition: query_response.h:89
bool has_total_rows() const
Definition: query_response.h:460
bool has_kind() const
Definition: query_response.h:244
bool has_page_token() const
Definition: query_response.h:319
bool has_errors() const
Definition: query_response.h:135
bool get_job_complete() const
Definition: query_response.h:184
void set_total_rows(uint64 value)
Definition: query_response.h:488
int64 get_num_dml_affected_rows() const
Definition: query_response.h:296
Definition: aggregate_classification_metrics.h:37
void clear_rows()
Definition: query_response.h:363
void set_total_bytes_processed(int64 value)
Definition: query_response.h:450
void clear_schema()
Definition: query_response.h:396
void set_kind(const StringPiece &value)
Definition: query_response.h:272
bool has_job_reference() const
Definition: query_response.h:208
bool has_schema() const
Definition: query_response.h:389
bool has_cache_hit() const
Definition: query_response.h:98
void set_page_token(const StringPiece &value)
Definition: query_response.h:347
void set_cache_hit(bool value)
Definition: query_response.h:125
const StringPiece get_kind() const
Definition: query_response.h:259
void clear_errors()
Definition: query_response.h:142
bool has_rows() const
Definition: query_response.h:356
void clear_kind()
Definition: query_response.h:251
Definition: job_reference.h:50
void clear_total_rows()
Definition: query_response.h:467
void clear_num_dml_affected_rows()
Definition: query_response.h:288
void clear_page_token()
Definition: query_response.h:326
void set_num_dml_affected_rows(int64 value)
Definition: query_response.h:309
const StringPiece get_page_token() const
Definition: query_response.h:334
void clear_cache_hit()
Definition: query_response.h:105
bool get_cache_hit() const
Definition: query_response.h:113
bool has_job_complete() const
Definition: query_response.h:169
void clear_job_reference()
Definition: query_response.h:215