public abstract class AbstractApi extends Object
Constructor and Description |
---|
AbstractApi(GitLabApi gitLabApi) |
Modifier and Type | Method and Description |
---|---|
protected void |
addFormParam(javax.ws.rs.core.Form formData,
String name,
Object value)
Convenience method for adding query and form parameters to a get() or post() call.
|
protected void |
addFormParam(javax.ws.rs.core.Form formData,
String name,
Object value,
boolean required)
Convenience method for adding query and form parameters to a get() or post() call.
|
protected javax.ws.rs.core.Response |
delete(javax.ws.rs.core.Response.Status expectedStatus,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
Object... pathArgs)
Perform an HTTP DELETE call with the specified form data and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
|
protected javax.ws.rs.core.Response |
delete(javax.ws.rs.core.Response.Status expectedStatus,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
URL url)
Perform an HTTP DELETE call with the specified form data and URL, returning
a ClientResponse instance with the data returned from the endpoint.
|
protected javax.ws.rs.core.Response |
get(javax.ws.rs.core.Response.Status expectedStatus,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
Object... pathArgs)
Perform an HTTP GET call with the specified query parameters and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
|
protected javax.ws.rs.core.Response |
get(javax.ws.rs.core.Response.Status expectedStatus,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
URL url)
Perform an HTTP GET call with the specified query parameters and URL, returning
a ClientResponse instance with the data returned from the endpoint.
|
protected GitLabApiClient |
getApiClient() |
protected GitLabApiException |
handle(Exception thrown)
Wraps exception if needed
|
protected javax.ws.rs.core.Response |
post(javax.ws.rs.core.Response.Status expectedStatus,
javax.ws.rs.core.Form formData,
Object... pathArgs)
Perform an HTTP POST call with the specified form data and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
|
protected javax.ws.rs.core.Response |
post(javax.ws.rs.core.Response.Status expectedStatus,
javax.ws.rs.core.Form formData,
URL url)
Perform an HTTP POST call with the specified form data and URL, returning
a ClientResponse instance with the data returned from the endpoint.
|
protected javax.ws.rs.core.Response |
put(javax.ws.rs.core.Response.Status expectedStatus,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
Object... pathArgs)
Perform an HTTP PUT call with the specified form data and path objects, returning
a ClientResponse instance with the data returned from the endpoint.
|
protected javax.ws.rs.core.Response |
put(javax.ws.rs.core.Response.Status expectedStatus,
javax.ws.rs.core.MultivaluedMap<String,String> queryParams,
URL url)
Perform an HTTP PUT call with the specified form data and URL, returning
a ClientResponse instance with the data returned from the endpoint.
|
protected javax.ws.rs.core.Response |
validate(javax.ws.rs.core.Response response,
javax.ws.rs.core.Response.Status expected)
Validates response.
|
public AbstractApi(GitLabApi gitLabApi)
protected GitLabApiClient getApiClient()
protected javax.ws.rs.core.Response get(javax.ws.rs.core.Response.Status expectedStatus, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, Object... pathArgs) throws GitLabApiException
expectedStatus
- the HTTP status that should be returned from the serverqueryParams
- pathArgs
- GitLabApiException
protected javax.ws.rs.core.Response get(javax.ws.rs.core.Response.Status expectedStatus, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, URL url) throws GitLabApiException
expectedStatus
- the HTTP status that should be returned from the serverqueryParams
- url
- GitLabApiException
protected javax.ws.rs.core.Response post(javax.ws.rs.core.Response.Status expectedStatus, javax.ws.rs.core.Form formData, Object... pathArgs) throws GitLabApiException
expectedStatus
- the HTTP status that should be returned from the serverformData
- pathArgs
- GitLabApiException
protected javax.ws.rs.core.Response post(javax.ws.rs.core.Response.Status expectedStatus, javax.ws.rs.core.Form formData, URL url) throws GitLabApiException
expectedStatus
- the HTTP status that should be returned from the serverformData
- url
- GitLabApiException
protected javax.ws.rs.core.Response put(javax.ws.rs.core.Response.Status expectedStatus, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, Object... pathArgs) throws GitLabApiException
expectedStatus
- the HTTP status that should be returned from the serverqueryParams
- pathArgs
- GitLabApiException
protected javax.ws.rs.core.Response put(javax.ws.rs.core.Response.Status expectedStatus, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, URL url) throws GitLabApiException
expectedStatus
- the HTTP status that should be returned from the serverqueryParams
- url
- GitLabApiException
protected javax.ws.rs.core.Response delete(javax.ws.rs.core.Response.Status expectedStatus, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, Object... pathArgs) throws GitLabApiException
expectedStatus
- the HTTP status that should be returned from the serverqueryParams
- pathArgs
- GitLabApiException
protected javax.ws.rs.core.Response delete(javax.ws.rs.core.Response.Status expectedStatus, javax.ws.rs.core.MultivaluedMap<String,String> queryParams, URL url) throws GitLabApiException
expectedStatus
- the HTTP status that should be returned from the serverqueryParams
- url
- GitLabApiException
protected void addFormParam(javax.ws.rs.core.Form formData, String name, Object value) throws IllegalArgumentException
formData
- name
- value
- IllegalArgumentException
protected void addFormParam(javax.ws.rs.core.Form formData, String name, Object value, boolean required) throws IllegalArgumentException
formData
- name
- value
- required
- IllegalArgumentException
- if a required parameter is null or emptyprotected javax.ws.rs.core.Response validate(javax.ws.rs.core.Response response, javax.ws.rs.core.Response.Status expected) throws GitLabApiException
response
- responseexpected
- expected respone statusGitLabApiException
- in case of unexpected response statusprotected GitLabApiException handle(Exception thrown) throws GitLabApiException
thrown
- exceptionGitLabApiException
- alwaysCopyright © 2015. All rights reserved.