Package org.gitlab4j.api
Class GitLabApiClient
java.lang.Object
org.gitlab4j.api.GitLabApiClient
- All Implemented Interfaces:
AutoCloseable
This class utilizes the Jersey client package to communicate with a GitLab API endpoint.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionGitLabApiClient(String hostUrl, String privateToken) Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL, private token, and secret token.GitLabApiClient(String hostUrl, String privateToken, String secretToken) Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL, private token, and secret token.GitLabApiClient(String hostUrl, String privateToken, String secretToken, Map<String, Object> clientConfigProperties) Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL and private token.GitLabApiClient(String hostUrl, Constants.TokenType tokenType, String authToken) Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL, private token, and secret token.GitLabApiClient(String hostUrl, Constants.TokenType tokenType, String authToken, String secretToken) Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL, private token, and secret token.GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, String privateToken) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL, private token, and secret token.GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, String privateToken, String secretToken) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL, private token, and secret token.GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, String privateToken, String secretToken, Map<String, Object> clientConfigProperties) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL and private token.GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, Constants.TokenType tokenType, String authToken) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL, auth token type, private or access token, and secret token.GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, Constants.TokenType tokenType, String authToken, String secretToken) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL, private token, and secret token.GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, Constants.TokenType tokenType, String authToken, String secretToken, Map<String, Object> clientConfigProperties) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL and private token. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Close the underlyingClientand its associated resources.protected jakarta.ws.rs.client.Clientprotected jakarta.ws.rs.core.ResponsePerform an HTTP DELETE call with the specified form data and path objects, returning a Response instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP DELETE call with the specified form data and URL, returning a Response instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP GET call with the specified query parameters and path objects, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP GET call with the specified query parameters and URL, returning a ClientResponse instance with the data returned from the endpoint.protected URLConstruct a REST URL with the specified path arguments.booleanReturns true if the API is setup to ignore SSL certificate errors, otherwise returns false.protected URLgetUrlWithBase(Object... pathArgs) Construct a REST URL with the specified path arguments using Gitlab base url.protected jakarta.ws.rs.core.ResponsegetWithAccepts(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, String accepts, 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 jakarta.ws.rs.core.ResponsegetWithAccepts(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, URL url, String accepts) Perform an HTTP GET call with the specified query parameters and URL, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP HEAD call with the specified query parameters and path objects, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP HEAD call with the specified query parameters and URL, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.client.Invocation.Builderinvocation(URL url, jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams) protected jakarta.ws.rs.client.Invocation.Builderinvocation(URL url, jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, String accept) protected jakarta.ws.rs.core.ResponsePerform an HTTP PATCH call with the specified query parameters and path objects, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP PATCH call with the specified query parameters and URL, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP POST call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP POST call with the specified form data and URL, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP POST call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP POST call with the specified form data and URL, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP POST call with the specified StreamingOutput, MediaType, and path objects, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP POST call with the specified payload object and URL, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP PUT call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP PUT call with the specified form data and URL, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP PUT call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP PUT call with the specified form data and URL, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform an HTTP PUT call with the specified payload object and URL, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform a file upload using multipart/form-data using the HTTP PUT method, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform a file upload using multipart/form-data using the HTTP PUT method, returning a ClientResponse instance with the data returned from the endpoint.voidsetAuthTokenSupplier(Supplier<String> authTokenSupplier) Set auth token supplier for gitlab api client.voidsetIgnoreCertificateErrors(boolean ignoreCertificateErrors) Sets up the Jersey system ignore SSL certificate errors or not.protected jakarta.ws.rs.core.Responseupload(String name, File fileToUpload, String mediaTypeString, jakarta.ws.rs.core.Form formData, Object... pathArgs) Perform a file upload using the specified media type, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.Responseupload(String name, File fileToUpload, String mediaTypeString, jakarta.ws.rs.core.Form formData, URL url) Perform a file upload using multipart/form-data, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.ResponsePerform a file upload using the specified media type, returning a ClientResponse instance with the data returned from the endpoint.protected jakarta.ws.rs.core.Responseupload(String name, InputStream inputStream, String filename, String mediaTypeString, jakarta.ws.rs.core.Form formData, URL url) protected jakarta.ws.rs.core.Responseupload(String name, InputStream inputStream, String filename, String mediaTypeString, Object... pathArgs) protected jakarta.ws.rs.core.Responseupload(org.glassfish.jersey.media.multipart.BodyPart bodyPart, jakarta.ws.rs.core.Form formData, URL url) protected booleanvalidateSecretToken(jakarta.ws.rs.core.Response response) Validates the secret token (X-GitLab-Token) header against the expected secret token, returns true if valid, otherwise returns false.
-
Field Details
-
PRIVATE_TOKEN_HEADER
- See Also:
-
SUDO_HEADER
- See Also:
-
AUTHORIZATION_HEADER
- See Also:
-
X_GITLAB_TOKEN_HEADER
- See Also:
-
-
Constructor Details
-
GitLabApiClient
Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL, private token, and secret token.- Parameters:
apiVersion- the ApiVersion specifying which version of the API to usehostUrl- the URL to the GitLab API serverprivateToken- the private token to authenticate with
-
GitLabApiClient
public GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, Constants.TokenType tokenType, String authToken) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL, auth token type, private or access token, and secret token.- Parameters:
apiVersion- the ApiVersion specifying which version of the API to usehostUrl- the URL to the GitLab API servertokenType- the type of auth the token is for, PRIVATE or ACCESSauthToken- the token to authenticate with
-
GitLabApiClient
Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL, private token, and secret token.- Parameters:
hostUrl- the URL to the GitLab API serverprivateToken- the private token to authenticate with
-
GitLabApiClient
Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL, private token, and secret token.- Parameters:
hostUrl- the URL to the GitLab API servertokenType- the type of auth the token is for, PRIVATE or ACCESSauthToken- the token to authenticate with
-
GitLabApiClient
public GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, String privateToken, String secretToken) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL, private token, and secret token.- Parameters:
apiVersion- the ApiVersion specifying which version of the API to usehostUrl- the URL to the GitLab API serverprivateToken- the private token to authenticate withsecretToken- use this token to validate received payloads
-
GitLabApiClient
public GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, Constants.TokenType tokenType, String authToken, String secretToken) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL, private token, and secret token.- Parameters:
apiVersion- the ApiVersion specifying which version of the API to usehostUrl- the URL to the GitLab API servertokenType- the type of auth the token is for, PRIVATE or ACCESSauthToken- the token to authenticate withsecretToken- use this token to validate received payloads
-
GitLabApiClient
Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL, private token, and secret token.- Parameters:
hostUrl- the URL to the GitLab API serverprivateToken- the private token to authenticate withsecretToken- use this token to validate received payloads
-
GitLabApiClient
public GitLabApiClient(String hostUrl, Constants.TokenType tokenType, String authToken, String secretToken) Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL, private token, and secret token.- Parameters:
hostUrl- the URL to the GitLab API servertokenType- the type of auth the token is for, PRIVATE or ACCESSauthToken- the token to authenticate withsecretToken- use this token to validate received payloads
-
GitLabApiClient
public GitLabApiClient(String hostUrl, String privateToken, String secretToken, Map<String, Object> clientConfigProperties) Construct an instance to communicate with a GitLab API server using GitLab API version 4, and the specified server URL and private token.- Parameters:
hostUrl- the URL to the GitLab API serverprivateToken- the private token to authenticate withsecretToken- use this token to validate received payloadsclientConfigProperties- the properties given to Jersey's clientconfig
-
GitLabApiClient
public GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, String privateToken, String secretToken, Map<String, Object> clientConfigProperties) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL and private token.- Parameters:
apiVersion- the ApiVersion specifying which version of the API to usehostUrl- the URL to the GitLab API serverprivateToken- the private token to authenticate withsecretToken- use this token to validate received payloadsclientConfigProperties- the properties given to Jersey's clientconfig
-
GitLabApiClient
public GitLabApiClient(GitLabApi.ApiVersion apiVersion, String hostUrl, Constants.TokenType tokenType, String authToken, String secretToken, Map<String, Object> clientConfigProperties) Construct an instance to communicate with a GitLab API server using the specified GitLab API version, server URL and private token.- Parameters:
apiVersion- the ApiVersion specifying which version of the API to usehostUrl- the URL to the GitLab API servertokenType- the type of auth the token is for, PRIVATE or ACCESSauthToken- the private token to authenticate withsecretToken- use this token to validate received payloadsclientConfigProperties- the properties given to Jersey's clientconfig
-
-
Method Details
-
close
public void close()Close the underlyingClientand its associated resources.- Specified by:
closein interfaceAutoCloseable
-
getApiUrl
Construct a REST URL with the specified path arguments.- Parameters:
pathArgs- variable list of arguments used to build the URI- Returns:
- a REST URL with the specified path arguments
- Throws:
IOException- if an error occurs while constructing the URL
-
getUrlWithBase
Construct a REST URL with the specified path arguments using Gitlab base url.- Parameters:
pathArgs- variable list of arguments used to build the URI- Returns:
- a REST URL with the specified path arguments
- Throws:
IOException- if an error occurs while constructing the URL
-
validateSecretToken
protected boolean validateSecretToken(jakarta.ws.rs.core.Response response) Validates the secret token (X-GitLab-Token) header against the expected secret token, returns true if valid, otherwise returns false.- Parameters:
response- the Response instance sent from the GitLab server- Returns:
- true if the response's secret token is valid, otherwise returns false
-
get
protected jakarta.ws.rs.core.Response get(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOExceptionPerform an HTTP GET call with the specified query parameters and path objects, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parameterspathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
get
protected jakarta.ws.rs.core.Response get(jakarta.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.- Parameters:
queryParams- multivalue map of request parametersurl- the fully formed path to the GitLab API endpoint- Returns:
- a ClientResponse instance with the data returned from the endpoint
-
getWithAccepts
protected jakarta.ws.rs.core.Response getWithAccepts(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, String accepts, Object... pathArgs) throws IOExceptionPerform an HTTP GET call with the specified query parameters and path objects, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parametersaccepts- if non-empty will set the Accepts header to this valuepathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
getWithAccepts
protected jakarta.ws.rs.core.Response getWithAccepts(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, URL url, String accepts) Perform an HTTP GET call with the specified query parameters and URL, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parametersurl- the fully formed path to the GitLab API endpointaccepts- if non-empty will set the Accepts header to this value- Returns:
- a ClientResponse instance with the data returned from the endpoint
-
head
protected jakarta.ws.rs.core.Response head(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOExceptionPerform an HTTP HEAD call with the specified query parameters and path objects, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parameterspathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
head
protected jakarta.ws.rs.core.Response head(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, URL url) Perform an HTTP HEAD call with the specified query parameters and URL, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parametersurl- the fully formed path to the GitLab API endpoint- Returns:
- a ClientResponse instance with the data returned from the endpoint
-
patch
protected jakarta.ws.rs.core.Response patch(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOExceptionPerform an HTTP PATCH call with the specified query parameters and path objects, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parameterspathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
patch
protected jakarta.ws.rs.core.Response patch(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, URL url) Perform an HTTP PATCH call with the specified query parameters and URL, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parametersurl- the fully formed path to the GitLab API endpoint- Returns:
- a ClientResponse instance with the data returned from the endpoint
-
post
protected jakarta.ws.rs.core.Response post(jakarta.ws.rs.core.Form formData, Object... pathArgs) throws IOException Perform an HTTP POST call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
formData- the Form containing the name/value pairspathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
post
protected jakarta.ws.rs.core.Response post(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOExceptionPerform an HTTP POST call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parameterspathArgs- variable list of arguments used to build the URI- Returns:
- a Response instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
post
Perform an HTTP POST call with the specified form data and URL, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
formData- the Form containing the name/value pairsurl- the fully formed path to the GitLab API endpoint- Returns:
- a ClientResponse instance with the data returned from the endpoint
-
post
protected jakarta.ws.rs.core.Response post(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, 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.- Parameters:
queryParams- multivalue map of request parametersformData the Form containing the name/value pairsurl- the fully formed path to the GitLab API endpoint- Returns:
- a ClientResponse instance with the data returned from the endpoint
-
post
Perform an HTTP POST call with the specified payload object and URL, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
payload- the object instance that will be serialized to JSON and used as the POST datapathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
post
protected jakarta.ws.rs.core.Response post(jakarta.ws.rs.core.StreamingOutput stream, String mediaType, Object... pathArgs) throws IOException Perform an HTTP POST call with the specified StreamingOutput, MediaType, and path objects, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
stream- the StreamingOutput instance that contains the POST datamediaType- the content-type of the POST datapathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
upload
protected jakarta.ws.rs.core.Response upload(String name, File fileToUpload, String mediaTypeString, Object... pathArgs) throws IOException Perform a file upload using the specified media type, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
name- the name for the form field that contains the file namefileToUpload- a File instance pointing to the file to uploadmediaTypeString- unused; will be removed in the next major versionpathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
upload
protected jakarta.ws.rs.core.Response upload(String name, File fileToUpload, String mediaTypeString, jakarta.ws.rs.core.Form formData, Object... pathArgs) throws IOException Perform a file upload using the specified media type, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
name- the name for the form field that contains the file namefileToUpload- a File instance pointing to the file to uploadmediaTypeString- unused; will be removed in the next major versionformData- the Form containing the name/value pairspathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
upload
protected jakarta.ws.rs.core.Response upload(String name, File fileToUpload, String mediaTypeString, jakarta.ws.rs.core.Form formData, URL url) throws IOException Perform a file upload using multipart/form-data, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
name- the name for the form field that contains the file namefileToUpload- a File instance pointing to the file to uploadmediaTypeString- unused; will be removed in the next major versionformData- the Form containing the name/value pairsurl- the fully formed path to the GitLab API endpoint- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
upload
protected jakarta.ws.rs.core.Response upload(String name, InputStream inputStream, String filename, String mediaTypeString, Object... pathArgs) throws IOException - Throws:
IOException
-
upload
protected jakarta.ws.rs.core.Response upload(String name, InputStream inputStream, String filename, String mediaTypeString, jakarta.ws.rs.core.Form formData, URL url) throws IOException - Throws:
IOException
-
upload
protected jakarta.ws.rs.core.Response upload(org.glassfish.jersey.media.multipart.BodyPart bodyPart, jakarta.ws.rs.core.Form formData, URL url) throws IOException - Throws:
IOException
-
putUpload
protected jakarta.ws.rs.core.Response putUpload(String name, File fileToUpload, Object... pathArgs) throws IOException Perform a file upload using multipart/form-data using the HTTP PUT method, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
name- the name for the form field that contains the file namefileToUpload- a File instance pointing to the file to uploadpathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
putUpload
protected jakarta.ws.rs.core.Response putUpload(String name, File fileToUpload, URL url) throws IOException Perform a file upload using multipart/form-data using the HTTP PUT method, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
name- the name for the form field that contains the file namefileToUpload- a File instance pointing to the file to uploadurl- the fully formed path to the GitLab API endpoint- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
put
protected jakarta.ws.rs.core.Response put(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOExceptionPerform an HTTP PUT call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parameterspathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
put
protected jakarta.ws.rs.core.Response put(jakarta.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.- Parameters:
queryParams- multivalue map of request parametersurl- the fully formed path to the GitLab API endpoint- Returns:
- a ClientResponse instance with the data returned from the endpoint
-
put
protected jakarta.ws.rs.core.Response put(jakarta.ws.rs.core.Form formData, Object... pathArgs) throws IOException Perform an HTTP PUT call with the specified form data and path objects, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
formData- the Form containing the name/value pairspathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
put
Perform an HTTP PUT call with the specified form data and URL, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
formData- the Form containing the name/value pairsurl- the fully formed path to the GitLab API endpoint- Returns:
- a ClientResponse instance with the data returned from the endpoint
-
put
Perform an HTTP PUT call with the specified payload object and URL, returning a ClientResponse instance with the data returned from the endpoint.- Parameters:
payload- the object instance that will be serialized to JSON and used as the PUT datapathArgs- variable list of arguments used to build the URI- Returns:
- a ClientResponse instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
delete
protected jakarta.ws.rs.core.Response delete(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, Object... pathArgs) throws IOExceptionPerform an HTTP DELETE call with the specified form data and path objects, returning a Response instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parameterspathArgs- variable list of arguments used to build the URI- Returns:
- a Response instance with the data returned from the endpoint
- Throws:
IOException- if an error occurs while constructing the URL
-
delete
protected jakarta.ws.rs.core.Response delete(jakarta.ws.rs.core.MultivaluedMap<String, String> queryParams, URL url) Perform an HTTP DELETE call with the specified form data and URL, returning a Response instance with the data returned from the endpoint.- Parameters:
queryParams- multivalue map of request parametersurl- the fully formed path to the GitLab API endpoint- Returns:
- a Response instance with the data returned from the endpoint
-
invocation
-
createApiClient
protected jakarta.ws.rs.client.Client createApiClient() -
invocation
-
getIgnoreCertificateErrors
public boolean getIgnoreCertificateErrors()Returns true if the API is setup to ignore SSL certificate errors, otherwise returns false.- Returns:
- true if the API is setup to ignore SSL certificate errors, otherwise returns false
-
setIgnoreCertificateErrors
public void setIgnoreCertificateErrors(boolean ignoreCertificateErrors) Sets up the Jersey system ignore SSL certificate errors or not.- Parameters:
ignoreCertificateErrors- if true will set up the Jersey system ignore SSL certificate errors
-
setAuthTokenSupplier
Set auth token supplier for gitlab api client.- Parameters:
authTokenSupplier- - supplier which provide actual auth token
-