AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
VideoEntityTypes.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef ALEXA_CLIENT_SDK_VIDEOCONTENT_INCLUDE_ACSDK_VIDEOCONTENT_VIDEOENTITYTYPES_H_
17 #define ALEXA_CLIENT_SDK_VIDEOCONTENT_INCLUDE_ACSDK_VIDEOCONTENT_VIDEOENTITYTYPES_H_
18 
19 #include <string>
20 #include <unordered_map>
21 
22 #include <rapidjson/document.h>
24 
25 namespace alexaClientSDK {
26 namespace acsdkAlexaVideoCommon {
27 
36 class VideoEntity {
37 public:
41  enum class EntityType {
43  ACTOR,
45  APP,
47  CHANNEL,
49  CHARACTER,
51  DIRECTOR,
53  EPISODE,
55  EVENT,
57  FRANCHISE,
59  GENRE,
61  LEAGUE,
63  MEDIA_TYPE,
65  POPULARITY,
69  RECENCY,
71  SEASON,
73  SPORT,
77  VIDEO,
80  };
81 
85  struct Actor {
88  std::unordered_map<std::string, std::string> externalIds;
91  };
92 
96  struct App {
99  std::unordered_map<std::string, std::string> externalIds;
102  };
103 
107  struct Channel {
113  Channel(int channelNum) : channelNumber{channelNum} {};
114 
117  std::unordered_map<std::string, std::string> externalIds;
126  };
127 
131  struct Character {
134  std::unordered_map<std::string, std::string> externalIds;
137  };
138 
142  struct Director {
145  std::unordered_map<std::string, std::string> externalIds;
148  };
149 
154  struct Episode {
157  };
158 
163  struct Event {
166  std::unordered_map<std::string, std::string> externalIds;
169  };
170 
175  struct Franchise {
178  };
179 
184  struct Genre {
187  std::unordered_map<std::string, std::string> externalIds;
190  };
191 
195  struct League {
198  std::unordered_map<std::string, std::string> externalIds;
201  };
202 
206  struct Media {
210  enum class Type {
212  MOVIE,
214  VIDEO,
216  TV_SHOW
217  };
218 
224  Media(Type typeValue) : type{typeValue} {};
225 
227  Type type;
228  };
229 
233  struct Popularity {
235  bool value;
236  };
237 
244  };
245 
250  struct Recency {
254  enum class Type {
256  NEW,
258  OLD
259  };
260 
266  Recency(Type recencyType) : type{recencyType} {};
267 
269  Type type;
270  };
271 
276  struct Season {
279  };
280 
284  struct Sport {
287  std::unordered_map<std::string, std::string> externalIds;
290  };
291 
295  struct SportsTeam {
298  std::unordered_map<std::string, std::string> externalIds;
301  };
302 
306  struct Video {
309  std::unordered_map<std::string, std::string> externalIds;
312  };
313 
321  enum class Type {
323  SD,
325  HD,
327  FOUR_K,
329  EIGHT_K
330  };
331 
337  VideoResolution(Type resolutionType) : type{resolutionType} {};
338 
340  Type type;
341  };
342 
349  bool parseVideoEntityType(const rapidjson::Value& entityJson, VideoEntity::EntityType& entityType);
350 
357  bool parseActorEntity(const rapidjson::Value& entityJson, Actor& actor);
358 
365  bool parseAppEntity(const rapidjson::Value& entityJson, App& app);
366 
373  bool parseChannelEntity(const rapidjson::Value& entityJson, Channel& channel);
374 
381  bool parseCharacterEntity(const rapidjson::Value& entityJson, Character& character);
382 
389  bool parseDirectorEntity(const rapidjson::Value& entityJson, Director& director);
390 
397  bool parseEpisodeEntity(const rapidjson::Value& entityJson, Episode& episode);
398 
405  bool parseEventEntity(const rapidjson::Value& entityJson, Event& event);
406 
413  bool parseFranchiseEntity(const rapidjson::Value& entityJson, Franchise& franchise);
414 
421  bool parseGenreEntity(const rapidjson::Value& entityJson, Genre& genre);
422 
429  bool parseLeagueEntity(const rapidjson::Value& entityJson, League& league);
430 
437  bool parseMediaEntity(const rapidjson::Value& entityJson, Media& media);
438 
445  bool parsePopularityEntity(const rapidjson::Value& entityJson, Popularity& popularity);
446 
453  bool parseProductionCompanyEntity(const rapidjson::Value& entityJson, ProductionCompany& productionCompany);
454 
461  bool parseRecencyEntity(const rapidjson::Value& entityJson, Recency& recency);
462 
469  bool parseSeasonEntity(const rapidjson::Value& entityJson, Season& season);
470 
477  bool parseSportEntity(const rapidjson::Value& entityJson, Sport& sport);
478 
485  bool parseSportsTeamEntity(const rapidjson::Value& entityJson, SportsTeam& sportsTeam);
486 
493  bool parseVideoEntity(const rapidjson::Value& entityJson, Video& video);
494 
501  bool parseVideoResolutionEntity(const rapidjson::Value& entityJson, VideoResolution& videoResolution);
502 
509 };
510 
511 } // namespace acsdkAlexaVideoCommon
512 } // namespace alexaClientSDK
513 #endif // ALEXA_CLIENT_SDK_VIDEOCONTENT_INCLUDE_ACSDK_VIDEOCONTENT_VIDEOENTITYTYPES_H_
bool parseSportsTeamEntity(const rapidjson::Value &entityJson, SportsTeam &sportsTeam)
Related video entities, such as a trilogy or five part series.
std::string name
Name of the actor. There is no restriction on the format of actor name.
Definition: VideoEntityTypes.h:90
Identifying data for the piece of video content, such as the movie title.
bool parseActorEntity(const rapidjson::Value &entityJson, Actor &actor)
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:187
A type of event, such as a music concert or sporting event.
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:287
Category of video content, such as action, drama, or comedy.
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:88
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:99
bool parseMediaEntity(const rapidjson::Value &entityJson, Media &media)
bool parseSeasonEntity(const rapidjson::Value &entityJson, Season &season)
std::string name
The name of the video.
Definition: VideoEntityTypes.h:311
bool parseGenreEntity(const rapidjson::Value &entityJson, Genre &genre)
std::string name
The name of the genre.
Definition: VideoEntityTypes.h:189
std::string name
The name of the director.
Definition: VideoEntityTypes.h:147
bool parseEpisodeEntity(const rapidjson::Value &entityJson, Episode &episode)
::std::string string
Definition: gtest-port.h:1097
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:309
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:166
std::string name
The name of the sports team.
Definition: VideoEntityTypes.h:300
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:113
std::string number
The episode number.
Definition: VideoEntityTypes.h:156
std::string name
The name of the sport.
Definition: VideoEntityTypes.h:289
An application that the user might launch, such as Prime Video.
bool parseSportEntity(const rapidjson::Value &entityJson, Sport &sport)
A helper class that provides an aggregation of all video entity types. Users can ask Alexa to search ...
Definition: VideoEntityTypes.h:36
std::string name
The name of the franchise.
Definition: VideoEntityTypes.h:177
std::string name
The name of the character.
Definition: VideoEntityTypes.h:136
VideoResolution(Type resolutionType)
Definition: VideoEntityTypes.h:337
bool parseProductionCompanyEntity(const rapidjson::Value &entityJson, ProductionCompany &productionCompany)
bool parseVideoEntity(const rapidjson::Value &entityJson, Video &video)
bool parseEventEntity(const rapidjson::Value &entityJson, Event &event)
EntityType
Definition: VideoEntityTypes.h:41
std::string name
The name of the event type.
Definition: VideoEntityTypes.h:168
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:134
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:145
std::string channelCallSign
The call sign for the channel.
Definition: VideoEntityTypes.h:121
std::string uri
The URI of the channel.
Definition: VideoEntityTypes.h:123
Represents the identifying data for a television channel.
static std::string convertEntityTypeToString(const VideoEntity::EntityType &entityType)
bool Value(const T &value, M matcher)
Definition: gmock-matchers.h:4347
bool parsePopularityEntity(const rapidjson::Value &entityJson, Popularity &popularity)
bool parseRecencyEntity(const rapidjson::Value &entityJson, Recency &recency)
Type type
Indicates whether the user searches for new or old content.
Definition: VideoEntityTypes.h:266
std::string name
The name of the league.
Definition: VideoEntityTypes.h:200
bool parseCharacterEntity(const rapidjson::Value &entityJson, Character &character)
bool parseLeagueEntity(const rapidjson::Value &entityJson, League &league)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
bool parseAppEntity(const rapidjson::Value &entityJson, App &app)
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:298
bool parseFranchiseEntity(const rapidjson::Value &entityJson, Franchise &franchise)
type
Definition: upload.py:443
bool parseVideoResolutionEntity(const rapidjson::Value &entityJson, VideoResolution &videoResolution)
Type category of the video content, such as movie or TV show.
std::string name
Name of the application.
Definition: VideoEntityTypes.h:101
bool parseVideoEntityType(const rapidjson::Value &entityJson, VideoEntity::EntityType &entityType)
Indicates whether the user content is new or old.
int channelNumber
The channel number.
Definition: VideoEntityTypes.h:119
std::string name
The name of the channel.
Definition: VideoEntityTypes.h:125
Indicates whether the user asks for popular content.
Represents the requested video resolution, such as HD.
bool value
Indicates to provider that the user searches for popular content.
Definition: VideoEntityTypes.h:235
Type type
The media type.
Definition: VideoEntityTypes.h:224
bool parseDirectorEntity(const rapidjson::Value &entityJson, Director &director)
std::string number
The season number.
Definition: VideoEntityTypes.h:278
std::string name
Production company name.
Definition: VideoEntityTypes.h:243
bool parseChannelEntity(const rapidjson::Value &entityJson, Channel &channel)
std::unordered_map< std::string, std::string > externalIds
Definition: VideoEntityTypes.h:198

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0