Reddit.NET  1.5
Reddit.NET is a .NET Standard library that provides easy access to the Reddit API with virtually no boilerplate code required.
Reddit.Models.Emoji Class Reference
Inheritance diagram for Reddit.Models.Emoji:
Reddit.Models.BaseModel Reddit.Models.Internal.Request

Public Member Functions

 Emoji (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null)
 
object Add (string subreddit, EmojiAddInput emojiAddInput)
 Add an emoji to the DB by posting a message on emoji_upload_q. A job processor that listens on a queue uses the s3_key provided in the request to locate the image in S3 Temp Bucket and moves it to the PERM bucket. It also adds it to the DB using name as the column and sr_fullname as the key and sends the status on the websocket URL that is provided as part of this response. More...
 
object Delete (string subreddit, string emojiName)
 Delete a Subreddit emoji. Remove the emoji from Cassandra and purge the assets from S3 and the image resizing provider. More...
 
S3UploadLeaseContainer AcquireLease (string subreddit, ImageUploadInput imageUploadInput)
 Acquire and return an upload lease to s3 temp bucket. The return value of this function is a json object containing credentials for uploading assets to S3 bucket, S3 url for upload request and the key to use for uploading. Using this lease the client will upload the emoji image to S3 temp bucket (included as part of the S3 URL). This lease is used by S3 to verify that the upload is authorized. More...
 
void UploadLeaseImage (byte[] imageData, S3UploadLeaseContainer s3)
 Upload an Emoji. More...
 
object CustomSize (string subreddit, int height=0, int width=0)
 Set custom emoji size. Omitting width or height will disable custom emoji sizing. More...
 
SnoomojiContainer All (string subreddit)
 Get all emojis for a SR. The response includes reddit emojis as well as emojis for the SR specified in the request. More...
 
- Public Member Functions inherited from Reddit.Models.BaseModel
 BaseModel (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null)
 
string Sr (string subreddit)
 
- Public Member Functions inherited from Reddit.Models.Internal.Request
 Request (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null)
 
SendRequest< T > (string url, dynamic parameters, Method method=Method.GET, string contentType="application/x-www-form-urlencoded")
 
async Task< T > SendRequestAsync< T > (string url, dynamic parameters, Method method=Method.GET, string contentType="application/x-www-form-urlencoded")
 
RestRequest PrepareIDRequest (string path, string id, Method method=Method.POST)
 
RestRequest PrepareJSONRequest (string path, Method method=Method.POST)
 
RestRequest PrepareRequest (string url, Method method=Method.GET, string contentType="application/x-www-form-urlencoded")
 
RestRequest PrepareRequest (string url, Method method, List< Parameter > parameters, List< FileParameter > files, string contentType="application/x-www-form-urlencoded")
 
RestRequest PrepareRequest (RestRequest restRequest, string contentType="application/x-www-form-urlencoded")
 
string GetVersion ()
 
string ExecuteRequest (string url, Method method=Method.GET)
 
async Task< string > ExecuteRequestAsync (string url, Method method=Method.GET)
 
string ExecuteRequest (RestRequest restRequest)
 
async Task< string > ExecuteRequestAsync (RestRequest restRequest)
 
void UpdateAccessToken (string accessToken)
 
void UpdateRequests (List< DateTime > requests)
 
void AddParamIfNotNull (string name, dynamic value, ref RestRequest restRequest)
 

Additional Inherited Members

- Protected Member Functions inherited from Reddit.Models.Internal.Request
virtual void OnTokenUpdated (TokenUpdateEventArgs e)
 
virtual void OnRequestsUpdated (RequestsUpdateEventArgs e)
 
- Events inherited from Reddit.Models.Internal.Request
EventHandler< TokenUpdateEventArgsTokenUpdated
 
EventHandler< RequestsUpdateEventArgsRequestsUpdated
 

Constructor & Destructor Documentation

◆ Emoji()

Reddit.Models.Emoji.Emoji ( string  appId,
string  appSecret,
string  refreshToken,
string  accessToken,
ref RestClient  restClient,
string  deviceId = null,
string  userAgent = null 
)

Member Function Documentation

◆ AcquireLease()

S3UploadLeaseContainer Reddit.Models.Emoji.AcquireLease ( string  subreddit,
ImageUploadInput  imageUploadInput 
)

Acquire and return an upload lease to s3 temp bucket. The return value of this function is a json object containing credentials for uploading assets to S3 bucket, S3 url for upload request and the key to use for uploading. Using this lease the client will upload the emoji image to S3 temp bucket (included as part of the S3 URL). This lease is used by S3 to verify that the upload is authorized.

Parameters
subredditThe subreddit with the emojis
imageUploadInputA valid ImageUploadInput instance
Returns
An S3 lease.

◆ Add()

object Reddit.Models.Emoji.Add ( string  subreddit,
EmojiAddInput  emojiAddInput 
)

Add an emoji to the DB by posting a message on emoji_upload_q. A job processor that listens on a queue uses the s3_key provided in the request to locate the image in S3 Temp Bucket and moves it to the PERM bucket. It also adds it to the DB using name as the column and sr_fullname as the key and sends the status on the websocket URL that is provided as part of this response.

Parameters
subredditThe subreddit with the emojis
emojiAddInputA valid EmojiAddInput instance
Returns
(TODO - Untested)

◆ All()

SnoomojiContainer Reddit.Models.Emoji.All ( string  subreddit)

Get all emojis for a SR. The response includes reddit emojis as well as emojis for the SR specified in the request.

Parameters
subredditThe subreddit with the emojis
Returns
Emojis.

◆ CustomSize()

object Reddit.Models.Emoji.CustomSize ( string  subreddit,
int  height = 0,
int  width = 0 
)

Set custom emoji size. Omitting width or height will disable custom emoji sizing.

Parameters
subredditThe subreddit with the emojis
heightan integer between 1 and 40 (default: 0)
widthan integer between 1 and 40 (default: 0)
Returns
(TODO - Untested)

◆ Delete()

object Reddit.Models.Emoji.Delete ( string  subreddit,
string  emojiName 
)

Delete a Subreddit emoji. Remove the emoji from Cassandra and purge the assets from S3 and the image resizing provider.

Parameters
subredditThe subreddit with the emojis
emojiNameThe name of the emoji to be deleted
Returns
(TODO - Untested)

◆ UploadLeaseImage()

void Reddit.Models.Emoji.UploadLeaseImage ( byte[]  imageData,
S3UploadLeaseContainer  s3 
)

Upload an Emoji.

Parameters
imageDataRaw image data.
s3The data retrieved by AcquireLease.
Returns
(TODO - Untested)

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