Package com.pulumi.cloud.sdk
Class ApiClient
- java.lang.Object
-
- com.pulumi.cloud.sdk.ApiClient
-
public class ApiClient extends java.lang.ObjectHTTP engine for the generated Pulumi Cloud SDK, built on the JDKHttpClient. Generated*Apimethods build anApiRequestand hand it tocall(ApiRequest, TypeReference); this class substitutes path parameters, encodes the query string, applies authentication and headers, serializes the body, performs the request, and deserializes the 2xx response into the requested type. Non-2xx responses and transport/serialization failures surface asApiException.
-
-
Constructor Summary
Constructors Constructor Description ApiClient()ApiClient(ApiClientConfiguration configuration)ApiClient(ApiClientConfiguration configuration, java.net.http.HttpClient http)Use a caller-suppliedHttpClient(custom proxy, executor, or a test transport).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcall(ApiRequest request)Perform a request whose response body is ignored (void operations).<T> Tcall(ApiRequest request, com.fasterxml.jackson.core.type.TypeReference<T> responseType)Perform a request and deserialize the 2xx response intoresponseType.<T,H>
ResponseWithHeaders<T,H>callWithHeaders(ApiRequest request, com.fasterxml.jackson.core.type.TypeReference<T> responseType, java.util.function.Function<java.net.http.HttpHeaders,H> parseHeaders)Perform a request and return both the deserialized 2xx response body and the response's headers, converted byparseHeaders— for operations whose response declares typed response headers.<H> HcallWithHeadersOnly(ApiRequest request, java.util.function.Function<java.net.http.HttpHeaders,H> parseHeaders)Perform a request and return just the response's headers, converted byparseHeaders— for a no-body (e.g.ApiClientConfigurationgetConfiguration()
-
-
-
Constructor Detail
-
ApiClient
public ApiClient()
-
ApiClient
public ApiClient(ApiClientConfiguration configuration)
-
ApiClient
public ApiClient(ApiClientConfiguration configuration, java.net.http.HttpClient http)
Use a caller-suppliedHttpClient(custom proxy, executor, or a test transport).
-
-
Method Detail
-
getConfiguration
public ApiClientConfiguration getConfiguration()
-
call
public void call(ApiRequest request)
Perform a request whose response body is ignored (void operations).
-
call
public <T> T call(ApiRequest request, com.fasterxml.jackson.core.type.TypeReference<T> responseType)
Perform a request and deserialize the 2xx response intoresponseType. WhenresponseTypeisbyte[]orStringthe raw body is returned without JSON parsing; anulltype (or a 204 / empty body) returnsnull.
-
callWithHeaders
public <T,H> ResponseWithHeaders<T,H> callWithHeaders(ApiRequest request, com.fasterxml.jackson.core.type.TypeReference<T> responseType, java.util.function.Function<java.net.http.HttpHeaders,H> parseHeaders)
Perform a request and return both the deserialized 2xx response body and the response's headers, converted byparseHeaders— for operations whose response declares typed response headers. Kept as its own method (duplicatingcall(ApiRequest, TypeReference)'s body viaexecuteWithHeaders(com.pulumi.cloud.sdk.ApiRequest, com.fasterxml.jackson.core.type.TypeReference<T>)) rather than added as an optional code path oncall, so every other generated method's call site is untouched.
-
callWithHeadersOnly
public <H> H callWithHeadersOnly(ApiRequest request, java.util.function.Function<java.net.http.HttpHeaders,H> parseHeaders)
Perform a request and return just the response's headers, converted byparseHeaders— for a no-body (e.g. 204) operation that still carries typed response headers.
-
-