TwitchReflection.cpp 54 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <AzCore/Script/ScriptContext.h>
  9. #include <AzCore/RTTI/BehaviorContext.h>
  10. #include <Twitch/TwitchBus.h>
  11. #include "TwitchReflection.h"
  12. namespace AZ
  13. {
  14. /*
  15. ** Helper macros to reflect the Twitch enums
  16. */
  17. AZ_TYPE_INFO_SPECIALIZE(Twitch::ResultCode, "{DA72B2F5-2983-4E30-B64C-BDF417FA73A6}");
  18. AZ_TYPE_INFO_SPECIALIZE(Twitch::PresenceAvailability, "{090CF417-870C-4E27-B9FC-6FE96787DE18}");
  19. AZ_TYPE_INFO_SPECIALIZE(Twitch::PresenceActivityType, "{B8D3EFFC-D71E-4441-9D09-BFD585A4B1B8}");
  20. AZ_TYPE_INFO_SPECIALIZE(Twitch::BroadCastType, "{751DA7A4-A080-4DE4-A15F-F63B2B066AA6}");
  21. AZ_TYPE_INFO_SPECIALIZE(Twitch::CommercialLength, "{76255136-2B04-4EE2-A499-BBB141A28716}");
  22. }
  23. namespace Twitch
  24. {
  25. #define ENUMCASE(code) case code: txtCode=AZStd::string::format(#code"(%llu)",static_cast<AZ::u64>(code)); break;
  26. AZStd::string ResultCodeToString(ResultCode code)
  27. {
  28. AZStd::string txtCode;
  29. switch(code)
  30. {
  31. ENUMCASE(ResultCode::Success)
  32. ENUMCASE(ResultCode::InvalidParam)
  33. ENUMCASE(ResultCode::TwitchRESTError)
  34. ENUMCASE(ResultCode::TwitchChannelNoUpdatesToMake)
  35. ENUMCASE(ResultCode::Unknown)
  36. default:
  37. txtCode = AZStd::string::format("Undefined ResultCode (%llu)", static_cast<AZ::u64>(code));
  38. }
  39. return txtCode;
  40. }
  41. AZStd::string PresenceAvailabilityToString(PresenceAvailability availability)
  42. {
  43. AZStd::string txtCode;
  44. switch (availability)
  45. {
  46. ENUMCASE(PresenceAvailability::Unknown)
  47. ENUMCASE(PresenceAvailability::Online)
  48. ENUMCASE(PresenceAvailability::Idle)
  49. default:
  50. txtCode = AZStd::string::format("Undefined PresenceAvailability (%llu)", static_cast<AZ::u64>(availability));
  51. }
  52. return txtCode;
  53. }
  54. AZStd::string PresenceActivityTypeToString(PresenceActivityType activity)
  55. {
  56. AZStd::string txtCode;
  57. switch (activity)
  58. {
  59. ENUMCASE(PresenceActivityType::Unknown)
  60. ENUMCASE(PresenceActivityType::Watching)
  61. ENUMCASE(PresenceActivityType::Playing)
  62. ENUMCASE(PresenceActivityType::Broadcasting)
  63. default:
  64. txtCode = AZStd::string::format("Undefined PresenceActivityType (%llu)", static_cast<AZ::u64>(activity));
  65. }
  66. return txtCode;
  67. }
  68. AZStd::string BoolName(bool value, const AZStd::string & trueText, const AZStd::string & falseText)
  69. {
  70. return value ? trueText : falseText;
  71. }
  72. AZStd::string UserNotificationsToString(const UserNotifications & info)
  73. {
  74. return "Email: " + BoolName(info.EMail, "On", "Off") +
  75. "Push: " + BoolName(info.EMail, "On", "Off");
  76. }
  77. AZStd::string UserInfoIDToString(const UserInfo & info)
  78. {
  79. return "UserID:" + info.ID;
  80. }
  81. AZStd::string UserInfoMiniString(const UserInfo & info)
  82. {
  83. return UserInfoIDToString(info) +
  84. " DisplayName:" + info.DisplayName +
  85. " Name:" + info.Name +
  86. " Type:" + info.Type;
  87. }
  88. AZStd::string UserInfoToString(const UserInfo & info)
  89. {
  90. return UserInfoMiniString(info) +
  91. " Bio:" + info.Bio +
  92. " EMail:" + info.EMail +
  93. " Logo:" + info.Logo +
  94. " Notifications:" + UserNotificationsToString(info.Notifications) +
  95. " CreatedDate:" + info.CreatedDate +
  96. " UpdatedDate:" + info.UpdatedDate +
  97. " EMailVerified:" + BoolName(info.EMailVerified, "Yes", "No") +
  98. " Partnered:" + BoolName(info.Partnered, "Yes", "No") +
  99. " TwitterConnected:" + BoolName(info.TwitterConnected, "Yes", "No");
  100. }
  101. AZStd::string UserInfoListToString(const UserInfoList & info)
  102. {
  103. AZStd::string strList;
  104. for (const auto & i : info)
  105. {
  106. if (!strList.empty())
  107. {
  108. strList += ",";
  109. }
  110. strList += "{";
  111. strList += UserInfoMiniString(i);
  112. strList += "}";
  113. }
  114. return strList;
  115. }
  116. AZStd::string FriendRecommendationToString(const FriendRecommendation & info)
  117. {
  118. return UserInfoIDToString(info.User) +
  119. " Reason:" + info.Reason;
  120. }
  121. AZStd::string FriendRecommendationsToString(const FriendRecommendationList & info)
  122. {
  123. AZStd::string strList;
  124. for (const auto & i : info)
  125. {
  126. if (!strList.empty())
  127. {
  128. strList += ",";
  129. }
  130. strList += "{";
  131. strList += FriendRecommendationToString(i);
  132. strList += "}";
  133. }
  134. return strList;
  135. }
  136. AZStd::string FriendInfoToString(const FriendInfo & info)
  137. {
  138. return UserInfoIDToString(info.User) +
  139. " CreatedDate:" + info.CreatedDate;
  140. }
  141. AZStd::string FriendListToString(const FriendList & info)
  142. {
  143. AZStd::string strList;
  144. for (const auto & i : info)
  145. {
  146. if (!strList.empty())
  147. {
  148. strList += ",";
  149. }
  150. strList += "{";
  151. strList += FriendInfoToString(i);
  152. strList += "}";
  153. }
  154. return strList;
  155. }
  156. AZStd::string FriendRequestToString(const FriendRequest & info)
  157. {
  158. return UserInfoIDToString(info.User) +
  159. " IsRecommended:" + BoolName(info.IsRecommended, "Yes", "No") +
  160. " IsStranger:" + BoolName(info.IsStranger, "Yes", "No") +
  161. " NonStrangerReason:" + info.NonStrangerReason +
  162. " RequestedDate:" + info.RequestedDate;
  163. }
  164. AZStd::string FriendRequestListToString(const FriendRequestList & info)
  165. {
  166. AZStd::string strList;
  167. for (const auto & i : info)
  168. {
  169. if (!strList.empty())
  170. {
  171. strList += ",";
  172. }
  173. strList += "{";
  174. strList += FriendRequestToString(i);
  175. strList += "}";
  176. }
  177. return strList;
  178. }
  179. AZStd::string PresenceStatusToString(const PresenceStatus & info)
  180. {
  181. return "UserID:" + info.UserID +
  182. " Index:" + AZStd::string::format("%lld", info.Index) +
  183. " UpdatedDate:" + AZStd::string::format("%lld", info.UpdatedDate) +
  184. " ActivityType:" + PresenceActivityTypeToString(info.ActivityType) +
  185. " Availability:" + PresenceAvailabilityToString(info.Availability);
  186. }
  187. AZStd::string PresenceStatusListToString(const PresenceStatusList & info)
  188. {
  189. AZStd::string strList;
  190. for (const auto & i : info)
  191. {
  192. if (!strList.empty())
  193. {
  194. strList += ",";
  195. }
  196. strList += "{";
  197. strList += PresenceStatusToString(i);
  198. strList += "}";
  199. }
  200. return strList;
  201. }
  202. AZStd::string PresenceSettingsToString(const PresenceSettings & info)
  203. {
  204. return "IsInvisible:" + BoolName(info.IsInvisible, "Yes", "No") +
  205. " ShareActivity:" + BoolName(info.ShareActivity, "Shared", "None");
  206. }
  207. AZStd::string ChannelInfoToString(const ChannelInfo & info)
  208. {
  209. return "Followers:" + AZStd::string::format("%llu", info.NumFollowers) +
  210. "Views:" + AZStd::string::format("%llu", info.NumViews) +
  211. "ItemsRecieved:" + AZStd::string::format("%llu", info.NumItemsRecieved) +
  212. "Partner:" + BoolName(info.Partner, "Yes", "No") +
  213. "Mature:" + BoolName(info.Mature, "Yes", "No") +
  214. "Id:" + info.Id +
  215. "BroadcasterLanguage:" + info.BroadcasterLanguage +
  216. "DisplayName:" + info.DisplayName +
  217. "eMail:" + info.eMail +
  218. "GameName:" + info.GameName +
  219. "Language:" + info.Lanugage +
  220. "Logo:" + info.Logo +
  221. "Name:" + info.Name +
  222. "ProfileBanner:" + info.ProfileBanner +
  223. "ProfileBannerBackgroundColor:" + info.ProfileBannerBackgroundColor +
  224. "Status:" + info.Status +
  225. "StreamKey:" + info.StreamKey +
  226. "UpdatedDate:" + info.UpdatedDate +
  227. "CreatedDate:" + info.CreatedDate +
  228. "URL:" + info.URL +
  229. "VideoBanner:" + info.VideoBanner;
  230. }
  231. AZStd::string FollowerToString(const Follower& info)
  232. {
  233. return UserInfoIDToString(info.User) +
  234. " CreatedDate:" + info.CreatedDate +
  235. " Notifications:" + BoolName(info.Notifications, "On", "Off");
  236. }
  237. AZStd::string FollowerListToString(const FollowerList & info)
  238. {
  239. AZStd::string strList;
  240. for (const auto & i : info)
  241. {
  242. if (!strList.empty())
  243. {
  244. strList += ",";
  245. }
  246. strList += "{";
  247. strList += FollowerToString(i);
  248. strList += "}";
  249. }
  250. return strList;
  251. }
  252. AZStd::string TeamInfoToString(const TeamInfo& info)
  253. {
  254. return "ID:" + info.ID +
  255. " Background:" + info.Background +
  256. " Banner:" + info.Banner +
  257. " CreatedDate:" + info.CreatedDate +
  258. " DisplayName:" + info.DisplayName +
  259. " Info:" + info.Info +
  260. " Logo:" + info.Logo +
  261. " Name:" + info.Name +
  262. " UpdatedDate:" + info.UpdatedDate;
  263. }
  264. AZStd::string TeamInfoListToString(const TeamInfoList& info)
  265. {
  266. AZStd::string strList;
  267. for (const auto & i : info)
  268. {
  269. if (!strList.empty())
  270. {
  271. strList += ",";
  272. }
  273. strList += "{";
  274. strList += TeamInfoToString(i);
  275. strList += "}";
  276. }
  277. return strList;
  278. }
  279. AZStd::string SubscriberInfoToString(const SubscriberInfo& info)
  280. {
  281. return "ID:" + info.ID +
  282. " CreatedDate:" + info.CreatedDate +
  283. UserInfoIDToString(info.User);
  284. }
  285. AZStd::string SubscriberInfoListToString(const SubscriberInfoList& info)
  286. {
  287. AZStd::string strList;
  288. for (const auto & i : info)
  289. {
  290. if (!strList.empty())
  291. {
  292. strList += ",";
  293. }
  294. strList += "{";
  295. strList += SubscriberInfoToString(i);
  296. strList += "}";
  297. }
  298. return strList;
  299. }
  300. AZStd::string VideoInfoShortToString(const VideoInfo& info)
  301. {
  302. return "ID:" + info.ID;
  303. }
  304. AZStd::string VideoInfoListToString(const VideoInfoList& info)
  305. {
  306. AZStd::string strList;
  307. for (const auto & i : info)
  308. {
  309. if (!strList.empty())
  310. {
  311. strList += ",";
  312. }
  313. strList += "{";
  314. strList += VideoInfoShortToString(i);
  315. strList += "}";
  316. }
  317. return strList;
  318. }
  319. AZStd::string StartChannelCommercialResultToString(const StartChannelCommercialResult& info)
  320. {
  321. return "Duration:" + AZStd::string::format("%llu", info.Duration) +
  322. " RetryAfter:" + AZStd::string::format("%llu", info.RetryAfter) +
  323. " Message:" + info.Message;
  324. }
  325. AZStd::string CommunityInfoToString(const CommunityInfo& info)
  326. {
  327. return "ID:" + info.ID +
  328. " AvatarImageURL:" + info.AvatarImageURL +
  329. " CoverImageURL:" + info.CoverImageURL +
  330. " Description:" + info.Description +
  331. " DescriptionHTML:" + info.DescriptionHTML +
  332. " Language:" + info.Language +
  333. " Name:" + info.Name +
  334. " OwnerID:" + info.OwnerID +
  335. " Rules:" + info.Rules +
  336. " RulesHTML:" + info.RulesHTML +
  337. " Summary:" + info.Summary;
  338. }
  339. AZStd::string CommunityInfoListToString(const CommunityInfoList& info)
  340. {
  341. AZStd::string strList;
  342. for (const auto & i : info)
  343. {
  344. if (!strList.empty())
  345. {
  346. strList += ",";
  347. }
  348. strList += "{";
  349. strList += CommunityInfoToString(i);
  350. strList += "}";
  351. }
  352. return strList;
  353. }
  354. AZStd::string ReturnValueToString(const ReturnValue& info)
  355. {
  356. return "ReceiptID:" + AZStd::string::format("%llu", info.GetID()) +
  357. " Result: " + ResultCodeToString(info.Result);
  358. }
  359. AZStd::string Int64Value::ToString() const
  360. {
  361. return ReturnValueToString(*this) +
  362. AZStd::string::format(" Int64:%lld", Value);
  363. }
  364. AZStd::string Uint64Value::ToString() const
  365. {
  366. return ReturnValueToString(*this) +
  367. AZStd::string::format(" Uint64:%llu", Value);
  368. }
  369. AZStd::string StringValue::ToString() const
  370. {
  371. return ReturnValueToString(*this) +
  372. " String:" + "\"" + Value + "\"";
  373. }
  374. AZStd::string UserInfoValue::ToString() const
  375. {
  376. return ReturnValueToString(*this) +
  377. UserInfoToString(Value);
  378. }
  379. AZStd::string FriendRecommendationValue::ToString() const
  380. {
  381. return ReturnValueToString(*this) +
  382. " ListSize:" + AZStd::string::format("%llu-", static_cast<AZ::u64>(Value.size())) +
  383. " Recommendations:" + FriendRecommendationsToString(Value);
  384. }
  385. AZStd::string GetFriendValue::ToString() const
  386. {
  387. return ReturnValueToString(*this) +
  388. " ListSize:" + AZStd::string::format("%llu-", static_cast<AZ::u64>(Value.Friends.size())) +
  389. " Cursor:" + Value.Cursor +
  390. " Friends:" + FriendListToString(Value.Friends);
  391. }
  392. AZStd::string FriendStatusValue::ToString() const
  393. {
  394. return ReturnValueToString(*this) +
  395. " Status:" + Value.Status +
  396. UserInfoToString(Value.User);
  397. }
  398. AZStd::string FriendRequestValue::ToString() const
  399. {
  400. return ReturnValueToString(*this) +
  401. " Total:" + AZStd::string::format("%llu", Value.Total) +
  402. " Cursor:" + Value.Cursor +
  403. " Requests:" + FriendRequestListToString(Value.Requests);
  404. }
  405. AZStd::string PresenceStatusValue::ToString() const
  406. {
  407. return ReturnValueToString(*this) +
  408. " Total:" + AZStd::string::format("%llu", static_cast<AZ::u64>(Value.size())) +
  409. " StatusList:" + PresenceStatusListToString(Value);
  410. }
  411. AZStd::string PresenceSettingsValue::ToString() const
  412. {
  413. return ReturnValueToString(*this) +
  414. " " + PresenceSettingsToString(Value);
  415. }
  416. AZStd::string ChannelInfoValue::ToString() const
  417. {
  418. return ReturnValueToString(*this) +
  419. " " + ChannelInfoToString(Value);
  420. }
  421. AZStd::string UserInfoListValue::ToString() const
  422. {
  423. return ReturnValueToString(*this) +
  424. " Total:" + AZStd::string::format("%llu", static_cast<AZ::u64>(Value.size())) +
  425. " Users:" + UserInfoListToString(Value);
  426. }
  427. AZStd::string FollowerResultValue::ToString() const
  428. {
  429. return ReturnValueToString(*this) +
  430. " Total:" + AZStd::string::format("%llu", Value.Total) +
  431. " Cursor:" + Value.Cursor +
  432. " Followers:" + FollowerListToString(Value.Followers);
  433. }
  434. AZStd::string ChannelTeamValue::ToString() const
  435. {
  436. return ReturnValueToString(*this) +
  437. " Total:" + AZStd::string::format("%llu", static_cast<AZ::u64>(Value.size())) +
  438. " Teams:" + TeamInfoListToString(Value);
  439. }
  440. AZStd::string SubscriberValue::ToString() const
  441. {
  442. return ReturnValueToString(*this) +
  443. " Total:" + AZStd::string::format("%llu", Value.Total) +
  444. " Subscribers:" + SubscriberInfoListToString(Value.Subscribers);
  445. }
  446. AZStd::string SubscriberbyUserValue::ToString() const
  447. {
  448. return ReturnValueToString(*this) +
  449. " SubscriberInfo:" + SubscriberInfoToString(Value);
  450. }
  451. AZStd::string VideoReturnValue::ToString() const
  452. {
  453. return ReturnValueToString(*this) +
  454. " Total:" + AZStd::string::format("%llu", Value.Total) +
  455. " Videos:" + VideoInfoListToString(Value.Videos);
  456. }
  457. AZStd::string StartChannelCommercialValue::ToString() const
  458. {
  459. return ReturnValueToString(*this) +
  460. " " + StartChannelCommercialResultToString(Value);
  461. }
  462. AZStd::string CommunityInfoValue::ToString() const
  463. {
  464. return ReturnValueToString(*this) +
  465. " " + CommunityInfoToString(Value);
  466. }
  467. AZStd::string CommunityInfoReturnValue::ToString() const
  468. {
  469. return ReturnValueToString(*this) +
  470. " Total:" + AZStd::string::format("%llu", Value.Total) +
  471. " Communities:" + CommunityInfoListToString(Value.Communities);
  472. }
  473. namespace Internal
  474. {
  475. class BehaviorTwitchNotifyBus
  476. : public TwitchNotifyBus::Handler
  477. , public AZ::BehaviorEBusHandler
  478. {
  479. public:
  480. AZ_EBUS_BEHAVIOR_BINDER(BehaviorTwitchNotifyBus, "{63EEA49D-1205-4E43-9451-26ACF5771901}", AZ::SystemAllocator,
  481. UserIDNotify,
  482. OAuthTokenNotify,
  483. GetUser,
  484. ResetFriendsNotificationCountNotify,
  485. GetFriendNotificationCount,
  486. GetFriendRecommendations,
  487. GetFriends,
  488. GetFriendStatus,
  489. AcceptFriendRequest,
  490. GetFriendRequests,
  491. CreateFriendRequest,
  492. DeclineFriendRequest,
  493. UpdatePresenceStatus,
  494. GetPresenceStatusofFriends,
  495. GetPresenceSettings,
  496. UpdatePresenceSettings,
  497. GetChannel,
  498. GetChannelbyID,
  499. UpdateChannel,
  500. GetChannelEditors,
  501. GetChannelFollowers,
  502. GetChannelTeams,
  503. GetChannelSubscribers,
  504. CheckChannelSubscriptionbyUser,
  505. GetChannelVideos,
  506. StartChannelCommercial,
  507. ResetChannelStreamKey);
  508. void UserIDNotify(const StringValue& userID) override
  509. {
  510. Call(FN_UserIDNotify, userID);
  511. }
  512. void OAuthTokenNotify(const StringValue& token) override
  513. {
  514. Call(FN_OAuthTokenNotify, token);
  515. }
  516. void GetUser(const UserInfoValue& result) override
  517. {
  518. Call(FN_GetUser, result);
  519. }
  520. void ResetFriendsNotificationCountNotify(const Int64Value& result) override
  521. {
  522. Call(FN_ResetFriendsNotificationCountNotify, result);
  523. }
  524. void GetFriendNotificationCount(const Int64Value& result) override
  525. {
  526. Call(FN_GetFriendNotificationCount, result);
  527. }
  528. void GetFriendRecommendations(const FriendRecommendationValue& result) override
  529. {
  530. Call(FN_GetFriendRecommendations, result);
  531. }
  532. void GetFriends(const GetFriendValue& result) override
  533. {
  534. Call(FN_GetFriends, result);
  535. }
  536. void GetFriendStatus(const FriendStatusValue& result) override
  537. {
  538. Call(FN_GetFriendStatus, result);
  539. }
  540. void AcceptFriendRequest(const Int64Value& result) override
  541. {
  542. Call(FN_AcceptFriendRequest, result);
  543. }
  544. void GetFriendRequests(const FriendRequestValue& result) override
  545. {
  546. Call(FN_GetFriendRequests, result);
  547. }
  548. void CreateFriendRequest(const Int64Value& result) override
  549. {
  550. Call(FN_CreateFriendRequest, result);
  551. }
  552. void DeclineFriendRequest(const Int64Value& result) override
  553. {
  554. Call(FN_DeclineFriendRequest, result);
  555. }
  556. void UpdatePresenceStatus(const Int64Value& result) override
  557. {
  558. Call(FN_UpdatePresenceStatus, result);
  559. }
  560. void GetPresenceStatusofFriends(const PresenceStatusValue& result) override
  561. {
  562. Call(FN_GetPresenceStatusofFriends, result);
  563. }
  564. void GetPresenceSettings(const PresenceSettingsValue& result) override
  565. {
  566. Call(FN_GetPresenceSettings, result);
  567. }
  568. void UpdatePresenceSettings(const PresenceSettingsValue& result) override
  569. {
  570. Call(FN_UpdatePresenceSettings, result);
  571. }
  572. void GetChannelbyID(const ChannelInfoValue& result) override
  573. {
  574. Call(FN_GetChannelbyID, result);
  575. }
  576. void GetChannel(const ChannelInfoValue& result) override
  577. {
  578. Call(FN_GetChannel, result);
  579. }
  580. void UpdateChannel(const ChannelInfoValue& result) override
  581. {
  582. Call(FN_UpdateChannel, result);
  583. }
  584. void GetChannelEditors(const UserInfoListValue& result) override
  585. {
  586. Call(FN_GetChannelEditors, result);
  587. }
  588. void GetChannelFollowers(const FollowerResultValue& result) override
  589. {
  590. Call(FN_GetChannelFollowers, result);
  591. }
  592. void GetChannelTeams(const ChannelTeamValue& result) override
  593. {
  594. Call(FN_GetChannelTeams, result);
  595. }
  596. void GetChannelSubscribers(const SubscriberValue& result) override
  597. {
  598. Call(FN_GetChannelSubscribers, result);
  599. }
  600. void CheckChannelSubscriptionbyUser(const SubscriberbyUserValue& result) override
  601. {
  602. Call(FN_CheckChannelSubscriptionbyUser, result);
  603. }
  604. void GetChannelVideos(const VideoReturnValue& result) override
  605. {
  606. Call(FN_GetChannelVideos, result);
  607. }
  608. void StartChannelCommercial(const StartChannelCommercialValue& result) override
  609. {
  610. Call(FN_StartChannelCommercial, result);
  611. }
  612. void ResetChannelStreamKey(const ChannelInfoValue& result) override
  613. {
  614. Call(FN_ResetChannelStreamKey, result);
  615. }
  616. };
  617. /*
  618. ** helper macro for reflecting the enums
  619. */
  620. #define ENUM_CLASS_HELPER(className, enumName) Enum<(int)className::enumName>(#enumName)
  621. void Reflect(AZ::BehaviorContext & context)
  622. {
  623. /*
  624. ** Reflect the enum's
  625. */
  626. context.Class<ResultCode>("ResultCode")->
  627. ENUM_CLASS_HELPER(ResultCode, Success)->
  628. ENUM_CLASS_HELPER(ResultCode, InvalidParam)->
  629. ENUM_CLASS_HELPER(ResultCode, TwitchRESTError)->
  630. ENUM_CLASS_HELPER(ResultCode, TwitchChannelNoUpdatesToMake)->
  631. ENUM_CLASS_HELPER(ResultCode, Unknown)
  632. ;
  633. context.Class<PresenceAvailability>("PresenceAvailability")->
  634. ENUM_CLASS_HELPER(PresenceAvailability, Unknown)->
  635. ENUM_CLASS_HELPER(PresenceAvailability, Online)->
  636. ENUM_CLASS_HELPER(PresenceAvailability, Idle)
  637. ;
  638. context.Class<PresenceActivityType>("PresenceActivityType")->
  639. ENUM_CLASS_HELPER(PresenceActivityType, Unknown)->
  640. ENUM_CLASS_HELPER(PresenceActivityType, Watching)->
  641. ENUM_CLASS_HELPER(PresenceActivityType, Playing)->
  642. ENUM_CLASS_HELPER(PresenceActivityType, Broadcasting)
  643. ;
  644. context.Class<BroadCastType>("BroadCastType")->
  645. ENUM_CLASS_HELPER(BroadCastType, Default)->
  646. ENUM_CLASS_HELPER(BroadCastType, Archive)->
  647. ENUM_CLASS_HELPER(BroadCastType, Highlight)->
  648. ENUM_CLASS_HELPER(BroadCastType, Upload)->
  649. ENUM_CLASS_HELPER(BroadCastType, ArchiveAndHighlight)->
  650. ENUM_CLASS_HELPER(BroadCastType, ArchiveAndUpload)->
  651. ENUM_CLASS_HELPER(BroadCastType, ArchiveAndHighlightAndUpload)->
  652. ENUM_CLASS_HELPER(BroadCastType, HighlightAndUpload)
  653. ;
  654. context.Class<CommercialLength>("CommercialLength")->
  655. ENUM_CLASS_HELPER(CommercialLength, T30Seconds)->
  656. ENUM_CLASS_HELPER(CommercialLength, T60Seconds)->
  657. ENUM_CLASS_HELPER(CommercialLength, T90Seconds)->
  658. ENUM_CLASS_HELPER(CommercialLength, T120Seconds)->
  659. ENUM_CLASS_HELPER(CommercialLength, T150Seconds)->
  660. ENUM_CLASS_HELPER(CommercialLength, T180Seconds)
  661. ;
  662. context.Class<ReceiptID>()->
  663. Method("Equal", &ReceiptID::operator==)->
  664. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::Equal)->
  665. Property("ID", &ReceiptID::GetID, &ReceiptID::SetID)
  666. ;
  667. context.Class<Int64Value>()->
  668. Property("Value", [](const Int64Value& i64Value) { return i64Value.Value; }, nullptr)->
  669. Property("Result", [](const Int64Value& i64Value) { return i64Value.Result; }, nullptr)->
  670. Method("ToString", &Int64Value::ToString)->
  671. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  672. ;
  673. context.Class<Uint64Value>()->
  674. Property("Value", [](const Uint64Value& u64Value) { return u64Value.Value; }, nullptr)->
  675. Property("Result", [](const Uint64Value& u64Value) { return u64Value.Result; }, nullptr)->
  676. Method("ToString", &Uint64Value::ToString)->
  677. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  678. ;
  679. context.Class<StringValue>()->
  680. Property("Value", [](const StringValue& strValue) { return strValue.Value; }, nullptr)->
  681. Property("Result", [](const StringValue& strValue) { return strValue.Result; }, nullptr)->
  682. Method("ToString", &StringValue::ToString)->
  683. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  684. ;
  685. context.Class<UserNotifications>()->
  686. Property("EMail", [](const UserNotifications& value) { return value.EMail; }, nullptr)->
  687. Property("Push", [](const UserNotifications& value) { return value.Push; }, nullptr)
  688. ;
  689. context.Class<UserInfo>()->
  690. Property("ID", [](const UserInfo& value) { return value.ID; }, nullptr)->
  691. Property("Bio", [](const UserInfo& value) { return value.Bio; }, nullptr)->
  692. Property("CreatedDate", [](const UserInfo& value) { return value.CreatedDate; }, nullptr)->
  693. Property("DisplayName", [](const UserInfo& value) { return value.DisplayName; }, nullptr)->
  694. Property("EMail", [](const UserInfo& value) { return value.EMail; }, nullptr)->
  695. Property("Logo", [](const UserInfo& value) { return value.Logo; }, nullptr)->
  696. Property("Name", [](const UserInfo& value) { return value.Name; }, nullptr)->
  697. Property("ProfileBanner", [](const UserInfo& value) { return value.ProfileBanner; }, nullptr)->
  698. Property("ProfileBannerBackgroundColor", [](const UserInfo& value) { return value.ProfileBannerBackgroundColor; }, nullptr)->
  699. Property("Type", [](const UserInfo& value) { return value.Type; }, nullptr)->
  700. Property("UpdatedDate", [](const UserInfo& value) { return value.UpdatedDate; }, nullptr)->
  701. Property("Notifications", [](const UserInfo& value) { return value.Notifications; }, nullptr)->
  702. Property("EMailVerified", [](const UserInfo& value) { return value.EMailVerified; }, nullptr)->
  703. Property("Partnered", [](const UserInfo& value) { return value.Partnered; }, nullptr)->
  704. Property("TwitterConnected", [](const UserInfo& value) { return value.TwitterConnected; }, nullptr)
  705. ;
  706. context.Class<UserInfoValue>()->
  707. Property("Value", [](const UserInfoValue& value) { return value.Value; }, nullptr)->
  708. Property("Result", [](const UserInfoValue& value) { return value.Result; }, nullptr)->
  709. Method("ToString", &UserInfoValue::ToString)->
  710. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  711. ;
  712. context.Class<FriendRecommendation>()->
  713. Property("Reason", [](const FriendRecommendation& value) { return value.Reason; }, nullptr)->
  714. Property("User", [](const FriendRecommendation& value) { return value.User; }, nullptr)
  715. ;
  716. context.Class<FriendRecommendationValue>()->
  717. Property("Value", [](const FriendRecommendationValue& value) { return value.Value; }, nullptr)->
  718. Property("Result", [](const FriendRecommendationValue& value) { return value.Result; }, nullptr)->
  719. Method("ToString", &FriendRecommendationValue::ToString)->
  720. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  721. ;
  722. context.Class<GetFriendReturn>()->
  723. Property("Cursor", [](const GetFriendReturn& value) { return value.Cursor; }, nullptr)->
  724. Property("Friends", [](const GetFriendReturn& value) { return value.Friends; }, nullptr)
  725. ;
  726. context.Class<GetFriendValue>()->
  727. Property("Value", [](const GetFriendValue& value) { return value.Value; }, nullptr)->
  728. Property("Result", [](const GetFriendValue& value) { return value.Result; }, nullptr)->
  729. Method("ToString", &GetFriendValue::ToString)->
  730. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  731. ;
  732. context.Class<FriendStatus>()->
  733. Property("Status", [](const FriendStatus& value) { return value.Status; }, nullptr)->
  734. Property("User", [](const FriendStatus& value) { return value.User; }, nullptr)
  735. ;
  736. context.Class<FriendStatusValue>()->
  737. Property("Value", [](const FriendStatusValue& value) { return value.Value; }, nullptr)->
  738. Property("Result", [](const FriendStatusValue& value) { return value.Result; }, nullptr)->
  739. Method("ToString", &FriendStatusValue::ToString)->
  740. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  741. ;
  742. context.Class<FriendRequest>()->
  743. Property("IsRecommended", [](const FriendRequest& value) { return value.IsRecommended; }, nullptr)->
  744. Property("IsStranger", [](const FriendRequest& value) { return value.IsStranger; }, nullptr)->
  745. Property("NonStrangerReason", [](const FriendRequest& value) { return value.NonStrangerReason; }, nullptr)->
  746. Property("RequestedDate", [](const FriendRequest& value) { return value.RequestedDate; }, nullptr)->
  747. Property("User", [](const FriendRequest& value) { return value.User; }, nullptr)
  748. ;
  749. context.Class<FriendRequestResult>()->
  750. Property("Total", [](const FriendRequestResult& value) { return value.Total; }, nullptr)->
  751. Property("Cursor", [](const FriendRequestResult& value) { return value.Cursor; }, nullptr)->
  752. Property("Requests", [](const FriendRequestResult& value) { return value.Requests; }, nullptr)
  753. ;
  754. context.Class<FriendRequestValue>()->
  755. Property("Value", [](const FriendRequestValue& value) { return value.Value; }, nullptr)->
  756. Property("Result", [](const FriendRequestValue& value) { return value.Result; }, nullptr)->
  757. Method("ToString", &FriendRequestValue::ToString)->
  758. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  759. ;
  760. context.Class<PresenceStatus>()->
  761. Property("ActivityType", [](const PresenceStatus& value) { return value.ActivityType; }, nullptr)->
  762. Property("Availability", [](const PresenceStatus& value) { return value.Availability; }, nullptr)->
  763. Property("Index", [](const PresenceStatus& value) { return value.Index; }, nullptr)->
  764. Property("UpdatedDate", [](const PresenceStatus& value) { return value.UpdatedDate; }, nullptr)->
  765. Property("UserID", [](const PresenceStatus& value) { return value.UserID; }, nullptr)
  766. ;
  767. context.Class<PresenceStatusValue>()->
  768. Property("Value", [](const PresenceStatusValue& value) { return value.Value; }, nullptr)->
  769. Property("Result", [](const PresenceStatusValue& value) { return value.Result; }, nullptr)->
  770. Method("ToString", &PresenceStatusValue::ToString)->
  771. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  772. ;
  773. context.Class<PresenceSettings>()->
  774. Property("IsInvisible", [](const PresenceSettings& value) { return value.IsInvisible; }, nullptr)->
  775. Property("ShareActivity", [](const PresenceSettings& value) { return value.ShareActivity; }, nullptr)
  776. ;
  777. context.Class<PresenceSettingsValue>()->
  778. Property("Value", [](const PresenceSettingsValue& value) { return value.Value; }, nullptr)->
  779. Property("Result", [](const PresenceSettingsValue& value) { return value.Result; }, nullptr)->
  780. Method("ToString", &PresenceSettingsValue::ToString)->
  781. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  782. ;
  783. context.Class<ChannelInfo>()->
  784. Property("NumFollowers", [](const ChannelInfo& value) { return value.NumFollowers; }, nullptr)->
  785. Property("NumViews", [](const ChannelInfo& value) { return value.NumViews; }, nullptr)->
  786. Property("NumItemsRecieved", [](const ChannelInfo& value) { return value.NumItemsRecieved; }, nullptr)->
  787. Property("Partner", [](const ChannelInfo& value) { return value.Partner; }, nullptr)->
  788. Property("Mature", [](const ChannelInfo& value) { return value.Mature; }, nullptr)->
  789. Property("Id", [](const ChannelInfo& value) { return value.Id; }, nullptr)->
  790. Property("BroadcasterLanguage", [](const ChannelInfo& value) { return value.BroadcasterLanguage; }, nullptr)->
  791. Property("DisplayName", [](const ChannelInfo& value) { return value.DisplayName; }, nullptr)->
  792. Property("eMail", [](const ChannelInfo& value) { return value.eMail; }, nullptr)->
  793. Property("GameName", [](const ChannelInfo& value) { return value.GameName; }, nullptr)->
  794. Property("Lanugage", [](const ChannelInfo& value) { return value.Lanugage; }, nullptr)->
  795. Property("Logo", [](const ChannelInfo& value) { return value.Logo; }, nullptr)->
  796. Property("Name", [](const ChannelInfo& value) { return value.Name; }, nullptr)->
  797. Property("ProfileBanner", [](const ChannelInfo& value) { return value.ProfileBanner; }, nullptr)->
  798. Property("ProfileBannerBackgroundColor", [](const ChannelInfo& value) { return value.ProfileBannerBackgroundColor; }, nullptr)->
  799. Property("Status", [](const ChannelInfo& value) { return value.Status; }, nullptr)->
  800. Property("StreamKey", [](const ChannelInfo& value) { return value.StreamKey; }, nullptr)->
  801. Property("UpdatedDate", [](const ChannelInfo& value) { return value.UpdatedDate; }, nullptr)->
  802. Property("CreatedDate", [](const ChannelInfo& value) { return value.CreatedDate; }, nullptr)->
  803. Property("URL", [](const ChannelInfo& value) { return value.URL; }, nullptr)->
  804. Property("VideoBanner", [](const ChannelInfo& value) { return value.VideoBanner; }, nullptr)
  805. ;
  806. context.Class<ChannelInfoValue>()->
  807. Property("Value", [](const ChannelInfoValue& value) { return value.Value; }, nullptr)->
  808. Property("Result", [](const ChannelInfoValue& value) { return value.Result; }, nullptr)->
  809. Method("ToString", &ChannelInfoValue::ToString)->
  810. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  811. ;
  812. context.Class<UpdateValuebool>()->
  813. Property("Value", &UpdateValuebool::GetValue, &UpdateValuebool::SetValue)->
  814. Method("ToBeUpdated", &UpdateValuebool::ToBeUpdated)
  815. ;
  816. context.Class<UpdateValueuint>()->
  817. Property("Value", &UpdateValueuint::GetValue, &UpdateValueuint::SetValue)->
  818. Method("ToBeUpdated", &UpdateValueuint::ToBeUpdated)
  819. ;
  820. context.Class<UpdateValuestring>()->
  821. Property("Value", &UpdateValuestring::GetValue, &UpdateValuestring::SetValue)->
  822. Method("ToBeUpdated", &UpdateValuestring::ToBeUpdated)
  823. ;
  824. context.Class<ChannelUpdateInfo>()->
  825. Property("ChannelFeedEnabled", BehaviorValueProperty(&ChannelUpdateInfo::ChannelFeedEnabled))->
  826. Property("Delay", BehaviorValueProperty(&ChannelUpdateInfo::Delay))->
  827. Property("Status", BehaviorValueProperty(&ChannelUpdateInfo::Status))->
  828. Property("GameName", BehaviorValueProperty(&ChannelUpdateInfo::GameName))
  829. ;
  830. context.Class<UserInfoListValue>()->
  831. Property("Value", [](const UserInfoListValue& value) { return value.Value; }, nullptr)->
  832. Property("Result", [](const UserInfoListValue& value) { return value.Result; }, nullptr)->
  833. Method("ToString", &UserInfoListValue::ToString)->
  834. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  835. ;
  836. context.Class<Follower>()->
  837. Property("Notifications", [](const Follower& value) { return value.Notifications; }, nullptr)->
  838. Property("CreatedDate", [](const Follower& value) { return value.CreatedDate; }, nullptr)->
  839. Property("User", [](const Follower& value) { return value.User; }, nullptr)
  840. ;
  841. context.Class<FollowerResult>()->
  842. Property("Total", [](const FollowerResult& value) { return value.Total; }, nullptr)->
  843. Property("Cursor", [](const FollowerResult& value) { return value.Cursor; }, nullptr)->
  844. Property("Followers", [](const FollowerResult& value) { return value.Followers; }, nullptr)
  845. ;
  846. context.Class<FollowerResultValue>()->
  847. Property("Value", [](const FollowerResultValue& value) { return value.Value; }, nullptr)->
  848. Property("Result", [](const FollowerResultValue& value) { return value.Result; }, nullptr)->
  849. Method("ToString", &FollowerResultValue::ToString)->
  850. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  851. ;
  852. context.Class<TeamInfo>()->
  853. Property("ID", [](const TeamInfo& value) { return value.ID; }, nullptr)->
  854. Property("Background", [](const TeamInfo& value) { return value.Background; }, nullptr)->
  855. Property("Banner", [](const TeamInfo& value) { return value.Banner; }, nullptr)->
  856. Property("CreatedDate", [](const TeamInfo& value) { return value.CreatedDate; }, nullptr)->
  857. Property("DisplayName", [](const TeamInfo& value) { return value.DisplayName; }, nullptr)->
  858. Property("Info", [](const TeamInfo& value) { return value.Info; }, nullptr)->
  859. Property("Logo", [](const TeamInfo& value) { return value.Logo; }, nullptr)->
  860. Property("Name", [](const TeamInfo& value) { return value.Name; }, nullptr)->
  861. Property("UpdatedDate", [](const TeamInfo& value) { return value.UpdatedDate; }, nullptr)
  862. ;
  863. context.Class<ChannelTeamValue>()->
  864. Property("Value", [](const ChannelTeamValue& value) { return value.Value; }, nullptr)->
  865. Property("Result", [](const ChannelTeamValue& value) { return value.Result; }, nullptr)->
  866. Method("ToString", &ChannelTeamValue::ToString)->
  867. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  868. ;
  869. context.Class<SubscriberInfo>()->
  870. Property("ID", [](const SubscriberInfo& value) { return value.ID; }, nullptr)->
  871. Property("CreatedDate", [](const SubscriberInfo& value) { return value.CreatedDate; }, nullptr)->
  872. Property("User", [](const SubscriberInfo& value) { return value.User; }, nullptr)
  873. ;
  874. context.Class<Subscription>()->
  875. Property("Total", [](const Subscription& value) { return value.Total; }, nullptr)->
  876. Property("Subscribers", [](const Subscription& value) { return value.Subscribers; }, nullptr)
  877. ;
  878. context.Class<SubscriberValue>()->
  879. Property("Value", [](const SubscriberValue& value) { return value.Value; }, nullptr)->
  880. Property("Result", [](const SubscriberValue& value) { return value.Result; }, nullptr)->
  881. Method("ToString", &SubscriberValue::ToString)->
  882. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  883. ;
  884. context.Class<SubscriberbyUserValue>()->
  885. Property("Value", [](const SubscriberbyUserValue& value) { return value.Value; }, nullptr)->
  886. Property("Result", [](const SubscriberbyUserValue& value) { return value.Result; }, nullptr)->
  887. Method("ToString", &SubscriberbyUserValue::ToString)->
  888. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  889. ;
  890. context.Class<VideoChannelInfo>()->
  891. Property("ID", [](const VideoChannelInfo& value) { return value.ID; }, nullptr)->
  892. Property("DisplayName", [](const VideoChannelInfo& value) { return value.DisplayName; }, nullptr)->
  893. Property("Name", [](const VideoChannelInfo& value) { return value.Name; }, nullptr)
  894. ;
  895. context.Class<FPSInfo>()->
  896. Property("Chunked", [](const FPSInfo& value) { return value.Chunked; }, nullptr)->
  897. Property("High", [](const FPSInfo& value) { return value.High; }, nullptr)->
  898. Property("Low", [](const FPSInfo& value) { return value.Low; }, nullptr)->
  899. Property("Medium", [](const FPSInfo& value) { return value.Medium; }, nullptr)->
  900. Property("Mobile", [](const FPSInfo& value) { return value.Mobile; }, nullptr)
  901. ;
  902. context.Class<PreviewInfo>()->
  903. Property("Large", [](const PreviewInfo& value) { return value.Large; }, nullptr)->
  904. Property("Medium", [](const PreviewInfo& value) { return value.Medium; }, nullptr)->
  905. Property("Small", [](const PreviewInfo& value) { return value.Small; }, nullptr)->
  906. Property("Template", [](const PreviewInfo& value) { return value.Template; }, nullptr)
  907. ;
  908. context.Class<ResolutionsInfo>()->
  909. Property("Chunked", [](const ResolutionsInfo& value) { return value.Chunked; }, nullptr)->
  910. Property("High", [](const ResolutionsInfo& value) { return value.High; }, nullptr)->
  911. Property("Low", [](const ResolutionsInfo& value) { return value.Low; }, nullptr)->
  912. Property("Medium", [](const ResolutionsInfo& value) { return value.Medium; }, nullptr)->
  913. Property("Mobile", [](const ResolutionsInfo& value) { return value.Mobile; }, nullptr)
  914. ;
  915. context.Class<ThumbnailInfo>()->
  916. Property("Type", [](const ThumbnailInfo& value) { return value.Type; }, nullptr)->
  917. Property("Url", [](const ThumbnailInfo& value) { return value.Url; }, nullptr)
  918. ;
  919. context.Class<ThumbnailsInfo>()->
  920. Property("Large", [](const ThumbnailsInfo& value) { return value.Large; }, nullptr)->
  921. Property("Medium", [](const ThumbnailsInfo& value) { return value.Medium; }, nullptr)->
  922. Property("Small", [](const ThumbnailsInfo& value) { return value.Small; }, nullptr)->
  923. Property("Template", [](const ThumbnailsInfo& value) { return value.Template; }, nullptr)
  924. ;
  925. context.Class<VideoInfo>()->
  926. Property("Length", [](const VideoInfo& value) { return value.Length; }, nullptr)->
  927. Property("Views", [](const VideoInfo& value) { return value.Views; }, nullptr)->
  928. Property("BroadcastID", [](const VideoInfo& value) { return value.BroadcastID; }, nullptr)->
  929. Property("Type", [](const VideoInfo& value) { return value.Type; }, nullptr)->
  930. Property("CreatedDate", [](const VideoInfo& value) { return value.CreatedDate; }, nullptr)->
  931. Property("Description", [](const VideoInfo& value) { return value.Description; }, nullptr)->
  932. Property("DescriptionHTML", [](const VideoInfo& value) { return value.DescriptionHTML; }, nullptr)->
  933. Property("ID", [](const VideoInfo& value) { return value.ID; }, nullptr)->
  934. Property("Game", [](const VideoInfo& value) { return value.Game; }, nullptr)->
  935. Property("Language", [](const VideoInfo& value) { return value.Language; }, nullptr)->
  936. Property("PublishedDate", [](const VideoInfo& value) { return value.PublishedDate; }, nullptr)->
  937. Property("Status", [](const VideoInfo& value) { return value.Status; }, nullptr)->
  938. Property("TagList", [](const VideoInfo& value) { return value.TagList; }, nullptr)->
  939. Property("Title", [](const VideoInfo& value) { return value.Title; }, nullptr)->
  940. Property("URL", [](const VideoInfo& value) { return value.URL; }, nullptr)->
  941. Property("Viewable", [](const VideoInfo& value) { return value.Viewable; }, nullptr)->
  942. Property("ViewableAt", [](const VideoInfo& value) { return value.ViewableAt; }, nullptr)->
  943. Property("Channel", [](const VideoInfo& value) { return value.Channel; }, nullptr)->
  944. Property("FPS", [](const VideoInfo& value) { return value.FPS; }, nullptr)->
  945. Property("Preview", [](const VideoInfo& value) { return value.Preview; }, nullptr)->
  946. Property("Thumbnails", [](const VideoInfo& value) { return value.Thumbnails; }, nullptr)->
  947. Property("Resolutions", [](const VideoInfo& value) { return value.Resolutions; }, nullptr)
  948. ;
  949. context.Class<VideoReturn>()->
  950. Property("Total", [](const VideoReturn& value) { return value.Total; }, nullptr)->
  951. Property("Videos", [](const VideoReturn& value) { return value.Videos; }, nullptr)
  952. ;
  953. context.Class<VideoReturnValue>()->
  954. Property("Value", [](const VideoReturnValue& value) { return value.Value; }, nullptr)->
  955. Property("Result", [](const VideoReturnValue& value) { return value.Result; }, nullptr)->
  956. Method("ToString", &VideoReturnValue::ToString)->
  957. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  958. ;
  959. context.Class<StartChannelCommercialResult>()->
  960. Property("Duration", [](const StartChannelCommercialResult& value) { return value.Duration; }, nullptr)->
  961. Property("RetryAfter", [](const StartChannelCommercialResult& value) { return value.RetryAfter; }, nullptr)->
  962. Property("Message", [](const StartChannelCommercialResult& value) { return value.Message; }, nullptr)
  963. ;
  964. context.Class<StartChannelCommercialValue>()->
  965. Property("Value", [](const StartChannelCommercialValue& value) { return value.Value; }, nullptr)->
  966. Property("Result", [](const StartChannelCommercialValue& value) { return value.Result; }, nullptr)->
  967. Method("ToString", &StartChannelCommercialValue::ToString)->
  968. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  969. ;
  970. context.Class<CommunityInfo>()->
  971. Property("ID", [](const CommunityInfo& value) { return value.ID; }, nullptr)->
  972. Property("AvatarImageURL", [](const CommunityInfo& value) { return value.AvatarImageURL; }, nullptr)->
  973. Property("CoverImageURL", [](const CommunityInfo& value) { return value.CoverImageURL; }, nullptr)->
  974. Property("Description", [](const CommunityInfo& value) { return value.Description; }, nullptr)->
  975. Property("DescriptionHTML", [](const CommunityInfo& value) { return value.DescriptionHTML; }, nullptr)->
  976. Property("Language", [](const CommunityInfo& value) { return value.Language; }, nullptr)->
  977. Property("Name", [](const CommunityInfo& value) { return value.Name; }, nullptr)->
  978. Property("OwnerID", [](const CommunityInfo& value) { return value.OwnerID; }, nullptr)->
  979. Property("Rules", [](const CommunityInfo& value) { return value.Rules; }, nullptr)->
  980. Property("RulesHTML", [](const CommunityInfo& value) { return value.RulesHTML; }, nullptr)->
  981. Property("Summary", [](const CommunityInfo& value) { return value.Summary; }, nullptr)
  982. ;
  983. context.Class<CommunityInfoValue>()->
  984. Property("Value", [](const CommunityInfoValue& value) { return value.Value; }, nullptr)->
  985. Property("Result", [](const CommunityInfoValue& value) { return value.Result; }, nullptr)->
  986. Method("ToString", &CommunityInfoValue::ToString)->
  987. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  988. ;
  989. context.Class<CommunityInfoReturn>()->
  990. Property("Total", [](const CommunityInfoReturn& value) { return value.Total; }, nullptr)->
  991. Property("Communities", [](const CommunityInfoReturn& value) { return value.Communities; }, nullptr)
  992. ;
  993. context.Class<CommunityInfoReturnValue>()->
  994. Property("Value", [](const CommunityInfoReturnValue& value) { return value.Value; }, nullptr)->
  995. Property("Result", [](const CommunityInfoReturnValue& value) { return value.Result; }, nullptr)->
  996. Method("ToString", &CommunityInfoReturnValue::ToString)->
  997. Attribute(AZ::Script::Attributes::Operator, AZ::Script::Attributes::OperatorType::ToString)
  998. ;
  999. context.EBus<TwitchRequestBus>("TwitchRequestBus")
  1000. ->Event("SetApplicationID", &TwitchRequestBus::Events::SetApplicationID)
  1001. ->Event("GetApplicationID", &TwitchRequestBus::Events::GetApplicationID)
  1002. ->Event("GetUserID", &TwitchRequestBus::Events::GetUserID)
  1003. ->Event("GetOAuthToken", &TwitchRequestBus::Events::GetOAuthToken)
  1004. ->Event("GetSessionID", &TwitchRequestBus::Events::GetSessionID)
  1005. ->Event("SetUserID", &TwitchRequestBus::Events::SetUserID)
  1006. ->Event("SetOAuthToken", &TwitchRequestBus::Events::SetOAuthToken)
  1007. ->Event("RequestUserID", &TwitchRequestBus::Events::RequestUserID)
  1008. ->Event("RequestOAuthToken", &TwitchRequestBus::Events::RequestOAuthToken)
  1009. ->Event("GetUser", &TwitchRequestBus::Events::GetUser)
  1010. ->Event("ResetFriendsNotificationCount", &TwitchRequestBus::Events::ResetFriendsNotificationCount)
  1011. ->Event("GetFriendNotificationCount", &TwitchRequestBus::Events::GetFriendNotificationCount)
  1012. ->Event("GetFriendRecommendations", &TwitchRequestBus::Events::GetFriendRecommendations)
  1013. ->Event("GetFriends", &TwitchRequestBus::Events::GetFriends)
  1014. ->Event("GetFriendStatus", &TwitchRequestBus::Events::GetFriendStatus)
  1015. ->Event("AcceptFriendRequest", &TwitchRequestBus::Events::AcceptFriendRequest)
  1016. ->Event("GetFriendRequests", &TwitchRequestBus::Events::GetFriendRequests)
  1017. ->Event("CreateFriendRequest", &TwitchRequestBus::Events::CreateFriendRequest)
  1018. ->Event("DeclineFriendRequest", &TwitchRequestBus::Events::DeclineFriendRequest)
  1019. ->Event("UpdatePresenceStatus", &TwitchRequestBus::Events::UpdatePresenceStatus)
  1020. ->Event("GetPresenceStatusofFriends", &TwitchRequestBus::Events::GetPresenceStatusofFriends)
  1021. ->Event("GetPresenceSettings", &TwitchRequestBus::Events::GetPresenceSettings)
  1022. ->Event("UpdatePresenceSettings", &TwitchRequestBus::Events::UpdatePresenceSettings)
  1023. ->Event("GetChannel", &TwitchRequestBus::Events::GetChannel)
  1024. ->Event("GetChannelbyID", &TwitchRequestBus::Events::GetChannelbyID)
  1025. ->Event("UpdateChannel", &TwitchRequestBus::Events::UpdateChannel)
  1026. ->Event("GetChannelEditors", &TwitchRequestBus::Events::GetChannelEditors)
  1027. ->Event("GetChannelFollowers", &TwitchRequestBus::Events::GetChannelFollowers)
  1028. ->Event("GetChannelTeams", &TwitchRequestBus::Events::GetChannelTeams)
  1029. ->Event("GetChannelSubscribers", &TwitchRequestBus::Events::GetChannelSubscribers)
  1030. ->Event("CheckChannelSubscriptionbyUser", &TwitchRequestBus::Events::CheckChannelSubscriptionbyUser)
  1031. ->Event("GetChannelVideos", &TwitchRequestBus::Events::GetChannelVideos)
  1032. ->Event("StartChannelCommercial", &TwitchRequestBus::Events::StartChannelCommercial)
  1033. ->Event("ResetChannelStreamKey", &TwitchRequestBus::Events::ResetChannelStreamKey)
  1034. ;
  1035. context.EBus<TwitchNotifyBus>("TwitchNotifyBus")
  1036. ->Handler<BehaviorTwitchNotifyBus>();
  1037. }
  1038. }
  1039. }