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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@
- [v0.7.0](services/resourcemanager/CHANGELOG.md#v070)
- **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12`
- **Feature:** The `members` attribute in the `CreateProjectPayload` model class is now optional (previously required) and therefore changed from `@javax.annotation.Nonnull` to `@javax.annotation.Nullable`
- `sfs`:
- [v0.6.0](services/sfs/CHANGELOG.md#v060)
- **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12`
- `v1api`:
- **Feature:** Add new `ConflictError` model for responses with 409 status code
- `v1betaapi`:
- **Feature:** Add new `ConflictError` model for responses with 409 status code

## Release (2026-10-16)

Expand Down
7 changes: 7 additions & 0 deletions services/sfs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## v0.6.0
- **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12`
- `v1api`:
- **Feature:** Add new `ConflictError` model for responses with 409 status code
- `v1betaapi`:
- **Feature:** Add new `ConflictError` model for responses with 409 status code

## v0.5.0
- **Deprecation:** deprecated field `schedules` in model `SnapshotPolicy`
- **Feature:** new field `snapshotSchedules` in model `SnapshotPolicy`
Expand Down
2 changes: 1 addition & 1 deletion services/sfs/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.6.0
2 changes: 1 addition & 1 deletion services/sfs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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.8'
implementation 'org.openapitools:jackson-databind-nullable:0.2.12'
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'
Expand Down
2 changes: 1 addition & 1 deletion services/sfs/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0c4c4c22a2db77c6bcc0e27e513531d1c25d4fe1
1cb7803383991935e2278722c995a222c96aa43a
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,17 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
return this;
}

/**
* Set LocalDateTimeFormat.
*
* @param dateFormat a {@link java.time.format.DateTimeFormatter} object
* @return a {@link cloud.stackit.sdk.sfs.v1api.ApiClient} object
*/
public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) {
JSON.setLocalDateTimeFormat(dateFormat);
return this;
}

/**
* Set LenientOnJson.
*
Expand Down Expand Up @@ -597,6 +608,46 @@ public String parameterToString(Object param) {
}
}

/**
* Format the given parameter object as an ASCII-safe JSON string.
*
* @param param Parameter
* @return JSON representation of the parameter
*/
public String parameterToJsonString(Object param) {
if (param == null) {
return "";
}
String json = JSON.serialize(param);
int firstUnsafe = -1;
for (int i = 0; i < json.length(); i++) {
if (json.charAt(i) >= 0x7f) {
firstUnsafe = i;
break;
}
}
if (firstUnsafe == -1) {
return json;
}

StringBuilder escaped = new StringBuilder(json.length());
escaped.append(json, 0, firstUnsafe);
for (int i = firstUnsafe; i < json.length(); i++) {
char c = json.charAt(i);
if (c >= 0x7f) {
escaped.append("\\u");
escaped.append(Character.forDigit((c >> 12) & 0xf, 16));
escaped.append(Character.forDigit((c >> 8) & 0xf, 16));
escaped.append(Character.forDigit((c >> 4) & 0xf, 16));
escaped.append(Character.forDigit(c & 0xf, 16));
} else {
escaped.append(c);
}
}

return escaped.toString();
}

/**
* Formats the specified query parameter to a list containing a single {@code Pair} object.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@
import java.text.ParseException;
import java.text.ParsePosition;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.util.Date;
import java.util.Map;
import okio.ByteString;
Expand All @@ -51,6 +53,8 @@ public class JSON {
private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter =
new OffsetDateTimeTypeAdapter();
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
private static LocalDateTimeTypeAdapter localDateTimeTypeAdapter =
new LocalDateTimeTypeAdapter();
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();

@SuppressWarnings("unchecked")
Expand Down Expand Up @@ -94,7 +98,10 @@ private static Class getClassByDiscriminator(
gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter);
gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter);
gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter);
gsonBuilder.registerTypeAdapter(LocalDateTime.class, localDateTimeTypeAdapter);
gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter);
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.sfs.v1api.model.ConflictError.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.sfs.v1api.model.CreateResourcePoolPayload
.CustomTypeAdapterFactory());
Expand Down Expand Up @@ -432,6 +439,53 @@ public LocalDate read(JsonReader in) throws IOException {
}
}

/** Gson TypeAdapter for JSR310 LocalDateTime type */
public static class LocalDateTimeTypeAdapter extends TypeAdapter<LocalDateTime> {

private DateTimeFormatter formatter;

public LocalDateTimeTypeAdapter() {
this(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
}

public LocalDateTimeTypeAdapter(DateTimeFormatter formatter) {
this.formatter = formatter;
}

public void setFormat(DateTimeFormatter dateFormat) {
this.formatter = dateFormat;
}

@Override
public void write(JsonWriter out, LocalDateTime date) throws IOException {
if (date == null) {
out.nullValue();
} else {
out.value(formatter.format(date));
}
}

@Override
public LocalDateTime read(JsonReader in) throws IOException {
switch (in.peek()) {
case NULL:
in.nextNull();
return null;
default:
String date = in.nextString();
try {
return LocalDateTime.parse(date, formatter);
} catch (DateTimeParseException e) {
if (date.length() > 10 && date.charAt(10) == ' ') {
date = date.substring(0, 10) + 'T' + date.substring(11);
return LocalDateTime.parse(date, formatter);
}
throw e;
}
}
}
}

public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
offsetDateTimeTypeAdapter.setFormat(dateFormat);
}
Expand All @@ -440,6 +494,10 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
localDateTypeAdapter.setFormat(dateFormat);
}

public static void setLocalDateTimeFormat(DateTimeFormatter dateFormat) {
localDateTimeTypeAdapter.setFormat(dateFormat);
}

/**
* Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd"
* format will be used (more efficient than SimpleDateFormat).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

package cloud.stackit.sdk.sfs.v1api;

@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0")
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.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 @@ -15,7 +15,7 @@
import java.util.Map;

/** Representing a Server configuration. */
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0")
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0")
public class ServerConfiguration {
public String URL;
public String description;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.HashSet;

/** Representing a Server Variable for server URL template substitution. */
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0")
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0")
public class ServerVariable {
public String description;
public String defaultValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.Collection;
import java.util.Iterator;

@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0")
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0")
public class StringUtil {
/**
* Check if the given array contains the given value (with case-insensitive comparison).
Expand Down
Loading
Loading