using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
namespace Octokit
{
///
/// Information about a file in a repository. It does not include the contents of the file.
///
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class RepositoryContentInfo
{
public RepositoryContentInfo() { }
public RepositoryContentInfo(string name, string path, string sha, int size, ContentType type, Uri downloadUrl, Uri url, Uri gitUrl, Uri htmlUrl)
{
Name = name;
Path = path;
Sha = sha;
Size = size;
Type = type;
DownloadUrl = downloadUrl;
Url = url;
GitUrl = gitUrl;
HtmlUrl = htmlUrl;
}
///
/// Name of the content.
///
public string Name { get; protected set; }
///
/// Path to this content.
///
public string Path { get; protected set; }
///
/// SHA of the last commit that modified this content.
///
public string Sha { get; protected set; }
///
/// Size of the content.
///
public int Size { get; protected set; }
///
/// The type of this content. It might be a File, Directory, Submodule, or Symlink
///
[SuppressMessage("Microsoft.Naming", "CA1721:PropertyNamesShouldNotMatchGetMethods", Justification = "Matches the property name used by the API")]
public ContentType Type { get; protected set; }
///
/// URL to the raw content
///
public Uri DownloadUrl { get; protected set; }
///
/// URL to this content
///
public Uri Url { get; protected set; }
///
/// The GIT URL to this content.
///
public Uri GitUrl { get; protected set; }
///
/// The URL to view this content on GitHub.
///
public Uri HtmlUrl { get; protected set; }
internal string DebuggerDisplay
{
get
{
return string.Format(CultureInfo.InvariantCulture, "Name: {0} Path: {1} Type:{2}", Name, Path, Type);
}
}
}
}