diff --git a/.github/workflows/rust-integration-tests.yml b/.github/workflows/rust-integration-tests.yml index 860d067..171840f 100644 --- a/.github/workflows/rust-integration-tests.yml +++ b/.github/workflows/rust-integration-tests.yml @@ -1,7 +1,7 @@ name: Rust integration tests # Language-specific workflow: only runs for the Rust client. Triggers on PRs to master -# that touch Rust client or test code, and can be dispatched manually from any branch. +# that touch Rust client, test, docs or build code, and can be dispatched manually from any branch. on: pull_request: branches: [master] @@ -9,6 +9,9 @@ on: - 'src/**' - 'tests/**' - 'examples/**' + - 'docs/**' + - 'README.md' + - 'build.rs' - 'Cargo.toml' - 'Cargo.lock' - '.github/workflows/rust-integration-tests.yml' diff --git a/CHANGELOG.md b/CHANGELOG.md index 44dc505..ab50197 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.14.1] - 2026-10-26 + +### Changed +- Synced with Apify OpenAPI spec `v2-2026-10-26T112451Z` (`API_SPEC_VERSION`). + +### Fixed +- Documented `RunClient::resurrect`: the terminal statuses it accepts and how + `max_total_charge_usd` applies to a run that reached its cost limit. +- Corrected the `max_total_charge_usd` field docs: it caps the total cost of the run for all + pricing models, not only pay-per-event Actors. + ## [0.14.0] - 2026-10-21 ### Added diff --git a/Cargo.toml b/Cargo.toml index c7c3b7d..551e8c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "apify-client" -version = "0.14.0" +version = "0.14.1" 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/docs/actors.md b/docs/actors.md index 31059e5..5b382d3 100644 --- a/docs/actors.md +++ b/docs/actors.md @@ -46,7 +46,7 @@ All fields are optional. Used by both `start` and `call` here, and by the identi | `timeout_secs` | `Option` | Timeout for the run in seconds (`0` means no timeout). | | `wait_for_finish` | `Option` | Maximum seconds to wait server-side for the run to finish (max 60). | | `max_items` | `Option` | Maximum number of dataset items to charge (pay-per-result Actors). | -| `max_total_charge_usd` | `Option` | Maximum total charge in USD (pay-per-event Actors). | +| `max_total_charge_usd` | `Option` | Maximum total cost of the run in USD, across all pricing models. | | `content_type` | `Option` | Content type of the input body. Defaults to `application/json` for `start`/`call`, or `application/octet-stream` for `start_raw`/`call_raw`, when unset. | | `restart_on_error` | `Option` | Whether to restart the run if it fails. | | `force_permission_level` | `Option` | Override the Actor's permission level for this run. | diff --git a/docs/runs.md b/docs/runs.md index 92fc8cc..c0361e6 100644 --- a/docs/runs.md +++ b/docs/runs.md @@ -21,7 +21,7 @@ collections are available via `actor.runs()` and `task.runs()`. | `metamorph(target, input, options)` | `&str`, `Option<&impl Serialize>`, `RunMetamorphOptions` | `ActorRun` | Transforms the run into another Actor. | | `metamorph_raw(target, input, options)` | `&str`, `&[u8]`, `RunMetamorphOptions` | `ActorRun` | Like `metamorph`, but sends `input` as a raw request body (no JSON serialization), paired with `options.content_type`. | | `reboot()` | — | `ActorRun` | Reboots the run's container. | -| `resurrect(options)` | `RunResurrectOptions` | `ActorRun` | Resurrects a finished run. | +| `resurrect(options)` | `RunResurrectOptions` | `ActorRun` | Resurrects a run in a terminal state (`SUCCEEDED`, `FAILED`, `ABORTED`, `TIMED-OUT`). To continue a run that reached its cost limit, pass a higher `max_total_charge_usd`; the limit covers the whole run, including the cost before the resurrection. | | `charge(options)` | `RunChargeOptions` | `()` | Charges a pay-per-event run (always sends an idempotency key). | | `wait_for_finish(wait_secs)` | `Option` | `ActorRun` | Polls until the run is terminal. `None` waits indefinitely; `Some(n)` bounds the wait and may return a still-running (non-terminal) run if `n` elapses first. A run ID that keeps 404ing past a 3-second grace period (reset by any successful fetch) returns the `404` as an error instead of polling forever. | | `dataset()` / `key_value_store()` / `request_queue()` / `log()` | — | resource client | Access the run's default storages and log. | diff --git a/src/clients/actor.rs b/src/clients/actor.rs index 6f9f5a1..f177255 100644 --- a/src/clients/actor.rs +++ b/src/clients/actor.rs @@ -44,7 +44,7 @@ pub struct ActorStartOptions { pub wait_for_finish: Option, /// Maximum number of dataset items to charge (pay-per-result Actors). pub max_items: Option, - /// Maximum total charge in USD (pay-per-event Actors). + /// Maximum total cost of the run in USD, across all pricing models. pub max_total_charge_usd: Option, /// Content type of the input body. Defaults to `application/json`. pub content_type: Option, diff --git a/src/clients/run.rs b/src/clients/run.rs index 0eff6a1..55e09df 100644 --- a/src/clients/run.rs +++ b/src/clients/run.rs @@ -47,7 +47,7 @@ pub struct RunResurrectOptions { pub timeout_secs: Option, /// Maximum number of dataset items to charge (pay-per-result Actors). pub max_items: Option, - /// Maximum total charge in USD (pay-per-event Actors). + /// Maximum total cost of the run in USD, across all pricing models. pub max_total_charge_usd: Option, /// If `true`, restart the run automatically when it fails. pub restart_on_error: Option, @@ -208,6 +208,12 @@ impl RunClient { } /// Resurrects a finished run, starting it again with (optionally overridden) settings. + /// + /// Only runs in a terminal state (`SUCCEEDED`, `FAILED`, `ABORTED` or `TIMED-OUT`) can be + /// resurrected. The run continues with the same storages, and its timeout counts from the + /// resurrection. `max_total_charge_usd` applies to the whole run including the cost before the + /// resurrection, so raise it to continue a run that stopped at its cost limit; otherwise the + /// resurrected run keeps the original limit and stops right after it starts. pub async fn resurrect(&self, options: RunResurrectOptions) -> ApifyClientResult { let mut params = QueryParams::new(); params diff --git a/src/version.rs b/src/version.rs index 11bdfc1..50ea1cb 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-10-20T121847Z"; +pub const API_SPEC_VERSION: &str = "v2-2026-10-26T112451Z";