C# Class Imgur.API.Endpoints.Impl.GalleryEndpoint

ファイルを表示 Open project: DamienDennehy/Imgur.API Class Usage Examples

Private Properties

Property Type Description
GalleryEndpoint System

Public Methods

Method Description
CreateGalleryItemCommentAsync ( string comment, string galleryItemId ) : Task

Create a comment for an item. OAuth authentication required.

CreateGalleryItemCommentReplyAsync ( string comment, string galleryItemId, string parentId ) : Task

Reply to a comment that has been created for an item. OAuth authentication required.

GalleryEndpoint ( IApiClient apiClient ) : System

Initializes a new instance of the GalleryEndpoint class.

GetGalleryAlbumAsync ( string albumId ) : Task

Get additional information about an album in the gallery.

GetGalleryAsync ( GallerySection section = GallerySection.Hot, GallerySortOrder sort = GallerySortOrder.Viral, TimeWindow window = TimeWindow.Day, int page = null, bool showViral = true ) : Task>

Returns the images in the gallery.

GetGalleryImageAsync ( string imageId ) : Task

Get additional information about an image in the gallery.

GetGalleryItemCommentAsync ( int commentId, string galleryItemId ) : Task

Get information about a specific comment.

GetGalleryItemCommentCountAsync ( string galleryItemId ) : Task

The number of comments on an item.

GetGalleryItemCommentIdsAsync ( string galleryItemId ) : Task>

List all of the IDs for the comments on an item.

GetGalleryItemCommentsAsync ( string galleryItemId, CommentSortOrder sort = CommentSortOrder.Best ) : Task>

Get all comments for a gallery item.

GetGalleryItemTagsAsync ( string galleryItemId ) : Task

View tags for a gallery item.

GetGalleryItemVotesAsync ( string galleryItemId ) : Task

Get the vote information about an image.

GetGalleryTagAsync ( string tag, GalleryTagSortOrder sort = GalleryTagSortOrder.Viral, TimeWindow window = TimeWindow.Week, int page = null ) : Task

View images for a gallery tag.

GetGalleryTagImageAsync ( string galleryItemId, string tag ) : Task

View a single item in a gallery tag.

GetMemesSubGalleryAsync ( MemesGallerySortOrder sort = MemesGallerySortOrder.Viral, TimeWindow window = TimeWindow.Week, int page = null ) : Task>

View images for memes subgallery.

GetMemesSubGalleryImageAsync ( string imageId ) : Task

View a single image in the memes gallery.

GetRandomGalleryAsync ( int page = null ) : Task>

Returns a random set of gallery images.

GetSubredditGalleryAsync ( string subreddit, SubredditGallerySortOrder sort = SubredditGallerySortOrder.Time, TimeWindow window = TimeWindow.Week, int page = null ) : Task>

View gallery images for a subreddit.

GetSubredditImageAsync ( string imageId, string subreddit ) : Task

View a single image in the subreddit.

PublishToGalleryAsync ( string galleryItemId, string title, string topicId = null, bool bypassTerms = null, bool mature = null ) : Task

Share an Album or Image to the Gallery. OAuth authentication required.

RemoveFromGalleryAsync ( string galleryItemId ) : Task

Remove an item from the gallery. OAuth authentication required.

ReportGalleryItemAsync ( string galleryItemId, ReportReason reason ) : Task

Report an item in the gallery. OAuth authentication required.

SearchGalleryAdvancedAsync ( string qAll = null, string qAny = null, string qExactly = null, string qNot = null, ImageFileType fileType = null, ImageSize imageSize = null, GallerySortOrder sort = GallerySortOrder.Time, TimeWindow window = TimeWindow.All, int page = null ) : Task>

Search the gallery with a given query string.

SearchGalleryAsync ( string query, GallerySortOrder sort = GallerySortOrder.Time, TimeWindow window = TimeWindow.All, int page = null ) : Task>

Search the gallery with a given query string.

VoteGalleryItemAsync ( string galleryItemId, VoteOption vote ) : Task

Vote for an item. Send the same value again to undo a vote. OAuth authentication required.

VoteGalleryTagAsync ( string galleryItemId, string tag, VoteOption vote ) : Task

Vote for a tag. Send the same value again to undo a vote. OAuth authentication required.

Private Methods

Method Description
GalleryEndpoint ( IApiClient apiClient, HttpClient httpClient ) : System

Initializes a new instance of the GalleryEndpoint class.

Method Details

CreateGalleryItemCommentAsync() public method

Create a comment for an item. OAuth authentication required.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public CreateGalleryItemCommentAsync ( string comment, string galleryItemId ) : Task
comment string The text of the comment.
galleryItemId string The gallery item id.
return Task

CreateGalleryItemCommentReplyAsync() public method

Reply to a comment that has been created for an item. OAuth authentication required.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public CreateGalleryItemCommentReplyAsync ( string comment, string galleryItemId, string parentId ) : Task
comment string The text of the comment.
galleryItemId string The gallery item id.
parentId string The comment id that you are replying to.
return Task

GalleryEndpoint() public method

Initializes a new instance of the GalleryEndpoint class.
public GalleryEndpoint ( IApiClient apiClient ) : System
apiClient IApiClient The type of client that will be used for authentication.
return System

GetGalleryAlbumAsync() public method

Get additional information about an album in the gallery.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryAlbumAsync ( string albumId ) : Task
albumId string The album id.
return Task

GetGalleryAsync() public method

Returns the images in the gallery.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryAsync ( GallerySection section = GallerySection.Hot, GallerySortOrder sort = GallerySortOrder.Viral, TimeWindow window = TimeWindow.Day, int page = null, bool showViral = true ) : Task>
section GallerySection The gallery section. Default: Hot
sort GallerySortOrder The order that the gallery should be sorted by. Default: Viral
window TimeWindow The time period that should be used in filtering requests. Default: Day
page int The data paging number. Default: null
showViral bool Show or hide viral images from the 'user' section. Default: true
return Task>

GetGalleryImageAsync() public method

Get additional information about an image in the gallery.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryImageAsync ( string imageId ) : Task
imageId string The image id.
return Task

GetGalleryItemCommentAsync() public method

Get information about a specific comment.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryItemCommentAsync ( int commentId, string galleryItemId ) : Task
commentId int The comment id.
galleryItemId string The gallery item id.
return Task

GetGalleryItemCommentCountAsync() public method

The number of comments on an item.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryItemCommentCountAsync ( string galleryItemId ) : Task
galleryItemId string The gallery item id.
return Task

GetGalleryItemCommentIdsAsync() public method

List all of the IDs for the comments on an item.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryItemCommentIdsAsync ( string galleryItemId ) : Task>
galleryItemId string The gallery item id.
return Task>

GetGalleryItemCommentsAsync() public method

Get all comments for a gallery item.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryItemCommentsAsync ( string galleryItemId, CommentSortOrder sort = CommentSortOrder.Best ) : Task>
galleryItemId string The gallery item id.
sort CommentSortOrder The order that comments should be sorted by.
return Task>

GetGalleryItemTagsAsync() public method

View tags for a gallery item.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryItemTagsAsync ( string galleryItemId ) : Task
galleryItemId string The gallery item id.
return Task

GetGalleryItemVotesAsync() public method

Get the vote information about an image.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryItemVotesAsync ( string galleryItemId ) : Task
galleryItemId string The gallery item id.
return Task

GetGalleryTagAsync() public method

View images for a gallery tag.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryTagAsync ( string tag, GalleryTagSortOrder sort = GalleryTagSortOrder.Viral, TimeWindow window = TimeWindow.Week, int page = null ) : Task
tag string The name of the tag.
sort GalleryTagSortOrder The order that the images in the gallery tag should be sorted by. Default: Viral
window TimeWindow The time period that should be used in filtering requests. Default: Week
page int The data paging number. Default: null
return Task

GetGalleryTagImageAsync() public method

View a single item in a gallery tag.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetGalleryTagImageAsync ( string galleryItemId, string tag ) : Task
galleryItemId string The gallery item id.
tag string The name of the tag.
return Task

GetMemesSubGalleryAsync() public method

View images for memes subgallery.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetMemesSubGalleryAsync ( MemesGallerySortOrder sort = MemesGallerySortOrder.Viral, TimeWindow window = TimeWindow.Week, int page = null ) : Task>
sort MemesGallerySortOrder The order that the gallery should be sorted by. Default: Viral
window TimeWindow The time period that should be used in filtering requests. Default: Week
page int The data paging number. Default: null
return Task>

GetMemesSubGalleryImageAsync() public method

View a single image in the memes gallery.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetMemesSubGalleryImageAsync ( string imageId ) : Task
imageId string The image id.
return Task

GetRandomGalleryAsync() public method

Returns a random set of gallery images.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetRandomGalleryAsync ( int page = null ) : Task>
page int A page of random gallery images, from 0-50. Pages are regenerated every hour.
return Task>

GetSubredditGalleryAsync() public method

View gallery images for a subreddit.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetSubredditGalleryAsync ( string subreddit, SubredditGallerySortOrder sort = SubredditGallerySortOrder.Time, TimeWindow window = TimeWindow.Week, int page = null ) : Task>
subreddit string A valid subreddit name. Example: pics, gaming
sort SubredditGallerySortOrder The order that the gallery should be sorted by. Default: Time
window TimeWindow The time period that should be used in filtering requests. Default: Week
page int The data paging number. Default: null
return Task>

GetSubredditImageAsync() public method

View a single image in the subreddit.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public GetSubredditImageAsync ( string imageId, string subreddit ) : Task
imageId string The image id.
subreddit string A valid subreddit name. Example: pics, gaming
return Task

PublishToGalleryAsync() public method

Share an Album or Image to the Gallery. OAuth authentication required.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public PublishToGalleryAsync ( string galleryItemId, string title, string topicId = null, bool bypassTerms = null, bool mature = null ) : Task
galleryItemId string The gallery item id.
title string The title of the image. This is required.
topicId string The topic id - not the topic name.
bypassTerms bool /// If the user has not accepted the terms yet, this endpoint will return an error. To by-pass /// the terms in general simply set this value to true. ///
mature bool If the post is mature, set this value to true.
return Task

RemoveFromGalleryAsync() public method

Remove an item from the gallery. OAuth authentication required.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public RemoveFromGalleryAsync ( string galleryItemId ) : Task
galleryItemId string The gallery item id.
return Task

ReportGalleryItemAsync() public method

Report an item in the gallery. OAuth authentication required.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public ReportGalleryItemAsync ( string galleryItemId, ReportReason reason ) : Task
galleryItemId string The gallery item id.
reason ReportReason A reason why content is inappropriate.
return Task

SearchGalleryAdvancedAsync() public method

Search the gallery with a given query string.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public SearchGalleryAdvancedAsync ( string qAll = null, string qAny = null, string qExactly = null, string qNot = null, ImageFileType fileType = null, ImageSize imageSize = null, GallerySortOrder sort = GallerySortOrder.Time, TimeWindow window = TimeWindow.All, int page = null ) : Task>
qAll string Search for all of these words (and).
qAny string Search for any of these words (or).
qExactly string Search for exactly this word or phrase.
qNot string Exclude results matching this word or phrase.
fileType ImageFileType Show results for a specific file type.
imageSize ImageSize Show results for a specific image size.
sort GallerySortOrder The order that the gallery should be sorted by. Default: Time
window TimeWindow The time period that should be used in filtering requests. Default: Day
page int The data paging number. Default: null
return Task>

SearchGalleryAsync() public method

Search the gallery with a given query string.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public SearchGalleryAsync ( string query, GallerySortOrder sort = GallerySortOrder.Time, TimeWindow window = TimeWindow.All, int page = null ) : Task>
query string /// Query string to search by. This parameter also supports boolean operators (AND, OR, NOT) and /// indices (tag: user: title: ext: subreddit: album: meme:). An example compound query would be 'title: cats AND dogs /// ext: gif' ///
sort GallerySortOrder The order that the gallery should be sorted by. Default: Time
window TimeWindow The time period that should be used in filtering requests. Default: Day
page int The data paging number. Default: null
return Task>

VoteGalleryItemAsync() public method

Vote for an item. Send the same value again to undo a vote. OAuth authentication required.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public VoteGalleryItemAsync ( string galleryItemId, VoteOption vote ) : Task
galleryItemId string The gallery item id.
vote VoteOption The vote.
return Task

VoteGalleryTagAsync() public method

Vote for a tag. Send the same value again to undo a vote. OAuth authentication required.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public VoteGalleryTagAsync ( string galleryItemId, string tag, VoteOption vote ) : Task
galleryItemId string The gallery item id.
tag string Name of the tag (implicitly created, if doesn't exist).
vote VoteOption The vote.
return Task