Skip to content

Commit 6434435

Browse files
committed
Organization and Team API.
1 parent e05968c commit 6434435

File tree

4 files changed

+219
-810
lines changed

4 files changed

+219
-810
lines changed

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

Lines changed: 21 additions & 295 deletions
Original file line numberDiff line numberDiff line change
@@ -17,306 +17,32 @@
1717
package com.github.api.v2.services;
1818

1919
import java.util.List;
20-
import java.util.Map;
21-
import java.util.zip.ZipInputStream;
2220

23-
import com.github.api.v2.schema.Key;
24-
import com.github.api.v2.schema.Language;
21+
import com.github.api.v2.schema.Organization;
2522
import com.github.api.v2.schema.Repository;
23+
import com.github.api.v2.schema.Team;
2624
import com.github.api.v2.schema.User;
27-
import com.github.api.v2.schema.Repository.Visibility;
2825

2926
/**
30-
* The Interface RepositoryService.
27+
* The Interface OrganizationService.
3128
*/
3229
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);
30+
public Organization getOrganization(String name);
31+
public void updateOrganization(Organization organization);
32+
public List<Organization> getUserOrganizations(String userName);
33+
public List<Organization> getUserOrganizations();
34+
public List<Repository> getAllOrganizationRepositories();
35+
public List<Repository> getPublicRepositories(String organizationName);
36+
public List<User> getPublicMembers(String organizationName);
37+
public List<Team> getTeams(String organizationName);
38+
public void createTeam(Team team);
39+
public Team getTeam(String teamId);
40+
public void updateTeam(Team team);
41+
public void deleteTeam(String teamId);
42+
public List<User> getTeamMembers(String teamId);
43+
public void addTeamMember(String userName);
44+
public void removeTeamMember(String userName);
45+
public List<Repository> getTeamRepositories(String teamId);
46+
public void addTeamRepository(String userName, String repositoryName);
47+
public void removeTeamRepository(String userName, String repositoryName);
32248
}

0 commit comments

Comments
 (0)