Interface Request<T>
- Type Parameters:
T- The parsed return type representing the response.
- All Known Subinterfaces:
PageableRequest<T>
- All Known Implementing Classes:
CancelBuildRequest,CreateBuildRequest,DeleteAccessTokenRequest,DeleteRequest,GetAccessTokenRequest,GetBuildRequest,GetMetaRequest,GetOrganizationRequest,GetPipelineRequest,GetRequest,GetUserRequest,ListBuildsRequest,ListEmojisRequest,ListOrganizationsRequest,ListPipelinesRequest,PingRequest,PostRequest,PutRequest,RebuildBuildRequest,RetryJobRequest,UnblockJobRequest
public interface Request<T>
Defines an API request.
-
Method Summary
Modifier and TypeMethodDescriptionWhich HTTP Method to make the request using.getPath()REST Endpoint Path to request.default StringThe Request body value.default RequestParametersKeyValue pairs of Request Parameters.Defines how to parse the APIs response into a concrete object.default TparseResponse(HttpResult result) Parses the API's response into a concrete object.
-
Method Details
-
getMethod
HttpMethod getMethod()Which HTTP Method to make the request using. GET, POST, PUT, etc...- Returns:
- Which HTTP Method to make the request using. GET, POST, PUT, etc...
-
getPath
String getPath()REST Endpoint Path to request. Example "/v2/access-token"- Returns:
- REST Endpoint Path to request. Example "/v2/access-token"
-
getRequestParameters
KeyValue pairs of Request Parameters.- Returns:
- RequestParameters associated with request.
-
getRequestBody
The Request body value.- Returns:
- null if no request body is needed, or the request body as a String.
- Throws:
RequestParsingException- if unable to generate request body due to some error.
-
getResponseParser
ResponseParser<T> getResponseParser()Defines how to parse the APIs response into a concrete object.- Returns:
- Defines how to parse the APIs response into a concrete object.
-
parseResponse
Parses the API's response into a concrete object.- Parameters:
result- The API's response.- Returns:
- Parsed response object.
- Throws:
ResponseParsingException- if unable to properly parse a response from the API.
-