@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", date="2023-02-10T11:07:35.698-06:00[America/Chicago]") @Component(value="org.openapitools.client.ApiClient") public class ApiClient extends JavaTimeFormatter
| Modifier and Type | Class and Description |
|---|---|
static class |
ApiClient.CollectionFormat |
| Constructor and Description |
|---|
ApiClient() |
ApiClient(org.springframework.web.client.RestTemplate restTemplate,
CacheManager cacheManager) |
ApiClient(org.springframework.web.client.RestTemplate restTemplate,
CacheManager cacheManager,
com.okta.commons.http.config.HttpClientConfiguration httpClientConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCookiesToRequest(org.springframework.util.MultiValueMap<String,String> cookies,
org.springframework.http.RequestEntity.BodyBuilder requestBuilder)
Add cookies to the request that is being built
|
ApiClient |
addDefaultCookie(String name,
String value)
Add a default cookie.
|
ApiClient |
addDefaultHeader(String name,
String value)
Add a default header.
|
protected void |
addHeadersToRequest(org.springframework.http.HttpHeaders headers,
org.springframework.http.RequestEntity.BodyBuilder requestBuilder)
Add headers to the request that is being built
|
protected org.springframework.web.client.RestTemplate |
buildRestTemplate()
Build the RestTemplate used to make HTTP requests.
|
protected org.springframework.retry.support.RetryTemplate |
buildRetryTemplate() |
String |
collectionPathParameterToString(ApiClient.CollectionFormat collectionFormat,
Collection<?> values)
Formats the specified collection path parameter to a string value.
|
String |
expandPath(String pathTemplate,
Map<String,Object> variables)
Expand path template with variables
|
String |
formatDate(Date date)
Format the given Date object into string.
|
String |
generateQueryUri(org.springframework.util.MultiValueMap<String,String> queryParams,
Map<String,Object> uriParams)
Include queryParams in uriParams taking into account the paramName
|
Authentication |
getAuthentication(String authName)
Get authentication for the given name.
|
Map<String,Authentication> |
getAuthentications()
Get authentications (key: authentication name, value: authentication).
|
String |
getBasePath()
Get the current base path
|
DateFormat |
getDateFormat()
Get the date format used to parse/format date parameters.
|
protected void |
init() |
<T> org.springframework.http.ResponseEntity<T> |
invokeAPI(String path,
org.springframework.http.HttpMethod method,
Map<String,Object> pathParams,
org.springframework.util.MultiValueMap<String,String> queryParams,
Object body,
org.springframework.http.HttpHeaders headerParams,
org.springframework.util.MultiValueMap<String,String> cookieParams,
org.springframework.util.MultiValueMap<String,Object> formParams,
List<org.springframework.http.MediaType> accept,
org.springframework.http.MediaType contentType,
String[] authNames,
org.springframework.core.ParameterizedTypeReference<T> returnType)
Invoke API by sending HTTP request with the given options.
|
boolean |
isDebugging()
Check that whether debugging is enabled for this API client.
|
boolean |
isJsonMime(org.springframework.http.MediaType mediaType)
Check if the given MIME is a JSON MIME.
|
boolean |
isJsonMime(String mediaType)
Check if the given
String is a JSON MIME. |
boolean |
isProblemJsonMime(String mediaType)
Check if the given
String is a Problem JSON MIME (RFC-7807). |
org.springframework.util.MultiValueMap<String,String> |
parameterToMultiValueMap(ApiClient.CollectionFormat collectionFormat,
String name,
Object value)
Converts a parameter to a
MultiValueMap for use in REST requests |
String |
parameterToString(Object param)
Format the given parameter object into string.
|
Date |
parseDate(String str)
Parse the given string into Date object.
|
protected Object |
selectBody(Object obj,
org.springframework.util.MultiValueMap<String,Object> formParams,
org.springframework.http.MediaType contentType)
Select the body to use for the request
|
List<org.springframework.http.MediaType> |
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)
|
org.springframework.http.MediaType |
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 |
setAccessToken(String accessToken)
Helper method to set access token for the first OAuth2 authentication.
|
void |
setApiKey(String apiKey)
Helper method to set API key value for the first API key authentication.
|
void |
setApiKeyPrefix(String apiKeyPrefix)
Helper method to set API key prefix for the first API key authentication.
|
ApiClient |
setBasePath(String basePath)
Set the base path, which should include the host
|
ApiClient |
setDateFormat(DateFormat dateFormat)
Set the date format used to parse/format date parameters.
|
void |
setDebugging(boolean debugging) |
ApiClient |
setUserAgent(String userAgent)
Set the User-Agent header's value (by adding to the default header map).
|
protected void |
updateParamsForAuth(String[] authNames,
org.springframework.util.MultiValueMap<String,String> queryParams,
org.springframework.http.HttpHeaders headerParams,
org.springframework.util.MultiValueMap<String,String> cookieParams)
Update query and header parameters based on authentication settings.
|
formatOffsetDateTime, getOffsetDateTimeFormatter, parseOffsetDateTime, setOffsetDateTimeFormatterpublic ApiClient()
public ApiClient(org.springframework.web.client.RestTemplate restTemplate,
CacheManager cacheManager)
public ApiClient(org.springframework.web.client.RestTemplate restTemplate,
CacheManager cacheManager,
com.okta.commons.http.config.HttpClientConfiguration httpClientConfiguration)
protected void init()
public String getBasePath()
public ApiClient setBasePath(String basePath)
basePath - the base pathpublic Map<String,Authentication> getAuthentications()
public Authentication getAuthentication(String authName)
authName - The authentication namepublic void setApiKey(String apiKey)
apiKey - the API keypublic void setApiKeyPrefix(String apiKeyPrefix)
apiKeyPrefix - API key prefixpublic void setAccessToken(String accessToken)
accessToken - Access tokenpublic ApiClient setUserAgent(String userAgent)
userAgent - the user agent stringpublic ApiClient addDefaultHeader(String name, String value)
name - The header's namevalue - The header's valuepublic ApiClient addDefaultCookie(String name, String value)
name - The cookie's namevalue - The cookie's valuepublic void setDebugging(boolean debugging)
public boolean isDebugging()
public DateFormat getDateFormat()
public ApiClient setDateFormat(DateFormat dateFormat)
dateFormat - Date formatpublic Date parseDate(String str)
str - the string to parsepublic String formatDate(Date date)
date - the date to formatpublic String parameterToString(Object param)
param - the object to convertpublic String collectionPathParameterToString(ApiClient.CollectionFormat collectionFormat, Collection<?> values)
collectionFormat - The collection format of the parameter.values - The values of the parameter.public org.springframework.util.MultiValueMap<String,String> parameterToMultiValueMap(ApiClient.CollectionFormat collectionFormat, String name, Object value)
MultiValueMap for use in REST requestscollectionFormat - The format to convert toname - The name of the parametervalue - The parameter's valuepublic boolean isJsonMime(String mediaType)
String is a JSON MIME.mediaType - the input MediaTypepublic boolean isJsonMime(org.springframework.http.MediaType mediaType)
mediaType - the input MediaTypepublic boolean isProblemJsonMime(String mediaType)
String is a Problem JSON MIME (RFC-7807).mediaType - the input MediaTypepublic List<org.springframework.http.MediaType> selectHeaderAccept(String[] accepts)
accepts - The accepts array to select frompublic org.springframework.http.MediaType selectHeaderContentType(String[] contentTypes)
contentTypes - The Content-Type array to select fromprotected Object selectBody(Object obj, org.springframework.util.MultiValueMap<String,Object> formParams, org.springframework.http.MediaType contentType)
obj - the body objectformParams - the form parameterscontentType - the content type of the requestpublic String expandPath(String pathTemplate, Map<String,Object> variables)
pathTemplate - path template with placeholdersvariables - variables to replacepublic String generateQueryUri(org.springframework.util.MultiValueMap<String,String> queryParams, Map<String,Object> uriParams)
queryParams - The query parametersuriParams - The path parameters
return templatized query stringpublic <T> org.springframework.http.ResponseEntity<T> invokeAPI(String path, org.springframework.http.HttpMethod method, Map<String,Object> pathParams, org.springframework.util.MultiValueMap<String,String> queryParams, Object body, org.springframework.http.HttpHeaders headerParams, org.springframework.util.MultiValueMap<String,String> cookieParams, org.springframework.util.MultiValueMap<String,Object> formParams, List<org.springframework.http.MediaType> accept, org.springframework.http.MediaType contentType, String[] authNames, org.springframework.core.ParameterizedTypeReference<T> returnType) throws org.springframework.web.client.RestClientException
T - the return type to usepath - The sub-path of the HTTP URLmethod - The request methodpathParams - The path parametersqueryParams - The query parametersbody - The request body objectheaderParams - The header parameterscookieParams - The cookie parametersformParams - The form parametersaccept - The request's Accept headercontentType - The request's Content-Type headerauthNames - The authentications to applyreturnType - The return type into which to deserialize the responseorg.springframework.web.client.RestClientExceptionprotected void addHeadersToRequest(org.springframework.http.HttpHeaders headers,
org.springframework.http.RequestEntity.BodyBuilder requestBuilder)
headers - The headers to addrequestBuilder - The current requestprotected void addCookiesToRequest(org.springframework.util.MultiValueMap<String,String> cookies, org.springframework.http.RequestEntity.BodyBuilder requestBuilder)
cookies - The cookies to addrequestBuilder - The current requestprotected org.springframework.web.client.RestTemplate buildRestTemplate()
protected org.springframework.retry.support.RetryTemplate buildRetryTemplate()
protected void updateParamsForAuth(String[] authNames, org.springframework.util.MultiValueMap<String,String> queryParams, org.springframework.http.HttpHeaders headerParams, org.springframework.util.MultiValueMap<String,String> cookieParams)
authNames - The authentications to applyqueryParams - The query parametersheaderParams - The header parametersCopyright © 2017–2023 Okta. All rights reserved.