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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 4 additions & 1 deletion gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.schematic.api.core;

import java.io.FilterInputStream;
import java.io.IOException;
import okhttp3.Response;

/**
* A custom InputStream that wraps the InputStream from the OkHttp Response and ensures that the
* OkHttp Response object is properly closed when the stream is closed.
*
* This class extends FilterInputStream and takes an OkHttp Response object as a parameter.
* It retrieves the InputStream from the Response and overrides the close method to close
* both the InputStream and the Response object, ensuring proper resource management and preventing
* premature closure of the underlying HTTP connection.
*/
public class ResponseBodyInputStream extends FilterInputStream {
private final Response response;

/**
* Constructs a ResponseBodyInputStream that wraps the InputStream from the given OkHttp
* Response object.
*
* @param response the OkHttp Response object from which the InputStream is retrieved
* @throws IOException if an I/O error occurs while retrieving the InputStream
*/
public ResponseBodyInputStream(Response response) throws IOException {
super(response.body().byteStream());
this.response = response;
}

/**
* Closes the InputStream and the associated OkHttp Response object. This ensures that the
* underlying HTTP connection is properly closed after the stream is no longer needed.
*
* @throws IOException if an I/O error occurs
*/
@Override
public void close() throws IOException {
super.close();
response.close(); // Ensure the response is closed when the stream is closed
}
}
44 changes: 44 additions & 0 deletions src/main/java/com/schematic/api/core/ResponseBodyReader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/
package com.schematic.api.core;

import java.io.FilterReader;
import java.io.IOException;
import okhttp3.Response;

/**
* A custom Reader that wraps the Reader from the OkHttp Response and ensures that the
* OkHttp Response object is properly closed when the reader is closed.
*
* This class extends FilterReader and takes an OkHttp Response object as a parameter.
* It retrieves the Reader from the Response and overrides the close method to close
* both the Reader and the Response object, ensuring proper resource management and preventing
* premature closure of the underlying HTTP connection.
*/
public class ResponseBodyReader extends FilterReader {
private final Response response;

/**
* Constructs a ResponseBodyReader that wraps the Reader from the given OkHttp Response object.
*
* @param response the OkHttp Response object from which the Reader is retrieved
* @throws IOException if an I/O error occurs while retrieving the Reader
*/
public ResponseBodyReader(Response response) throws IOException {
super(response.body().charStream());
this.response = response;
}

/**
* Closes the Reader and the associated OkHttp Response object. This ensures that the
* underlying HTTP connection is properly closed after the reader is no longer needed.
*
* @throws IOException if an I/O error occurs
*/
@Override
public void close() throws IOException {
super.close();
response.close(); // Ensure the response is closed when the reader is closed
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Map;
import java.util.Objects;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = IssueTemporaryAccessTokenRequestBody.Builder.class)
public final class IssueTemporaryAccessTokenRequestBody {
private final Map<String, String> lookup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Map;
import java.util.Objects;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = IssueTemporaryAccessTokenResponse.Builder.class)
public final class IssueTemporaryAccessTokenResponse {
private final IssueTemporaryAccessTokenResponseData data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = CountApiKeysRequest.Builder.class)
public final class CountApiKeysRequest {
private final Optional<String> environmentId;
Expand Down Expand Up @@ -160,7 +160,7 @@ public _FinalStage requireEnvironment(boolean requireEnvironment) {
*/
@java.lang.Override
public _FinalStage offset(Integer offset) {
this.offset = Optional.of(offset);
this.offset = Optional.ofNullable(offset);
return this;
}

Expand All @@ -177,7 +177,7 @@ public _FinalStage offset(Optional<Integer> offset) {
*/
@java.lang.Override
public _FinalStage limit(Integer limit) {
this.limit = Optional.of(limit);
this.limit = Optional.ofNullable(limit);
return this;
}

Expand All @@ -190,7 +190,7 @@ public _FinalStage limit(Optional<Integer> limit) {

@java.lang.Override
public _FinalStage environmentId(String environmentId) {
this.environmentId = Optional.of(environmentId);
this.environmentId = Optional.ofNullable(environmentId);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = CountApiRequestsRequest.Builder.class)
public final class CountApiRequestsRequest {
private final Optional<String> q;
Expand Down Expand Up @@ -144,7 +144,7 @@ public Builder q(Optional<String> q) {
}

public Builder q(String q) {
this.q = Optional.of(q);
this.q = Optional.ofNullable(q);
return this;
}

Expand All @@ -155,7 +155,7 @@ public Builder requestType(Optional<String> requestType) {
}

public Builder requestType(String requestType) {
this.requestType = Optional.of(requestType);
this.requestType = Optional.ofNullable(requestType);
return this;
}

Expand All @@ -166,7 +166,7 @@ public Builder environmentId(Optional<String> environmentId) {
}

public Builder environmentId(String environmentId) {
this.environmentId = Optional.of(environmentId);
this.environmentId = Optional.ofNullable(environmentId);
return this;
}

Expand All @@ -177,7 +177,7 @@ public Builder limit(Optional<Integer> limit) {
}

public Builder limit(Integer limit) {
this.limit = Optional.of(limit);
this.limit = Optional.ofNullable(limit);
return this;
}

Expand All @@ -188,7 +188,7 @@ public Builder offset(Optional<Integer> offset) {
}

public Builder offset(Integer offset) {
this.offset = Optional.of(offset);
this.offset = Optional.ofNullable(offset);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = CreateApiKeyRequestBody.Builder.class)
public final class CreateApiKeyRequestBody {
private final Optional<String> description;
Expand Down Expand Up @@ -133,7 +133,7 @@ public _FinalStage name(String name) {

@java.lang.Override
public _FinalStage environmentId(String environmentId) {
this.environmentId = Optional.of(environmentId);
this.environmentId = Optional.ofNullable(environmentId);
return this;
}

Expand All @@ -146,7 +146,7 @@ public _FinalStage environmentId(Optional<String> environmentId) {

@java.lang.Override
public _FinalStage description(String description) {
this.description = Optional.of(description);
this.description = Optional.ofNullable(description);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.Map;
import java.util.Objects;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = CreateEnvironmentRequestBody.Builder.class)
public final class CreateEnvironmentRequestBody {
private final CreateEnvironmentRequestBodyEnvironmentType environmentType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = ListApiKeysRequest.Builder.class)
public final class ListApiKeysRequest {
private final Optional<String> environmentId;
Expand Down Expand Up @@ -160,7 +160,7 @@ public _FinalStage requireEnvironment(boolean requireEnvironment) {
*/
@java.lang.Override
public _FinalStage offset(Integer offset) {
this.offset = Optional.of(offset);
this.offset = Optional.ofNullable(offset);
return this;
}

Expand All @@ -177,7 +177,7 @@ public _FinalStage offset(Optional<Integer> offset) {
*/
@java.lang.Override
public _FinalStage limit(Integer limit) {
this.limit = Optional.of(limit);
this.limit = Optional.ofNullable(limit);
return this;
}

Expand All @@ -190,7 +190,7 @@ public _FinalStage limit(Optional<Integer> limit) {

@java.lang.Override
public _FinalStage environmentId(String environmentId) {
this.environmentId = Optional.of(environmentId);
this.environmentId = Optional.ofNullable(environmentId);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = ListApiRequestsRequest.Builder.class)
public final class ListApiRequestsRequest {
private final Optional<String> q;
Expand Down Expand Up @@ -144,7 +144,7 @@ public Builder q(Optional<String> q) {
}

public Builder q(String q) {
this.q = Optional.of(q);
this.q = Optional.ofNullable(q);
return this;
}

Expand All @@ -155,7 +155,7 @@ public Builder requestType(Optional<String> requestType) {
}

public Builder requestType(String requestType) {
this.requestType = Optional.of(requestType);
this.requestType = Optional.ofNullable(requestType);
return this;
}

Expand All @@ -166,7 +166,7 @@ public Builder environmentId(Optional<String> environmentId) {
}

public Builder environmentId(String environmentId) {
this.environmentId = Optional.of(environmentId);
this.environmentId = Optional.ofNullable(environmentId);
return this;
}

Expand All @@ -177,7 +177,7 @@ public Builder limit(Optional<Integer> limit) {
}

public Builder limit(Integer limit) {
this.limit = Optional.of(limit);
this.limit = Optional.ofNullable(limit);
return this;
}

Expand All @@ -188,7 +188,7 @@ public Builder offset(Optional<Integer> offset) {
}

public Builder offset(Integer offset) {
this.offset = Optional.of(offset);
this.offset = Optional.ofNullable(offset);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import java.util.Objects;
import java.util.Optional;

@JsonInclude(JsonInclude.Include.NON_EMPTY)
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = ListEnvironmentsRequest.Builder.class)
public final class ListEnvironmentsRequest {
private final Optional<String> ids;
Expand Down Expand Up @@ -116,7 +116,7 @@ public Builder ids(Optional<String> ids) {
}

public Builder ids(String ids) {
this.ids = Optional.of(ids);
this.ids = Optional.ofNullable(ids);
return this;
}

Expand All @@ -127,7 +127,7 @@ public Builder limit(Optional<Integer> limit) {
}

public Builder limit(Integer limit) {
this.limit = Optional.of(limit);
this.limit = Optional.ofNullable(limit);
return this;
}

Expand All @@ -138,7 +138,7 @@ public Builder offset(Optional<Integer> offset) {
}

public Builder offset(Integer offset) {
this.offset = Optional.of(offset);
this.offset = Optional.ofNullable(offset);
return this;
}

Expand Down
Loading