Skip to content

deprecate-auto-endpoint: add ScaniiTarget type, deprecate AUTO default - #4

Merged
rferreira merged 2 commits into
mainfrom
change/deprecate-auto-endpoint
May 5, 2026
Merged

rferreira merged 2 commits into
mainfrom
change/deprecate-auto-endpoint

Conversation

@rferreira

Copy link
Copy Markdown
Contributor

Summary

  • New ScaniiTarget type with regional constructors: us1(), eu1(), eu2(), ap1(), ap2(), ca1(), and from_url() for custom URLs
  • New ScaniiClientBuilder::target(ScaniiTarget) builder method — preferred way to set the endpoint
  • ScaniiClientBuilder::endpoint(String) marked #[deprecated(since = "1.3.0")]
  • Building without .target() or .endpoint() emits a runtime eprintln! warning pointing to the regional constructors
  • Integration tests updated from .endpoint(endpoint()) to .target(test_target())
  • Version bumped 1.2.0 → 1.3.0

Canary context

This is the canary PR for uvasoftware/sdks#1. Java locked the annotation convention (PR scanii/scanii-java#112). The remaining 5 SDKs fan out after this is reviewed.

Design note: associated functions vs constants

Rust const fields require Copy types — String doesn't qualify. Used associated functions (ScaniiTarget::us1()) rather than constants (ScaniiTarget::US1) to avoid &'static str-vs-String complexity. This is idiomatic Rust; Go uses vars (TargetUS1), Java/Python/dotnet use static fields (ScaniiTarget.US1 / ScaniiTarget.US1 / ScaniiTarget.Auto).

🤖 Generated with Claude Code

rferreira and others added 2 commits May 5, 2026 13:24
Introduces `ScaniiTarget` type with regional constructors (us1, eu1,
eu2, ap1, ap2, ca1) and from_url for custom URLs. Adds a `target()`
builder method as the preferred way to set the API endpoint. The raw
`endpoint()` builder method is marked `#[deprecated]`. Building without
either `.target()` or `.endpoint()` emits a runtime stderr warning that
the AUTO fallback will be removed in a future major version.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Missed the endpoint() call in process_from_url test and the quickstart
example when replacing the deprecated .endpoint() API.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rferreira
rferreira merged commit 0537284 into main May 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant