![]() |
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.
|
Public Member Functions | |
Widgets (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null) | |
T | Add< T > (string json, string subreddit=null) |
Add and return a widget to the specified subreddit. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind. More... | |
WidgetTextArea | Add (WidgetTextArea widgetTextArea, string subreddit=null) |
Add and return a widget to the specified subreddit. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind. More... | |
WidgetCalendar | Add (WidgetCalendar widgetCalendar, string subreddit=null) |
Add and return a widget to the specified subreddit. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind. More... | |
WidgetCommunityListDetailed | Add (WidgetCommunityList widgetCommunityList, string subreddit=null) |
Add and return a widget to the specified subreddit. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind. More... | |
void | Delete (string widgetId, string subreddit=null) |
Delete a widget from the specified subreddit (if it exists). More... | |
T | Update< T > (string widgetId, string json, string subreddit=null) |
Update and return the data of a widget. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind. More... | |
WidgetTextArea | Update (string widgetId, WidgetTextArea widgetTextArea, string subreddit=null) |
Update and return the data of a widget. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind. More... | |
WidgetCalendar | Update (string widgetId, WidgetCalendar widgetCalendar, string subreddit=null) |
Update and return the data of a widget. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind. More... | |
WidgetCommunityList | Update (string widgetId, WidgetCommunityList widgetCommunityList, string subreddit=null) |
Update and return the data of a widget. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind. More... | |
object | WidgetImageUploadS3 (string filePath, string mimeType) |
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 | UpdateOrder (string section, string json, string subreddit=null) |
Update the order of widget_ids in the specified subreddit. More... | |
void | UpdateOrder (string section, List< string > widgetIds, string subreddit=null) |
Update the order of widget_ids in the specified subreddit. More... | |
WidgetResults | Get (bool progressiveImages, string subreddit=null) |
Return all widgets for the given subreddit. More... | |
![]() | |
BaseModel (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null) | |
string | Sr (string subreddit) |
![]() | |
Request (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null) | |
T | 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 | |
![]() | |
virtual void | OnTokenUpdated (TokenUpdateEventArgs e) |
virtual void | OnRequestsUpdated (RequestsUpdateEventArgs e) |
![]() | |
EventHandler< TokenUpdateEventArgs > | TokenUpdated |
EventHandler< RequestsUpdateEventArgs > | RequestsUpdated |
Reddit.Models.Widgets.Widgets | ( | string | appId, |
string | appSecret, | ||
string | refreshToken, | ||
string | accessToken, | ||
ref RestClient | restClient, | ||
string | deviceId = null , |
||
string | userAgent = null |
||
) |
WidgetCalendar Reddit.Models.Widgets.Add | ( | WidgetCalendar | widgetCalendar, |
string | subreddit = null |
||
) |
Add and return a widget to the specified subreddit. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind.
widgetCalendar | See https://www.reddit.com/dev/api/#POST_api_widget for expected format |
subreddit | The subreddit with the widgets |
WidgetCommunityListDetailed Reddit.Models.Widgets.Add | ( | WidgetCommunityList | widgetCommunityList, |
string | subreddit = null |
||
) |
Add and return a widget to the specified subreddit. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind.
widgetCommunityList | See https://www.reddit.com/dev/api/#POST_api_widget for expected format |
subreddit | The subreddit with the widgets |
WidgetTextArea Reddit.Models.Widgets.Add | ( | WidgetTextArea | widgetTextArea, |
string | subreddit = null |
||
) |
Add and return a widget to the specified subreddit. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind.
widgetTextArea | See https://www.reddit.com/dev/api/#POST_api_widget for expected format |
subreddit | The subreddit with the widgets |
T Reddit.Models.Widgets.Add< T > | ( | string | json, |
string | subreddit = null |
||
) |
Add and return a widget to the specified subreddit. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind.
json | See https://www.reddit.com/dev/api/#POST_api_widget for expected format |
subreddit | The subreddit with the widgets |
void Reddit.Models.Widgets.Delete | ( | string | widgetId, |
string | subreddit = null |
||
) |
Delete a widget from the specified subreddit (if it exists).
widgetId | id of an existing widget |
subreddit | The subreddit with the widgets |
WidgetResults Reddit.Models.Widgets.Get | ( | bool | progressiveImages, |
string | subreddit = null |
||
) |
Return all widgets for the given subreddit.
progressiveImages | boolean value |
subreddit | The subreddit with the widgets |
WidgetCalendar Reddit.Models.Widgets.Update | ( | string | widgetId, |
WidgetCalendar | widgetCalendar, | ||
string | subreddit = null |
||
) |
Update and return the data of a widget. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind.
widgetId | a valid widget id |
widgetCalendar | See https://www.reddit.com/dev/api/#PUT_api_widget_{widget_id} for expected format |
subreddit | The subreddit with the widgets |
WidgetCommunityList Reddit.Models.Widgets.Update | ( | string | widgetId, |
WidgetCommunityList | widgetCommunityList, | ||
string | subreddit = null |
||
) |
Update and return the data of a widget. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind.
widgetId | a valid widget id |
widgetCommunityList | See https://www.reddit.com/dev/api/#PUT_api_widget_{widget_id} for expected format |
subreddit | The subreddit with the widgets |
WidgetTextArea Reddit.Models.Widgets.Update | ( | string | widgetId, |
WidgetTextArea | widgetTextArea, | ||
string | subreddit = null |
||
) |
Update and return the data of a widget. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind.
widgetId | a valid widget id |
widgetTextArea | See https://www.reddit.com/dev/api/#PUT_api_widget_{widget_id} for expected format |
subreddit | The subreddit with the widgets |
T Reddit.Models.Widgets.Update< T > | ( | string | widgetId, |
string | json, | ||
string | subreddit = null |
||
) |
Update and return the data of a widget. Accepts a JSON payload representing the widget data to be saved. Valid payloads differ in shape based on the "kind" attribute passed on the root object, which must be a valid widget kind.
widgetId | a valid widget id |
json | See https://www.reddit.com/dev/api/#PUT_api_widget_{widget_id} for expected format |
subreddit | The subreddit with the widgets |
void Reddit.Models.Widgets.UpdateOrder | ( | string | section, |
List< string > | widgetIds, | ||
string | subreddit = null |
||
) |
Update the order of widget_ids in the specified subreddit.
section | one of (sidebar) |
widgetIds | a list of widget ids |
subreddit | The subreddit with the widgets |
void Reddit.Models.Widgets.UpdateOrder | ( | string | section, |
string | json, | ||
string | subreddit = null |
||
) |
Update the order of widget_ids in the specified subreddit.
section | one of (sidebar) |
json | json data: [ a string, ... ] |
subreddit | The subreddit with the widgets |
object Reddit.Models.Widgets.WidgetImageUploadS3 | ( | string | filePath, |
string | mimeType | ||
) |
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.
filePath | name and extension of the image file e.g. image1.png |
mimeType | mime type of the image e.g. image/png |