File tree Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Expand file tree Collapse file tree 1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change 2
2
=======
3
3
4
4
A simple API in terms of querying github with C#, based on RestSharp.
5
+
6
+ Usage
7
+ -----
8
+
9
+ ### Create a client instance
10
+ ``` csharp
11
+ using Git .hub ;
12
+ Client client = new Client ();
13
+ ```
14
+
15
+ ### login
16
+ OAuth token:
17
+ ``` csharp
18
+ client .setOAuth2Token (" 0fd..." );
19
+ ```
20
+
21
+ Username and Password:
22
+ ``` csharp
23
+ client .setCredentials (" mabako" , " super duper password" );
24
+ ```
25
+
26
+ Retrieve the currently logged in user:
27
+ ``` csharp
28
+ User user = client .getUser ();
29
+ ```
30
+
31
+
32
+ ### fetch repositories
33
+ ``` csharp
34
+ IList < Repository > repos = client .getRepositories (" mabako" );
35
+ IList < Repository > orgRepos = client .getOrganizationRepositories (" github" );
36
+
37
+ Repository pluginSource = client .getRepository (" mabako" , " Git.hub" );
38
+
39
+ /* Requires login */
40
+ IList < Repository > ownRepos = client .getRepositories ();
41
+ ```
42
+
43
+ ### repository actions
44
+ Fork the repo:
45
+ ``` csharp
46
+ Repository forked = pluginSource .CreateFork ();
47
+ ```
48
+
49
+ List branches:
50
+ ``` csharp
51
+ IList < Branch > branches = pluginSource .GetBranches ();
52
+ ```
You can’t perform that action at this time.
0 commit comments