bigquery  v2
query_request.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_REQUEST_H_
31 #define GOOGLE_BIGQUERY_API_QUERY_REQUEST_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/dataset_reference.h"
40 #include "google/bigquery_api/query_parameter.h"
41 
42 namespace Json {
43 class Value;
44 } // namespace Json
45 
46 namespace google_bigquery_api {
47 using namespace googleapis;
48 
54 class QueryRequest : public client::JsonCppData {
55  public:
61  static QueryRequest* New();
62 
68  explicit QueryRequest(const Json::Value& storage);
69 
75  explicit QueryRequest(Json::Value* storage);
76 
80  virtual ~QueryRequest();
81 
87  const StringPiece GetTypeName() const {
88  return StringPiece("google_bigquery_api::QueryRequest");
89  }
90 
96  bool has_default_dataset() const {
97  return Storage().isMember("defaultDataset");
98  }
99 
104  MutableStorage()->removeMember("defaultDataset");
105  }
106 
107 
112  const DatasetReference get_default_dataset() const;
113 
124  DatasetReference mutable_defaultDataset();
125 
131  bool has_dry_run() const {
132  return Storage().isMember("dryRun");
133  }
134 
138  void clear_dry_run() {
139  MutableStorage()->removeMember("dryRun");
140  }
141 
142 
146  bool get_dry_run() const {
147  const Json::Value& storage = Storage("dryRun");
148  return client::JsonValueToCppValueHelper<bool >(storage);
149  }
150 
161  void set_dry_run(bool value) {
162  client::SetJsonValueFromCppValueHelper<bool >(
163  value, MutableStorage("dryRun"));
164  }
165 
171  bool has_kind() const {
172  return Storage().isMember("kind");
173  }
174 
178  void clear_kind() {
179  MutableStorage()->removeMember("kind");
180  }
181 
182 
186  const StringPiece get_kind() const {
187  const Json::Value& v = Storage("kind");
188  if (v == Json::Value::null) return StringPiece("");
189  return StringPiece(v.asCString());
190  }
191 
199  void set_kind(const StringPiece& value) {
200  *MutableStorage("kind") = value.data();
201  }
202 
208  bool has_location() const {
209  return Storage().isMember("location");
210  }
211 
215  void clear_location() {
216  MutableStorage()->removeMember("location");
217  }
218 
219 
223  const StringPiece get_location() const {
224  const Json::Value& v = Storage("location");
225  if (v == Json::Value::null) return StringPiece("");
226  return StringPiece(v.asCString());
227  }
228 
237  void set_location(const StringPiece& value) {
238  *MutableStorage("location") = value.data();
239  }
240 
246  bool has_max_results() const {
247  return Storage().isMember("maxResults");
248  }
249 
254  MutableStorage()->removeMember("maxResults");
255  }
256 
257 
261  uint32 get_max_results() const {
262  const Json::Value& storage = Storage("maxResults");
263  return client::JsonValueToCppValueHelper<uint32 >(storage);
264  }
265 
277  void set_max_results(uint32 value) {
278  client::SetJsonValueFromCppValueHelper<uint32 >(
279  value, MutableStorage("maxResults"));
280  }
281 
287  bool has_parameter_mode() const {
288  return Storage().isMember("parameterMode");
289  }
290 
295  MutableStorage()->removeMember("parameterMode");
296  }
297 
298 
302  const StringPiece get_parameter_mode() const {
303  const Json::Value& v = Storage("parameterMode");
304  if (v == Json::Value::null) return StringPiece("");
305  return StringPiece(v.asCString());
306  }
307 
316  void set_parameter_mode(const StringPiece& value) {
317  *MutableStorage("parameterMode") = value.data();
318  }
319 
325  bool has_preserve_nulls() const {
326  return Storage().isMember("preserveNulls");
327  }
328 
333  MutableStorage()->removeMember("preserveNulls");
334  }
335 
336 
340  bool get_preserve_nulls() const {
341  const Json::Value& storage = Storage("preserveNulls");
342  return client::JsonValueToCppValueHelper<bool >(storage);
343  }
344 
354  void set_preserve_nulls(bool value) {
355  client::SetJsonValueFromCppValueHelper<bool >(
356  value, MutableStorage("preserveNulls"));
357  }
358 
364  bool has_query() const {
365  return Storage().isMember("query");
366  }
367 
371  void clear_query() {
372  MutableStorage()->removeMember("query");
373  }
374 
375 
379  const StringPiece get_query() const {
380  const Json::Value& v = Storage("query");
381  if (v == Json::Value::null) return StringPiece("");
382  return StringPiece(v.asCString());
383  }
384 
394  void set_query(const StringPiece& value) {
395  *MutableStorage("query") = value.data();
396  }
397 
403  bool has_query_parameters() const {
404  return Storage().isMember("queryParameters");
405  }
406 
411  MutableStorage()->removeMember("queryParameters");
412  }
413 
414 
419  const client::JsonCppArray<QueryParameter > get_query_parameters() const;
420 
429  client::JsonCppArray<QueryParameter > mutable_queryParameters();
430 
436  bool has_timeout_ms() const {
437  return Storage().isMember("timeoutMs");
438  }
439 
444  MutableStorage()->removeMember("timeoutMs");
445  }
446 
447 
451  uint32 get_timeout_ms() const {
452  const Json::Value& storage = Storage("timeoutMs");
453  return client::JsonValueToCppValueHelper<uint32 >(storage);
454  }
455 
469  void set_timeout_ms(uint32 value) {
470  client::SetJsonValueFromCppValueHelper<uint32 >(
471  value, MutableStorage("timeoutMs"));
472  }
473 
479  bool has_use_legacy_sql() const {
480  return Storage().isMember("useLegacySql");
481  }
482 
487  MutableStorage()->removeMember("useLegacySql");
488  }
489 
490 
494  bool get_use_legacy_sql() const {
495  const Json::Value& storage = Storage("useLegacySql");
496  return client::JsonValueToCppValueHelper<bool >(storage);
497  }
498 
510  void set_use_legacy_sql(bool value) {
511  client::SetJsonValueFromCppValueHelper<bool >(
512  value, MutableStorage("useLegacySql"));
513  }
514 
520  bool has_use_query_cache() const {
521  return Storage().isMember("useQueryCache");
522  }
523 
528  MutableStorage()->removeMember("useQueryCache");
529  }
530 
531 
535  bool get_use_query_cache() const {
536  const Json::Value& storage = Storage("useQueryCache");
537  return client::JsonValueToCppValueHelper<bool >(storage);
538  }
539 
549  void set_use_query_cache(bool value) {
550  client::SetJsonValueFromCppValueHelper<bool >(
551  value, MutableStorage("useQueryCache"));
552  }
553 
554  private:
555  void operator=(const QueryRequest&);
556 }; // QueryRequest
557 } // namespace google_bigquery_api
558 #endif // GOOGLE_BIGQUERY_API_QUERY_REQUEST_H_
bool has_default_dataset() const
Definition: query_request.h:96
void set_timeout_ms(uint32 value)
Definition: query_request.h:469
bool get_preserve_nulls() const
Definition: query_request.h:340
void clear_parameter_mode()
Definition: query_request.h:294
void clear_dry_run()
Definition: query_request.h:138
void clear_kind()
Definition: query_request.h:178
void clear_location()
Definition: query_request.h:215
bool has_kind() const
Definition: query_request.h:171
bool get_use_legacy_sql() const
Definition: query_request.h:494
Definition: dataset_reference.h:50
void clear_query_parameters()
Definition: query_request.h:410
uint32 get_max_results() const
Definition: query_request.h:261
const StringPiece get_location() const
Definition: query_request.h:223
bool has_use_legacy_sql() const
Definition: query_request.h:479
const StringPiece get_parameter_mode() const
Definition: query_request.h:302
void clear_max_results()
Definition: query_request.h:253
void set_preserve_nulls(bool value)
Definition: query_request.h:354
Definition: aggregate_classification_metrics.cc:39
bool has_dry_run() const
Definition: query_request.h:131
void clear_preserve_nulls()
Definition: query_request.h:332
bool has_preserve_nulls() const
Definition: query_request.h:325
bool has_query_parameters() const
Definition: query_request.h:403
bool has_location() const
Definition: query_request.h:208
const StringPiece get_kind() const
Definition: query_request.h:186
bool has_use_query_cache() const
Definition: query_request.h:520
void set_use_query_cache(bool value)
Definition: query_request.h:549
bool get_dry_run() const
Definition: query_request.h:146
void clear_timeout_ms()
Definition: query_request.h:443
void clear_use_query_cache()
Definition: query_request.h:527
bool has_query() const
Definition: query_request.h:364
bool get_use_query_cache() const
Definition: query_request.h:535
void clear_default_dataset()
Definition: query_request.h:103
Definition: aggregate_classification_metrics.h:37
void set_kind(const StringPiece &value)
Definition: query_request.h:199
void set_dry_run(bool value)
Definition: query_request.h:161
void clear_use_legacy_sql()
Definition: query_request.h:486
void set_query(const StringPiece &value)
Definition: query_request.h:394
void set_parameter_mode(const StringPiece &value)
Definition: query_request.h:316
uint32 get_timeout_ms() const
Definition: query_request.h:451
void set_max_results(uint32 value)
Definition: query_request.h:277
const StringPiece GetTypeName() const
Definition: query_request.h:87
bool has_max_results() const
Definition: query_request.h:246
bool has_parameter_mode() const
Definition: query_request.h:287
void set_location(const StringPiece &value)
Definition: query_request.h:237
bool has_timeout_ms() const
Definition: query_request.h:436
Definition: query_request.h:54
const StringPiece get_query() const
Definition: query_request.h:379
void set_use_legacy_sql(bool value)
Definition: query_request.h:510
void clear_query()
Definition: query_request.h:371