Package com.atlan.net
Class ApiResource
java.lang.Object
com.atlan.model.core.AtlanObject
com.atlan.net.ApiResource
- All Implemented Interfaces:
- AtlanResponseInterface,- Serializable
- Direct Known Subclasses:
- AbstractEndpoint.RawResponse,- AdminEventResponse,- ApiTokenResponse,- AssetMutationResponse,- AssetResponse,- AtlanFile,- AtlanImage,- AtlanRequestResponse,- AuditSearchResponse,- CreateGroupResponse,- CredentialResponse,- CredentialTestResponse,- GroupResponse,- IndexSearchResponse,- KeycloakEventResponse,- LineageListResponse,- OAuthClientResponse,- OAuthExchangeResponse,- ParsedQuery,- PermissionsResponse,- RoleResponse,- SearchLogResponse,- SessionResponse,- SSOMapping,- SuggestionResponse,- TaskSearchResponse,- TypeDefResponse,- UserMinimalResponse,- UserResponse,- WorkflowResponse,- WorkflowSearchResponse
Base class for all response objects.
- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumHTTP methods that can be used in API requests.Nested classes/interfaces inherited from class com.atlan.model.core.AtlanObjectAtlanObject.AtlanObjectBuilder<C extends AtlanObject,B extends AtlanObject.AtlanObjectBuilder<C, B>> 
- 
Field SummaryFieldsFields inherited from class com.atlan.model.core.AtlanObjectrawJsonObject
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidcheckNullTypedParams(String url, AtlanObject params) Invalidate null typed parameters.static StringcreateQueryString(Collection<KeyValuePair<String, String>> nameValueCollection) Creates the HTTP query string for a collection of name/value tuples.static StringcreateQueryString(Map<String, Object> params) Creates the HTTP query string for a given map of parameters.com.fasterxml.jackson.databind.JsonNodeReturns the raw JsonNode exposed by the Jackson library.static voidinjectTraceId(String requestId) static voidrequest(AtlanClient client, ApiResource.RequestMethod method, String url, AtlanObject payload, RequestOptions options) Pass-through to the request-handling method after confirming that the provided payload is non-null, for calls that do not expect a response.static <T extends ApiResource>
 Trequest(AtlanClient client, ApiResource.RequestMethod method, String url, AtlanObject payload, Class<T> clazz, RequestOptions options) Pass-through to the request-handling method after confirming that the provided payload is non-null.static <T extends ApiResource>
 Trequest(AtlanClient client, ApiResource.RequestMethod method, String url, InputStream payload, String filename, Class<T> clazz, RequestOptions options) Pass-through the request to the request-handling method, for file uploads.static <T extends ApiResource>
 Trequest(AtlanClient client, ApiResource.RequestMethod method, String url, InputStream payload, String filename, Class<T> clazz, Map<String, String> extras, RequestOptions options) Pass-through the request to the request-handling method, for file uploads.static voidrequest(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options) Pass-through the request to the request-handling method.static <T extends ApiResource>
 Trequest(AtlanClient client, ApiResource.RequestMethod method, String url, String body, Class<T> clazz, RequestOptions options) Pass-through the request to the request-handling method.static <T extends ApiResource>
 Trequest(AtlanClient client, ApiResource.RequestMethod method, String url, Map<String, Object> map, Class<T> clazz, RequestOptions options) Pass-through the request to the request-handling method, for form-urlencoded endpoints.static StringrequestPlainText(AtlanClient client, ApiResource.RequestMethod method, String url, AtlanObject payload, RequestOptions options) Pass-through to the request-handling method after confirming that the provided payload is non-null.static StringrequestPlainText(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options) Pass-through the request to the request-handling method.voidsetLastResponse(AtlanResponse response) toString()static StringURL-encodes a string.static StringurlEncodeId(String id) URL-encode a string ID in url path formatting.Methods inherited from class com.atlan.model.core.AtlanObjectcanEqual, equals, hashCode, setRawJsonObject, toJson
- 
Field Details- 
CHARSET
 
- 
- 
Constructor Details- 
ApiResourcepublic ApiResource()
 
- 
- 
Method Details- 
getLastResponse- Specified by:
- getLastResponsein interface- AtlanResponseInterface
 
- 
setLastResponse- Specified by:
- setLastResponsein interface- AtlanResponseInterface
 
- 
getRawJsonObjectpublic com.fasterxml.jackson.databind.JsonNode getRawJsonObject()Returns the raw JsonNode exposed by the Jackson library. This can be used to access properties that are not directly exposed by Atlan's Java library.Note: You should always prefer using the standard property accessors whenever possible. Because this method exposes Jackson's underlying API, it is not considered fully stable. Atlan's Java library might move off Jackson in the future and this method would be removed or change significantly. - Overrides:
- getRawJsonObjectin class- AtlanObject
- Returns:
- The raw JsonNode.
 
- 
urlEncodeURL-encodes a string.
- 
urlEncodeIdURL-encode a string ID in url path formatting.- Throws:
- InvalidRequestException
 
- 
createQueryStringCreates the HTTP query string for a given map of parameters.- Parameters:
- params- The map of parameters.
- Returns:
- The query string.
 
- 
createQueryStringCreates the HTTP query string for a collection of name/value tuples.- Parameters:
- nameValueCollection- The collection of name/value tuples.
- Returns:
- The query string.
 
- 
requestpublic static void request(AtlanClient client, ApiResource.RequestMethod method, String url, AtlanObject payload, RequestOptions options) throws AtlanException Pass-through to the request-handling method after confirming that the provided payload is non-null, for calls that do not expect a response.- Parameters:
- client- connectivity to Atlan
- method- for the request
- url- of the request
- payload- to send in the request
- options- for sending the request (or null to use global defaults)
- Throws:
- AtlanException- on any API interaction problem
 
- 
requestpublic static void request(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options) throws AtlanException Pass-through the request to the request-handling method. This method wraps debug-level logging lines around the request to show precisely what was constructed and sent to Atlan. Since this method is used when no response is expected, no response will be logged.- Parameters:
- client- connectivity to Atlan
- method- for the request
- url- of the request
- body- to send in the request, if any (to not send any use an empty string)
- options- for sending the request (or null to use global defaults)
- Throws:
- AtlanException- on any API interaction problem
 
- 
requestpublic static <T extends ApiResource> T request(AtlanClient client, ApiResource.RequestMethod method, String url, AtlanObject payload, Class<T> clazz, RequestOptions options) throws AtlanException Pass-through to the request-handling method after confirming that the provided payload is non-null.- Type Parameters:
- T- the type of the response
- Parameters:
- client- connectivity to Atlan
- method- for the request
- url- of the request
- payload- to send in the request
- clazz- defining the expected response type
- options- for sending the request (or null to use global defaults)
- Returns:
- the response
- Throws:
- AtlanException- on any API interaction problem
 
- 
requestPlainTextpublic static String requestPlainText(AtlanClient client, ApiResource.RequestMethod method, String url, AtlanObject payload, RequestOptions options) throws AtlanException Pass-through to the request-handling method after confirming that the provided payload is non-null. This uses special handling of the response, where the response is plain text rather than JSON.- Parameters:
- client- connectivity to Atlan
- method- for the request
- url- of the request
- payload- to send in the request
- options- for sending the request (or null to use global defaults)
- Returns:
- the response
- Throws:
- AtlanException- on any API interaction problem
 
- 
requestpublic static <T extends ApiResource> T request(AtlanClient client, ApiResource.RequestMethod method, String url, String body, Class<T> clazz, RequestOptions options) throws AtlanException Pass-through the request to the request-handling method. This method wraps debug-level logging lines around the request to show precisely what was constructed and sent to Atlan and precisely what was returned (prior to deserialization).- Type Parameters:
- T- the type of the response
- Parameters:
- client- connectivity to Atlan
- method- for the request
- url- of the request
- body- to send in the request, if any (to not send any use an empty string)
- clazz- defining the expected response type
- options- for sending the request (or null to use global defaults)
- Returns:
- the response
- Throws:
- AtlanException- on any API interaction problem
 
- 
requestPlainTextpublic static String requestPlainText(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options) throws AtlanException Pass-through the request to the request-handling method. This method wraps debug-level logging lines around the request to show precisely what was constructed and sent to Atlan and precisely what was returned (prior to deserialization). This handles the response as plain text rather than JSON.- Parameters:
- client- connectivity to Atlan
- method- for the request
- url- of the request
- body- to send in the request, if any (to not send any use an empty string)
- options- for sending the request (or null to use global defaults)
- Returns:
- the response
- Throws:
- AtlanException- on any API interaction problem
 
- 
requestpublic static <T extends ApiResource> T request(AtlanClient client, ApiResource.RequestMethod method, String url, InputStream payload, String filename, Class<T> clazz, RequestOptions options) throws AtlanException Pass-through the request to the request-handling method, for file uploads. This method wraps debug-level logging lines around the request to show precisely what was constructed and sent to Atlan and precisely what was returned (prior to deserialization).- Type Parameters:
- T- the type of the response
- Parameters:
- client- connectivity to Atlan
- method- for the request
- url- of the request
- payload- binary input stream of the file contents
- filename- name of the file being streamed
- clazz- defining the expected response type
- options- for sending the request (or null to use global defaults)
- Returns:
- the response
- Throws:
- AtlanException- on any API interaction problem
 
- 
requestpublic static <T extends ApiResource> T request(AtlanClient client, ApiResource.RequestMethod method, String url, InputStream payload, String filename, Class<T> clazz, Map<String, String> extras, RequestOptions options) throws AtlanExceptionPass-through the request to the request-handling method, for file uploads. This method wraps debug-level logging lines around the request to show precisely what was constructed and sent to Atlan and precisely what was returned (prior to deserialization).- Type Parameters:
- T- the type of the response
- Parameters:
- client- connectivity to Atlan
- method- for the request
- url- of the request
- payload- binary input stream of the file contents
- filename- name of the file being streamed
- clazz- defining the expected response type
- extras- additional form-encoded fields to send in the request
- options- for sending the request (or null to use global defaults)
- Returns:
- the response
- Throws:
- AtlanException- on any API interaction problem
 
- 
requestpublic static <T extends ApiResource> T request(AtlanClient client, ApiResource.RequestMethod method, String url, Map<String, Object> map, Class<T> clazz, RequestOptions options) throws AtlanExceptionPass-through the request to the request-handling method, for form-urlencoded endpoints.- Type Parameters:
- T- the type of the response
- Parameters:
- client- connectivity to Atlan
- method- for the request
- url- of the request
- map- of key-value pairs to be form-urlencoded
- clazz- defining the expected response type
- options- for sending the request (or null to use global defaults)
- Returns:
- the response
- Throws:
- AtlanException- on any API interaction problem
 
- 
injectTraceId
- 
checkNullTypedParamsInvalidate null typed parameters.- Parameters:
- url- request url associated with the given parameters.
- params- typed parameters to check for null value.
 
- 
toStringDescription copied from class:AtlanObject- Overrides:
- toStringin class- AtlanObject
 
 
-