ITwitchREST.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. #pragma once
  9. #include <AzCore/std/smart_ptr/shared_ptr.h>
  10. #include <HttpRequestor/HttpRequestorBus.h>
  11. namespace Twitch
  12. {
  13. class ITwitchREST;
  14. using ITwitchRESTPtr = AZStd::shared_ptr<ITwitchREST>;
  15. class ITwitchREST
  16. {
  17. public:
  18. static ITwitchRESTPtr Alloc();
  19. virtual ~ITwitchREST() = default;
  20. virtual void FlushEvents() = 0;
  21. /*
  22. ** Users
  23. */
  24. virtual void GetUser(ReceiptID& receipt) = 0;
  25. /*
  26. ** Friends
  27. */
  28. virtual void ResetFriendsNotificationCount(const ReceiptID& receipt, const AZStd::string& friendID) = 0;
  29. virtual void GetFriendNotificationCount(const ReceiptID& receipt, const AZStd::string& friendID) = 0;
  30. virtual void GetFriendRecommendations(const ReceiptID& receipt, const AZStd::string& friendID) = 0;
  31. virtual void GetFriends(const ReceiptID& receipt, const AZStd::string& friendID, const AZStd::string& cursor) = 0;
  32. virtual void GetFriendStatus(const ReceiptID& receipt, const AZStd::string& sourceFriendID, const AZStd::string& targetFriendID) = 0;
  33. virtual void AcceptFriendRequest(const ReceiptID& receipt, const AZStd::string& friendID) = 0;
  34. virtual void GetFriendRequests(const ReceiptID& receipt, const AZStd::string& cursor) = 0;
  35. virtual void CreateFriendRequest(const ReceiptID& receipt, const AZStd::string& friendID) = 0;
  36. virtual void DeclineFriendRequest(const ReceiptID& receipt, const AZStd::string& friendID) = 0;
  37. /*
  38. ** Presence
  39. */
  40. virtual void UpdatePresenceStatus(const ReceiptID& receipt, PresenceAvailability availability, PresenceActivityType activityType, const AZStd::string& gameContext) = 0;
  41. virtual void GetPresenceStatusofFriends(const ReceiptID& receipt) = 0;
  42. virtual void GetPresenceSettings(const ReceiptID& receipt) = 0;
  43. virtual void UpdatePresenceSettings(const ReceiptID& receipt, bool isInvisible, bool shareActivity) = 0;
  44. /*
  45. ** Channels
  46. */
  47. virtual void GetChannel(const ReceiptID& receipt) = 0;
  48. virtual void GetChannelbyID(const ReceiptID& receipt, const AZStd::string& channelID) = 0;
  49. virtual void UpdateChannel(const ReceiptID& receipt, const ChannelUpdateInfo& channelUpdateInfo) = 0;
  50. virtual void GetChannelEditors(ReceiptID& receipt, const AZStd::string& channelID) = 0;
  51. virtual void GetChannelFollowers(ReceiptID& receipt, const AZStd::string& channelID, const AZStd::string& cursor, AZ::u64 offset) = 0;
  52. virtual void GetChannelTeams(ReceiptID& receipt, const AZStd::string& channelID) = 0;
  53. virtual void GetChannelSubscribers(ReceiptID& receipt, const AZStd::string& channelID, AZ::u64 offset) = 0;
  54. virtual void CheckChannelSubscriptionbyUser(ReceiptID& receipt, const AZStd::string& channelID, const AZStd::string& userID) = 0;
  55. virtual void GetChannelVideos(ReceiptID& receipt, const AZStd::string& channelID, BroadCastType boradcastType, const AZStd::string& language, AZ::u64 offset) = 0;
  56. virtual void StartChannelCommercial(ReceiptID& receipt, const AZStd::string& channelID, CommercialLength length) = 0;
  57. virtual void ResetChannelStreamKey(ReceiptID& receipt, const AZStd::string& channelID) = 0;
  58. /*
  59. ** Helper functions
  60. */
  61. virtual bool IsValidGameContext(const AZStd::string& gameContext) const = 0;
  62. virtual void AddHTTPRequest(const AZStd::string& URI, Aws::Http::HttpMethod method, const HttpRequestor::Headers & headers, const HttpRequestor::Callback & callback) = 0;
  63. virtual void AddHTTPRequest(const AZStd::string& URI, Aws::Http::HttpMethod method, const HttpRequestor::Headers & headers, const AZStd::string& body, const HttpRequestor::Callback& callback) = 0;
  64. };
  65. }