youtube  v3
promoted_item.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-02-27, 01:46:08 UTC
18 // C++ generator version: 0.1.4
19 
20 // ----------------------------------------------------------------------------
21 // NOTE: This file is generated from Google APIs Discovery Service.
22 // Service:
23 // YouTube Data API (youtube/v3)
24 // Generated from:
25 // Version: v3
26 // Revision: 222
27 // Generated by:
28 // Tool: google-apis-code-generator 1.5.1
29 // C++: 0.1.4
30 #ifndef GOOGLE_YOUTUBE_API_PROMOTED_ITEM_H_
31 #define GOOGLE_YOUTUBE_API_PROMOTED_ITEM_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/youtube_api/invideo_timing.h"
39 #include "google/youtube_api/promoted_item_id.h"
40 
41 namespace Json {
42 class Value;
43 } // namespace Json
44 
45 namespace google_youtube_api {
46 using namespace googleapis;
47 
53 class PromotedItem : public client::JsonCppData {
54  public:
60  static PromotedItem* New();
61 
67  explicit PromotedItem(const Json::Value& storage);
68 
74  explicit PromotedItem(Json::Value* storage);
75 
79  virtual ~PromotedItem();
80 
86  const StringPiece GetTypeName() const {
87  return StringPiece("google_youtube_api::PromotedItem");
88  }
89 
95  bool has_custom_message() const {
96  return Storage().isMember("customMessage");
97  }
98 
103  MutableStorage()->removeMember("customMessage");
104  }
105 
106 
110  const StringPiece get_custom_message() const {
111  const Json::Value& v = Storage("customMessage");
112  if (v == Json::Value::null) return StringPiece("");
113  return StringPiece(v.asCString());
114  }
115 
124  void set_custom_message(const StringPiece& value) {
125  *MutableStorage("customMessage") = value.data();
126  }
127 
133  bool has_id() const {
134  return Storage().isMember("id");
135  }
136 
140  void clear_id() {
141  MutableStorage()->removeMember("id");
142  }
143 
144 
148  const PromotedItemId get_id() const;
149 
157  PromotedItemId mutable_id();
158 
166  return Storage().isMember("promotedByContentOwner");
167  }
168 
173  MutableStorage()->removeMember("promotedByContentOwner");
174  }
175 
176 
181  const Json::Value& storage = Storage("promotedByContentOwner");
182  return client::JsonValueToCppValueHelper<bool >(storage);
183  }
184 
194  void set_promoted_by_content_owner(bool value) {
195  client::SetJsonValueFromCppValueHelper<bool >(
196  value, MutableStorage("promotedByContentOwner"));
197  }
198 
204  bool has_timing() const {
205  return Storage().isMember("timing");
206  }
207 
211  void clear_timing() {
212  MutableStorage()->removeMember("timing");
213  }
214 
215 
219  const InvideoTiming get_timing() const;
220 
229  InvideoTiming mutable_timing();
230 
231  private:
232  void operator=(const PromotedItem&);
233 }; // PromotedItem
234 } // namespace google_youtube_api
235 #endif // GOOGLE_YOUTUBE_API_PROMOTED_ITEM_H_
bool has_custom_message() const
Definition: promoted_item.h:95
Definition: promoted_item.h:53
Definition: invideo_timing.h:51
bool get_promoted_by_content_owner() const
Definition: promoted_item.h:180
Definition: access_policy.cc:40
void clear_custom_message()
Definition: promoted_item.h:102
const StringPiece GetTypeName() const
Definition: promoted_item.h:86
void clear_promoted_by_content_owner()
Definition: promoted_item.h:172
void set_custom_message(const StringPiece &value)
Definition: promoted_item.h:124
Definition: access_policy.h:38
const StringPiece get_custom_message() const
Definition: promoted_item.h:110
void clear_id()
Definition: promoted_item.h:140
bool has_promoted_by_content_owner() const
Definition: promoted_item.h:165
Definition: promoted_item_id.h:50
void clear_timing()
Definition: promoted_item.h:211
void set_promoted_by_content_owner(bool value)
Definition: promoted_item.h:194
bool has_timing() const
Definition: promoted_item.h:204
bool has_id() const
Definition: promoted_item.h:133