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
4 changes: 2 additions & 2 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"base-exception-class-name": "CloudPDFException",
"base-api-exception-class-name": "CloudPDFApiException"
},
"originGitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
"originGitCommit": "ce65e1390549db1272ac3720a5ddfcea55be2c07",
"originGitCommitIsDirty": false,
"invokedBy": "ci",
"requestedVersion": "3.0.0-alpha.21",
"requestedVersion": "3.0.0-alpha.22",
"ciProvider": "github"
}
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ java {

group = 'com.cloudpdf'

version = '3.0.0-alpha.21'
version = '3.0.0-alpha.22'

jar {
dependsOn(":generatePomFileForMavenPublication")
Expand All @@ -73,7 +73,7 @@ publishing {
maven(MavenPublication) {
groupId = 'com.cloudpdf'
artifactId = 'sdk'
version = '3.0.0-alpha.21'
version = '3.0.0-alpha.22'
from components.java
pom {
name = 'CloudPDF'
Expand Down
8 changes: 4 additions & 4 deletions cloudpdf-generation.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"language": "java",
"canonicalVersion": "3.0.0-next.21",
"sdkVersion": "3.0.0-alpha.21",
"canonicalVersion": "3.0.0-next.22",
"sdkVersion": "3.0.0-alpha.22",
"source": {
"repository": "embedpdf/embed-pdf-viewer",
"openapi": "cloudpdf/contract/openapi.json",
"openapiSha256": "f85648401f5c683a32e2b50acc3d753df9f4ce06df8492e5d2b599beceb0e788",
"gitCommit": "3283147ded32fc15c426768f75557a4d95943d84",
"openapiSha256": "1f5aa976eec4d5fc4e2b22efe725df58a01389896733ec1870f96a6441b62859",
"gitCommit": "ce65e1390549db1272ac3720a5ddfcea55be2c07",
"gitCommitIsDirty": false
},
"fern": {
Expand Down
55 changes: 55 additions & 0 deletions reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,45 @@ client.deployment().licenseStatus();
</dl>


</dd>
</dl>
</details>

<details><summary><code>client.deployment.modules() -> DeploymentModulesResponse</code></summary>
<dl>
<dd>

#### 📝 Description

<dl>
<dd>

<dl>
<dd>

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.
</dd>
</dl>
</dd>
</dl>

#### 🔌 Usage

<dl>
<dd>

<dl>
<dd>

```java
client.deployment().modules();
```
</dd>
</dl>
</dd>
</dl>


</dd>
</dl>
</details>
Expand Down Expand Up @@ -1659,6 +1698,22 @@ client.tenants().usage(

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

</dd>
</dl>

<dl>
<dd>

**from:** `Optional<String>`

</dd>
</dl>

<dl>
<dd>

**to:** `Optional<String>`

</dd>
</dl>
</dd>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/api/core/ClientOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private ClientOptions(
{
put("X-Fern-Language", "JAVA");
put("X-Fern-SDK-Name", "com.cloudpdf:sdk");
put("X-Fern-SDK-Version", "3.0.0-alpha.21");
put("X-Fern-SDK-Version", "3.0.0-alpha.22");
}
});
this.headerSuppliers = headerSuppliers;
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/api/resources/deployment/AsyncDeploymentClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.cloudpdf.api.core.ClientOptions;
import com.cloudpdf.api.core.RequestOptions;
import com.cloudpdf.api.types.DeploymentLicenseStatusResponse;
import com.cloudpdf.api.types.DeploymentModulesResponse;
import java.util.concurrent.CompletableFuture;

public class AsyncDeploymentClient {
Expand All @@ -32,4 +33,18 @@ public CompletableFuture<DeploymentLicenseStatusResponse> licenseStatus() {
public CompletableFuture<DeploymentLicenseStatusResponse> licenseStatus(RequestOptions requestOptions) {
return this.rawClient.licenseStatus(requestOptions).thenApply(response -> response.body());
}

/**
* 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.
*/
public CompletableFuture<DeploymentModulesResponse> modules() {
return this.rawClient.modules().thenApply(response -> response.body());
}

/**
* 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.
*/
public CompletableFuture<DeploymentModulesResponse> modules(RequestOptions requestOptions) {
return this.rawClient.modules(requestOptions).thenApply(response -> response.body());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.cloudpdf.api.core.RequestOptions;
import com.cloudpdf.api.core.RetryInterceptor;
import com.cloudpdf.api.types.DeploymentLicenseStatusResponse;
import com.cloudpdf.api.types.DeploymentModulesResponse;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
Expand Down Expand Up @@ -97,4 +98,76 @@ public void onFailure(@NotNull Call call, @NotNull IOException e) {
});
return future;
}

/**
* 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.
*/
public CompletableFuture<CloudPDFClientHttpResponse<DeploymentModulesResponse>> modules() {
return modules(null);
}

/**
* 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.
*/
public CompletableFuture<CloudPDFClientHttpResponse<DeploymentModulesResponse>> modules(
RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v1/deployment/modules");
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
});
}
Request okhttpRequest = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
okhttpRequest = okhttpRequest
.newBuilder()
.tag(
RetryInterceptor.MaxRetriesOverride.class,
new RetryInterceptor.MaxRetriesOverride(
requestOptions.getMaxRetries().get()))
.build();
}
CompletableFuture<CloudPDFClientHttpResponse<DeploymentModulesResponse>> future = new CompletableFuture<>();
client.newCall(okhttpRequest).enqueue(new Callback() {
@Override
public void onResponse(@NotNull Call call, @NotNull Response response) throws IOException {
try (ResponseBody responseBody = response.body()) {
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
if (response.isSuccessful()) {
future.complete(new CloudPDFClientHttpResponse<>(
ObjectMappers.JSON_MAPPER.readValue(
responseBodyString, DeploymentModulesResponse.class),
response));
return;
}
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
future.completeExceptionally(new CloudPDFApiException(
"Error with status code " + response.code(), response.code(), errorBody, response));
return;
} catch (JsonProcessingException e) {
future.completeExceptionally(
new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e));
} catch (IOException e) {
future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e));
}
}

@Override
public void onFailure(@NotNull Call call, @NotNull IOException e) {
future.completeExceptionally(new CloudPDFException("Network error executing HTTP request", e));
}
});
return future;
}
}
15 changes: 15 additions & 0 deletions src/main/java/api/resources/deployment/DeploymentClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.cloudpdf.api.core.ClientOptions;
import com.cloudpdf.api.core.RequestOptions;
import com.cloudpdf.api.types.DeploymentLicenseStatusResponse;
import com.cloudpdf.api.types.DeploymentModulesResponse;

public class DeploymentClient {
protected final ClientOptions clientOptions;
Expand All @@ -31,4 +32,18 @@ public DeploymentLicenseStatusResponse licenseStatus() {
public DeploymentLicenseStatusResponse licenseStatus(RequestOptions requestOptions) {
return this.rawClient.licenseStatus(requestOptions).body();
}

/**
* 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.
*/
public DeploymentModulesResponse modules() {
return this.rawClient.modules().body();
}

/**
* 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.
*/
public DeploymentModulesResponse modules(RequestOptions requestOptions) {
return this.rawClient.modules(requestOptions).body();
}
}
57 changes: 57 additions & 0 deletions src/main/java/api/resources/deployment/RawDeploymentClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.cloudpdf.api.core.RequestOptions;
import com.cloudpdf.api.core.RetryInterceptor;
import com.cloudpdf.api.types.DeploymentLicenseStatusResponse;
import com.cloudpdf.api.types.DeploymentModulesResponse;
import com.fasterxml.jackson.core.JsonProcessingException;
import java.io.IOException;
import okhttp3.Headers;
Expand Down Expand Up @@ -76,4 +77,60 @@ public CloudPDFClientHttpResponse<DeploymentLicenseStatusResponse> licenseStatus
throw new CloudPDFException("Network error executing HTTP request", e);
}
}

/**
* 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.
*/
public CloudPDFClientHttpResponse<DeploymentModulesResponse> modules() {
return modules(null);
}

/**
* 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.
*/
public CloudPDFClientHttpResponse<DeploymentModulesResponse> modules(RequestOptions requestOptions) {
HttpUrl.Builder httpUrl = HttpUrl.parse(this.clientOptions.environment().getUrl())
.newBuilder()
.addPathSegments("v1/deployment/modules");
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
});
}
Request okhttpRequest = new Request.Builder()
.url(httpUrl.build())
.method("GET", null)
.headers(Headers.of(clientOptions.headers(requestOptions)))
.addHeader("Accept", "application/json")
.build();
OkHttpClient client = clientOptions.httpClient();
if (requestOptions != null && requestOptions.getTimeout().isPresent()) {
client = clientOptions.httpClientWithTimeout(requestOptions);
}
if (requestOptions != null && requestOptions.getMaxRetries().isPresent()) {
okhttpRequest = okhttpRequest
.newBuilder()
.tag(
RetryInterceptor.MaxRetriesOverride.class,
new RetryInterceptor.MaxRetriesOverride(
requestOptions.getMaxRetries().get()))
.build();
}
try (Response response = client.newCall(okhttpRequest).execute()) {
ResponseBody responseBody = response.body();
String responseBodyString = responseBody != null ? responseBody.string() : "{}";
if (response.isSuccessful()) {
return new CloudPDFClientHttpResponse<>(
ObjectMappers.JSON_MAPPER.readValue(responseBodyString, DeploymentModulesResponse.class),
response);
}
Object errorBody = ObjectMappers.parseErrorBody(responseBodyString);
throw new CloudPDFApiException(
"Error with status code " + response.code(), response.code(), errorBody, response);
} catch (JsonProcessingException e) {
throw new CloudPDFException("Failed to deserialize response: " + e.getMessage(), e);
} catch (IOException e) {
throw new CloudPDFException("Network error executing HTTP request", e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,13 @@ public CompletableFuture<CloudPDFClientHttpResponse<TenantsUsage200Response>> us
QueryStringMapper.addQueryParameter(
httpUrl, "period", request.getPeriod().get(), false);
}
if (request.getFrom().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "from", request.getFrom().get(), false);
}
if (request.getTo().isPresent()) {
QueryStringMapper.addQueryParameter(httpUrl, "to", request.getTo().get(), false);
}
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/api/resources/tenants/RawTenantsClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,13 @@ public CloudPDFClientHttpResponse<TenantsUsage200Response> usage(
QueryStringMapper.addQueryParameter(
httpUrl, "period", request.getPeriod().get(), false);
}
if (request.getFrom().isPresent()) {
QueryStringMapper.addQueryParameter(
httpUrl, "from", request.getFrom().get(), false);
}
if (request.getTo().isPresent()) {
QueryStringMapper.addQueryParameter(httpUrl, "to", request.getTo().get(), false);
}
if (requestOptions != null) {
requestOptions.getQueryParameters().forEach((_key, _value) -> {
httpUrl.addQueryParameter(_key, _value);
Expand Down
Loading
Loading