Package io.iworkflow.gen.api
Class ApiClient
java.lang.Object
io.iworkflow.gen.api.ApiClient
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2025-03-04T12:30:57.104056Z[Europe/Dublin]")
public class ApiClient
extends Object
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.fasterxml.jackson.databind.ObjectMapper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAuthorization
(String authName, feign.RequestInterceptor authorization) Adds an authorization to be used by the client<T extends ApiClient.Api>
TbuildClient
(Class<T> clientClass) Creates a feign client for given API interface.feign.RequestInterceptor
getAuthorization
(String authName) Gets request interceptor based on authentication namefeign.Feign.Builder
com.fasterxml.jackson.databind.ObjectMapper
selectHeaderAccept
(String[] accepts) Select the Accept header's value from the given accepts array: if JSON exists in the given array, use it; otherwise use all of them (joining into a string)selectHeaderContentType
(String[] contentTypes) Select the Content-Type header's value from the given array: if JSON exists in the given array, use it; otherwise use the first one of the array.void
setApiAuthorizations
(Map<String, feign.RequestInterceptor> apiAuthorizations) void
Helper method to configure the first api key foundsetBasePath
(String basePath) void
setBearerToken
(String bearerToken) Helper method to configure the bearer token.void
setCredentials
(String username, String password) Helper method to configure the username/password for basic authsetFeignBuilder
(feign.Feign.Builder feignBuilder) void
setObjectMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
-
Field Details
-
objectMapper
protected com.fasterxml.jackson.databind.ObjectMapper objectMapper
-
-
Constructor Details
-
ApiClient
public ApiClient() -
ApiClient
-
ApiClient
Basic constructor for single auth name- Parameters:
authName
-
-
ApiClient
Helper constructor for single api key- Parameters:
authName
-apiKey
-
-
-
Method Details
-
getBasePath
-
setBasePath
-
getApiAuthorizations
-
setApiAuthorizations
-
getFeignBuilder
public feign.Feign.Builder getFeignBuilder() -
setFeignBuilder
-
getObjectMapper
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper() -
setObjectMapper
public void setObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
buildClient
Creates a feign client for given API interface. Usage: ApiClient apiClient = new ApiClient(); apiClient.setBasePath("http://localhost:8080"); XYZApi api = apiClient.buildClient(XYZApi.class); XYZResponse response = api.someMethod(...);- Type Parameters:
T
- Type- Parameters:
clientClass
- Client class- Returns:
- The Client
-
selectHeaderAccept
Select the Accept header's value from the given accepts array: if JSON exists in the given array, use it; otherwise use all of them (joining into a string)- Parameters:
accepts
- The accepts array to select from- Returns:
- The Accept header to use. If the given array is empty, null will be returned (not to set the Accept header explicitly).
-
selectHeaderContentType
Select the Content-Type header's value from the given array: if JSON exists in the given array, use it; otherwise use the first one of the array.- Parameters:
contentTypes
- The Content-Type array to select from- Returns:
- The Content-Type header to use. If the given array is empty, JSON will be used.
-
setBearerToken
Helper method to configure the bearer token.- Parameters:
bearerToken
- the bearer token.
-
setApiKey
Helper method to configure the first api key found- Parameters:
apiKey
- API key
-
setCredentials
Helper method to configure the username/password for basic auth- Parameters:
username
- Usernamepassword
- Password
-
getAuthorization
Gets request interceptor based on authentication name- Parameters:
authName
- Authentication name- Returns:
- Request Interceptor
-
addAuthorization
Adds an authorization to be used by the client- Parameters:
authName
- Authentication nameauthorization
- Request interceptor
-