using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using Octokit.Internal;
namespace Octokit
{
///
/// Response from the /meta endpoint that provides information about GitHub.com or a GitHub Enterprise instance.
///
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Meta
{
///
/// Create an instance of the Meta
///
public Meta()
{
}
///
/// Create an instance of the Meta
///
/// Whether authentication with username and password is supported.
/// The currently-deployed SHA of github-services.
/// An array of IP addresses in CIDR format specifying the addresses that incoming service hooks will originate from on GitHub.com.
/// An array of IP addresses in CIDR format specifying the Git servers for the GitHub server
/// An array of IP addresses in CIDR format specifying the A records for GitHub Pages.
/// An Array of IP addresses specifying the addresses that source imports will originate from on GitHub.com.
public Meta(
bool verifiablePasswordAuthentication,
string gitHubServicesSha,
IReadOnlyList hooks,
IReadOnlyList git,
IReadOnlyList pages,
IReadOnlyList importer)
{
VerifiablePasswordAuthentication = verifiablePasswordAuthentication;
GitHubServicesSha = gitHubServicesSha;
Hooks = hooks;
Git = git;
Pages = pages;
Importer = importer;
}
///
/// Whether authentication with username and password is supported. (GitHub Enterprise instances using CAS or
/// OAuth for authentication will return false. Features like Basic Authentication with a username and
/// password, sudo mode, and two-factor authentication are not supported on these servers.)
///
public bool VerifiablePasswordAuthentication { get; private set; }
///
/// The currently-deployed SHA of github-services.
///
[Parameter(Key = "github_services_sha")]
public string GitHubServicesSha { get; private set; }
///
/// An Array of IP addresses in CIDR format specifying the addresses that incoming service hooks will
/// originate from on GitHub.com. Subscribe to the API Changes blog or follow @GitHubAPI on Twitter to get
/// updated when this list changes.
///
public IReadOnlyList Hooks { get; private set; }
///
/// An Array of IP addresses in CIDR format specifying the Git servers for GitHub.com.
///
public IReadOnlyList Git { get; private set; }
///
/// An Array of IP addresses in CIDR format specifying the A records for GitHub Pages.
///
public IReadOnlyList Pages { get; private set; }
///
/// An Array of IP addresses specifying the addresses that source imports will originate from on GitHub.com.
///
public IReadOnlyList Importer { get; private set; }
internal string DebuggerDisplay
{
get
{
return string.Format(
CultureInfo.InvariantCulture,
"GitHubServicesSha: {0}, VerifiablePasswordAuthentication: {1} ",
GitHubServicesSha,
VerifiablePasswordAuthentication);
}
}
}
}