static void Main(string[] args) { var client = new GithubRestApiClient( @"https://api.github.com"); client.WithAuthentication(new HttpBasicAuthenticator("[user name here]", "[password here]")); CreateAuthorization(client); //GetAuthorizations(client); }
private static void CreateAuthorization(GithubRestApiClient client) { var response = client.CreateAuthorization<Authorization>(new List<string> { "repo" }, "[client id here]", "[client secret here]"); Console.WriteLine("Authorization Token: " + response.Data.Token); Console.ReadKey(); }
private static void GetAuthorizations(GithubRestApiClient client) { var response = client.GetAuthorizations<List<Authorization>>(); foreach (var auth in response.Data) { Console.WriteLine("App: " + auth.App.Name); Console.WriteLine("Authorization Token: " + auth.Token); Console.WriteLine(Environment.NewLine); } Console.ReadKey(); }
public override void Context() { base.Context(); Github = new GithubRestApiClient(GitHubUrl); }
public static IRestResponse Events(GithubRestApiClient client) { return null; }