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

Image related actions.
Inheritance: EndpointBase, IImageEndpoint
Show file Open project: DamienDennehy/Imgur.API Class Usage Examples

Private Properties

Property Type Description
ImageEndpoint System

Public Methods

Method Description
DeleteImageAsync ( string imageId ) : Task

Deletes an image. For an anonymous image, {id} must be the image's deletehash. If the image belongs to your account then passing the ID of the image is sufficient.

FavoriteImageAsync ( string imageId ) : Task

Favorite an image with the given ID. OAuth authentication required.

GetImageAsync ( string imageId ) : Task

Get information about an image.

ImageEndpoint ( IApiClient apiClient ) : System

Initializes a new instance of the ImageEndpoint class.

UpdateImageAsync ( string imageId, string title = null, string description = null ) : Task

Updates the title or description of an image. You can only update an image you own and is associated with your account. For an anonymous image, {id} must be the image's deletehash.

UploadImageBinaryAsync ( byte image, string albumId = null, string title = null, string description = null ) : Task

Upload a new image using a binary file.

UploadImageStreamAsync ( Stream image, string albumId = null, string title = null, string description = null ) : Task

Upload a new image using a stream.

UploadImageUrlAsync ( string image, string albumId = null, string title = null, string description = null ) : Task

Upload a new image using a URL.

Private Methods

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

Initializes a new instance of the ImageEndpoint class.

Method Details

DeleteImageAsync() public method

Deletes an image. For an anonymous image, {id} must be the image's deletehash. If the image belongs to your account then passing the ID of the image is sufficient.
/// 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 DeleteImageAsync ( string imageId ) : Task
imageId string The image id.
return Task

FavoriteImageAsync() public method

Favorite an image with the given ID. 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 FavoriteImageAsync ( string imageId ) : Task
imageId string The image id.
return Task

GetImageAsync() public method

Get 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 GetImageAsync ( string imageId ) : Task
imageId string The image id.
return Task

ImageEndpoint() public method

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

UpdateImageAsync() public method

Updates the title or description of an image. You can only update an image you own and is associated with your account. For an anonymous image, {id} must be the image's deletehash.
/// 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 UpdateImageAsync ( string imageId, string title = null, string description = null ) : Task
imageId string The image id.
title string The title of the image.
description string The description of the image.
return Task

UploadImageBinaryAsync() public method

Upload a new image using a binary file.
/// 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 UploadImageBinaryAsync ( byte image, string albumId = null, string title = null, string description = null ) : Task
image byte A binary file.
albumId string /// The id of the album you want to add the image to. For anonymous albums, {albumId} should be the /// deletehash that is returned at creation. ///
title string The title of the image.
description string The description of the image.
return Task

UploadImageStreamAsync() public method

Upload a new image using a stream.
/// 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 UploadImageStreamAsync ( Stream image, string albumId = null, string title = null, string description = null ) : Task
image Stream A stream.
albumId string /// The id of the album you want to add the image to. For anonymous albums, {albumId} should be the /// deletehash that is returned at creation. ///
title string The title of the image.
description string The description of the image.
return Task

UploadImageUrlAsync() public method

Upload a new image using a URL.
/// 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 UploadImageUrlAsync ( string image, string albumId = null, string title = null, string description = null ) : Task
image string The URL for the image.
albumId string /// The id of the album you want to add the image to. For anonymous albums, {albumId} should be the /// deletehash that is returned at creation. ///
title string The title of the image.
description string The description of the image.
return Task