Package org.azd.utils
Class RestClient
java.lang.Object
org.azd.utils.RestClient
Deprecated.
RestClient to call Azure DevOps REST API.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
Deprecated.Metadata class to retrieve the response headers. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
send
(String requestUrl, Connection connection, RequestMethod requestMethod, Object requestBody, CustomHeader contentType, boolean callback) Deprecated.Mediator for BaseRestClient and other Api implementations.static String
send
(String requestUrl, RequestMethod requestMethod, Object requestBody, CustomHeader contentType, boolean callback) Deprecated.Mediator for BaseRestClient and other Api implementations.static CompletableFuture<HttpResponse<InputStream>>
send
(String requestUrl, RequestMethod requestMethod, Connection connection, String resourceId, String project, String area, String id, String resource, String apiVersion, Map queryString, InputStream contentStream, CustomHeader contentType, boolean callback) Deprecated.Mediator for BaseRestClient and other Api implementations.static <T> CompletableFuture<HttpResponse<T>>
send
(String requestUrl, RequestMethod requestMethod, Connection connection, String resourceId, String project, String area, String id, String resource, String apiVersion, Map queryString, HttpRequest.BodyPublisher publisher, HttpResponse.BodyHandler<T> handler, Map<String, CustomHeader> headerMap, boolean callback) Deprecated.Helper method and a mediator for calling Azure DevOps REST Api.static InputStream
send
(RequestMethod requestMethod, Connection connection, String resourceId, String project, String area, String id, String resource, String apiVersion, Map queryString, InputStream contentStream, CustomHeader contentType, boolean callback) Deprecated.Request the Azure DevOps REST API and builds the request url dynamically based on resource id and endpoints passedstatic String
send
(RequestMethod requestMethod, Connection connection, String resourceId, String project, String area, String id, String resource, String apiVersion, Map queryString, Object requestBody, CustomHeader contentType) Deprecated.Request the Azure DevOps REST API and builds the request url dynamically based on resource id and endpoints passed
-
Constructor Details
-
RestClient
public RestClient()Deprecated.
-
-
Method Details
-
send
public static String send(RequestMethod requestMethod, Connection connection, String resourceId, String project, String area, String id, String resource, String apiVersion, Map queryString, Object requestBody, CustomHeader contentType) throws AzDException Deprecated.Request the Azure DevOps REST API and builds the request url dynamically based on resource id and endpoints passed- Parameters:
requestMethod
- type of request GET, POST, PATCH, DELETERequestMethod
connection
- name of the organizationresourceId
- pass the resource id.project
- name of the projectarea
- resource areaid
- resource idresource
- resource area endpointapiVersion
- api versionqueryString
- query string to append the urlrequestBody
- Api payload for post, patch and put methodscontentType
- Type of content to request and accept as; Default is "Accept", "application/json"- Returns:
- String response from Api
- Throws:
AzDException
- Default Api exception handler
-
send
public static InputStream send(RequestMethod requestMethod, Connection connection, String resourceId, String project, String area, String id, String resource, String apiVersion, Map queryString, InputStream contentStream, CustomHeader contentType, boolean callback) throws AzDException Deprecated.Request the Azure DevOps REST API and builds the request url dynamically based on resource id and endpoints passed- Parameters:
requestMethod
- type of request GET, POST, PATCH, DELETERequestMethod
connection
- name of the organizationresourceId
- pass the resource id.project
- name of the projectarea
- resource areaid
- resource idresource
- resource area endpointapiVersion
- api versionqueryString
- query string to append the urlcontentStream
- API payload as streamcontentType
- Type of content to request and accept as; Default is "Content-Type", "application/octet-stream"callback
- If true default redirect policy will be applied. The redirect policy can be controlled in BaseRestClient class.- Returns:
- InputStream from API
- Throws:
AzDException
- Default Api exception handler
-
send
public static CompletableFuture<HttpResponse<InputStream>> send(String requestUrl, RequestMethod requestMethod, Connection connection, String resourceId, String project, String area, String id, String resource, String apiVersion, Map queryString, InputStream contentStream, CustomHeader contentType, boolean callback) throws AzDException Deprecated.Mediator for BaseRestClient and other Api implementations.- Parameters:
requestUrl
- Pass the request url if any. Note that if the url is passed only this will be considered for Api call.requestMethod
- type of request GET, POST, PATCH, DELETERequestMethod
connection
- name of the organizationresourceId
- pass the resource id.project
- name of the projectarea
- resource areaid
- resource idresource
- resource area endpointapiVersion
- api versionqueryString
- query string to append the urlcontentStream
- API payload as streamcontentType
- Type of content to request and accept as; Default is "Content-Type", "application/octet-stream"callback
- If true default redirect policy will be applied. The redirect policy can be controlled- Returns:
- A Future of Http response stream.
- Throws:
AzDException
- Default Api exception handler.
-
send
public static String send(String requestUrl, RequestMethod requestMethod, Object requestBody, CustomHeader contentType, boolean callback) throws AzDException Deprecated.Mediator for BaseRestClient and other Api implementations.- Parameters:
requestUrl
- Pass the request url if any. Note that if the url is passed only this will be considered for Api call.requestMethod
- type of request GET, POST, PATCH, DELETERequestMethod
requestBody
- API payloadcontentType
- Type of content to request and accept as; Default is "Accept", "application/json"callback
- If true default redirect policy will be applied. The redirect policy can be controlled- Returns:
- String response from Api
- Throws:
AzDException
- Default Api exception handler
-
send
public static String send(String requestUrl, Connection connection, RequestMethod requestMethod, Object requestBody, CustomHeader contentType, boolean callback) throws AzDException Deprecated.Mediator for BaseRestClient and other Api implementations.- Parameters:
requestUrl
- Pass the request url if any. Note that if the url is passed only this will be considered for Api call.connection
- Connection object to determine the mandatory details for calling the Api.requestMethod
- type of request GET, POST, PATCH, DELETERequestMethod
requestBody
- API payloadcontentType
- Type of content to request and accept as; Default is "Accept", "application/json"callback
- If true default redirect policy will be applied. The redirect policy can be controlled- Returns:
- String response from Api
- Throws:
AzDException
- Default Api exception handler
-
send
public static <T> CompletableFuture<HttpResponse<T>> send(String requestUrl, RequestMethod requestMethod, Connection connection, String resourceId, String project, String area, String id, String resource, String apiVersion, Map queryString, HttpRequest.BodyPublisher publisher, HttpResponse.BodyHandler<T> handler, Map<String, CustomHeader> headerMap, boolean callback) throws AzDExceptionDeprecated.Helper method and a mediator for calling Azure DevOps REST Api.- Type Parameters:
T
- Type name that is been returned.- Parameters:
requestUrl
- Pass the request url if any. Note that if the url is passed only this will be considered for Api call.requestMethod
- type of request GET, POST, PATCH, DELETERequestMethod
connection
- name of the organizationresourceId
- pass the resource id.project
- name of the projectarea
- resource areaid
- resource idresource
- resource area endpointapiVersion
- api versionqueryString
- query string to append the urlpublisher
- HttpRequest body publisher typehandler
- HttpResponse body typeheaderMap
- Map of request headers.callback
- If true default redirect policy will be applied- Returns:
- Generic type can be String or Stream response from Api.
- Throws:
AzDException
- Default Api exception handler.
-