Skip to content

Commit 31ccb60

Browse files
SDK regeneration
1 parent a0b32d6 commit 31ccb60

File tree

1,087 files changed

+195085
-1
lines changed

Some content is hidden

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

1,087 files changed

+195085
-1
lines changed

.fern/metadata.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"cliVersion": "3.55.7",
3+
"generatorName": "fernapi/fern-java-sdk",
4+
"generatorVersion": "3.24.1",
5+
"generatorConfig": {
6+
"client-class-name": "IcePanelClient",
7+
"publish-to": "central"
8+
}
9+
}

.fernignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Specify files that shouldn't be modified by Fern

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: ci
2+
3+
on: [push]
4+
5+
jobs:
6+
compile:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout repo
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Java
14+
id: setup-jre
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: "11"
18+
architecture: x64
19+
20+
- name: Compile
21+
run: ./gradlew compileJava
22+
23+
test:
24+
needs: [ compile ]
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout repo
28+
uses: actions/checkout@v4
29+
30+
- name: Set up Java
31+
id: setup-jre
32+
uses: actions/setup-java@v1
33+
with:
34+
java-version: "11"
35+
architecture: x64
36+
37+
- name: Test
38+
run: ./gradlew test
39+
publish:
40+
needs: [ compile, test ]
41+
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
42+
runs-on: ubuntu-latest
43+
44+
steps:
45+
- name: Checkout repo
46+
uses: actions/checkout@v4
47+
48+
- name: Set up Java
49+
id: setup-jre
50+
uses: actions/setup-java@v1
51+
with:
52+
java-version: "11"
53+
architecture: x64
54+
55+
- name: Publish to maven
56+
run: |
57+
./gradlew publish
58+
env:
59+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
60+
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
61+
MAVEN_PUBLISH_REGISTRY_URL: "https://s01.oss.sonatype.org/content/repositories/releases/"

.gitignore

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
*.class
2+
.project
3+
.gradle
4+
?
5+
.classpath
6+
.checkstyle
7+
.settings
8+
.node
9+
build
10+
11+
# IntelliJ
12+
*.iml
13+
*.ipr
14+
*.iws
15+
.idea/
16+
out/
17+
18+
# Eclipse/IntelliJ APT
19+
generated_src/
20+
generated_testSrc/
21+
generated/
22+
23+
bin
24+
build

.publish/prepare.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Write key ring file
2+
echo "$MAVEN_SIGNATURE_SECRET_KEY" > armored_key.asc
3+
gpg -o publish_key.gpg --dearmor armored_key.asc
4+
5+
# Generate gradle.properties file
6+
echo "signing.keyId=$MAVEN_SIGNATURE_KID" > gradle.properties
7+
echo "signing.secretKeyRingFile=publish_key.gpg" >> gradle.properties
8+
echo "signing.password=$MAVEN_SIGNATURE_PASSWORD" >> gradle.properties

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2026 Icepanel.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 206 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,206 @@
1-
# icepanel-java
1+
# IcePanel Java Library
2+
3+
[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-Built%20with%20Fern-brightgreen)](https://buildwithfern.com?utm_source=github&utm_medium=github&utm_campaign=readme&utm_source=https%3A%2F%2Fgithub.com%2FIcePanel%2Ficepanel-java)
4+
[![Maven Central](https://img.shields.io/maven-central/v/com.icepanel/sdk)](https://central.sonatype.com/artifact/com.icepanel/sdk)
5+
6+
The IcePanel Java library provides convenient access to the IcePanel APIs from Java.
7+
8+
## Table of Contents
9+
10+
- [Installation](#installation)
11+
- [Reference](#reference)
12+
- [Environments](#environments)
13+
- [Base Url](#base-url)
14+
- [Exception Handling](#exception-handling)
15+
- [Advanced](#advanced)
16+
- [Custom Client](#custom-client)
17+
- [Retries](#retries)
18+
- [Timeouts](#timeouts)
19+
- [Custom Headers](#custom-headers)
20+
- [Access Raw Response Data](#access-raw-response-data)
21+
- [Contributing](#contributing)
22+
23+
## Installation
24+
25+
### Gradle
26+
27+
Add the dependency in your `build.gradle` file:
28+
29+
```groovy
30+
dependencies {
31+
implementation 'com.icepanel:sdk'
32+
}
33+
```
34+
35+
### Maven
36+
37+
Add the dependency in your `pom.xml` file:
38+
39+
```xml
40+
<dependency>
41+
<groupId>com.icepanel</groupId>
42+
<artifactId>sdk</artifactId>
43+
<version>0.0.440</version>
44+
</dependency>
45+
```
46+
47+
## Reference
48+
49+
A full reference for this library is available [here](https://github.com/IcePanel/icepanel-java/blob/HEAD/./reference.md).
50+
51+
## Environments
52+
53+
This SDK allows you to configure different environments for API requests.
54+
55+
```java
56+
import com.icepanel.api.IcePanelClient;
57+
import com.icepanel.api.core.Environment;
58+
59+
IcePanelClient client = IcePanelClient
60+
.builder()
61+
.environment(Environment.v1)
62+
.build();
63+
```
64+
65+
## Base Url
66+
67+
You can set a custom base URL when constructing the client.
68+
69+
```java
70+
import com.icepanel.api.IcePanelClient;
71+
72+
IcePanelClient client = IcePanelClient
73+
.builder()
74+
.url("https://example.com")
75+
.build();
76+
```
77+
78+
## Exception Handling
79+
80+
When the API returns a non-success status code (4xx or 5xx response), an API exception will be thrown.
81+
82+
```java
83+
import com.icepanel.api.core.IcepanelApiApiException;
84+
85+
try{
86+
client.model().objects().list(...);
87+
} catch (IcepanelApiApiException e){
88+
// Do something with the API exception...
89+
}
90+
```
91+
92+
## Advanced
93+
94+
### Custom Client
95+
96+
This SDK is built to work with any instance of `OkHttpClient`. By default, if no client is provided, the SDK will construct one.
97+
However, you can pass your own client like so:
98+
99+
```java
100+
import com.icepanel.api.IcePanelClient;
101+
import okhttp3.OkHttpClient;
102+
103+
OkHttpClient customClient = ...;
104+
105+
IcePanelClient client = IcePanelClient
106+
.builder()
107+
.httpClient(customClient)
108+
.build();
109+
```
110+
111+
### Retries
112+
113+
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long
114+
as the request is deemed retryable and the number of retry attempts has not grown larger than the configured
115+
retry limit (default: 2). Before defaulting to exponential backoff, the SDK will first attempt to respect
116+
the `Retry-After` header (as either in seconds or as an HTTP date), and then the `X-RateLimit-Reset` header
117+
(as a Unix timestamp in epoch seconds); failing both of those, it will fall back to exponential backoff.
118+
119+
A request is deemed retryable when any of the following HTTP status codes is returned:
120+
121+
- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout)
122+
- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests)
123+
- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors)
124+
125+
Use the `maxRetries` client option to configure this behavior.
126+
127+
```java
128+
import com.icepanel.api.IcePanelClient;
129+
130+
IcePanelClient client = IcePanelClient
131+
.builder()
132+
.maxRetries(1)
133+
.build();
134+
```
135+
136+
### Timeouts
137+
138+
The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level.
139+
```java
140+
import com.icepanel.api.IcePanelClient;
141+
import com.icepanel.api.core.RequestOptions;
142+
143+
// Client level
144+
IcePanelClient client = IcePanelClient
145+
.builder()
146+
.timeout(60)
147+
.build();
148+
149+
// Request level
150+
client.model().objects().list(
151+
...,
152+
RequestOptions
153+
.builder()
154+
.timeout(60)
155+
.build()
156+
);
157+
```
158+
159+
### Custom Headers
160+
161+
The SDK allows you to add custom headers to requests. You can configure headers at the client level or at the request level.
162+
163+
```java
164+
import com.icepanel.api.IcePanelClient;
165+
import com.icepanel.api.core.RequestOptions;
166+
167+
// Client level
168+
IcePanelClient client = IcePanelClient
169+
.builder()
170+
.addHeader("X-Custom-Header", "custom-value")
171+
.addHeader("X-Request-Id", "abc-123")
172+
.build();
173+
;
174+
175+
// Request level
176+
client.model().objects().list(
177+
...,
178+
RequestOptions
179+
.builder()
180+
.addHeader("X-Request-Header", "request-value")
181+
.build()
182+
);
183+
```
184+
185+
### Access Raw Response Data
186+
187+
The SDK provides access to raw response data, including headers, through the `withRawResponse()` method.
188+
The `withRawResponse()` method returns a raw client that wraps all responses with `body()` and `headers()` methods.
189+
(A normal client's `response` is identical to a raw client's `response.body()`.)
190+
191+
```java
192+
ListHttpResponse response = client.model().objects().withRawResponse().list(...);
193+
194+
System.out.println(response.body());
195+
System.out.println(response.headers().get("X-My-Header"));
196+
```
197+
198+
## Contributing
199+
200+
While we value open-source contributions to this SDK, this library is generated programmatically.
201+
Additions made directly to this library would have to be moved over to our generation code,
202+
otherwise they would be overwritten upon the next generated release. Feel free to open a PR as
203+
a proof of concept, but know that we will not be able to merge it as-is. We suggest opening
204+
an issue first to discuss with us!
205+
206+
On the other hand, contributions to the README are always very welcome!

0 commit comments

Comments
 (0)