Twitch SDK (Internal)
socialpostpresencetask.h
Go to the documentation of this file.
1 /********************************************************************************************
2 * Twitch Broadcasting SDK
3 *
4 * This software is supplied under the terms of a license agreement with Twitch Interactive, Inc. and
5 * may not be copied or used except in accordance with the terms of that agreement
6 * Copyright (c) 2012-2016 Twitch Interactive, Inc.
7 *********************************************************************************************/
8 
9 #pragma once
10 
14 #include <map>
15 
16 namespace ttv
17 {
18  namespace social
19  {
20  class SocialPostPresenceTask;
21  }
22 }
23 
25 {
26 public:
27  struct Result
28  {
29  Result();
30 
32  };
33 
34  typedef std::function<void(SocialPostPresenceTask* source, TTV_ErrorCode ec, const std::shared_ptr<Result>& result)> Callback;
35 
36 public:
37  SocialPostPresenceTask(UserId userId, const std::string& authToken, PresenceSessionAvailability availability, std::vector<std::unique_ptr<PresenceActivity>>&& activities, const std::string& sessionGuid, Callback callback);
38 
39 protected:
40  virtual const char* GetTaskName() const override { return "SocialPostPresenceTask"; }
41 
42  virtual void FillHttpRequestInfo(HttpRequestInfo& requestInfo) override;
43  virtual bool ProcessHeaders(uint statusCode, const std::map<std::string, std::string>& headers) override;
44  virtual void ProcessResponse(uint statusCode, const std::vector<char>& response) override;
45  virtual void OnComplete() override;
46 
47 private:
48  std::shared_ptr<Result> mResult;
49  std::vector<std::unique_ptr<PresenceActivity>> mActivities;
51  std::string mSessionGuid;
54 };
uint32_t UserId
Definition: coretypes.h:22
Definition: socialpostpresencetask.h:24
virtual bool ProcessHeaders(uint statusCode, const std::map< std::string, std::string > &headers) override
virtual void OnComplete() override
UserId mUserId
Definition: socialpostpresencetask.h:53
Definition: httptask.h:19
std::function< void(SocialPostPresenceTask *source, TTV_ErrorCode ec, const std::shared_ptr< Result > &result)> Callback
Definition: socialpostpresencetask.h:34
PresenceSessionAvailability mAvailability
Definition: socialpostpresencetask.h:52
JSON (JavaScript Object Notation).
Definition: adsapi.h:16
Callback mCallback
Definition: socialpostpresencetask.h:50
virtual void ProcessResponse(uint statusCode, const std::vector< char > &response) override
uint32_t pollIntervalSeconds
The next time the presence should be refreshed by the client.
Definition: socialpostpresencetask.h:31
virtual void FillHttpRequestInfo(HttpRequestInfo &requestInfo) override
Definition: socialpostpresencetask.h:27
std::shared_ptr< Result > mResult
Definition: socialpostpresencetask.h:48
SocialPostPresenceTask(UserId userId, const std::string &authToken, PresenceSessionAvailability availability, std::vector< std::unique_ptr< PresenceActivity >> &&activities, const std::string &sessionGuid, Callback callback)
unsigned int uint
Definition: coretypes.h:18
std::vector< std::unique_ptr< PresenceActivity > > mActivities
Definition: socialpostpresencetask.h:49
PresenceSessionAvailability
Definition: socialtypes.h:49
virtual const char * GetTaskName() const override
Definition: socialpostpresencetask.h:40
Definition: httptask.h:22
std::string mSessionGuid
Definition: socialpostpresencetask.h:51