1 /*
2 * Copyright (C) 2012 Atlassian
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 package com.atlassian.jira.rest.client.api;
17
18 import com.atlassian.jira.rest.client.api.domain.ProjectRole;
19 import com.atlassian.util.concurrent.Promise;
20
21 import java.net.URI;
22
23 /**
24 * The com.atlassian.jira.rest.client.api handling roles resources.
25 *
26 * @since 1.0
27 */
28 public interface ProjectRolesRestClient {
29
30 /**
31 * Retrieves a full information about the selected role.
32 *
33 * @param uri URI of the role to retrieve.
34 * @return full information about selected role.
35 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
36 */
37 Promise<ProjectRole> getRole(URI uri);
38
39 /**
40 * Retrieves a full information about the selected role.
41 *
42 * @param projectUri uri of the project of the role to retrieve.
43 * @param roleId unique role id.
44 * @return full information about selected role.
45 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
46 */
47 Promise<ProjectRole> getRole(URI projectUri, Long roleId);
48
49 /**
50 * Retrieves a collection of roles in the selected project.
51 *
52 * @param projectUri uri of the project of the roles to retrieve.
53 * @return a collection of roles in the selected project.
54 * @throws RestClientException in case of problems (connectivity, malformed messages, etc.)
55 */
56 Promise<Iterable<ProjectRole>> getRoles(URI projectUri);
57
58 }