pub struct DatasetClient { /* private fields */ }Expand description
Client for a specific dataset.
Implementations§
Source§impl DatasetClient
impl DatasetClient
Sourcepub async fn get(&self) -> ApifyClientResult<Option<Dataset>>
pub async fn get(&self) -> ApifyClientResult<Option<Dataset>>
Fetches the dataset metadata, or None if it does not exist.
Sourcepub async fn update<T: Serialize>(
&self,
new_fields: &T,
) -> ApifyClientResult<Dataset>
pub async fn update<T: Serialize>( &self, new_fields: &T, ) -> ApifyClientResult<Dataset>
Updates the dataset metadata (e.g. name, title).
Sourcepub async fn delete(&self) -> ApifyClientResult<()>
pub async fn delete(&self) -> ApifyClientResult<()>
Deletes the dataset.
Sourcepub async fn list_items<T: DeserializeOwned>(
&self,
options: DatasetListItemsOptions,
) -> ApifyClientResult<PaginationList<T>>
pub async fn list_items<T: DeserializeOwned>( &self, options: DatasetListItemsOptions, ) -> ApifyClientResult<PaginationList<T>>
Lists items from the dataset.
The dataset items endpoint returns a bare JSON array (not a data envelope) and
reports pagination via X-Apify-Pagination-* headers, which are surfaced in the
returned PaginationList.
Sourcepub async fn download_items(
&self,
format: DownloadItemsFormat,
options: DatasetDownloadOptions,
) -> ApifyClientResult<Vec<u8>>
pub async fn download_items( &self, format: DownloadItemsFormat, options: DatasetDownloadOptions, ) -> ApifyClientResult<Vec<u8>>
Downloads dataset items serialized in the given format, returning the raw bytes.
Unlike list_items, which returns parsed items, this returns the
items already serialized to JSON, CSV, XLSX, XML, RSS or HTML — useful for exporting.
Use DatasetDownloadOptions to control export-specific behaviour (BOM, CSV
delimiter/header, XML element names, attachment disposition).
Sourcepub async fn push_items<T: Serialize>(&self, items: &T) -> ApifyClientResult<()>
pub async fn push_items<T: Serialize>(&self, items: &T) -> ApifyClientResult<()>
Pushes one or more items to the dataset.
items must serialize to a JSON object or an array of objects.
Sourcepub async fn create_items_public_url(
&self,
options: DatasetListItemsOptions,
expires_in_secs: Option<i64>,
) -> ApifyClientResult<String>
pub async fn create_items_public_url( &self, options: DatasetListItemsOptions, expires_in_secs: Option<i64>, ) -> ApifyClientResult<String>
Builds a public URL for downloading this dataset’s items.
Mirrors the reference client’s createItemsPublicUrl: it fetches the dataset, and if
the dataset exposes a URL-signing secret key (i.e. it is private), appends an
HMAC-SHA256 signature so the URL grants access without an API token. expires_in_secs
optionally bounds the validity of a signed URL. The URL is built from the configured
public base URL.
Sourcepub async fn get_statistics(&self) -> ApifyClientResult<Option<Value>>
pub async fn get_statistics(&self) -> ApifyClientResult<Option<Value>>
Returns statistical information about the dataset, or None if unavailable.
Trait Implementations§
Source§impl Clone for DatasetClient
impl Clone for DatasetClient
Source§fn clone(&self) -> DatasetClient
fn clone(&self) -> DatasetClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more