Skip to content

Commit 5ec0182

Browse files
SDK regeneration
1 parent 1b7e8e3 commit 5ec0182

File tree

207 files changed

+4373
-4674
lines changed

Some content is hidden

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

207 files changed

+4373
-4674
lines changed

.fern/metadata.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"cliVersion": "2.2.5",
3+
"generatorName": "fernapi/fern-java-sdk",
4+
"generatorVersion": "3.18.8",
5+
"generatorConfig": {
6+
"base-api-exception-class-name": "SquareApiException",
7+
"base-exception-class-name": "SquareException",
8+
"client-class-name": "SquareClient",
9+
"inline-path-parameters": true,
10+
"inline-file-properties": true,
11+
"package-prefix": "com.squareup.square",
12+
"package-layout": "flat",
13+
"enable-forward-compatible-enums": true,
14+
"publish-to": "central"
15+
}
16+
}

README.md

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@
55

66
The Square Java library provides convenient access to the Square APIs from Java.
77

8+
## Table of Contents
9+
10+
- [Requirements](#requirements)
11+
- [Installation](#installation)
12+
- [Usage](#usage)
13+
- [Instantiation](#instantiation)
14+
- [Enums](#enums)
15+
- [Versioning](#versioning)
16+
- [Automatic Pagination](#automatic-pagination)
17+
- [Retries](#retries)
18+
- [Timeouts](#timeouts)
19+
- [Environments](#environments)
20+
- [Base Url](#base-url)
21+
- [Exception Handling](#exception-handling)
22+
- [Webhook Signature Verification](#webhook-signature-verification)
23+
- [Reference](#reference)
24+
- [Legacy Sdk](#legacy-sdk)
25+
- [Advanced](#advanced)
26+
- [Custom Client](#custom-client)
27+
- [Retries](#retries)
28+
- [Timeouts](#timeouts)
29+
- [Custom Headers](#custom-headers)
30+
- [Access Raw Response Data](#access-raw-response-data)
31+
- [Contributing](#contributing)
32+
833
## Requirements
934

1035
Use of the Square Java SDK requires:
@@ -31,7 +56,7 @@ Add the dependency in your `pom.xml` file:
3156
<dependency>
3257
<groupId>com.squareup</groupId>
3358
<artifactId>square</artifactId>
34-
<version>45.1.0.20251016</version>
59+
<version>0.0.540</version>
3560
</dependency>
3661
```
3762

@@ -278,9 +303,9 @@ When the API returns a non-success status code (4xx or 5xx response), an API exc
278303
```java
279304
import com.squareup.square.core.SquareApiException;
280305

281-
try {
306+
try{
282307
client.payments().create(...);
283-
} catch (SquareApiException e) {
308+
} catch (SquareApiException e){
284309
// Do something with the API exception...
285310
}
286311
```
@@ -336,8 +361,8 @@ Gradle:
336361

337362
```groovy
338363
dependencies {
339-
implementation 'com.squareup:square:45.1.0.20251016'
340-
implementation 'com.squareup:square-legacy:45.1.0.20251016'
364+
implementation 'com.squareup:square:0.0.540'
365+
implementation 'com.squareup:square-legacy:0.0.540'
341366
}
342367
```
343368

@@ -347,12 +372,12 @@ Maven:
347372
<dependency>
348373
<groupId>com.squareup</groupId>
349374
<artifactId>square</artifactId>
350-
<version>45.1.0.20251016</version>
375+
<version>0.0.540</version>
351376
</dependency>
352377
<dependency>
353378
<groupId>com.squareup</groupId>
354379
<artifactId>square-legacy</artifactId>
355-
<version>45.1.0.20251016</version>
380+
<version>0.0.540</version>
356381
</dependency>
357382
```
358383

@@ -364,7 +389,7 @@ Maven:
364389

365390
### Custom Client
366391

367-
This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one.
392+
This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one.
368393
However, you can pass your own client like so:
369394

370395
```java
@@ -383,7 +408,9 @@ SquareClient client = SquareClient
383408

384409
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
385410
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
386-
retry limit (default: 2).
411+
retry limit (default: 2). Before defaulting to exponential backoff, the SDK will first attempt to respect
412+
the `Retry-After` header (as either in seconds or as an HTTP date), and then the `X-RateLimit-Reset` header
413+
(as a Unix timestamp in epoch seconds); failing both of those, it will fall back to exponential backoff.
387414

388415
A request is deemed retryable when any of the following HTTP status codes is returned:
389416

@@ -452,6 +479,19 @@ client.payments().create(
452479
);
453480
```
454481

482+
### Access Raw Response Data
483+
484+
The SDK provides access to raw response data, including headers, through the `withRawResponse()` method.
485+
The `withRawResponse()` method returns a raw client that wraps all responses with `body()` and `headers()` methods.
486+
(A normal client's `response` is identical to a raw client's `response.body()`.)
487+
488+
```java
489+
CreateHttpResponse response = client.payments().withRawResponse().create(...);
490+
491+
System.out.println(response.body());
492+
System.out.println(response.headers().get("X-My-Header"));
493+
```
494+
455495
## Contributing
456496

457497
While we value open-source contributions to this SDK, this library is generated programmatically.

build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ repositories {
1414
}
1515

1616
dependencies {
17-
api 'com.squareup.okhttp3:okhttp:4.12.0'
18-
api 'com.fasterxml.jackson.core:jackson-databind:2.17.2'
19-
api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.17.2'
20-
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.2'
17+
api 'com.squareup.okhttp3:okhttp:5.2.1'
18+
api 'com.fasterxml.jackson.core:jackson-databind:2.18.2'
19+
api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.2'
20+
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.2'
2121
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
2222
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
2323
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.8.2'
@@ -47,7 +47,7 @@ java {
4747

4848
group = 'com.squareup'
4949

50-
version = '45.1.0.20251016'
50+
version = '0.0.540'
5151

5252
jar {
5353
dependsOn(":generatePomFileForMavenPublication")
@@ -78,7 +78,7 @@ publishing {
7878
maven(MavenPublication) {
7979
groupId = 'com.squareup'
8080
artifactId = 'square'
81-
version = '45.1.0.20251016'
81+
version = '0.0.540'
8282
from components.java
8383
pom {
8484
name = 'square'

0 commit comments

Comments
 (0)