![]() |
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 | |
Flair (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null) | |
GenericContainer | ClearFlairTemplates (string flairType, string subreddit=null) |
Clear flair templates. More... | |
async Task< GenericContainer > | ClearFlairTemplatesAsync (string flairType, string subreddit=null) |
Clear flair templates asynchronously. More... | |
GenericContainer | DeleteFlair (string name, string subreddit=null) |
Delete flair. More... | |
async Task< GenericContainer > | DeleteFlairAsync (string name, string subreddit=null) |
Delete flair asynchronously. More... | |
GenericContainer | DeleteFlairTemplate (string flairTemplateId, string subreddit=null) |
Delete flair template. More... | |
async Task< GenericContainer > | DeleteFlairTemplateAsync (string flairTemplateId, string subreddit=null) |
Delete flair template asynchronously. More... | |
GenericContainer | Create (FlairCreateInput flairCreateInput, string subreddit=null) |
Create a new flair. More... | |
async Task< GenericContainer > | CreateAsync (FlairCreateInput flairCreateInput, string subreddit=null) |
Create a new flair asynchronously. More... | |
object | FlairTemplateOrder (string flairType, List< Things.Flair > flairs, string subreddit=null) |
Update the order of flair templates in the specified subreddit. Order should contain every single flair id for that flair type; omitting any id will result in a loss of data. More... | |
GenericContainer | FlairConfig (FlairConfigInput flairConfigInput, string subreddit=null) |
Flair config. More... | |
async Task< GenericContainer > | FlairConfigAsync (FlairConfigInput flairConfigInput, string subreddit=null) |
Asynchronous flair config. More... | |
List< ActionResult > | FlairCSV (string flairCsv, string subreddit=null) |
Change the flair of multiple users in the same subreddit with a single API call. Requires a string 'flair_csv' which has up to 100 lines of the form 'user,flairtext,cssclass' (Lines beyond the 100th are ignored). If both cssclass and flairtext are the empty string for a given user, instead clears that user's flair. Returns an array of objects indicating if each flair setting was applied, or a reason for the failure. More... | |
async Task< List< ActionResult > > | FlairCSVAsync (string flairCsv, string subreddit=null) |
Asynchronously change the flair of multiple users in the same subreddit with a single API call. Requires a string 'flair_csv' which has up to 100 lines of the form 'user,flairtext,cssclass' (Lines beyond the 100th are ignored). If both cssclass and flairtext are the empty string for a given user, instead clears that user's flair. Returns an array of objects indicating if each flair setting was applied, or a reason for the failure. More... | |
FlairListResultContainer | FlairList (FlairNameListingInput flairNameListingInput, string subreddit=null) |
List of flairs. More... | |
FlairSelectorResultContainer | FlairSelector (FlairLinkInput flairLinkInput, string subreddit=null) |
Return information about a users's flair options. If link is given, return link flair options. Otherwise, return user flair options for this subreddit. The logged in user's flair is also returned. Subreddit moderators may give a user by name to instead retrieve that user's flair. More... | |
GenericContainer | FlairTemplate (FlairTemplateInput flairTemplateInput, string subreddit=null) |
Create or update a flair template. More... | |
async Task< GenericContainer > | FlairTemplateAsync (FlairTemplateInput flairTemplateInput, string subreddit=null) |
Create or update a flair template asynchronously. More... | |
FlairV2 | FlairTemplateV2 (FlairTemplateV2Input flairTemplateV2Input, string subreddit=null) |
Create or update a flair template asynchronously. Null values are ignored. This new endpoint is primarily used for the redesign. More... | |
async Task< FlairV2 > | FlairTemplateV2Async (FlairTemplateV2Input flairTemplateV2Input, string subreddit=null) |
Create or update a flair template. Null values are ignored. This new endpoint is primarily used for the redesign. More... | |
List< Things.Flair > | LinkFlair (string subreddit=null) |
Return list of available link flair for the current subreddit. Will not return flair if the user cannot set their own link flair and they are not a moderator that can set flair. More... | |
List< FlairV2 > | LinkFlairV2 (string subreddit=null) |
Return list of available link flair for the current subreddit. Will not return flair if the user cannot set their own link flair and they are not a moderator that can set flair. More... | |
GenericContainer | SelectFlair (FlairSelectFlairInput flairSelectFlairInput, string subreddit=null) |
Sets a link flair. More... | |
async Task< GenericContainer > | SelectFlairAsync (FlairSelectFlairInput flairSelectFlairInput, string subreddit=null) |
Sets a link flair asynchronously. More... | |
GenericContainer | SetFlairEnabled (bool flairEnabled, string subreddit=null) |
Set flair enabled. More... | |
async Task< GenericContainer > | SetFlairEnabledAsync (bool flairEnabled, string subreddit=null) |
Set flair enabled asynchronously. More... | |
List< Things.Flair > | UserFlair (string subreddit=null) |
Return list of available user flair for the current subreddit. Will not return flair if flair is disabled on the subreddit, the user cannot set their own flair, or they are not a moderator that can set flair. More... | |
List< FlairV2 > | UserFlairV2 (string subreddit=null) |
Return list of available user flair for the current subreddit. If user is not a mod of the subreddit, this endpoint filters out mod_only templates. 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.Flair.Flair | ( | string | appId, |
string | appSecret, | ||
string | refreshToken, | ||
string | accessToken, | ||
ref RestClient | restClient, | ||
string | deviceId = null , |
||
string | userAgent = null |
||
) |
GenericContainer Reddit.Models.Flair.ClearFlairTemplates | ( | string | flairType, |
string | subreddit = null |
||
) |
Clear flair templates.
flairType | one of (USER_FLAIR, LINK_FLAIR) |
subreddit | The subreddit with the flairs |
async Task<GenericContainer> Reddit.Models.Flair.ClearFlairTemplatesAsync | ( | string | flairType, |
string | subreddit = null |
||
) |
Clear flair templates asynchronously.
flairType | one of (USER_FLAIR, LINK_FLAIR) |
subreddit | The subreddit with the flairs |
GenericContainer Reddit.Models.Flair.Create | ( | FlairCreateInput | flairCreateInput, |
string | subreddit = null |
||
) |
Create a new flair.
flairCreateInput | a valid FlairCreateInput instance |
subreddit | The subreddit with the flairs |
async Task<GenericContainer> Reddit.Models.Flair.CreateAsync | ( | FlairCreateInput | flairCreateInput, |
string | subreddit = null |
||
) |
Create a new flair asynchronously.
flairCreateInput | a valid FlairCreateInput instance |
subreddit | The subreddit with the flairs |
GenericContainer Reddit.Models.Flair.DeleteFlair | ( | string | name, |
string | subreddit = null |
||
) |
Delete flair.
name | a user by name |
subreddit | The subreddit with the flairs |
async Task<GenericContainer> Reddit.Models.Flair.DeleteFlairAsync | ( | string | name, |
string | subreddit = null |
||
) |
Delete flair asynchronously.
name | a user by name |
subreddit | The subreddit with the flairs |
GenericContainer Reddit.Models.Flair.DeleteFlairTemplate | ( | string | flairTemplateId, |
string | subreddit = null |
||
) |
Delete flair template.
flairTemplateId | |
subreddit | The subreddit with the flairs |
async Task<GenericContainer> Reddit.Models.Flair.DeleteFlairTemplateAsync | ( | string | flairTemplateId, |
string | subreddit = null |
||
) |
Delete flair template asynchronously.
flairTemplateId | |
subreddit | The subreddit with the flairs |
GenericContainer Reddit.Models.Flair.FlairConfig | ( | FlairConfigInput | flairConfigInput, |
string | subreddit = null |
||
) |
Flair config.
flairConfigInput | A valid FlairConfigInput instance |
subreddit | The subreddit with the flairs |
async Task<GenericContainer> Reddit.Models.Flair.FlairConfigAsync | ( | FlairConfigInput | flairConfigInput, |
string | subreddit = null |
||
) |
Asynchronous flair config.
flairConfigInput | A valid FlairConfigInput instance |
subreddit | The subreddit with the flairs |
List<ActionResult> Reddit.Models.Flair.FlairCSV | ( | string | flairCsv, |
string | subreddit = null |
||
) |
Change the flair of multiple users in the same subreddit with a single API call. Requires a string 'flair_csv' which has up to 100 lines of the form 'user,flairtext,cssclass' (Lines beyond the 100th are ignored). If both cssclass and flairtext are the empty string for a given user, instead clears that user's flair. Returns an array of objects indicating if each flair setting was applied, or a reason for the failure.
flairCsv | comma-seperated flair information |
subreddit | The subreddit with the flairs |
async Task<List<ActionResult> > Reddit.Models.Flair.FlairCSVAsync | ( | string | flairCsv, |
string | subreddit = null |
||
) |
Asynchronously change the flair of multiple users in the same subreddit with a single API call. Requires a string 'flair_csv' which has up to 100 lines of the form 'user,flairtext,cssclass' (Lines beyond the 100th are ignored). If both cssclass and flairtext are the empty string for a given user, instead clears that user's flair. Returns an array of objects indicating if each flair setting was applied, or a reason for the failure.
flairCsv | comma-seperated flair information |
subreddit | The subreddit with the flairs |
FlairListResultContainer Reddit.Models.Flair.FlairList | ( | FlairNameListingInput | flairNameListingInput, |
string | subreddit = null |
||
) |
List of flairs.
flairNameListingInput | A valid FlairNameListingInput instance |
subreddit | The subreddit with the flairs |
FlairSelectorResultContainer Reddit.Models.Flair.FlairSelector | ( | FlairLinkInput | flairLinkInput, |
string | subreddit = null |
||
) |
Return information about a users's flair options. If link is given, return link flair options. Otherwise, return user flair options for this subreddit. The logged in user's flair is also returned. Subreddit moderators may give a user by name to instead retrieve that user's flair.
flairLinkInput | A valid FlairLinkInput instance |
subreddit | The subreddit with the flairs |
GenericContainer Reddit.Models.Flair.FlairTemplate | ( | FlairTemplateInput | flairTemplateInput, |
string | subreddit = null |
||
) |
Create or update a flair template.
flairTemplateInput | a valid FlairTemplateInput instance |
subreddit | The subreddit with the flairs |
async Task<GenericContainer> Reddit.Models.Flair.FlairTemplateAsync | ( | FlairTemplateInput | flairTemplateInput, |
string | subreddit = null |
||
) |
Create or update a flair template asynchronously.
flairTemplateInput | a valid FlairTemplateInput instance |
subreddit | The subreddit with the flairs |
object Reddit.Models.Flair.FlairTemplateOrder | ( | string | flairType, |
List< Things.Flair > | flairs, | ||
string | subreddit = null |
||
) |
Update the order of flair templates in the specified subreddit. Order should contain every single flair id for that flair type; omitting any id will result in a loss of data.
flairType | one of (USER_FLAIR, LINK_FLAIR) |
subreddit | subreddit name |
FlairV2 Reddit.Models.Flair.FlairTemplateV2 | ( | FlairTemplateV2Input | flairTemplateV2Input, |
string | subreddit = null |
||
) |
Create or update a flair template asynchronously. Null values are ignored. This new endpoint is primarily used for the redesign.
flairTemplateV2Input | a valid FlairTemplateV2Input instance |
subreddit | The subreddit with the flairs |
async Task<FlairV2> Reddit.Models.Flair.FlairTemplateV2Async | ( | FlairTemplateV2Input | flairTemplateV2Input, |
string | subreddit = null |
||
) |
Create or update a flair template. Null values are ignored. This new endpoint is primarily used for the redesign.
flairTemplateV2Input | a valid FlairTemplateV2Input instance |
subreddit | The subreddit with the flairs |
List<Things.Flair> Reddit.Models.Flair.LinkFlair | ( | string | subreddit = null | ) |
Return list of available link flair for the current subreddit. Will not return flair if the user cannot set their own link flair and they are not a moderator that can set flair.
subreddit | The subreddit with the flairs |
List<FlairV2> Reddit.Models.Flair.LinkFlairV2 | ( | string | subreddit = null | ) |
Return list of available link flair for the current subreddit. Will not return flair if the user cannot set their own link flair and they are not a moderator that can set flair.
subreddit | The subreddit with the flairs |
GenericContainer Reddit.Models.Flair.SelectFlair | ( | FlairSelectFlairInput | flairSelectFlairInput, |
string | subreddit = null |
||
) |
Sets a link flair.
flairSelectFlairInput | a valid FlairSelectFlairInput instance |
subreddit | The subreddit with the flairs |
async Task<GenericContainer> Reddit.Models.Flair.SelectFlairAsync | ( | FlairSelectFlairInput | flairSelectFlairInput, |
string | subreddit = null |
||
) |
Sets a link flair asynchronously.
flairSelectFlairInput | a valid FlairSelectFlairInput instance |
subreddit | The subreddit with the flairs |
GenericContainer Reddit.Models.Flair.SetFlairEnabled | ( | bool | flairEnabled, |
string | subreddit = null |
||
) |
Set flair enabled.
flairEnabled | boolean value |
subreddit | The subreddit with the flairs |
async Task<GenericContainer> Reddit.Models.Flair.SetFlairEnabledAsync | ( | bool | flairEnabled, |
string | subreddit = null |
||
) |
Set flair enabled asynchronously.
flairEnabled | boolean value |
subreddit | The subreddit with the flairs |
List<Things.Flair> Reddit.Models.Flair.UserFlair | ( | string | subreddit = null | ) |
Return list of available user flair for the current subreddit. Will not return flair if flair is disabled on the subreddit, the user cannot set their own flair, or they are not a moderator that can set flair.
subreddit | The subreddit with the flairs |
List<FlairV2> Reddit.Models.Flair.UserFlairV2 | ( | string | subreddit = null | ) |
Return list of available user flair for the current subreddit. If user is not a mod of the subreddit, this endpoint filters out mod_only templates.
subreddit | The subreddit with the flairs |