libkazv
Kazv::Api::PostPusherJob Class Reference

Modify a pusher for this user on the homeserver. More...

#include <pusher.hpp>

Inheritance diagram for Kazv::Api::PostPusherJob:
Collaboration diagram for Kazv::Api::PostPusherJob:

Classes

class  JobResponse
 
struct  PusherData
 A dictionary of information for the pusher implementation itself. More...
 

Public Member Functions

 PostPusherJob (std::string serverUrl, std::string _accessToken, std::string pushkey, std::string kind, std::string appId, std::string appDisplayName, std::string deviceDisplayName, std::string lang, PusherData data, std::optional< std::string > profileTag=std::nullopt, std::optional< bool > append=std::nullopt)
 Modify a pusher for this user on the homeserver. More...
 
PostPusherJob withData (JsonWrap j) &&
 
PostPusherJob withData (JsonWrap j) const &
 
- Public Member Functions inherited from Kazv::BaseJob
 BaseJob (std::string serverUrl, std::string requestUrl, Method method, std::string jobId, std::string token={}, ReturnType returnType=ReturnType::Json, Body body=EmptyBody{}, Query query={}, Header header={}, std::optional< FileDesc > responseFile=std::nullopt)
 
 ~BaseJob ()
 
bool shouldReturnJson () const
 
std::string url () const
 
Body requestBody () const
 
Header requestHeader () const
 
ReturnType returnType () const
 
Query requestQuery () const
 returns the non-encoded query as an array of pairs More...
 
Method requestMethod () const
 
Response genResponse (Response r) const
 
BaseJob withData (JsonWrap j) &&
 
BaseJob withData (JsonWrap j) const &
 
BaseJob withQueue (std::string id, JobQueuePolicy policy=AlwaysContinue) &&
 
BaseJob withQueue (std::string id, JobQueuePolicy policy=AlwaysContinue) const &
 
json dataJson (const std::string &key) const
 
std::string dataStr (const std::string &key) const
 
std::string jobId () const
 
std::optional< std::string > queueId () const
 
JobQueuePolicy queuePolicy () const
 
std::optional< FileDescresponseFile () const
 

Static Public Member Functions

static constexpr auto needsAuth ()
 
static BaseJob::Query buildQuery ()
 
static BaseJob::Body buildBody (std::string pushkey, std::string kind, std::string appId, std::string appDisplayName, std::string deviceDisplayName, std::string lang, PusherData data, std::optional< std::string > profileTag, std::optional< bool > append)
 
- Static Public Member Functions inherited from Kazv::BaseJob
static bool contentTypeMatches (immer::array< std::string > expected, std::string actual)
 

Additional Inherited Members

- Public Types inherited from Kazv::BaseJob
enum  ReturnType { Json, File }
 
using Method = std::variant< Get, Post, Put, Delete >
 
using Body = ::Kazv::Body
 
using BytesBody = ::Kazv::BytesBody
 
using JsonBody = ::Kazv::JsonBody
 
using EmptyBody = ::Kazv::EmptyBody
 
using Header = ::Kazv::Header
 
using Response = ::Kazv::Response
 
- Static Public Attributes inherited from Kazv::BaseJob
static Get GET {}
 
static Post POST {}
 
static Put PUT {}
 
static Delete DELETE {}
 
- Protected Member Functions inherited from Kazv::BaseJob
void attachData (JsonWrap data)
 

Detailed Description

Modify a pusher for this user on the homeserver.

This endpoint allows the creation, modification and deletion of pushers for this user ID. The behaviour of this endpoint varies depending on the values in the JSON body.

Constructor & Destructor Documentation

◆ PostPusherJob()

Kazv::Api::PostPusherJob::PostPusherJob ( std::string  serverUrl,
std::string  _accessToken,
std::string  pushkey,
std::string  kind,
std::string  appId,
std::string  appDisplayName,
std::string  deviceDisplayName,
std::string  lang,
PusherData  data,
std::optional< std::string >  profileTag = std::nullopt,
std::optional< bool >  append = std::nullopt 
)
explicit

Modify a pusher for this user on the homeserver.

Parameters
pushkeyThis is a unique identifier for this pusher. The value you should use for this is the routing or destination address information for the notification, for example, the APNS token for APNS or the Registration ID for GCM. If your notification client has no such concept, use any unique identifier. Max length, 512 bytes.

If the kind is "email", this is the email address to send notifications to.

Parameters
kindThe kind of pusher to configure. "http" makes a pusher that sends HTTP pokes. "email" makes a pusher that emails the user with unread notifications. null deletes the pusher.
appIdThis is a reverse-DNS style identifier for the application. It is recommended that this end with the platform, such that different platform versions get different app identifiers. Max length, 64 chars.

If the kind is "email", this is "m.email".

Parameters
appDisplayNameA string that will allow the user to identify what application owns this pusher.
deviceDisplayNameA string that will allow the user to identify what device owns this pusher.
langThe preferred language for receiving notifications (e.g. 'en' or 'en-US').
dataA dictionary of information for the pusher implementation itself. If kind is http, this should contain url which is the URL to use to send notifications to.
profileTagThis string determines which set of device specific rules this pusher executes.
appendIf true, the homeserver should add another pusher with the given pushkey and App ID in addition to any others with different user IDs. Otherwise, the homeserver must remove any other pushers with the same App ID and pushkey for different users. The default is false.

Member Function Documentation

◆ buildBody()

BaseJob::Body Kazv::Api::PostPusherJob::buildBody ( std::string  pushkey,
std::string  kind,
std::string  appId,
std::string  appDisplayName,
std::string  deviceDisplayName,
std::string  lang,
PusherData  data,
std::optional< std::string >  profileTag,
std::optional< bool >  append 
)
static

◆ buildQuery()

BaseJob::Query Kazv::Api::PostPusherJob::buildQuery ( )
static

◆ needsAuth()

static constexpr auto Kazv::Api::PostPusherJob::needsAuth ( )
inlinestaticconstexpr

◆ withData() [1/2]

PostPusherJob Kazv::Api::PostPusherJob::withData ( JsonWrap  j) &&

◆ withData() [2/2]

PostPusherJob Kazv::Api::PostPusherJob::withData ( JsonWrap  j) const &

The documentation for this class was generated from the following files: