Skip to content

Commit 4dce035

Browse files
committed
## Java SDK Changes Detected:
* `shippo.batches.create()`: * `request.batchShipments.[].shipment.parcels.[].[parcelCreateFromTemplateRequest].template.[parcelTemplateCouriersPleaseEnum]` **Removed** **Breaking** ⚠️ * `shippo.batches.addShipments()`: * `requestbody.[].shipment.parcels.[].[parcelCreateFromTemplateRequest].template.[parcelTemplateCouriersPleaseEnum]` **Removed** **Breaking** ⚠️ * `shippo.carrierAccounts.register()`: `request` **Changed** **Breaking** ⚠️ * `shippo.ratesAtCheckout.create()`: * `request.parcel.[parcel].template.[parcelTemplateCouriersPleaseEnum]` **Removed** **Breaking** ⚠️ * `shippo.parcels.create()`: * `request.[parcelCreateFromTemplateRequest].template.[parcelTemplateCouriersPleaseEnum]` **Removed** **Breaking** ⚠️ * `response.template.[parcelTemplateCouriersPleaseEnum]` **Removed** * `shippo.shipments.create()`: * `request.parcels.[].[parcelCreateFromTemplateRequest].template.[parcelTemplateCouriersPleaseEnum]` **Removed** **Breaking** ⚠️ * `response.parcels.[].template.[parcelTemplateCouriersPleaseEnum]` **Removed** * `shippo.transactions.create()`: * `request.[instantTransactionCreateRequest].shipment.parcels.[].[parcelCreateFromTemplateRequest].template.[parcelTemplateCouriersPleaseEnum]` **Removed** **Breaking** ⚠️ * `shippo.carrierAccounts.list()`: * `request.carrier` **Changed** * `shippo.parcels.list()`: `response.results.[].template.[parcelTemplateCouriersPleaseEnum]` **Removed** * `shippo.parcels.get()`: `response.template.[parcelTemplateCouriersPleaseEnum]` **Removed** * `shippo.shipments.list()`: `response.results.[].parcels.[].template.[parcelTemplateCouriersPleaseEnum]` **Removed** * `shippo.shipments.get()`: `response.parcels.[].template.[parcelTemplateCouriersPleaseEnum]` **Removed**
1 parent 86baeeb commit 4dce035

File tree

767 files changed

+37454
-32369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

767 files changed

+37454
-32369
lines changed

.gitattributes

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@
88
*.bat text eol=crlf
99

1010
# This allows generated code to be indexed correctly
11-
*.java linguist-generated=false
12-
11+
*.java linguist-generated=false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
**/.speakeasy/temp/
2+
**/.speakeasy/logs/
3+
.speakeasy/reports
4+
.env
5+
.env.local
16
# Ignore Gradle project-specific cache directory
27
.gradle
38
# Ignore Gradle build output directory

.speakeasy/gen.lock

Lines changed: 258 additions & 165 deletions
Large diffs are not rendered by default.

.speakeasy/gen.yaml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,44 @@ generation:
44
maintainOpenAPIOrder: true
55
usageSnippets:
66
optionalPropertyRendering: withExample
7+
sdkInitStyle: constructor
78
useClassNamesForArrayFields: true
89
fixes:
910
nameResolutionDec2023: true
11+
nameResolutionFeb2025: false
1012
parameterOrderingFeb2024: true
1113
requestResponseComponentNamesFeb2024: true
14+
securityFeb2025: false
15+
sharedErrorComponentsApr2025: false
1216
auth:
1317
oAuth2ClientCredentialsEnabled: true
1418
oAuth2PasswordEnabled: false
19+
hoistGlobalSecurity: true
20+
schemas:
21+
allOfMergeStrategy: shallowMerge
22+
tests:
23+
generateTests: true
24+
generateNewTests: false
25+
skipResponseBodyAssertions: false
1526
java:
16-
version: 1.0.0-beta
27+
version: 1.0.0-beta.1
1728
additionalDependencies: []
1829
additionalPlugins:
1930
- id 'org.jreleaser' version '1.15.0'
2031
artifactID: shippo-sdk
32+
baseErrorName: ShippoException
2133
clientServerStatusCodesAsErrors: true
2234
companyEmail: [email protected]
2335
companyName: Shippo
2436
companyURL: www.goshippo.com
2537
defaultErrorName: SDKError
38+
enableCustomCodeRegions: false
39+
enableStreamingUploads: false
2640
externalDocs:
2741
url: https://github.com/goshippo/shippo-java-sdk
2842
version: ""
2943
flattenGlobalSecurity: true
44+
generateSpringBootStarter: true
3045
githubURL: https://github.com/goshippo/shippo-java-sdk
3146
groupID: com.goshippo
3247
imports:
@@ -41,11 +56,13 @@ java:
4156
descriptions: Maven library which integrates with Shippo Multi Carrier Shipping API. This library provides access to Shippo (goshippo.com) API capabilities. Including label generation, rating, tracking and more.
4257
version: ""
4358
inputModelSuffix: input
59+
languageVersion: 11
4460
license:
4561
name: The MIT License (MIT)
4662
shortName: MIT
4763
url: https://mit-license.org/
4864
maxMethodParams: 4
65+
nullFriendlyParameters: false
4966
outputModelSuffix: output
5067
projectName: api
5168
templateVersion: v2

.speakeasy/workflow.lock

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
speakeasyVersion: 1.448.2
1+
speakeasyVersion: 1.637.0
22
sources:
33
my-first-source:
44
sourceNamespace: my-first-source
5-
sourceRevisionDigest: sha256:480494c08f99f68cd119fdb481d81d31d37e4e22211cc6fd8a5197857b7580b4
6-
sourceBlobDigest: sha256:422c969f0c8ded72f1dc9d756407a9d51740270b9d16fd9c4f4a9d50f4e714ba
5+
sourceRevisionDigest: sha256:c7975b03b0e922bd14ceb9f47b00751e5ab098fca449707d2e20845cf7cc50f5
6+
sourceBlobDigest: sha256:38d48412b95b3b5c0ed071f4887b46472950b923b239a773d7830c0ee92c6c14
77
tags:
88
- latest
9+
- speakeasy-sdk-regen-1733703738
910
- "2018-02-08"
1011
targets:
1112
my-first-target:
1213
source: my-first-source
1314
sourceNamespace: my-first-source
14-
sourceRevisionDigest: sha256:480494c08f99f68cd119fdb481d81d31d37e4e22211cc6fd8a5197857b7580b4
15-
sourceBlobDigest: sha256:422c969f0c8ded72f1dc9d756407a9d51740270b9d16fd9c4f4a9d50f4e714ba
15+
sourceRevisionDigest: sha256:c7975b03b0e922bd14ceb9f47b00751e5ab098fca449707d2e20845cf7cc50f5
16+
sourceBlobDigest: sha256:38d48412b95b3b5c0ed071f4887b46472950b923b239a773d7830c0ee92c6c14
1617
codeSamplesNamespace: my-first-source-java-code-samples
17-
codeSamplesRevisionDigest: sha256:2b960672ec02abfbb6692e804ee954c218ece797c765654fab7f71084709ef08
18+
codeSamplesRevisionDigest: sha256:329337d24c9de0e0cd3902dcc398e2f40d8ebacb90d7d4d1ac9c1caed8166159
1819
workflow:
1920
workflowVersion: 1.0.0
2021
speakeasyVersion: latest

.speakeasy/workflow.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ targets:
1212
source: my-first-source
1313
publish:
1414
java:
15-
useSonatypeLegacy: false
1615
ossrhUsername: $ossrh_username
1716
ossrhPassword: $ossrh_password
1817
gpgSecretKey: $java_gpg_secret_key

README.md

Lines changed: 71 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Shippo external API.: Use this API to integrate with the Shippo service
3636
* [Error Handling](#error-handling)
3737
* [Server Selection](#server-selection)
3838
* [Authentication](#authentication)
39+
* [Debugging](#debugging)
3940

4041
<!-- End Table of Contents [toc] -->
4142

@@ -275,24 +276,24 @@ We provide the API and web app for all your shipping needs.<!-- Start Error Hand
275276

276277
Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
277278

278-
By default, an API error will throw a `models/errors/SDKError` exception. When custom error responses are specified for an operation, the SDK may also throw their associated exception. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `initiateOauth2Signin` method throws the following exceptions:
279279

280-
| Error Type | Status Code | Content Type |
281-
| --------------------------------------------------------------------- | ----------- | ---------------- |
282-
| models/errors/InitiateOauth2SigninResponseBody | 400 | application/json |
283-
| models/errors/InitiateOauth2SigninCarrierAccountsResponseBody | 401 | application/json |
284-
| models/errors/InitiateOauth2SigninCarrierAccountsResponseResponseBody | 404 | application/json |
285-
| models/errors/SDKError | 4XX, 5XX | \*/\* |
280+
[`ShippoException`](./src/main/java/models/errors/ShippoException.java) is the base class for all HTTP error responses. It has the following properties:
286281

287-
### Example
282+
| Method | Type | Description |
283+
| ---------------- | --------------------------- | ------------------------------------------------------------------------ |
284+
| `message()` | `String` | Error message |
285+
| `code()` | `int` | HTTP response status code eg `404` |
286+
| `headers` | `Map<String, List<String>>` | HTTP response headers |
287+
| `body()` | `byte[]` | HTTP body as a byte array. Can be empty array if no body is returned. |
288+
| `bodyAsString()` | `String` | HTTP body as a UTF-8 string. Can be empty string if no body is returned. |
289+
| `rawResponse()` | `HttpResponse<?>` | Raw HTTP response (body already read and not available for re-read) |
288290

291+
### Example
289292
```java
290293
package hello.world;
291294

292295
import com.goshippo.shippo_sdk.Shippo;
293-
import com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseBody;
294-
import com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseResponseBody;
295-
import com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninResponseBody;
296+
import com.goshippo.shippo_sdk.models.errors.*;
296297
import com.goshippo.shippo_sdk.models.operations.InitiateOauth2SigninResponse;
297298
import java.lang.Exception;
298299

@@ -301,29 +302,50 @@ public class Application {
301302
public static void main(String[] args) throws InitiateOauth2SigninResponseBody, InitiateOauth2SigninCarrierAccountsResponseBody, InitiateOauth2SigninCarrierAccountsResponseResponseBody, Exception {
302303

303304
Shippo sdk = Shippo.builder()
304-
.apiKeyHeader("<YOUR_API_KEY_HERE>")
305305
.shippoApiVersion("2018-02-08")
306+
.apiKeyHeader(System.getenv().getOrDefault("API_KEY_HEADER", ""))
306307
.build();
307308

308309
InitiateOauth2SigninResponse res = sdk.carrierAccounts().initiateOauth2Signin()
309310
.carrierAccountObjectId("<id>")
310-
.redirectUri("https://enlightened-mortise.com/")
311-
.state("Louisiana")
312-
.shippoApiVersion("2018-02-08")
311+
.redirectUri("https://ashamed-reporter.biz")
313312
.call();
314313

315314
// handle response
316315
}
317316
}
318317
```
318+
319+
### Error Classes
320+
**Primary error:**
321+
* [`ShippoException`](./src/main/java/models/errors/ShippoException.java): The base class for HTTP error responses.
322+
323+
<details><summary>Less common errors (9)</summary>
324+
325+
<br />
326+
327+
**Network errors:**
328+
* `java.io.IOException` (always wrapped by `java.io.UncheckedIOException`). Commonly encountered subclasses of
329+
`IOException` include `java.net.ConnectException`, `java.net.SocketTimeoutException`, `EOFException` (there are
330+
many more subclasses in the JDK platform).
331+
332+
**Inherit from [`ShippoException`](./src/main/java/models/errors/ShippoException.java)**:
333+
* [`com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninResponseBody`](./src/main/java/models/errors/com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninResponseBody.java): Invalid parameters provided by the user. Status code `400`. Applicable to 1 of 70 methods.*
334+
* [`com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseBody`](./src/main/java/models/errors/com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseBody.java): Invalid ShippoToken or unsupported carrier account provided by the user. Status code `401`. Applicable to 1 of 70 methods.*
335+
* [`com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseResponseBody`](./src/main/java/models/errors/com.goshippo.shippo_sdk.models.errors.InitiateOauth2SigninCarrierAccountsResponseResponseBody.java): Invalid carrier account provided by the user. Status code `404`. Applicable to 1 of 70 methods.*
336+
337+
338+
</details>
339+
340+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
319341
<!-- End Error Handling [errors] -->
320342

321343
<!-- Start Server Selection [server] -->
322344
## Server Selection
323345

324346
### Override Server URL Per-Client
325347

326-
The default server can also be overridden globally using the `.serverURL(String serverUrl)` builder method when initializing the SDK client instance. For example:
348+
The default server can be overridden globally using the `.serverURL(String serverUrl)` builder method when initializing the SDK client instance. For example:
327349
```java
328350
package hello.world;
329351

@@ -337,14 +359,13 @@ public class Application {
337359

338360
Shippo sdk = Shippo.builder()
339361
.serverURL("https://api.goshippo.com")
340-
.apiKeyHeader("<YOUR_API_KEY_HERE>")
341362
.shippoApiVersion("2018-02-08")
363+
.apiKeyHeader(System.getenv().getOrDefault("API_KEY_HEADER", ""))
342364
.build();
343365

344366
ListAddressesResponse res = sdk.addresses().list()
345367
.page(1L)
346368
.results(5L)
347-
.shippoApiVersion("2018-02-08")
348369
.call();
349370

350371
if (res.addressPaginatedList().isPresent()) {
@@ -379,14 +400,13 @@ public class Application {
379400
public static void main(String[] args) throws Exception {
380401

381402
Shippo sdk = Shippo.builder()
382-
.apiKeyHeader("<YOUR_API_KEY_HERE>")
403+
.apiKeyHeader(System.getenv().getOrDefault("API_KEY_HEADER", ""))
383404
.shippoApiVersion("2018-02-08")
384405
.build();
385406

386407
ListAddressesResponse res = sdk.addresses().list()
387408
.page(1L)
388409
.results(5L)
389-
.shippoApiVersion("2018-02-08")
390410
.call();
391411

392412
if (res.addressPaginatedList().isPresent()) {
@@ -402,6 +422,37 @@ public class Application {
402422
<!-- No SDK Installation -->
403423
<!-- No SDK Example Usage -->
404424
<!-- No SDK Available Operations -->
425+
<!-- Start Debugging [debug] -->
426+
## Debugging
427+
428+
### Debug
429+
You can setup your SDK to emit debug logs for SDK requests and responses.
430+
431+
For request and response logging (especially json bodies), call `enableHTTPDebugLogging(boolean)` on the SDK builder like so:
432+
```java
433+
SDK.builder()
434+
.enableHTTPDebugLogging(true)
435+
.build();
436+
```
437+
Example output:
438+
```
439+
Sending request: http://localhost:35123/bearer#global GET
440+
Request headers: {Accept=[application/json], Authorization=[******], Client-Level-Header=[added by client], Idempotency-Key=[some-key], x-speakeasy-user-agent=[speakeasy-sdk/java 0.0.1 internal 0.1.0 org.openapis.openapi]}
441+
Received response: (GET http://localhost:35123/bearer#global) 200
442+
Response headers: {access-control-allow-credentials=[true], access-control-allow-origin=[*], connection=[keep-alive], content-length=[50], content-type=[application/json], date=[Wed, 09 Apr 2025 01:43:29 GMT], server=[gunicorn/19.9.0]}
443+
Response body:
444+
{
445+
"authenticated": true,
446+
"token": "global"
447+
}
448+
```
449+
__WARNING__: This should only used for temporary debugging purposes. Leaving this option on in a production system could expose credentials/secrets in logs. <i>Authorization</i> headers are redacted by default and there is the ability to specify redacted header names via `SpeakeasyHTTPClient.setRedactedHeaders`.
450+
451+
__NOTE__: This is a convenience method that calls `HTTPClient.enableDebugLogging()`. The `SpeakeasyHTTPClient` honors this setting. If you are using a custom HTTP client, it is up to the custom client to honor this setting.
452+
453+
Another option is to set the System property `-Djdk.httpclient.HttpClient.log=all`. However, this second option does not log bodies.
454+
<!-- End Debugging [debug] -->
455+
405456
<!-- Placeholder for Future Speakeasy SDK Sections -->
406457

407458

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,14 @@ Based on:
6060
### Generated
6161
- [java v1.0.0-beta.3] .
6262
### Releases
63-
- [Maven Central v1.0.0-beta.3] https://central.sonatype.com/artifact/com.goshippo/sdk/1.0.0-beta.3 - .
63+
- [Maven Central v1.0.0-beta.3] https://central.sonatype.com/artifact/com.goshippo/sdk/1.0.0-beta.3 - .
64+
65+
## 2025-10-20 00:23:57
66+
### Changes
67+
Based on:
68+
- OpenAPI Doc
69+
- Speakeasy CLI 1.637.0 (2.727.4) https://github.com/speakeasy-api/speakeasy
70+
### Generated
71+
- [java v1.0.0-beta.1] .
72+
### Releases
73+
- [Maven Central v1.0.0-beta.1] https://central.sonatype.com/artifact/com.goshippo/shippo-sdk/1.0.0-beta.1 - .

USAGE.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ public class Application {
1111
public static void main(String[] args) throws Exception {
1212

1313
Shippo sdk = Shippo.builder()
14-
.apiKeyHeader("<YOUR_API_KEY_HERE>")
1514
.shippoApiVersion("2018-02-08")
15+
.apiKeyHeader(System.getenv().getOrDefault("API_KEY_HEADER", ""))
1616
.build();
1717

1818
ListAddressesResponse res = sdk.addresses().list()
1919
.page(1L)
2020
.results(5L)
21-
.shippoApiVersion("2018-02-08")
2221
.call();
2322

2423
if (res.addressPaginatedList().isPresent()) {

0 commit comments

Comments
 (0)