C# Класс Imgur.API.Endpoints.Impl.ImageEndpoint

Image related actions.
Наследование: EndpointBase, IImageEndpoint
Показать файл Открыть проект Примеры использования класса

Private Properties

Свойство Тип Описание
ImageEndpoint System

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
ImageEndpoint ( IApiClient apiClient, HttpClient httpClient ) : System

Initializes a new instance of the ImageEndpoint class.

Описание методов

DeleteImageAsync() публичный Метод

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.
Результат Task

FavoriteImageAsync() публичный Метод

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.
Результат Task

GetImageAsync() публичный Метод

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.
Результат Task

ImageEndpoint() публичный Метод

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.
Результат System

UpdateImageAsync() публичный Метод

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.
Результат Task

UploadImageBinaryAsync() публичный Метод

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.
Результат Task

UploadImageStreamAsync() публичный Метод

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.
Результат Task

UploadImageUrlAsync() публичный Метод

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.
Результат Task