Constructs a query so it can be inspected before being sent. collapse() can
be called at the end of a pipe that begins with galah_call() to return the
constructed user query generated by the user's data request
(a query object). Objects
of class data_request (created using request_data()), metadata_request
(from request_metadata()) or files_request (from request_files()) are
all supported.
Usage
# S3 method for class 'data_request'
collapse(x, ...)
# S3 method for class 'metadata_request'
collapse(x, ...)
# S3 method for class 'files_request'
collapse(x, ...)
# S3 method for class 'prequery'
collapse(x, ...)
# S3 method for class 'query'
collapse(x, ...)
# S3 method for class 'query_set'
collapse(x, ...)Arguments
- x
An object to run
collapse()on. Classes supported bygalahincludedata_request,metadata_requestandfiles_requestfor building queries; andprequery,queryorquery_setonce constructed (viacapture()orcompound()).- ...
Arguments passed on to
capture().
Value
An object of class query, which is a list-like object containing
two or more of the following slots:
type: The type of query, serves as a lookup to the corresponding field inshow_all(apis)url: Either:a length-1 character giving the API to be queried; or
a
tibblecontaining at least the fieldurland optionally others
headers: headers to be sent with the API callbody: body section of the API calloptions: options section of the API callrequest: captures the supplied_requestobject (seegalah_call())
Details
galah uses an object-based pipeline to convert piped requests into
valid queries, and to enact those queries with the specified organisation.
Typically, requests open with galah_call() - though request_metadata()
and request_files() are also valid - and end with
collect(). Under the hood,
the sequence of functions is as follows:
capture() → compound() →
collapse() →
compute() →
collect()
collapse() constructs a complete
user query, ready to be sent by
compute().
Information required to construct a complete user query are
provided by capture() and compound(), preceding functions to
parse and combine all required API calls necessary to build a user's query.
See also
To open a piped query, see galah_call(). For alternative
operations on _request objects, see capture(), compound(),
compute() or
collect().
