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
,ParsedQuery
,RoleResponse
,SearchLogResponse
,SessionResponse
,SSOMapping
,SuggestionResponse
,TaskSearchResponse
,TypeDefResponse
,UserMinimalResponse
,UserResponse
,WorkflowResponse
,WorkflowSearchResponse
Base class for all response objects.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
HTTP methods that can be used in API requests.Nested classes/interfaces inherited from class com.atlan.model.core.AtlanObject
AtlanObject.AtlanObjectBuilder<C extends AtlanObject,
B extends AtlanObject.AtlanObjectBuilder<C, B>> -
Field Summary
Fields inherited from class com.atlan.model.core.AtlanObject
rawJsonObject
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
checkNullTypedParams
(String url, AtlanObject params) Invalidate null typed parameters.static String
createQueryString
(Collection<KeyValuePair<String, String>> nameValueCollection) Creates the HTTP query string for a collection of name/value tuples.static String
createQueryString
(Map<String, Object> params) Creates the HTTP query string for a given map of parameters.com.fasterxml.jackson.databind.JsonNode
Returns the raw JsonNode exposed by the Jackson library.static void
request
(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 void
request
(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 String
requestPlainText
(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 String
requestPlainText
(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options) Pass-through the request to the request-handling method.void
setLastResponse
(AtlanResponse response) toString()
static String
URL-encodes a string.static String
urlEncodeId
(String id) URL-encode a string ID in url path formatting.Methods inherited from class com.atlan.model.core.AtlanObject
canEqual, equals, hashCode, setRawJsonObject, toJson
-
Field Details
-
CHARSET
-
-
Constructor Details
-
ApiResource
public ApiResource()
-
-
Method Details
-
getLastResponse
- Specified by:
getLastResponse
in interfaceAtlanResponseInterface
-
setLastResponse
- Specified by:
setLastResponse
in interfaceAtlanResponseInterface
-
getRawJsonObject
public 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:
getRawJsonObject
in classAtlanObject
- Returns:
- The raw JsonNode.
-
urlEncode
URL-encodes a string. -
urlEncodeId
URL-encode a string ID in url path formatting.- Throws:
InvalidRequestException
-
createQueryString
Creates the HTTP query string for a given map of parameters.- Parameters:
params
- The map of parameters.- Returns:
- The query string.
-
createQueryString
Creates the HTTP query string for a collection of name/value tuples.- Parameters:
nameValueCollection
- The collection of name/value tuples.- Returns:
- The query string.
-
request
public 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 Atlanmethod
- for the requesturl
- of the requestpayload
- to send in the requestoptions
- for sending the request (or null to use global defaults)- Throws:
AtlanException
- on any API interaction problem
-
request
public 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 Atlanmethod
- for the requesturl
- of the requestbody
- 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
-
request
public 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 Atlanmethod
- for the requesturl
- of the requestpayload
- to send in the requestclazz
- defining the expected response typeoptions
- for sending the request (or null to use global defaults)- Returns:
- the response
- Throws:
AtlanException
- on any API interaction problem
-
requestPlainText
public 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 Atlanmethod
- for the requesturl
- of the requestpayload
- to send in the requestoptions
- for sending the request (or null to use global defaults)- Returns:
- the response
- Throws:
AtlanException
- on any API interaction problem
-
request
public 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 Atlanmethod
- for the requesturl
- of the requestbody
- to send in the request, if any (to not send any use an empty string)clazz
- defining the expected response typeoptions
- for sending the request (or null to use global defaults)- Returns:
- the response
- Throws:
AtlanException
- on any API interaction problem
-
requestPlainText
public 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 Atlanmethod
- for the requesturl
- of the requestbody
- 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
-
request
public 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 Atlanmethod
- for the requesturl
- of the requestpayload
- binary input stream of the file contentsfilename
- name of the file being streamedclazz
- defining the expected response typeoptions
- for sending the request (or null to use global defaults)- Returns:
- the response
- Throws:
AtlanException
- on any API interaction problem
-
request
public 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 Atlanmethod
- for the requesturl
- of the requestpayload
- binary input stream of the file contentsfilename
- name of the file being streamedclazz
- defining the expected response typeextras
- additional form-encoded fields to send in the requestoptions
- for sending the request (or null to use global defaults)- Returns:
- the response
- Throws:
AtlanException
- on any API interaction problem
-
request
public 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 Atlanmethod
- for the requesturl
- of the requestmap
- of key-value pairs to be form-urlencodedclazz
- defining the expected response typeoptions
- for sending the request (or null to use global defaults)- Returns:
- the response
- Throws:
AtlanException
- on any API interaction problem
-
checkNullTypedParams
Invalidate null typed parameters.- Parameters:
url
- request url associated with the given parameters.params
- typed parameters to check for null value.
-
toString
Description copied from class:AtlanObject
- Overrides:
toString
in classAtlanObject
-