scruffy/client/bulk_data
Requests and response decoders for Scryfall’s Bulk Data endpoints.
Build a request with one of the *_request functions below, send it
with your own HTTP client, then decode its response with the matching
*_response function.
See https://scryfall.com/docs/api/bulk-data for the upstream reference.
Values
pub fn bulk_data_list_response(
resp: response.Response(String),
) -> Result(
scryfall_list.ScryfallList(bulk_data.BulkData),
client.ClientError,
)
Decode a response as a ScryfallList(BulkData). Pairs with
list_bulk_data_request.
pub fn bulk_data_response(
resp: response.Response(String),
) -> Result(bulk_data.BulkData, client.ClientError)
Decode a response as a single BulkData. Pairs with
get_bulk_data_by_id_request and get_bulk_data_by_type_request.
pub fn get_bulk_data_by_id_request(
id: String,
) -> request.Request(String)
Build a request for a single Bulk Data file by its Scryfall ID. Pair the
response with bulk_data_response.
pub fn get_bulk_data_by_type_request(
bulk_data_type: bulk_data.BulkDataType,
) -> request.Request(String)
Build a request for a single Bulk Data file by its type, such as
OracleCards. Pair the response with bulk_data_response.
pub fn list_bulk_data_request() -> request.Request(String)
Build a request to list all of the Bulk Data files Scryfall currently
offers. Pair the response with bulk_data_list_response.