using System;
using System.Diagnostics;
using System.Globalization;
using System.IO;
namespace Octokit
{
///
/// Used to upload a release asset.
///
///
/// This endpoint makes use of a Hypermedia relation to determine which URL to access. This endpoint is provided
/// by a URI template in the release’s API response. You need to use an HTTP client which supports SNI to make
/// calls to this endpoint. The asset data is expected in its raw binary form, rather than JSON. Everything else
/// about the endpoint is the same as the rest of the API. For example, you’ll still need to pass your
/// authentication to be able to upload an asset.
///
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class ReleaseAssetUpload
{
///
/// Initializes a new instance of the class.
///
public ReleaseAssetUpload() { }
///
/// Initializes a new instance of the class.
///
/// Name of the file.
///
/// The content type of the asset. Example: "application/zip". For a list of acceptable types, refer this list
/// of common media types.
///
/// The raw data.
/// The timeout.
public ReleaseAssetUpload(string fileName, string contentType, Stream rawData, TimeSpan? timeout)
{
FileName = fileName;
ContentType = contentType;
RawData = rawData;
Timeout = timeout;
}
///
/// Gets or sets the name of the file.
///
///
/// The name of the file.
///
public string FileName { get; set; }
///
/// Gets or sets the type of the content.
///
///
/// The type of the content.
///
public string ContentType { get; set; }
///
/// Gets or sets the raw data.
///
///
/// The raw data.
///
public Stream RawData { get; set; }
///
/// Gets or sets the timeout.
///
///
/// The timeout.
///
public TimeSpan? Timeout { get; set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "FileName: {0} ", FileName);
}
}
}
}