@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2022-10-28T09:54:00.189-05: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) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addCookiesToRequest(org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> cookies,
org.springframework.http.RequestEntity.BodyBuilder requestBuilder)
Add cookies to the request that is being built
|
ApiClient |
addDefaultCookie(java.lang.String name,
java.lang.String value)
Add a default cookie.
|
ApiClient |
addDefaultHeader(java.lang.String name,
java.lang.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() |
java.lang.String |
collectionPathParameterToString(ApiClient.CollectionFormat collectionFormat,
java.util.Collection<?> values)
Formats the specified collection path parameter to a string value.
|
java.lang.String |
expandPath(java.lang.String pathTemplate,
java.util.Map<java.lang.String,java.lang.Object> variables)
Expand path template with variables
|
java.lang.String |
formatDate(java.util.Date date)
Format the given Date object into string.
|
java.lang.String |
generateQueryUri(org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParams,
java.util.Map<java.lang.String,java.lang.Object> uriParams)
Include queryParams in uriParams taking into account the paramName
|
Authentication |
getAuthentication(java.lang.String authName)
Get authentication for the given name.
|
java.util.Map<java.lang.String,Authentication> |
getAuthentications()
Get authentications (key: authentication name, value: authentication).
|
java.lang.String |
getBasePath()
Get the current base path
|
java.text.DateFormat |
getDateFormat()
Get the date format used to parse/format date parameters.
|
protected void |
init() |
<T> org.springframework.http.ResponseEntity<T> |
invokeAPI(java.lang.String path,
org.springframework.http.HttpMethod method,
java.util.Map<java.lang.String,java.lang.Object> pathParams,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParams,
java.lang.Object body,
org.springframework.http.HttpHeaders headerParams,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> cookieParams,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.Object> formParams,
java.util.List<org.springframework.http.MediaType> accept,
org.springframework.http.MediaType contentType,
java.lang.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(java.lang.String mediaType)
Check if the given
String is a JSON MIME. |
boolean |
isProblemJsonMime(java.lang.String mediaType)
Check if the given
String is a Problem JSON MIME (RFC-7807). |
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> |
parameterToMultiValueMap(ApiClient.CollectionFormat collectionFormat,
java.lang.String name,
java.lang.Object value)
Converts a parameter to a
MultiValueMap for use in REST requests |
java.lang.String |
parameterToString(java.lang.Object param)
Format the given parameter object into string.
|
java.util.Date |
parseDate(java.lang.String str)
Parse the given string into Date object.
|
protected java.lang.Object |
selectBody(java.lang.Object obj,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.Object> formParams,
org.springframework.http.MediaType contentType)
Select the body to use for the request
|
java.util.List<org.springframework.http.MediaType> |
selectHeaderAccept(java.lang.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(java.lang.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(java.lang.String accessToken)
Helper method to set access token for the first OAuth2 authentication.
|
void |
setApiKey(java.lang.String apiKey)
Helper method to set API key value for the first API key authentication.
|
void |
setApiKeyPrefix(java.lang.String apiKeyPrefix)
Helper method to set API key prefix for the first API key authentication.
|
ApiClient |
setBasePath(java.lang.String basePath)
Set the base path, which should include the host
|
ApiClient |
setDateFormat(java.text.DateFormat dateFormat)
Set the date format used to parse/format date parameters.
|
void |
setDebugging(boolean debugging) |
ApiClient |
setUserAgent(java.lang.String userAgent)
Set the User-Agent header's value (by adding to the default header map).
|
protected void |
updateParamsForAuth(java.lang.String[] authNames,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParams,
org.springframework.http.HttpHeaders headerParams,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.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)
protected void init()
public java.lang.String getBasePath()
public ApiClient setBasePath(java.lang.String basePath)
basePath - the base pathpublic java.util.Map<java.lang.String,Authentication> getAuthentications()
public Authentication getAuthentication(java.lang.String authName)
authName - The authentication namepublic void setApiKey(java.lang.String apiKey)
apiKey - the API keypublic void setApiKeyPrefix(java.lang.String apiKeyPrefix)
apiKeyPrefix - API key prefixpublic void setAccessToken(java.lang.String accessToken)
accessToken - Access tokenpublic ApiClient setUserAgent(java.lang.String userAgent)
userAgent - the user agent stringpublic ApiClient addDefaultHeader(java.lang.String name, java.lang.String value)
name - The header's namevalue - The header's valuepublic ApiClient addDefaultCookie(java.lang.String name, java.lang.String value)
name - The cookie's namevalue - The cookie's valuepublic void setDebugging(boolean debugging)
public boolean isDebugging()
public java.text.DateFormat getDateFormat()
public ApiClient setDateFormat(java.text.DateFormat dateFormat)
dateFormat - Date formatpublic java.util.Date parseDate(java.lang.String str)
str - the string to parsepublic java.lang.String formatDate(java.util.Date date)
date - the date to formatpublic java.lang.String parameterToString(java.lang.Object param)
param - the object to convertpublic java.lang.String collectionPathParameterToString(ApiClient.CollectionFormat collectionFormat, java.util.Collection<?> values)
collectionFormat - The collection format of the parameter.values - The values of the parameter.public org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> parameterToMultiValueMap(ApiClient.CollectionFormat collectionFormat, java.lang.String name, java.lang.Object value)
MultiValueMap for use in REST requestscollectionFormat - The format to convert toname - The name of the parametervalue - The parameter's valuepublic boolean isJsonMime(java.lang.String mediaType)
String is a JSON MIME.mediaType - the input MediaTypepublic boolean isJsonMime(org.springframework.http.MediaType mediaType)
mediaType - the input MediaTypepublic boolean isProblemJsonMime(java.lang.String mediaType)
String is a Problem JSON MIME (RFC-7807).mediaType - the input MediaTypepublic java.util.List<org.springframework.http.MediaType> selectHeaderAccept(java.lang.String[] accepts)
accepts - The accepts array to select frompublic org.springframework.http.MediaType selectHeaderContentType(java.lang.String[] contentTypes)
contentTypes - The Content-Type array to select fromprotected java.lang.Object selectBody(java.lang.Object obj,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.Object> formParams,
org.springframework.http.MediaType contentType)
obj - the body objectformParams - the form parameterscontentType - the content type of the requestpublic java.lang.String expandPath(java.lang.String pathTemplate,
java.util.Map<java.lang.String,java.lang.Object> variables)
pathTemplate - path template with placeholdersvariables - variables to replacepublic java.lang.String generateQueryUri(org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParams,
java.util.Map<java.lang.String,java.lang.Object> uriParams)
queryParams - The query parametersuriParams - The path parameters
return templatized query stringpublic <T> org.springframework.http.ResponseEntity<T> invokeAPI(java.lang.String path,
org.springframework.http.HttpMethod method,
java.util.Map<java.lang.String,java.lang.Object> pathParams,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParams,
java.lang.Object body,
org.springframework.http.HttpHeaders headerParams,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> cookieParams,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.Object> formParams,
java.util.List<org.springframework.http.MediaType> accept,
org.springframework.http.MediaType contentType,
java.lang.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<java.lang.String,java.lang.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(java.lang.String[] authNames,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> queryParams,
org.springframework.http.HttpHeaders headerParams,
org.springframework.util.MultiValueMap<java.lang.String,java.lang.String> cookieParams)
authNames - The authentications to applyqueryParams - The query parametersheaderParams - The header parametersCopyright © 2017-2022 Okta. All Rights Reserved.