Skip to content

Commit 0003100

Browse files
cloudpdf-sdk-release[bot]cloudpdf-sdk-bot
andauthored
chore: generate CloudPDF Java SDK 3.0.0-alpha.22 (#24)
Co-authored-by: cloudpdf-sdk-bot <hello@cloudpdf.com>
1 parent 9c4b834 commit 0003100

111 files changed

Lines changed: 4710 additions & 3289 deletions

File tree

Some content is hidden

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

‎.fern/metadata.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"base-exception-class-name": "CloudPDFException",
1111
"base-api-exception-class-name": "CloudPDFApiException"
1212
},
13-
"originGitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
13+
"originGitCommit": "ce65e1390549db1272ac3720a5ddfcea55be2c07",
1414
"originGitCommitIsDirty": false,
1515
"invokedBy": "ci",
16-
"requestedVersion": "3.0.0-alpha.21",
16+
"requestedVersion": "3.0.0-alpha.22",
1717
"ciProvider": "github"
1818
}

‎build.gradle‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ java {
4646

4747
group = 'com.cloudpdf'
4848

49-
version = '3.0.0-alpha.21'
49+
version = '3.0.0-alpha.22'
5050

5151
jar {
5252
dependsOn(":generatePomFileForMavenPublication")
@@ -73,7 +73,7 @@ publishing {
7373
maven(MavenPublication) {
7474
groupId = 'com.cloudpdf'
7575
artifactId = 'sdk'
76-
version = '3.0.0-alpha.21'
76+
version = '3.0.0-alpha.22'
7777
from components.java
7878
pom {
7979
name = 'CloudPDF'

‎cloudpdf-generation.json‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"language": "java",
3-
"canonicalVersion": "3.0.0-next.21",
4-
"sdkVersion": "3.0.0-alpha.21",
3+
"canonicalVersion": "3.0.0-next.22",
4+
"sdkVersion": "3.0.0-alpha.22",
55
"source": {
66
"repository": "embedpdf/embed-pdf-viewer",
77
"openapi": "cloudpdf/contract/openapi.json",
8-
"openapiSha256": "f85648401f5c683a32e2b50acc3d753df9f4ce06df8492e5d2b599beceb0e788",
9-
"gitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
8+
"openapiSha256": "1f5aa976eec4d5fc4e2b22efe725df58a01389896733ec1870f96a6441b62859",
9+
"gitCommit": "ce65e1390549db1272ac3720a5ddfcea55be2c07",
1010
"gitCommitIsDirty": false
1111
},
1212
"fern": {

‎reference.md‎

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,45 @@ client.deployment().licenseStatus();
2121
</dl>
2222

2323

24+
</dd>
25+
</dl>
26+
</details>
27+
28+
<details><summary><code>client.deployment.modules() -> DeploymentModulesResponse</code></summary>
29+
<dl>
30+
<dd>
31+
32+
#### 📝 Description
33+
34+
<dl>
35+
<dd>
36+
37+
<dl>
38+
<dd>
39+
40+
What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their `features` (`tenants.get`); what it costs, if anything, is the operator's.
41+
</dd>
42+
</dl>
43+
</dd>
44+
</dl>
45+
46+
#### 🔌 Usage
47+
48+
<dl>
49+
<dd>
50+
51+
<dl>
52+
<dd>
53+
54+
```java
55+
client.deployment().modules();
56+
```
57+
</dd>
58+
</dl>
59+
</dd>
60+
</dl>
61+
62+
2463
</dd>
2564
</dl>
2665
</details>
@@ -1659,6 +1698,22 @@ client.tenants().usage(
16591698

16601699
**period:** `Optional<String>`
16611700

1701+
</dd>
1702+
</dl>
1703+
1704+
<dl>
1705+
<dd>
1706+
1707+
**from:** `Optional<String>`
1708+
1709+
</dd>
1710+
</dl>
1711+
1712+
<dl>
1713+
<dd>
1714+
1715+
**to:** `Optional<String>`
1716+
16621717
</dd>
16631718
</dl>
16641719
</dd>

‎src/main/java/api/core/ClientOptions.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private ClientOptions(
4949
{
5050
put("X-Fern-Language", "JAVA");
5151
put("X-Fern-SDK-Name", "com.cloudpdf:sdk");
52-
put("X-Fern-SDK-Version", "3.0.0-alpha.21");
52+
put("X-Fern-SDK-Version", "3.0.0-alpha.22");
5353
}
5454
});
5555
this.headerSuppliers = headerSuppliers;

‎src/main/java/api/resources/deployment/AsyncDeploymentClient.java‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.cloudpdf.api.core.ClientOptions;
77
import com.cloudpdf.api.core.RequestOptions;
88
import com.cloudpdf.api.types.DeploymentLicenseStatusResponse;
9+
import com.cloudpdf.api.types.DeploymentModulesResponse;
910
import java.util.concurrent.CompletableFuture;
1011

1112
public class AsyncDeploymentClient {
@@ -32,4 +33,18 @@ public CompletableFuture<DeploymentLicenseStatusResponse> licenseStatus() {
3233
public CompletableFuture<DeploymentLicenseStatusResponse> licenseStatus(RequestOptions requestOptions) {
3334
return this.rawClient.licenseStatus(requestOptions).thenApply(response -> response.body());
3435
}
36+
37+
/**
38+
* What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their <code>features</code> (<code>tenants.get</code>); what it costs, if anything, is the operator's.
39+
*/
40+
public CompletableFuture<DeploymentModulesResponse> modules() {
41+
return this.rawClient.modules().thenApply(response -> response.body());
42+
}
43+
44+
/**
45+
* What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their <code>features</code> (<code>tenants.get</code>); what it costs, if anything, is the operator's.
46+
*/
47+
public CompletableFuture<DeploymentModulesResponse> modules(RequestOptions requestOptions) {
48+
return this.rawClient.modules(requestOptions).thenApply(response -> response.body());
49+
}
3550
}

‎src/main/java/api/resources/deployment/AsyncRawDeploymentClient.java‎

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.cloudpdf.api.core.RequestOptions;
1212
import com.cloudpdf.api.core.RetryInterceptor;
1313
import com.cloudpdf.api.types.DeploymentLicenseStatusResponse;
14+
import com.cloudpdf.api.types.DeploymentModulesResponse;
1415
import com.fasterxml.jackson.core.JsonProcessingException;
1516
import java.io.IOException;
1617
import java.util.concurrent.CompletableFuture;
@@ -97,4 +98,76 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
9798
});
9899
return future;
99100
}
101+
102+
/**
103+
* What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their <code>features</code> (<code>tenants.get</code>); what it costs, if anything, is the operator's.
104+
*/
105+
public CompletableFuture<CloudPDFClientHttpResponse<DeploymentModulesResponse>> modules() {
106+
return modules(null);
107+
}
108+
109+
/**
110+
* What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their <code>features</code> (<code>tenants.get</code>); what it costs, if anything, is the operator's.
111+
*/
112+
public CompletableFuture<CloudPDFClientHttpResponse<DeploymentModulesResponse>> modules(
113+
RequestOptions requestOptions) {
114+
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
115+
.newBuilder()
116+
.addPathSegments("v1/deployment/modules");
117+
if (requestOptions != null) {
118+
requestOptions.getQueryParameters().forEach((_key, _value) -> {
119+
httpUrl.addQueryParameter(_key, _value);
120+
});
121+
}
122+
Request okhttpRequest = new Request.Builder()
123+
.url(httpUrl.build())
124+
.method("GET", null)
125+
.headers(Headers.of(clientOptions.headers(requestOptions)))
126+
.addHeader("Accept", "application/json")
127+
.build();
128+
OkHttpClient client = clientOptions.httpClient();
129+
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
130+
client = clientOptions.httpClientWithTimeout(requestOptions);
131+
}
132+
if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
133+
okhttpRequest = okhttpRequest
134+
.newBuilder()
135+
.tag(
136+
RetryInterceptor.MaxRetriesOverride.class,
137+
new RetryInterceptor.MaxRetriesOverride(
138+
requestOptions.getMaxRetries().get()))
139+
.build();
140+
}
141+
CompletableFuture<CloudPDFClientHttpResponse<DeploymentModulesResponse>> future = new CompletableFuture<>();
142+
client.newCall(okhttpRequest).enqueue(new Callback() {
143+
@Override
144+
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
145+
try (ResponseBody responseBody = response.body()) {
146+
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
147+
if (response.isSuccessful()) {
148+
future.complete(new CloudPDFClientHttpResponse<>(
149+
ObjectMappers.JSON_MAPPER.readValue(
150+
responseBodyString, DeploymentModulesResponse.class),
151+
response));
152+
return;
153+
}
154+
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
155+
future.completeExceptionally(new CloudPDFApiException(
156+
"Error with status code " + response.code(), response.code(), errorBody, response));
157+
return;
158+
} catch (JsonProcessingException e) {
159+
future.completeExceptionally(
160+
new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e));
161+
} catch (IOException e) {
162+
future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e));
163+
}
164+
}
165+
166+
@Override
167+
public void onFailure(@NotNull Call call, @NotNull IOException e) {
168+
future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e));
169+
}
170+
});
171+
return future;
172+
}
100173
}

‎src/main/java/api/resources/deployment/DeploymentClient.java‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.cloudpdf.api.core.ClientOptions;
77
import com.cloudpdf.api.core.RequestOptions;
88
import com.cloudpdf.api.types.DeploymentLicenseStatusResponse;
9+
import com.cloudpdf.api.types.DeploymentModulesResponse;
910

1011
public class DeploymentClient {
1112
protected final ClientOptions clientOptions;
@@ -31,4 +32,18 @@ public DeploymentLicenseStatusResponse licenseStatus() {
3132
public DeploymentLicenseStatusResponse licenseStatus(RequestOptions requestOptions) {
3233
return this.rawClient.licenseStatus(requestOptions).body();
3334
}
35+
36+
/**
37+
* What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their <code>features</code> (<code>tenants.get</code>); what it costs, if anything, is the operator's.
38+
*/
39+
public DeploymentModulesResponse modules() {
40+
return this.rawClient.modules().body();
41+
}
42+
43+
/**
44+
* What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their <code>features</code> (<code>tenants.get</code>); what it costs, if anything, is the operator's.
45+
*/
46+
public DeploymentModulesResponse modules(RequestOptions requestOptions) {
47+
return this.rawClient.modules(requestOptions).body();
48+
}
3449
}

‎src/main/java/api/resources/deployment/RawDeploymentClient.java‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import com.cloudpdf.api.core.RequestOptions;
1212
import com.cloudpdf.api.core.RetryInterceptor;
1313
import com.cloudpdf.api.types.DeploymentLicenseStatusResponse;
14+
import com.cloudpdf.api.types.DeploymentModulesResponse;
1415
import com.fasterxml.jackson.core.JsonProcessingException;
1516
import java.io.IOException;
1617
import okhttp3.Headers;
@@ -76,4 +77,60 @@ public CloudPDFClientHttpResponse<DeploymentLicenseStatusResponse> licenseStatus
7677
throw new CloudPDFException("Network error executing HTTP request", e);
7778
}
7879
}
80+
81+
/**
82+
* What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their <code>features</code> (<code>tenants.get</code>); what it costs, if anything, is the operator's.
83+
*/
84+
public CloudPDFClientHttpResponse<DeploymentModulesResponse> modules() {
85+
return modules(null);
86+
}
87+
88+
/**
89+
* What each module declares, for a dashboard or a script that lists modules, offers their permissions in its dialogs and shows their meters. Which tenants may use one is in their <code>features</code> (<code>tenants.get</code>); what it costs, if anything, is the operator's.
90+
*/
91+
public CloudPDFClientHttpResponse<DeploymentModulesResponse> modules(RequestOptions requestOptions) {
92+
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
93+
.newBuilder()
94+
.addPathSegments("v1/deployment/modules");
95+
if (requestOptions != null) {
96+
requestOptions.getQueryParameters().forEach((_key, _value) -> {
97+
httpUrl.addQueryParameter(_key, _value);
98+
});
99+
}
100+
Request okhttpRequest = new Request.Builder()
101+
.url(httpUrl.build())
102+
.method("GET", null)
103+
.headers(Headers.of(clientOptions.headers(requestOptions)))
104+
.addHeader("Accept", "application/json")
105+
.build();
106+
OkHttpClient client = clientOptions.httpClient();
107+
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
108+
client = clientOptions.httpClientWithTimeout(requestOptions);
109+
}
110+
if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
111+
okhttpRequest = okhttpRequest
112+
.newBuilder()
113+
.tag(
114+
RetryInterceptor.MaxRetriesOverride.class,
115+
new RetryInterceptor.MaxRetriesOverride(
116+
requestOptions.getMaxRetries().get()))
117+
.build();
118+
}
119+
try (Response response = client.newCall(okhttpRequest).execute()) {
120+
ResponseBody responseBody = response.body();
121+
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
122+
if (response.isSuccessful()) {
123+
return new CloudPDFClientHttpResponse<>(
124+
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DeploymentModulesResponse.class),
125+
response);
126+
}
127+
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
128+
throw new CloudPDFApiException(
129+
"Error with status code " + response.code(), response.code(), errorBody, response);
130+
} catch (JsonProcessingException e) {
131+
throw new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e);
132+
} catch (IOException e) {
133+
throw new CloudPDFException("Network error executing HTTP request", e);
134+
}
135+
}
79136
}

‎src/main/java/api/resources/tenants/AsyncRawTenantsClient.java‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,13 @@ public CompletableFuture<CloudPDFClientHttpResponse<TenantsUsage200Response>> us
717717
QueryStringMapper.addQueryParameter(
718718
httpUrl, "period", request.getPeriod().get(), false);
719719
}
720+
if (request.getFrom().isPresent()) {
721+
QueryStringMapper.addQueryParameter(
722+
httpUrl, "from", request.getFrom().get(), false);
723+
}
724+
if (request.getTo().isPresent()) {
725+
QueryStringMapper.addQueryParameter(httpUrl, "to", request.getTo().get(), false);
726+
}
720727
if (requestOptions != null) {
721728
requestOptions.getQueryParameters().forEach((_key, _value) -> {
722729
httpUrl.addQueryParameter(_key, _value);

0 commit comments

Comments
 (0)