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.Modmail Class Reference
Inheritance diagram for Reddit.Models.Modmail:
Reddit.Models.BaseModel Reddit.Models.Internal.Request

Public Member Functions

 Modmail (string appId, string appSecret, string refreshToken, string accessToken, ref RestClient restClient, string deviceId=null, string userAgent=null)
 
object BulkRead (ModmailBulkReadInput modmailBulkReadInput)
 Marks all conversations read for a particular conversation state within the passed list of subreddits. More...
 
ConversationContainer GetConversations (ModmailGetConversationsInput modmailGetConversationsInput)
 Get conversations for a logged in user or subreddits. More...
 
ModmailConversationContainer NewConversation (ModmailNewConversationInput modmailNewConversationInput)
 Creates a new conversation for a particular SR. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object. More...
 
async Task< ModmailConversationContainerNewConversationAsync (ModmailNewConversationInput modmailNewConversationInput)
 Creates a new conversation for a particular SR asynchronously. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object. More...
 
ModmailConversationContainer GetConversation (string conversationId, bool markRead)
 Returns all messages, mod actions and conversation metadata for a given conversation id. More...
 
ModmailConversationContainer NewMessage (string conversationId, ModmailNewMessageInput modmailNewMessageInput)
 Creates a new message for a particular conversation. More...
 
async Task< ModmailConversationContainerNewMessageAsync (string conversationId, ModmailNewMessageInput modmailNewMessageInput)
 Creates a new message for a particular conversation asynchronously. More...
 
object ArchiveConversation (string conversationId)
 Marks a conversation as archived. More...
 
ModmailConversationContainer RemoveHighlight (string conversationId)
 Removes a highlight from a conversation. More...
 
async Task< ModmailConversationContainerRemoveHighlightAsync (string conversationId)
 Removes a highlight from a conversation asynchronously. More...
 
ModmailConversationContainer MarkHighlighted (string conversationId)
 Marks a conversation as highlighted. More...
 
async Task< ModmailConversationContainerMarkHighlightedAsync (string conversationId)
 Marks a conversation as highlighted asynchronously. More...
 
ModmailConversationContainer Mute (string conversationId)
 Mutes the non-mod user associated with a particular conversation. More...
 
async Task< ModmailConversationContainerMuteAsync (string conversationId)
 Asynchronously mutes the non-mod user associated with a particular conversation. More...
 
object UnarchiveConversation (string conversationId)
 Marks conversation as unarchived. More...
 
ModmailConversationContainer UnMute (string conversationId)
 Unmutes the non mod user associated with a particular conversation. More...
 
async Task< ModmailConversationContainerUnMuteAsync (string conversationId)
 Asynchronously unmutes the non mod user associated with a particular conversation. More...
 
ModmailUser User (string conversationId)
 Returns recent posts, comments and modmail conversations for the user that started this conversation. More...
 
void MarkRead (string conversationIds)
 Marks conversations as read for the user. More...
 
async Task MarkReadAsync (string conversationIds)
 Asynchronously marks conversations as read for the user. More...
 
ModmailSubredditContainer Subreddits ()
 Returns a list of srs that the user moderates that are also enrolled in the new modmail. More...
 
void MarkUnread (string conversationIds)
 Marks conversations as unread for the user. More...
 
async Task MarkUnreadAsync (string conversationIds)
 Asynchronously marks conversations as unread for the user. More...
 
ModmailUnreadCount UnreadCount ()
 Endpoint to retrieve the unread conversation count by conversation state. 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

◆ Modmail()

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

Member Function Documentation

◆ ArchiveConversation()

object Reddit.Models.Modmail.ArchiveConversation ( string  conversationId)

Marks a conversation as archived.

Parameters
conversationIdbase36 modmail conversation id
Returns
(TODO - Untested)

◆ BulkRead()

object Reddit.Models.Modmail.BulkRead ( ModmailBulkReadInput  modmailBulkReadInput)

Marks all conversations read for a particular conversation state within the passed list of subreddits.

Parameters
modmailBulkReadInputA valid ModmailBulkReadInput instance
Returns
(TODO - Untested)

◆ GetConversation()

ModmailConversationContainer Reddit.Models.Modmail.GetConversation ( string  conversationId,
bool  markRead 
)

Returns all messages, mod actions and conversation metadata for a given conversation id.

Parameters
conversationIdbase36 modmail conversation id
markReadboolean value
Returns
An object containing the conversation data.

◆ GetConversations()

ConversationContainer Reddit.Models.Modmail.GetConversations ( ModmailGetConversationsInput  modmailGetConversationsInput)

Get conversations for a logged in user or subreddits.

Parameters
modmailGetConversationsInputA valid ModmailGetConversationsInput instance
Returns
The requested conversations.

◆ MarkHighlighted()

ModmailConversationContainer Reddit.Models.Modmail.MarkHighlighted ( string  conversationId)

Marks a conversation as highlighted.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ MarkHighlightedAsync()

async Task<ModmailConversationContainer> Reddit.Models.Modmail.MarkHighlightedAsync ( string  conversationId)

Marks a conversation as highlighted asynchronously.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ MarkRead()

void Reddit.Models.Modmail.MarkRead ( string  conversationIds)

Marks conversations as read for the user.

Parameters
conversationIdsA comma-separated list of items

◆ MarkReadAsync()

async Task Reddit.Models.Modmail.MarkReadAsync ( string  conversationIds)

Asynchronously marks conversations as read for the user.

Parameters
conversationIdsA comma-separated list of items

◆ MarkUnread()

void Reddit.Models.Modmail.MarkUnread ( string  conversationIds)

Marks conversations as unread for the user.

Parameters
conversationIdsA comma-separated list of items

◆ MarkUnreadAsync()

async Task Reddit.Models.Modmail.MarkUnreadAsync ( string  conversationIds)

Asynchronously marks conversations as unread for the user.

Parameters
conversationIdsA comma-separated list of items

◆ Mute()

ModmailConversationContainer Reddit.Models.Modmail.Mute ( string  conversationId)

Mutes the non-mod user associated with a particular conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ MuteAsync()

async Task<ModmailConversationContainer> Reddit.Models.Modmail.MuteAsync ( string  conversationId)

Asynchronously mutes the non-mod user associated with a particular conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ NewConversation()

ModmailConversationContainer Reddit.Models.Modmail.NewConversation ( ModmailNewConversationInput  modmailNewConversationInput)

Creates a new conversation for a particular SR. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object.

Parameters
modmailNewConversationInputA valid ModmailNewConversationInput instance
Returns
An object containing the conversation data.

◆ NewConversationAsync()

async Task<ModmailConversationContainer> Reddit.Models.Modmail.NewConversationAsync ( ModmailNewConversationInput  modmailNewConversationInput)

Creates a new conversation for a particular SR asynchronously. This endpoint will create a ModmailConversation object as well as the first ModmailMessage within the ModmailConversation object.

Parameters
modmailNewConversationInputA valid ModmailNewConversationInput instance
Returns
An object containing the conversation data.

◆ NewMessage()

ModmailConversationContainer Reddit.Models.Modmail.NewMessage ( string  conversationId,
ModmailNewMessageInput  modmailNewMessageInput 
)

Creates a new message for a particular conversation.

Parameters
conversationIdbase36 modmail conversation id
modmailNewMessageInputA valid ModmailNewMessageInput instance
Returns
An object containing the conversation data.

◆ NewMessageAsync()

async Task<ModmailConversationContainer> Reddit.Models.Modmail.NewMessageAsync ( string  conversationId,
ModmailNewMessageInput  modmailNewMessageInput 
)

Creates a new message for a particular conversation asynchronously.

Parameters
conversationIdbase36 modmail conversation id
modmailNewMessageInputA valid ModmailNewMessageInput instance
Returns
An object containing the conversation data.

◆ RemoveHighlight()

ModmailConversationContainer Reddit.Models.Modmail.RemoveHighlight ( string  conversationId)

Removes a highlight from a conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ RemoveHighlightAsync()

async Task<ModmailConversationContainer> Reddit.Models.Modmail.RemoveHighlightAsync ( string  conversationId)

Removes a highlight from a conversation asynchronously.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ Subreddits()

ModmailSubredditContainer Reddit.Models.Modmail.Subreddits ( )

Returns a list of srs that the user moderates that are also enrolled in the new modmail.

Returns
A list of subreddits.

◆ UnarchiveConversation()

object Reddit.Models.Modmail.UnarchiveConversation ( string  conversationId)

Marks conversation as unarchived.

Parameters
conversationIdbase36 modmail conversation id
Returns
(TODO - Untested)

◆ UnMute()

ModmailConversationContainer Reddit.Models.Modmail.UnMute ( string  conversationId)

Unmutes the non mod user associated with a particular conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ UnMuteAsync()

async Task<ModmailConversationContainer> Reddit.Models.Modmail.UnMuteAsync ( string  conversationId)

Asynchronously unmutes the non mod user associated with a particular conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the conversation data.

◆ UnreadCount()

ModmailUnreadCount Reddit.Models.Modmail.UnreadCount ( )

Endpoint to retrieve the unread conversation count by conversation state.

Returns
An object with the int properties: highlighted, notifications, archived, new, inprogress, and mod.

◆ User()

ModmailUser Reddit.Models.Modmail.User ( string  conversationId)

Returns recent posts, comments and modmail conversations for the user that started this conversation.

Parameters
conversationIdbase36 modmail conversation id
Returns
An object containing the user data.

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