translate  v2
 All Classes Functions Variables Groups
translations_resource.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: 2017-02-15 17:18:02 UTC
17 // on: 2017-05-29, 17:24:01 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // Google Cloud Translation API (translate/v2)
24 // Generated from:
25 // Version: v2
26 // Revision: 51
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_TRANSLATE_API_TRANSLATIONS_RESOURCE_H_
31 #define GOOGLE_TRANSLATE_API_TRANSLATIONS_RESOURCE_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 namespace Json {
39 class Value;
40 } // namespace Json
41 
42 namespace google_translate_api {
43 using namespace googleapis;
44 
50 class TranslationsResource : public client::JsonCppData {
51  public:
57  static TranslationsResource* New();
58 
64  explicit TranslationsResource(const Json::Value& storage);
65 
71  explicit TranslationsResource(Json::Value* storage);
72 
76  virtual ~TranslationsResource();
77 
83  const StringPiece GetTypeName() const {
84  return StringPiece("google_translate_api::TranslationsResource");
85  }
86 
94  return Storage().isMember("detectedSourceLanguage");
95  }
96 
101  MutableStorage()->removeMember("detectedSourceLanguage");
102  }
103 
104 
108  const StringPiece get_detected_source_language() const {
109  const Json::Value& v = Storage("detectedSourceLanguage");
110  if (v == Json::Value::null) return StringPiece("");
111  return StringPiece(v.asCString());
112  }
113 
124  void set_detected_source_language(const StringPiece& value) {
125  *MutableStorage("detectedSourceLanguage") = value.data();
126  }
127 
133  bool has_model() const {
134  return Storage().isMember("model");
135  }
136 
140  void clear_model() {
141  MutableStorage()->removeMember("model");
142  }
143 
144 
148  const StringPiece get_model() const {
149  const Json::Value& v = Storage("model");
150  if (v == Json::Value::null) return StringPiece("");
151  return StringPiece(v.asCString());
152  }
153 
163  void set_model(const StringPiece& value) {
164  *MutableStorage("model") = value.data();
165  }
166 
172  bool has_translated_text() const {
173  return Storage().isMember("translatedText");
174  }
175 
180  MutableStorage()->removeMember("translatedText");
181  }
182 
183 
187  const StringPiece get_translated_text() const {
188  const Json::Value& v = Storage("translatedText");
189  if (v == Json::Value::null) return StringPiece("");
190  return StringPiece(v.asCString());
191  }
192 
200  void set_translated_text(const StringPiece& value) {
201  *MutableStorage("translatedText") = value.data();
202  }
203 
204  private:
205  void operator=(const TranslationsResource&);
206 }; // TranslationsResource
207 } // namespace google_translate_api
208 #endif // GOOGLE_TRANSLATE_API_TRANSLATIONS_RESOURCE_H_