Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
- **Improvement:** Support additional properties in models
- `objectstorage`: [v0.1.2](services/objectstorage/CHANGELOG.md#v012)
- **Improvement:** Support additional properties in models
- `resourcemanager`: [v0.4.2](services/resourcemanager/CHANGELOG.md#v042)
- **Improvement:** Support additional properties in models
- `resourcemanager`:
- [v0.4.3](services/resourcemanager/CHANGELOG.md#v043)
- Bump dependency `org.apache.commons:commons-lang3` to `3.18.0`
- Bump dependency `org.openapitools:jackson-databind-nullable` to `0.2.8`
- [v0.4.2](services/resourcemanager/CHANGELOG.md#v042)
- **Improvement:** Support additional properties in models
- `serverbackup`: [v0.1.1](services/serverbackup/CHANGELOG.md#v011)
- **Improvement:** Support additional properties in models
- `serverupdate`: [v0.1.2](services/serverupdate/CHANGELOG.md#v012)
Expand Down
4 changes: 4 additions & 0 deletions services/resourcemanager/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.4.3
- Bump dependency `org.apache.commons:commons-lang3` to `3.18.0`
- Bump dependency `org.openapitools:jackson-databind-nullable` to `0.2.8`

## v0.4.2
- **Improvement:** Support additional properties in models

Expand Down
2 changes: 1 addition & 1 deletion services/resourcemanager/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.2
0.4.3
4 changes: 2 additions & 2 deletions services/resourcemanager/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ dependencies {
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'io.gsonfire:gson-fire:1.9.0'
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
implementation 'org.openapitools:jackson-databind-nullable:0.2.6'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.17.0'
implementation 'org.openapitools:jackson-databind-nullable:0.2.8'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0'
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'
testImplementation 'org.mockito:mockito-core:3.12.4'
Expand Down
2 changes: 1 addition & 1 deletion services/resourcemanager/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ed4e4fbee2f5db4d95725108fb3d736e5363fb2f
29ed135519d2a7b1b043cd0c8243bb8d423a784b
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public class ApiClient {
protected InputStream sslCaCert;
protected boolean verifyingSsl;
protected KeyManager[] keyManagers;
protected String tlsServerName;

protected OkHttpClient httpClient;
protected JSON json;
Expand Down Expand Up @@ -189,8 +190,8 @@ public String getBasePath() {
/**
* Set base path
*
* @param basePath Base path of the URL (e.g https://resource-manager.api.stackit.cloud
* @return An instance of OkHttpClient
* @param basePath Base path of the URL (e.g https://resource-manager.api.stackit.cloud)
* @return An instance of ApiClient
*/
public ApiClient setBasePath(String basePath) {
this.basePath = basePath;
Expand Down Expand Up @@ -321,6 +322,28 @@ public ApiClient setKeyManagers(KeyManager[] managers) {
return this;
}

/**
* Get TLS server name for SNI (Server Name Indication).
*
* @return The TLS server name
*/
public String getTlsServerName() {
return tlsServerName;
}

/**
* Set TLS server name for SNI (Server Name Indication). This is used to verify the server
* certificate against a specific hostname instead of the hostname in the URL.
*
* @param tlsServerName The TLS server name to use for certificate verification
* @return ApiClient
*/
public ApiClient setTlsServerName(String tlsServerName) {
this.tlsServerName = tlsServerName;
applySslSettings();
return this;
}

/**
* Getter for the field <code>dateFormat</code>.
*
Expand Down Expand Up @@ -605,7 +628,7 @@ public List<Pair> parameterToPair(String name, Object value) {
* @param value The value of the parameter.
* @return A list of {@code Pair} objects.
*/
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection value) {
public List<Pair> parameterToPairs(String collectionFormat, String name, Collection<?> value) {
List<Pair> params = new ArrayList<Pair>();

// preconditions
Expand Down Expand Up @@ -827,7 +850,17 @@ public <T> T deserialize(Response response, Type returnType) throws ApiException
}
try {
if (isJsonMime(contentType)) {
return JSON.deserialize(respBody.byteStream(), returnType);
if (returnType.equals(String.class)) {
String respBodyString = respBody.string();
if (respBodyString.isEmpty()) {
return null;
}
// Use String-based deserialize for String return type with fallback
return JSON.deserialize(respBodyString, returnType);
} else {
// Use InputStream-based deserialize which supports responses > 2GB
return JSON.deserialize(respBody.byteStream(), returnType);
}
} else if (returnType.equals(String.class)) {
String respBodyString = respBody.string();
if (respBodyString.isEmpty()) {
Expand Down Expand Up @@ -1227,8 +1260,10 @@ public String buildUrl(
if (serverIndex < 0 || serverIndex >= servers.size()) {
throw new ArrayIndexOutOfBoundsException(
String.format(
java.util.Locale.ROOT,
"Invalid index %d when selecting the host settings. Must be less than %d",
serverIndex, servers.size()));
serverIndex,
servers.size()));
}
baseURL = servers.get(serverIndex).URL(serverVariables);
} else {
Expand Down Expand Up @@ -1302,12 +1337,16 @@ public void processHeaderParams(Map<String, String> headerParams, Request.Builde
public void processCookieParams(Map<String, String> cookieParams, Request.Builder reqBuilder) {
for (Entry<String, String> param : cookieParams.entrySet()) {
reqBuilder.addHeader(
"Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
"Cookie",
String.format(
java.util.Locale.ROOT, "%s=%s", param.getKey(), param.getValue()));
}
for (Entry<String, String> param : defaultCookieMap.entrySet()) {
if (!cookieParams.containsKey(param.getKey())) {
reqBuilder.addHeader(
"Cookie", String.format("%s=%s", param.getKey(), param.getValue()));
"Cookie",
String.format(
java.util.Locale.ROOT, "%s=%s", param.getKey(), param.getValue()));
}
}
}
Expand Down Expand Up @@ -1495,7 +1534,20 @@ public boolean verify(String hostname, SSLSession session) {
trustManagerFactory.init(caKeyStore);
}
trustManagers = trustManagerFactory.getTrustManagers();
hostnameVerifier = OkHostnameVerifier.INSTANCE;
if (tlsServerName != null && !tlsServerName.isEmpty()) {
hostnameVerifier =
new HostnameVerifier() {
@Override
public boolean verify(String hostname, SSLSession session) {
// Verify the certificate against tlsServerName instead of the
// actual hostname
return OkHostnameVerifier.INSTANCE.verify(
tlsServerName, session);
}
};
} else {
hostnameVerifier = OkHostnameVerifier.INSTANCE;
}
}

SSLContext sslContext = SSLContext.getInstance("TLS");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.15.0")
comments = "Generator version: 7.19.0")
public class Pair {
private final String name;
private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/** Representing a Server configuration. */
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.15.0")
comments = "Generator version: 7.19.0")
public class ServerConfiguration {
public String URL;
public String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/** Representing a Server Variable for server URL template substitution. */
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.15.0")
comments = "Generator version: 7.19.0")
public class ServerVariable {
public String description;
public String defaultValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.15.0")
comments = "Generator version: 7.19.0")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/** Abstract class for oneOf,anyOf schemas defined in OpenAPI spec */
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.15.0")
comments = "Generator version: 7.19.0")
public abstract class AbstractOpenApiSchema {

// store the actual instance of the schema/object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
/** ContainerSearchResult */
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.15.0")
comments = "Generator version: 7.19.0")
public class ContainerSearchResult {
public static final String SERIALIZED_NAME_CONTAINER_ID = "containerId";

Expand Down Expand Up @@ -375,6 +375,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"The required field(s) %s in ContainerSearchResult is not found in the empty JSON string",
ContainerSearchResult.openapiRequiredFields.toString()));
}
Expand All @@ -385,20 +386,24 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"The required field `%s` is not found in the JSON string: %s",
requiredField, jsonElement.toString()));
requiredField,
jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if (!jsonObj.get("containerId").isJsonPrimitive()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `containerId` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("containerId").toString()));
}
if (!jsonObj.get("containerType").isJsonPrimitive()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `containerType` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("containerType").toString()));
}
Expand All @@ -407,6 +412,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
if (!jsonObj.get("id").isJsonPrimitive()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `id` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("id").toString()));
}
Expand All @@ -417,13 +423,15 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `name` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("name").toString()));
}
if ((jsonObj.get("organizationId") != null && !jsonObj.get("organizationId").isJsonNull())
&& !jsonObj.get("organizationId").isJsonPrimitive()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `organizationId` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("organizationId").toString()));
}
Expand Down Expand Up @@ -496,6 +504,7 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
else
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"The field `%s` has unknown primitive type. Value: %s",
entry.getKey(),
entry.getValue().toString()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
/** CreateFolderPayload */
@javax.annotation.Generated(
value = "org.openapitools.codegen.languages.JavaClientCodegen",
comments = "Generator version: 7.15.0")
comments = "Generator version: 7.19.0")
public class CreateFolderPayload {
public static final String SERIALIZED_NAME_CONTAINER_PARENT_ID = "containerParentId";

Expand Down Expand Up @@ -278,6 +278,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
.isEmpty()) { // has required fields but JSON element is null
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"The required field(s) %s in CreateFolderPayload is not found in the empty JSON string",
CreateFolderPayload.openapiRequiredFields.toString()));
}
Expand All @@ -288,14 +289,17 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"The required field `%s` is not found in the JSON string: %s",
requiredField, jsonElement.toString()));
requiredField,
jsonElement.toString()));
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if (!jsonObj.get("containerParentId").isJsonPrimitive()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `containerParentId` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("containerParentId").toString()));
}
Expand All @@ -306,6 +310,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
if (!jsonObj.get("members").isJsonArray()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `members` to be an array in the JSON string but got `%s`",
jsonObj.get("members").toString()));
}
Expand All @@ -320,6 +325,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
if (!jsonObj.get("name").isJsonPrimitive()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `name` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("name").toString()));
}
Expand Down Expand Up @@ -392,6 +398,7 @@ else if (entry.getValue().getAsJsonPrimitive().isBoolean())
else
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"The field `%s` has unknown primitive type. Value: %s",
entry.getKey(),
entry.getValue().toString()));
Expand Down
Loading