Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## [8.2.0] — 2026-05-05

### Deprecated

- `ScaniiTarget.AUTO` — latency-based routing (`https://api.scanii.com`) does not guarantee
regional data placement. Use an explicit regional constant (`ScaniiTarget.US1`,
`ScaniiTarget.EU1`, etc.) instead. Will be removed in a future major version.
- `ScaniiClients.createDefault(String key, String secret)` — defaults to `ScaniiTarget.AUTO`.
Use `createDefault(ScaniiTarget, String, String)` with an explicit target instead.
Will be removed in a future major version.

## [8.1.0] — 2026-05-01

### Added
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/com/scanii/ScaniiClientBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
* }</pre>
*/
public class ScaniiClientBuilder {
@SuppressWarnings("deprecation")
private ScaniiTarget target = ScaniiTarget.AUTO;
private String key;
private String secret;
Expand All @@ -35,7 +36,11 @@ public class ScaniiClientBuilder {
/**
* Sets the target region.
*
* @param target the target region {@link ScaniiTarget}. Defaults to {@link ScaniiTarget#AUTO}.
* <p>Use an explicit regional constant ({@link ScaniiTarget#US1}, {@link ScaniiTarget#EU1},
* etc.) for production. If not set, the client defaults to {@link ScaniiTarget#AUTO}, which is
* deprecated — a runtime warning will be emitted.</p>
*
* @param target the target region {@link ScaniiTarget}.
* @return this builder.
*/
public ScaniiClientBuilder target(ScaniiTarget target) {
Expand Down
6 changes: 5 additions & 1 deletion src/main/java/com/scanii/ScaniiClients.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ public static ScaniiClient createDefault(ScaniiTarget target, String key, String
}

/**
* Creates a default client using an API key/secret pair and routing to the nearest processing endpoint.
* Creates a default client using an API key/secret pair, routing to the nearest processing endpoint.
*
* @param key an API key to be used.
* @param secret an API secret to be used.
* @return the new scanii client.
* @deprecated Routing to the nearest processing endpoint does not give you control over which
* region processes your data. Use {@link #createDefault(ScaniiTarget, String, String)} with an
* explicit regional target instead. Will be removed in a future major version.
*/
@Deprecated(since = "8.2.0")
public static ScaniiClient createDefault(String key, String secret) {
return builder().credentials(key, secret).build();
}
Expand Down
13 changes: 11 additions & 2 deletions src/main/java/com/scanii/ScaniiTarget.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
import java.util.List;

/**
* Scanii Resource targets so you can control which api version and endpoint you would like your client to utilize.
* Scanii regional API endpoints.
*
* @see <a href="http://docs.scanii.com/v2.1/overview.html#endpoints">http://docs.scanii.com/v2.1/overview.html#endpoints</a>
* @see <a href="https://scanii.github.io/openapi/v22/">https://scanii.github.io/openapi/v22/</a>
*/
public class ScaniiTarget {
/**
* Latency-routed endpoint ({@code https://api.scanii.com}). Routes to the nearest regional
* endpoint automatically, but does not guarantee which region processes your data.
*
* @deprecated Use an explicit regional target for data residency compliance:
* {@link #US1}, {@link #EU1}, {@link #EU2}, {@link #AP1}, {@link #AP2}, {@link #CA1}.
* Will be removed in a future major version.
*/
@Deprecated(since = "8.2.0")
public static final ScaniiTarget AUTO = new ScaniiTarget("https://api.scanii.com");
public static final ScaniiTarget US1 = new ScaniiTarget("https://api-us1.scanii.com");
public static final ScaniiTarget EU1 = new ScaniiTarget("https://api-eu1.scanii.com");
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/scanii/ScaniiClientsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

import java.net.http.HttpClient;

@SuppressWarnings("deprecation")
class ScaniiClientsTest {

@Test
Expand Down
1 change: 1 addition & 0 deletions src/test/java/com/scanii/ScaniiTargetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.util.List;

@SuppressWarnings("deprecation")
class ScaniiTargetTest {

@Test
Expand Down
Loading