Package org.azd.abstractions.internals
Class ClientRequestAdapter
java.lang.Object
org.azd.http.ClientRequest
org.azd.abstractions.internals.ClientRequestAdapter
Implementation of the ClientRequest that executes or sends the request to
Azure DevOps API.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.azd.http.ClientRequest
ClientRequest.Builder
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns the access token credential object.<T extends SerializableEntity>
TExecutes the request and returns the deserialized response.<T extends SerializableEntity>
CompletableFuture<T>executeAsync
(Class<T> model) Executes the request and returns the deserialized response.Executes the request and doesn't return any response.Executes the request and doesn't return any response.Executes the request and returns the stream response from API.Executes the request and returns the stream response from API.Executes the raw request without serialization.Executes the raw request without serialization.request()
Return the request information object.Methods inherited from class org.azd.http.ClientRequest
builder, builder
-
Constructor Details
-
ClientRequestAdapter
Default.- Parameters:
builder
- Client request builder object.
-
-
Method Details
-
executeStringAsync
Executes the raw request without serialization.- Specified by:
executeStringAsync
in classClientRequest
- Returns:
- String response from API.
- Throws:
AzDException
- Default API exception handler.
-
executeAsync
public <T extends SerializableEntity> CompletableFuture<T> executeAsync(Class<T> model) throws AzDException Executes the request and returns the deserialized response.- Specified by:
executeAsync
in classClientRequest
- Type Parameters:
T
- Represents model.- Parameters:
model
- Represents the entity or model for which the response should be deserialized to.- Returns:
- Deserialized response from API.
- Throws:
AzDException
- Default API exception handler.
-
executeStreamAsync
Executes the request and returns the stream response from API.- Specified by:
executeStreamAsync
in classClientRequest
- Returns:
- Stream response.
InputStream
- Throws:
AzDException
- Default API exception handler.
-
executePrimitiveAsync
Executes the request and doesn't return any response. Useful for DELETE operations.- Specified by:
executePrimitiveAsync
in classClientRequest
- Returns:
- Void.
- Throws:
AzDException
- Default API exception handler.
-
execute
Executes the request and returns the deserialized response.- Specified by:
execute
in classClientRequest
- Type Parameters:
T
- Represents model.- Parameters:
model
- Represents the entity or model for which the response should be deserialized to.- Returns:
- Deserialized response from API.
- Throws:
AzDException
- Default API exception handler.
-
executeString
Executes the raw request without serialization.- Specified by:
executeString
in classClientRequest
- Returns:
- String response from API.
- Throws:
AzDException
- Default API exception handler.
-
executeStream
Executes the request and returns the stream response from API.- Specified by:
executeStream
in classClientRequest
- Returns:
- Stream response.
InputStream
- Throws:
AzDException
- Default API exception handler.
-
executePrimitive
Executes the request and doesn't return any response. Useful for DELETE operations.- Specified by:
executePrimitive
in classClientRequest
- Returns:
- Void.
- Throws:
AzDException
- Default API exception handler.
-
request
Return the request information object.- Specified by:
request
in classClientRequest
- Returns:
- RequestInformation
RequestInformation
-
accessTokenCredential
Returns the access token credential object.- Specified by:
accessTokenCredential
in classClientRequest
- Returns:
- AccessTokenCredential
AccessTokenCredential
-