The Client is the central gateway for interfacing with the HDA Service. It provides a comprehensive suite of methods to perform operations and retrieve data from the service efficiently.
apiUrl
API endpoint
new()
Constructor for the `Client` class. Initializes a new instance with authentication credentials.
Client$new(user, password, save_credentials = FALSE)
user
Character string representing the username for authentication.
password
Character string representing the password for authentication.
save_credentials
A logical value indicating whether to save the credentials to a configuration file. Default is FALSE.
An instance of the `Client` class.
token()
Retrieves the current authentication token.
Client$token()
Character string representing the authentication token.
get_token()
Generates a new authentication token.
Client$get_token()
Character string representing the newly generated token.
send_request()
Sends a specified request to the server and returns the response.
Client$send_request(req, raw_response = FALSE)
req
A request object or list representing the HTTP request.
raw_response
Optional logical value indicating whether the raw response should be returned instead of the parsed body.
A response object containing the server's response.
show_terms()
This function displays the terms and conditions for the services.
Client$show_terms()
An HTML document containing the terms and conditions in a collapsible format.
terms_and_conditions()
Function to retrieve and accept terms and conditions. Accepting T&C is permanent,
it is enough to run this function one.
To read T&C see show_terms
.
Client$terms_and_conditions(term_id, reject = FALSE)
term_id
A character vector of term_ids that you wish to accept. If missing current status is returned. Use "all" if you want to accept all terms at once.
reject
Logical, default 'FALSE'. If TRUE it inverts the operation and the provided term_id's are rejected/revoked.
A data frame reflecting the actual acceptance status for each term.
datasets()
Lists datasets available on WEkEO, optionally filtered by a text pattern.
Client$datasets(pattern = NULL)
pattern
Optional character string to filter dataset names by matching text.
List containing datasets and associated information.
search()
This function performs a search based on a specified query and returns an instance of SearchResults
.
Client$search(json_query, limit = NULL)
json_query
Character string representing the search query.
limit
Optional; a number specifying the maximum number of results to return.
An instance of the SearchResults
class containing the search results.
get_querytemplate()
Retrieves the raw query metadata for a specified datasetId.
Client$get_querytemplate(datasetId, to_json = FALSE)
datasetId
Character, representing the dataset's identifier.
to_json
Logical; if `TRUE`, returns the data in JSON format.
List or JSON file containing the raw query options.
generate_query_template()
This function generates a query template based on a specified datasetId.
Client$generate_query_template(datasetId)
datasetId
A numeric or character ID representing the dataset.
A JSON representing the generated query template.
clone()
The objects of this class are cloneable with this method.
Client$clone(deep = FALSE)
deep
Whether to make a deep clone.
show_terms
to read the Terms and conditions.
SearchResults
for details on the returned object.