Package com.atlan.net

Class AtlanRequest

java.lang.Object
com.atlan.net.AtlanRequest

public final class AtlanRequest extends Object
A request to Atlan's API.
  • Constructor Details

    • AtlanRequest

      public AtlanRequest(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options, String requestId) throws AtlanException
      Initializes a new instance of the AtlanRequest class, used for the majority of requests.
      Parameters:
      client - connectivity to an Atlan tenant
      method - the HTTP method
      url - the URL of the request
      body - the body of the request
      options - the special modifiers of the request
      requestId - unique identifier (GUID) of a single request to Atlan
      Throws:
      AtlanException - if the request cannot be initialized for any reason
    • AtlanRequest

      public AtlanRequest(AtlanClient client, ApiResource.RequestMethod method, String url, String body, RequestOptions options, String requestId, String acceptType) throws AtlanException
      Initializes a new instance of the AtlanRequest class, used for the majority of requests.
      Parameters:
      client - connectivity to an Atlan tenant
      method - the HTTP method
      url - the URL of the request
      body - the body of the request
      options - the special modifiers of the request
      requestId - unique identifier (GUID) of a single request to Atlan
      acceptType - mime-type for the content accepted in the response to this query
      Throws:
      AtlanException - if the request cannot be initialized for any reason
    • AtlanRequest

      public AtlanRequest(AtlanClient client, ApiResource.RequestMethod method, String url, InputStream file, String filename, Map<String,String> extras, RequestOptions options, String requestId) throws AtlanException
      Initializes a new instance of the AtlanRequest class, used specifically for uploading files (images).
      Parameters:
      client - connectivity to an Atlan tenant
      method - the HTTP method
      url - the URL of the request
      file - the file to be uploaded through the request
      filename - name of the file the InputStream is reading
      extras - (optional) additional form-encoded parameters to send
      options - the special modifiers of the request
      requestId - unique identifier (GUID) of a single request to Atlan
      Throws:
      AtlanException - if the request cannot be initialized for any reason
    • AtlanRequest

      public AtlanRequest(AtlanClient client, ApiResource.RequestMethod method, String url, Map<String,Object> map, RequestOptions options, String requestId) throws AtlanException
      Initializes a new instance of the AtlanRequest class, used specifically for exchanging form-urlencoded content.
      Parameters:
      client - connectivity to an Atlan tenant
      method - the HTTP method
      url - the URL of the request
      map - of key-value pairs to be form-urlencoded
      options - the special modifiers of the request
      requestId - unique identifier (GUID) of a single request to Atlan
      Throws:
      AtlanException - if the request cannot be initialized for any reason
    • AtlanRequest

      protected AtlanRequest(AtlanClient client, ApiResource.RequestMethod method, URL url, HttpContent content, HttpHeaders headers, String body, RequestOptions options, String requestId)
  • Method Details

    • client

      public AtlanClient client()
      Connectivity to the Atlan tenant.
    • method

      public ApiResource.RequestMethod method()
      The HTTP method for the request (GET, POST or DELETE).
    • url

      public URL url()
      The URL for the request. If this is a GET or DELETE request, the URL also includes the request parameters in its query string.
    • content

      public HttpContent content()
      The body of the request. For POST requests, this will be either a application/json payload or a multi-part form upload (for files). For GET requests, this will be null.
    • headers

      public HttpHeaders headers()
      The HTTP headers of the request (Authorization, Atlan-Version, Atlan-Account, Idempotency-Key...).
    • body

      public String body()
      The body of the request (as an unmodifiable JSON string).
    • options

      public RequestOptions options()
      The special modifiers of the request.
    • requestId

      public String requestId()
      Unique identifier (GUID) of this request.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object