|
13 | 13 | * @see <a href="http://developer.github.com/v3/oauth/#create-a-new-authorization">API documentation</a> |
14 | 14 | */ |
15 | 15 | public class GHAuthorization extends GHObject { |
16 | | - public static final String USER = "user"; |
17 | | - public static final String USER_EMAIL = "user:email"; |
18 | | - public static final String USER_FOLLOW = "user:follow"; |
19 | | - public static final String PUBLIC_REPO = "public_repo"; |
20 | | - public static final String REPO = "repo"; |
21 | | - public static final String REPO_STATUS = "repo:status"; |
22 | | - public static final String DELETE_REPO = "delete_repo"; |
23 | | - public static final String NOTIFICATIONS = "notifications"; |
24 | | - public static final String GIST = "gist"; |
25 | | - public static final String READ_HOOK = "read:repo_hook"; |
26 | | - public static final String WRITE_HOOK = "write:repo_hook"; |
27 | | - public static final String AMIN_HOOK = "admin:repo_hook"; |
28 | | - public static final String READ_ORG = "read:org"; |
29 | | - public static final String WRITE_ORG = "write:org"; |
30 | | - public static final String ADMIN_ORG = "admin:org"; |
31 | | - public static final String READ_KEY = "read:public_key"; |
32 | | - public static final String WRITE_KEY = "write:public_key"; |
33 | | - public static final String ADMIN_KEY = "admin:public_key"; |
34 | | - |
35 | | - private GitHub root; |
36 | | - private List<String> scopes; |
37 | | - private String token; |
38 | | - private App app; |
39 | | - private String note; |
40 | | - private String note_url; |
| 16 | + public static final String USER = "user"; |
| 17 | + public static final String USER_EMAIL = "user:email"; |
| 18 | + public static final String USER_FOLLOW = "user:follow"; |
| 19 | + public static final String PUBLIC_REPO = "public_repo"; |
| 20 | + public static final String REPO = "repo"; |
| 21 | + public static final String REPO_STATUS = "repo:status"; |
| 22 | + public static final String DELETE_REPO = "delete_repo"; |
| 23 | + public static final String NOTIFICATIONS = "notifications"; |
| 24 | + public static final String GIST = "gist"; |
| 25 | + public static final String READ_HOOK = "read:repo_hook"; |
| 26 | + public static final String WRITE_HOOK = "write:repo_hook"; |
| 27 | + public static final String AMIN_HOOK = "admin:repo_hook"; |
| 28 | + public static final String READ_ORG = "read:org"; |
| 29 | + public static final String WRITE_ORG = "write:org"; |
| 30 | + public static final String ADMIN_ORG = "admin:org"; |
| 31 | + public static final String READ_KEY = "read:public_key"; |
| 32 | + public static final String WRITE_KEY = "write:public_key"; |
| 33 | + public static final String ADMIN_KEY = "admin:public_key"; |
| 34 | + |
| 35 | + private GitHub root; |
| 36 | + private List<String> scopes; |
| 37 | + private String token; |
| 38 | + private App app; |
| 39 | + private String note; |
| 40 | + private String note_url; |
41 | 41 |
|
42 | 42 | public GitHub getRoot() { |
43 | 43 | return root; |
44 | 44 | } |
45 | 45 |
|
46 | | - public List<String> getScopes() { |
47 | | - return scopes; |
48 | | - } |
| 46 | + public List<String> getScopes() { |
| 47 | + return scopes; |
| 48 | + } |
49 | 49 |
|
50 | | - public String getToken(){ |
51 | | - return token; |
52 | | - } |
| 50 | + public String getToken() { |
| 51 | + return token; |
| 52 | + } |
53 | 53 |
|
54 | | - public URL getAppUrl(){ |
| 54 | + public URL getAppUrl() { |
55 | 55 | return GitHub.parseURL(app.url); |
56 | | - } |
| 56 | + } |
57 | 57 |
|
58 | | - public String getAppName() { |
59 | | - return app.name; |
60 | | - } |
61 | | - |
62 | | - public URL getApiURL(){ |
| 58 | + public String getAppName() { |
| 59 | + return app.name; |
| 60 | + } |
| 61 | + |
| 62 | + public URL getApiURL() { |
63 | 63 | return GitHub.parseURL(url); |
64 | | - } |
| 64 | + } |
65 | 65 |
|
66 | | - /** |
67 | | - * @deprecated This object has no HTML URL. |
68 | | - */ |
69 | | - @Override |
70 | | - public URL getHtmlUrl() { |
71 | | - return null; |
72 | | - } |
| 66 | + /** |
| 67 | + * @deprecated This object has no HTML URL. |
| 68 | + */ |
| 69 | + @Override |
| 70 | + public URL getHtmlUrl() { |
| 71 | + return null; |
| 72 | + } |
73 | 73 |
|
74 | | - public String getNote() { |
75 | | - return note; |
76 | | - } |
| 74 | + public String getNote() { |
| 75 | + return note; |
| 76 | + } |
77 | 77 |
|
78 | | - public URL getNoteUrl(){ |
| 78 | + public URL getNoteUrl() { |
79 | 79 | return GitHub.parseURL(note_url); |
80 | | - } |
81 | | - |
82 | | - /*package*/ GHAuthorization wrap(GitHub root) { |
83 | | - this.root = root; |
84 | | - return this; |
85 | | - } |
86 | | - |
87 | | - |
| 80 | + } |
88 | 81 |
|
| 82 | + /*package*/ GHAuthorization wrap(GitHub root) { |
| 83 | + this.root = root; |
| 84 | + return this; |
| 85 | + } |
89 | 86 |
|
90 | 87 |
|
91 | | - private static class App{ |
92 | | - private String url; |
93 | | - private String name; |
94 | | - } |
| 88 | + private static class App { |
| 89 | + private String url; |
| 90 | + private String name; |
| 91 | + } |
95 | 92 | } |
0 commit comments