Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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();
        }
Exemplo n.º 4
0
 public override void Context()
 {
     base.Context();
     Github = new GithubRestApiClient(GitHubUrl);
 }
 public static IRestResponse Events(GithubRestApiClient client)
 {
     return null;
 }