Class ApiRequest
- java.lang.Object
-
- com.inhousegreenhouse.ch.backend.model.api.ApiRequest
-
- Direct Known Subclasses:
ApiAuthenticatedRequest
public class ApiRequest extends java.lang.Object
This class represents an API request.
-
-
Constructor Summary
Constructors Constructor Description ApiRequest(Api apiConfig, GraphQLQuery query, ApiHeader... additionalHeaders)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.http.HttpRequest
build()
Get the HTTP request object.Api
getApiConfig()
Get the API configuration object.ApiHeader[]
getHeaders()
Get the additional headers that are sent with the HTTP request.GraphQLQuery
getQuery()
Get the GraphQL basic query, without headers and variables.
-
-
-
Constructor Detail
-
ApiRequest
public ApiRequest(Api apiConfig, GraphQLQuery query, ApiHeader... additionalHeaders)
Constructor.- Parameters:
apiConfig
- The API configuration object.query
- The GraphQL query that is sent to the API.additionalHeaders
- The additional headers that are sent with the HTTP request.
-
-
Method Detail
-
build
public java.net.http.HttpRequest build()
Get the HTTP request object.- Returns:
- The HTTP request as a HttpRequest object.
-
getQuery
public GraphQLQuery getQuery()
Get the GraphQL basic query, without headers and variables.- Returns:
- The GraphQL basic query.
-
getHeaders
public ApiHeader[] getHeaders()
Get the additional headers that are sent with the HTTP request.- Returns:
- The additional headers that are sent with the HTTP request.
-
getApiConfig
public Api getApiConfig()
Get the API configuration object.- Returns:
- The API configuration object.
-
-