Package com.atlan.net
Class LiveAtlanResponseGetter
java.lang.Object
com.atlan.net.LiveAtlanResponseGetter
- All Implemented Interfaces:
AtlanResponseGetter
Class that wraps the API request and response handling, such as detecting errors from specific response codes.
-
Constructor Summary
ConstructorsConstructorDescriptionInitializes a new instance of theLiveAtlanResponseGetterclass with default parameters.LiveAtlanResponseGetter(HttpClient httpClient) Initializes a new instance of theLiveAtlanResponseGetterclass. -
Method Summary
Modifier and TypeMethodDescription<T extends AtlanResponseInterface>
Trequest(AtlanClient client, ApiResource.RequestMethod method, String url, InputStream upload, String filename, Class<T> clazz, Map<String, String> extras, RequestOptions options, String requestId) Send a request to an Atlan API, to upload a file.voidrequest(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options, String requestId) Send a request to Atlan API, when no response is expected.<T extends AtlanResponseInterface>
Trequest(AtlanClient client, ApiResource.RequestMethod method, String url, String body, Class<T> clazz, RequestOptions options, String requestId) Send a request to an Atlan API, when a response is expected.<T extends AtlanResponseInterface>
Trequest(AtlanClient client, ApiResource.RequestMethod method, String url, Map<String, Object> map, Class<T> clazz, RequestOptions options, String requestId) Makes a request to Atlan's API, to form-urlencode parameters.requestPlainText(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options, String requestId) Send a request to an Atlan API, when a response is expected.<T extends AtlanEventStreamResponseInterface>
TrequestStream(AtlanClient client, ApiResource.RequestMethod method, String url, String body, Class<T> clazz, RequestOptions options, String requestId) Send a request to an Atlan API, when an event-stream response is expected.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlan.net.AtlanResponseGetter
request
-
Constructor Details
-
LiveAtlanResponseGetter
public LiveAtlanResponseGetter()Initializes a new instance of theLiveAtlanResponseGetterclass with default parameters. -
LiveAtlanResponseGetter
Initializes a new instance of theLiveAtlanResponseGetterclass.- Parameters:
httpClient- the HTTP client to use
-
-
Method Details
-
request
public void request(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options, String requestId) throws AtlanException Send a request to Atlan API, when no response is expected.- Specified by:
requestin interfaceAtlanResponseGetter- Parameters:
client- connectivity details for the tenant to which to send the requestmethod- type of requesturl- endpoint for the requestbody- payload to send as the body of the requestoptions- any one-off options for this specific requestrequestId- unique identifier for this specific request- Throws:
AtlanException- on any API interaction problem, indicating the type of problem encountered
-
request
public <T extends AtlanResponseInterface> T request(AtlanClient client, ApiResource.RequestMethod method, String url, String body, Class<T> clazz, RequestOptions options, String requestId) throws AtlanException Send a request to an Atlan API, when a response is expected.- Specified by:
requestin interfaceAtlanResponseGetter- Type Parameters:
T- the type of the response of the request- Parameters:
client- connectivity to Atlanmethod- to use for the requesturl- of the endpoint (with all path and query parameters) for the requestbody- payload for the request, if anyclazz- the expected response object type from the requestoptions- any alternative options to use for the request, or null to use default optionsrequestId- unique identifier (GUID) of a single request to Atlan- Returns:
- the response of the request
- Throws:
AtlanException- on any API interaction problem, indicating the type of problem encountered
-
requestPlainText
public String requestPlainText(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options, String requestId) throws AtlanException Send a request to an Atlan API, when a response is expected. This handles the response as plain text, rather than JSON.- Specified by:
requestPlainTextin interfaceAtlanResponseGetter- Parameters:
client- connectivity to Atlanmethod- to use for the requesturl- of the endpoint (with all path and query parameters) for the requestbody- payload for the request, if anyoptions- any alternative options to use for the request, or null to use default optionsrequestId- unique identifier (GUID) of a single request to Atlan- Returns:
- the response of the request
- Throws:
AtlanException- on any API interaction problem, indicating the type of problem encountered
-
requestStream
public <T extends AtlanEventStreamResponseInterface> T requestStream(AtlanClient client, ApiResource.RequestMethod method, String url, String body, Class<T> clazz, RequestOptions options, String requestId) throws AtlanException Send a request to an Atlan API, when an event-stream response is expected.- Specified by:
requestStreamin interfaceAtlanResponseGetter- Type Parameters:
T- the type of the response of the request- Parameters:
client- connectivity to Atlanmethod- to use for the requesturl- of the endpoint (with all path and query parameters) for the requestbody- payload for the request, if anyclazz- the expected response object type from the requestoptions- any alternative options to use for the request, or null to use default optionsrequestId- unique identifier (GUID) of a single request to Atlan- Returns:
- the response of the request
- Throws:
AtlanException- on any API interaction problem, indicating the type of problem encountered
-
request
public <T extends AtlanResponseInterface> T request(AtlanClient client, ApiResource.RequestMethod method, String url, InputStream upload, String filename, Class<T> clazz, Map<String, String> extras, RequestOptions options, String requestId) throws AtlanExceptionSend a request to an Atlan API, to upload a file.- Specified by:
requestin interfaceAtlanResponseGetter- Type Parameters:
T- the type of the response of the request- Parameters:
client- connectivity to Atlanmethod- to use for the requesturl- of the endpoint (with all path and query parameters) for the requestupload- file to be uploadedfilename- name of the file the InputStream is readingclazz- the expected response object type from the requestextras- (optional) additional form-encoded parameters to sendoptions- any alternative options to use for the request, or null to use default optionsrequestId- unique identifier (GUID) of a single request to Atlan- Returns:
- the response of the request
- Throws:
AtlanException- on any API interaction problems, indicating the type of problem encountered
-
request
public <T extends AtlanResponseInterface> T request(AtlanClient client, ApiResource.RequestMethod method, String url, Map<String, Object> map, Class<T> clazz, RequestOptions options, String requestId) throws AtlanExceptionMakes a request to Atlan's API, to form-urlencode parameters.- Specified by:
requestin interfaceAtlanResponseGetter- Type Parameters:
T- the type of the response of the request- Parameters:
client- connectivity to Atlanmethod- to use for the requesturl- of the endpoint (with all path and query parameters) for the requestmap- of key-value pairs to be form-urlencodedclazz- the expected response object type from the requestoptions- any alternative options to use for the request, or null to use default optionsrequestId- unique identifier (GUID) of a single request to Atlan- Returns:
- the response of the request
- Throws:
AtlanException- on any API interaction problems, indicating the type of problem encountered
-