youtube  v3
sponsor_snippet.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_SPONSOR_SNIPPET_H_
31 #define GOOGLE_YOUTUBE_API_SPONSOR_SNIPPET_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/client/util/date_time.h"
38 #include "googleapis/strings/stringpiece.h"
39 
40 #include "google/youtube_api/channel_profile_details.h"
41 
42 namespace Json {
43 class Value;
44 } // namespace Json
45 
46 namespace google_youtube_api {
47 using namespace googleapis;
48 
54 class SponsorSnippet : public client::JsonCppData {
55  public:
61  static SponsorSnippet* New();
62 
68  explicit SponsorSnippet(const Json::Value& storage);
69 
75  explicit SponsorSnippet(Json::Value* storage);
76 
80  virtual ~SponsorSnippet();
81 
87  const StringPiece GetTypeName() const {
88  return StringPiece("google_youtube_api::SponsorSnippet");
89  }
90 
96  bool has_channel_id() const {
97  return Storage().isMember("channelId");
98  }
99 
104  MutableStorage()->removeMember("channelId");
105  }
106 
107 
111  const StringPiece get_channel_id() const {
112  const Json::Value& v = Storage("channelId");
113  if (v == Json::Value::null) return StringPiece("");
114  return StringPiece(v.asCString());
115  }
116 
124  void set_channel_id(const StringPiece& value) {
125  *MutableStorage("channelId") = value.data();
126  }
127 
135  return Storage().isMember("cumulativeDurationMonths");
136  }
137 
142  MutableStorage()->removeMember("cumulativeDurationMonths");
143  }
144 
145 
150  const Json::Value& storage = Storage("cumulativeDurationMonths");
151  return client::JsonValueToCppValueHelper<int32 >(storage);
152  }
153 
161  void set_cumulative_duration_months(int32 value) {
162  client::SetJsonValueFromCppValueHelper<int32 >(
163  value, MutableStorage("cumulativeDurationMonths"));
164  }
165 
171  bool has_sponsor_details() const {
172  return Storage().isMember("sponsorDetails");
173  }
174 
179  MutableStorage()->removeMember("sponsorDetails");
180  }
181 
182 
187  const ChannelProfileDetails get_sponsor_details() const;
188 
197  ChannelProfileDetails mutable_sponsorDetails();
198 
204  bool has_sponsor_since() const {
205  return Storage().isMember("sponsorSince");
206  }
207 
212  MutableStorage()->removeMember("sponsorSince");
213  }
214 
215 
219  client::DateTime get_sponsor_since() const {
220  const Json::Value& storage = Storage("sponsorSince");
221  return client::JsonValueToCppValueHelper<client::DateTime >(storage);
222  }
223 
232  void set_sponsor_since(client::DateTime value) {
233  client::SetJsonValueFromCppValueHelper<client::DateTime >(
234  value, MutableStorage("sponsorSince"));
235  }
236 
237  private:
238  void operator=(const SponsorSnippet&);
239 }; // SponsorSnippet
240 } // namespace google_youtube_api
241 #endif // GOOGLE_YOUTUBE_API_SPONSOR_SNIPPET_H_
Definition: access_policy.cc:40
const StringPiece get_channel_id() const
Definition: sponsor_snippet.h:111
bool has_cumulative_duration_months() const
Definition: sponsor_snippet.h:134
void clear_cumulative_duration_months()
Definition: sponsor_snippet.h:141
Definition: channel_profile_details.h:50
void set_sponsor_since(client::DateTime value)
Definition: sponsor_snippet.h:232
const StringPiece GetTypeName() const
Definition: sponsor_snippet.h:87
void set_channel_id(const StringPiece &value)
Definition: sponsor_snippet.h:124
bool has_sponsor_details() const
Definition: sponsor_snippet.h:171
bool has_channel_id() const
Definition: sponsor_snippet.h:96
void clear_sponsor_since()
Definition: sponsor_snippet.h:211
void set_cumulative_duration_months(int32 value)
Definition: sponsor_snippet.h:161
Definition: access_policy.h:38
bool has_sponsor_since() const
Definition: sponsor_snippet.h:204
Definition: sponsor_snippet.h:54
int32 get_cumulative_duration_months() const
Definition: sponsor_snippet.h:149
void clear_channel_id()
Definition: sponsor_snippet.h:103
client::DateTime get_sponsor_since() const
Definition: sponsor_snippet.h:219
void clear_sponsor_details()
Definition: sponsor_snippet.h:178