bigquery  v2
model_definition.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_MODEL_DEFINITION_H_
31 #define GOOGLE_BIGQUERY_API_MODEL_DEFINITION_H_
32 
33 #include <string>
34 #include "googleapis/base/macros.h"
35 #include "googleapis/client/data/jsoncpp_data.h"
36 #include "googleapis/strings/stringpiece.h"
37 
38 #include "google/bigquery_api/bqml_training_run.h"
39 
40 namespace Json {
41 class Value;
42 } // namespace Json
43 
44 namespace google_bigquery_api {
45 using namespace googleapis;
46 
52 class ModelDefinition : public client::JsonCppData {
53  public:
61  class ModelDefinitionModelOptions : public client::JsonCppData {
62  public:
68  static ModelDefinitionModelOptions* New();
69 
75  explicit ModelDefinitionModelOptions(const Json::Value& storage);
76 
82  explicit ModelDefinitionModelOptions(Json::Value* storage);
83 
87  virtual ~ModelDefinitionModelOptions();
88 
94  const StringPiece GetTypeName() const {
95  return StringPiece("google_bigquery_api::ModelDefinitionModelOptions");
96  }
97 
103  bool has_labels() const {
104  return Storage().isMember("labels");
105  }
106 
110  void clear_labels() {
111  MutableStorage()->removeMember("labels");
112  }
113 
114 
118  const client::JsonCppArray<string > get_labels() const {
119  const Json::Value& storage = Storage("labels");
120  return client::JsonValueToCppValueHelper<client::JsonCppArray<string > >(storage);
121  }
122 
128  client::JsonCppArray<string > mutable_labels() {
129  Json::Value* storage = MutableStorage("labels");
130  return client::JsonValueToMutableCppValueHelper<client::JsonCppArray<string > >(storage);
131  }
132 
138  bool has_loss_type() const {
139  return Storage().isMember("lossType");
140  }
141 
146  MutableStorage()->removeMember("lossType");
147  }
148 
149 
153  const StringPiece get_loss_type() const {
154  const Json::Value& v = Storage("lossType");
155  if (v == Json::Value::null) return StringPiece("");
156  return StringPiece(v.asCString());
157  }
158 
163  void set_loss_type(const StringPiece& value) {
164  *MutableStorage("lossType") = value.data();
165  }
166 
172  bool has_model_type() const {
173  return Storage().isMember("modelType");
174  }
175 
180  MutableStorage()->removeMember("modelType");
181  }
182 
183 
187  const StringPiece get_model_type() const {
188  const Json::Value& v = Storage("modelType");
189  if (v == Json::Value::null) return StringPiece("");
190  return StringPiece(v.asCString());
191  }
192 
197  void set_model_type(const StringPiece& value) {
198  *MutableStorage("modelType") = value.data();
199  }
200 
201  private:
202  void operator=(const ModelDefinitionModelOptions&);
203  }; // ModelDefinitionModelOptions
209  static ModelDefinition* New();
210 
216  explicit ModelDefinition(const Json::Value& storage);
217 
223  explicit ModelDefinition(Json::Value* storage);
224 
228  virtual ~ModelDefinition();
229 
235  const StringPiece GetTypeName() const {
236  return StringPiece("google_bigquery_api::ModelDefinition");
237  }
238 
244  bool has_model_options() const {
245  return Storage().isMember("modelOptions");
246  }
247 
252  MutableStorage()->removeMember("modelOptions");
253  }
254 
255 
260  const Json::Value& storage = Storage("modelOptions");
261  return client::JsonValueToCppValueHelper<ModelDefinitionModelOptions >(storage);
262  }
263 
275  Json::Value* storage = MutableStorage("modelOptions");
276  return client::JsonValueToMutableCppValueHelper<ModelDefinitionModelOptions >(storage);
277  }
278 
284  bool has_training_runs() const {
285  return Storage().isMember("trainingRuns");
286  }
287 
292  MutableStorage()->removeMember("trainingRuns");
293  }
294 
295 
299  const client::JsonCppArray<BqmlTrainingRun > get_training_runs() const;
300 
312  client::JsonCppArray<BqmlTrainingRun > mutable_trainingRuns();
313 
314  private:
315  void operator=(const ModelDefinition&);
316 }; // ModelDefinition
317 } // namespace google_bigquery_api
318 #endif // GOOGLE_BIGQUERY_API_MODEL_DEFINITION_H_
void clear_labels()
Definition: model_definition.h:110
const ModelDefinitionModelOptions get_model_options() const
Definition: model_definition.h:259
bool has_loss_type() const
Definition: model_definition.h:138
void clear_loss_type()
Definition: model_definition.h:145
Definition: aggregate_classification_metrics.cc:39
const StringPiece get_model_type() const
Definition: model_definition.h:187
bool has_training_runs() const
Definition: model_definition.h:284
const StringPiece GetTypeName() const
Definition: model_definition.h:235
void set_loss_type(const StringPiece &value)
Definition: model_definition.h:163
bool has_model_type() const
Definition: model_definition.h:172
Definition: model_definition.h:52
void clear_model_type()
Definition: model_definition.h:179
ModelDefinitionModelOptions mutable_modelOptions()
Definition: model_definition.h:274
void set_model_type(const StringPiece &value)
Definition: model_definition.h:197
const StringPiece get_loss_type() const
Definition: model_definition.h:153
Definition: aggregate_classification_metrics.h:37
const client::JsonCppArray< string > get_labels() const
Definition: model_definition.h:118
void clear_model_options()
Definition: model_definition.h:251
client::JsonCppArray< string > mutable_labels()
Definition: model_definition.h:128
bool has_model_options() const
Definition: model_definition.h:244
const StringPiece GetTypeName() const
Definition: model_definition.h:94
void clear_training_runs()
Definition: model_definition.h:291
bool has_labels() const
Definition: model_definition.h:103