Skip to content

Commit e30d4db

Browse files
committed
Organization and Team API. Just stubs.
1 parent 9a62506 commit e30d4db

10 files changed

Lines changed: 1872 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ The library is divided into various services each implementing a specific portio
2121
* RepositoryService: Provides methods of the [Repository API](http://develop.github.com/p/repo.html).
2222
* CommitService: Provides methods of the [Commit API](http://develop.github.com/p/commits.html).
2323
* ObjectService: Provides methods of the [Object API](http://develop.github.com/p/object.html).
24+
* OrganizationService: Provides methods of the [Organization API](http://develop.github.com/p/orgs.html).
2425
* FeedService: Provides methods for reading the Atom/RSS feeds.
2526
* OAuthService: Provides methods for OAuth 2.0 authentication and authorization.
2627

core/src/main/java/com/github/api/v2/services/GitHubServiceFactory.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.github.api.v2.services.impl.NetworkServiceImpl;
2424
import com.github.api.v2.services.impl.OAuthServiceImpl;
2525
import com.github.api.v2.services.impl.ObjectServiceImpl;
26+
import com.github.api.v2.services.impl.OrganizationServiceImpl;
2627
import com.github.api.v2.services.impl.RepositoryServiceImpl;
2728
import com.github.api.v2.services.impl.UserServiceImpl;
2829

@@ -103,6 +104,15 @@ public RepositoryService createRepositoryService() {
103104
return new RepositoryServiceImpl();
104105
}
105106

107+
/**
108+
* Creates a new GitHubService object.
109+
*
110+
* @return the repository service
111+
*/
112+
public OrganizationService createOrganizationService() {
113+
return new OrganizationServiceImpl();
114+
}
115+
106116
/**
107117
* Creates a new GitHubService object.
108118
*
Lines changed: 322 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,322 @@
1+
/*
2+
* Copyright 2010 Nabeel Mukhtar
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
package com.github.api.v2.services;
18+
19+
import java.util.List;
20+
import java.util.Map;
21+
import java.util.zip.ZipInputStream;
22+
23+
import com.github.api.v2.schema.Key;
24+
import com.github.api.v2.schema.Language;
25+
import com.github.api.v2.schema.Repository;
26+
import com.github.api.v2.schema.User;
27+
import com.github.api.v2.schema.Repository.Visibility;
28+
29+
/**
30+
* The Interface RepositoryService.
31+
*/
32+
public interface OrganizationService extends GitHubService {
33+
34+
/**
35+
* Search repositories.
36+
*
37+
* @param query
38+
* the query
39+
*
40+
* @return the list< repository>
41+
*/
42+
public List<Repository> searchRepositories(String query);
43+
44+
/**
45+
* Search repositories.
46+
*
47+
* @param query
48+
* the query
49+
* @param language
50+
* the language
51+
*
52+
* @return the list< repository>
53+
*/
54+
public List<Repository> searchRepositories(String query, Language language);
55+
56+
/**
57+
* Search repositories.
58+
*
59+
* @param query
60+
* the query
61+
* @param pageNumber
62+
* the page number
63+
*
64+
* @return the list< repository>
65+
*/
66+
public List<Repository> searchRepositories(String query, int pageNumber);
67+
68+
/**
69+
* Search repositories.
70+
*
71+
* @param query
72+
* the query
73+
* @param language
74+
* the language
75+
* @param pageNumber
76+
* the page number
77+
*
78+
* @return the list< repository>
79+
*/
80+
public List<Repository> searchRepositories(String query, Language language, int pageNumber);
81+
82+
/**
83+
* Gets the repository.
84+
*
85+
* @param userName
86+
* the user name
87+
* @param repositoryName
88+
* the repository name
89+
*
90+
* @return the repository
91+
*/
92+
public Repository getRepository(String userName, String repositoryName);
93+
94+
/**
95+
* Update repository.
96+
*
97+
* @param repository
98+
* the repository
99+
*/
100+
public void updateRepository(Repository repository);
101+
102+
/**
103+
* Gets the repositories.
104+
*
105+
* @param userName
106+
* the user name
107+
*
108+
* @return the repositories
109+
*/
110+
public List<Repository> getRepositories(String userName);
111+
112+
/**
113+
* Watch repository.
114+
*
115+
* @param userName
116+
* the user name
117+
* @param repositoryName
118+
* the repository name
119+
*/
120+
public void watchRepository(String userName, String repositoryName);
121+
122+
/**
123+
* Unwatch repository.
124+
*
125+
* @param userName
126+
* the user name
127+
* @param repositoryName
128+
* the repository name
129+
*/
130+
public void unwatchRepository(String userName, String repositoryName);
131+
132+
/**
133+
* Fork repository.
134+
*
135+
* @param userName
136+
* the user name
137+
* @param repositoryName
138+
* the repository name
139+
*
140+
* @return the repository
141+
*/
142+
public Repository forkRepository(String userName, String repositoryName);
143+
144+
/**
145+
* Creates the repository.
146+
*
147+
* @param name
148+
* the name
149+
* @param description
150+
* the description
151+
* @param homePage
152+
* the home page
153+
* @param visibility
154+
* the visibility
155+
*/
156+
public void createRepository(String name, String description, String homePage, Visibility visibility);
157+
158+
/**
159+
* Delete repository.
160+
*
161+
* @param repositoryName
162+
* the repository name
163+
*/
164+
public void deleteRepository(String repositoryName);
165+
166+
/**
167+
* Change visibility.
168+
*
169+
* @param repositoryName
170+
* the repository name
171+
* @param visibility
172+
* the visibility
173+
*/
174+
public void changeVisibility(String repositoryName, Visibility visibility);
175+
176+
/**
177+
* Gets the deploy keys.
178+
*
179+
* @param repositoryName
180+
* the repository name
181+
*
182+
* @return the deploy keys
183+
*/
184+
public List<Key> getDeployKeys(String repositoryName);
185+
186+
/**
187+
* Adds the deploy key.
188+
*
189+
* @param repositoryName
190+
* the repository name
191+
* @param title
192+
* the title
193+
* @param key
194+
* the key
195+
*
196+
* @return the string
197+
*/
198+
public List<Key> addDeployKey(String repositoryName, String title, String key);
199+
200+
/**
201+
* Removes the deploy key.
202+
*
203+
* @param repository
204+
* the repository
205+
* @param id
206+
* the id
207+
*/
208+
public void removeDeployKey(String repository, String id);
209+
210+
/**
211+
* Gets the collaborators.
212+
*
213+
* @param userName
214+
* the user name
215+
* @param repositoryName
216+
* the repository name
217+
*
218+
* @return the collaborators
219+
*/
220+
public List<String> getCollaborators(String userName, String repositoryName);
221+
222+
/**
223+
* Adds the collaborator.
224+
*
225+
* @param repositoryName
226+
* the repository name
227+
* @param collaboratorName
228+
* the collaborator name
229+
*/
230+
public void addCollaborator(String repositoryName, String collaboratorName);
231+
232+
/**
233+
* Removes the collaborator.
234+
*
235+
* @param repositoryName
236+
* the repository name
237+
* @param collaboratorName
238+
* the collaborator name
239+
*/
240+
public void removeCollaborator(String repositoryName, String collaboratorName);
241+
242+
/**
243+
* Gets the pushable repositories.
244+
*
245+
* @return the pushable repositories
246+
*/
247+
public List<Repository> getPushableRepositories();
248+
249+
/**
250+
* Gets the contributors.
251+
*
252+
* @param userName
253+
* the user name
254+
* @param repositoryName
255+
* the repository name
256+
*
257+
* @return the contributors
258+
*/
259+
public List<User> getContributors(String userName, String repositoryName);
260+
261+
/**
262+
* Gets the watchers.
263+
*
264+
* @param userName
265+
* the user name
266+
* @param repositoryName
267+
* the repository name
268+
*
269+
* @return the watchers
270+
*/
271+
public List<String> getWatchers(String userName, String repositoryName);
272+
273+
/**
274+
* Gets the forks.
275+
*
276+
* @param userName
277+
* the user name
278+
* @param repositoryName
279+
* the repository name
280+
*
281+
* @return the forks
282+
*/
283+
public List<Repository> getForks(String userName, String repositoryName);
284+
285+
/**
286+
* Gets the language breakdown.
287+
*
288+
* @param userName
289+
* the user name
290+
* @param repositoryName
291+
* the repository name
292+
*
293+
* @return the language breakdown
294+
*/
295+
public Map<Language, Long> getLanguageBreakdown(String userName, String repositoryName);
296+
297+
/**
298+
* Gets the tags.
299+
*
300+
* @param userName
301+
* the user name
302+
* @param repositoryName
303+
* the repository name
304+
*
305+
* @return the tags
306+
*/
307+
public Map<String, String> getTags(String userName, String repositoryName);
308+
309+
/**
310+
* Gets the branches.
311+
*
312+
* @param userName
313+
* the user name
314+
* @param repositoryName
315+
* the repository name
316+
*
317+
* @return the branches
318+
*/
319+
public Map<String, String> getBranches(String userName, String repositoryName);
320+
321+
public ZipInputStream getRepositoryArchive(String userName, String repositoryName, String branchName);
322+
}

0 commit comments

Comments
 (0)