diff --git a/CHANGELOG.md b/CHANGELOG.md index ff371b0..00626e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,17 @@ All notable changes to the Rust Apify API client are documented here. The format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to [Semantic Versioning](https://semver.org/). +## [0.4.3] - 2026-06-30 + +### Changed +- Bumped `API_SPEC_VERSION` to `v2-2026-06-30T091455Z`. +- Bumped crate version to `0.4.3`. + +### Documentation +- `examples/get_account.rs`: import `chrono::Utc` explicitly so the snippet is self-contained. +- `RunCollectionClient::list`: added a rustdoc example for the two-argument + `list(ListOptions, RunListOptions)` call. + ## [0.4.2] - 2026-06-29 Synchronized with Apify OpenAPI specification `v2-2026-06-29T142258Z` (previously diff --git a/Cargo.toml b/Cargo.toml index 44969c8..f031c78 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apify-client" -version = "0.4.2" +version = "0.4.3" authors = ["Apify Technologies "] description = "An official, but experimental, AI-generated and AI-maintained Rust client for the Apify API (https://apify.com)." license = "Apache-2.0" diff --git a/examples/get_account.rs b/examples/get_account.rs index 6573459..0bb3249 100644 --- a/examples/get_account.rs +++ b/examples/get_account.rs @@ -3,6 +3,7 @@ //! Run with: `APIFY_TOKEN=... cargo run --example get_account` use apify_client::ApifyClient; +use chrono::Utc; #[tokio::main] async fn main() -> Result<(), Box> { @@ -22,7 +23,7 @@ async fn main() -> Result<(), Box> { // Usage for the billing cycle that contains a specific `YYYY-MM-DD` date — pass `Some(date)` // to look up a particular cycle, or `None` for the current one. We derive the date from the // current day (rather than hard-coding one) so the lookup always lands on a real cycle. - let date = chrono::Utc::now().format("%Y-%m-%d").to_string(); + let date = Utc::now().format("%Y-%m-%d").to_string(); let dated_usage = client.me().monthly_usage_for_date(Some(&date)).await?; if let Some(cycle) = dated_usage.get("usageCycle") { println!("Usage cycle containing {date}: {cycle}"); diff --git a/src/clients/run_collection.rs b/src/clients/run_collection.rs index 1a064f8..c52283b 100644 --- a/src/clients/run_collection.rs +++ b/src/clients/run_collection.rs @@ -39,6 +39,29 @@ impl RunCollectionClient { } /// Lists runs with offset/limit pagination and optional status/started-time filtering. + /// + /// Unlike other collections, run listing takes two arguments: the shared [`ListOptions`] + /// (offset/limit/desc) and a [`RunListOptions`] filter (status and start-time bounds). + /// + /// # Example + /// ```no_run + /// use apify_client::{ApifyClient, ListOptions, RunListOptions}; + /// + /// # async fn run() -> Result<(), Box> { + /// let client = ApifyClient::new("my-api-token"); + /// let runs = client + /// .runs() + /// .list( + /// ListOptions { limit: Some(10), desc: Some(true), ..Default::default() }, + /// RunListOptions { status: vec!["SUCCEEDED".to_string()], ..Default::default() }, + /// ) + /// .await?; + /// for run in runs.items { + /// println!("{}", run.id); + /// } + /// # Ok(()) + /// # } + /// ``` pub async fn list( &self, options: ListOptions, diff --git a/src/version.rs b/src/version.rs index 5dcfbd8..bf2a02b 100644 --- a/src/version.rs +++ b/src/version.rs @@ -10,4 +10,4 @@ pub const CLIENT_VERSION: &str = env!("CARGO_PKG_VERSION"); /// and verified against. /// /// This corresponds to the `info.version` field of the Apify OpenAPI document. -pub const API_SPEC_VERSION: &str = "v2-2026-06-29T142258Z"; +pub const API_SPEC_VERSION: &str = "v2-2026-06-30T091455Z";