Skip to content

Commit 57a403c

Browse files
Generator: Update SDK /services/automation (#1160)
Co-authored-by: Marcel Jacek <[email protected]>
1 parent a2cda95 commit 57a403c

95 files changed

Lines changed: 757 additions & 541 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.

‎CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Release (2026-MM-DD)
22

3+
- `automation`:
4+
- [v0.1.1](services/automation/CHANGELOG.md#v011)
5+
- **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12`
36
- `resourcemanager`:
47
- [v0.7.0](services/resourcemanager/CHANGELOG.md#v070)
58
- **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12`

‎services/automation/CHANGELOG.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
## v0.1.1
2+
- **Dependencies:** Bump `org.openapitools:jackson-databind-nullable` from `0.2.8` to `0.2.12`
3+
14
## v0.1.0
25
- Initial onboarding of STACKIT Java SDK for Automation service

‎services/automation/VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.0
1+
0.1.1

‎services/automation/build.gradle‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies {
1010
implementation 'com.google.code.gson:gson:2.9.1'
1111
implementation 'io.gsonfire:gson-fire:1.9.0'
1212
implementation 'jakarta.ws.rs:jakarta.ws.rs-api:2.1.6'
13-
implementation 'org.openapitools:jackson-databind-nullable:0.2.8'
13+
implementation 'org.openapitools:jackson-databind-nullable:0.2.12'
1414
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0'
1515
implementation "jakarta.annotation:jakarta.annotation-api:$jakarta_annotation_version"
1616
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.3'

‎services/automation/oas_commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
102a0d5966d54620a8ab70b605797a676c9a0082
1+
6c5332d5f71263507049f2f2ef036fe07937b63a

‎services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ApiClient.java‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,17 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
397397
return this;
398398
}
399399

400+
/**
401+
* Set LocalDateTimeFormat.
402+
*
403+
* @param dateFormat a {@link java.time.format.DateTimeFormatter} object
404+
* @return a {@link cloud.stackit.sdk.automation.v1api.ApiClient} object
405+
*/
406+
public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) {
407+
JSON.setLocalDateTimeFormat(dateFormat);
408+
return this;
409+
}
410+
400411
/**
401412
* Set LenientOnJson.
402413
*
@@ -597,6 +608,46 @@ public String parameterToString(Object param) {
597608
}
598609
}
599610

611+
/**
612+
* Format the given parameter object as an ASCII-safe JSON string.
613+
*
614+
* @param param Parameter
615+
* @return JSON representation of the parameter
616+
*/
617+
public String parameterToJsonString(Object param) {
618+
if (param == null) {
619+
return "";
620+
}
621+
String json = JSON.serialize(param);
622+
int firstUnsafe = -1;
623+
for (int i = 0; i < json.length(); i++) {
624+
if (json.charAt(i) >= 0x7f) {
625+
firstUnsafe = i;
626+
break;
627+
}
628+
}
629+
if (firstUnsafe == -1) {
630+
return json;
631+
}
632+
633+
StringBuilder escaped = new StringBuilder(json.length());
634+
escaped.append(json, 0, firstUnsafe);
635+
for (int i = firstUnsafe; i < json.length(); i++) {
636+
char c = json.charAt(i);
637+
if (c >= 0x7f) {
638+
escaped.append("\\u");
639+
escaped.append(Character.forDigit((c >> 12) & 0xf, 16));
640+
escaped.append(Character.forDigit((c >> 8) & 0xf, 16));
641+
escaped.append(Character.forDigit((c >> 4) & 0xf, 16));
642+
escaped.append(Character.forDigit(c & 0xf, 16));
643+
} else {
644+
escaped.append(c);
645+
}
646+
}
647+
648+
return escaped.toString();
649+
}
650+
600651
/**
601652
* Formats the specified query parameter to a list containing a single {@code Pair} object.
602653
*

‎services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/JSON.java‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@
3131
import java.text.ParseException;
3232
import java.text.ParsePosition;
3333
import java.time.LocalDate;
34+
import java.time.LocalDateTime;
3435
import java.time.OffsetDateTime;
3536
import java.time.format.DateTimeFormatter;
37+
import java.time.format.DateTimeParseException;
3638
import java.util.Date;
3739
import java.util.Map;
3840
import okio.ByteString;
@@ -51,6 +53,8 @@ public class JSON {
5153
private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter =
5254
new OffsetDateTimeTypeAdapter();
5355
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
56+
private static LocalDateTimeTypeAdapter localDateTimeTypeAdapter =
57+
new LocalDateTimeTypeAdapter();
5458
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
5559

5660
@SuppressWarnings("unchecked")
@@ -94,6 +98,7 @@ private static Class getClassByDiscriminator(
9498
gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter);
9599
gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter);
96100
gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter);
101+
gsonBuilder.registerTypeAdapter(LocalDateTime.class, localDateTimeTypeAdapter);
97102
gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter);
98103
gsonBuilder.registerTypeAdapterFactory(
99104
new cloud.stackit.sdk.automation.v1api.model.AutomationScheduleTrigger
@@ -401,6 +406,53 @@ public LocalDate read(JsonReader in) throws IOException {
401406
}
402407
}
403408

409+
/** Gson TypeAdapter for JSR310 LocalDateTime type */
410+
public static class LocalDateTimeTypeAdapter extends TypeAdapter<LocalDateTime> {
411+
412+
private DateTimeFormatter formatter;
413+
414+
public LocalDateTimeTypeAdapter() {
415+
this(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
416+
}
417+
418+
public LocalDateTimeTypeAdapter(DateTimeFormatter formatter) {
419+
this.formatter = formatter;
420+
}
421+
422+
public void setFormat(DateTimeFormatter dateFormat) {
423+
this.formatter = dateFormat;
424+
}
425+
426+
@Override
427+
public void write(JsonWriter out, LocalDateTime date) throws IOException {
428+
if (date == null) {
429+
out.nullValue();
430+
} else {
431+
out.value(formatter.format(date));
432+
}
433+
}
434+
435+
@Override
436+
public LocalDateTime read(JsonReader in) throws IOException {
437+
switch (in.peek()) {
438+
case NULL:
439+
in.nextNull();
440+
return null;
441+
default:
442+
String date = in.nextString();
443+
try {
444+
return LocalDateTime.parse(date, formatter);
445+
} catch (DateTimeParseException e) {
446+
if (date.length() > 10 && date.charAt(10) == ' ') {
447+
date = date.substring(0, 10) + 'T' + date.substring(11);
448+
return LocalDateTime.parse(date, formatter);
449+
}
450+
throw e;
451+
}
452+
}
453+
}
454+
}
455+
404456
public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
405457
offsetDateTimeTypeAdapter.setFormat(dateFormat);
406458
}
@@ -409,6 +461,10 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
409461
localDateTypeAdapter.setFormat(dateFormat);
410462
}
411463

464+
public static void setLocalDateTimeFormat(DateTimeFormatter dateFormat) {
465+
localDateTimeTypeAdapter.setFormat(dateFormat);
466+
}
467+
412468
/**
413469
* Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd"
414470
* format will be used (more efficient than SimpleDateFormat).

‎services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/Pair.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
package cloud.stackit.sdk.automation.v1api;
1414

15-
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0")
15+
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0")
1616
public class Pair {
1717
private final String name;
1818
private final String value;

‎services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerConfiguration.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.Map;
1616

1717
/** Representing a Server configuration. */
18-
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0")
18+
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0")
1919
public class ServerConfiguration {
2020
public String URL;
2121
public String description;

‎services/automation/src/main/java/cloud/stackit/sdk/automation/v1api/ServerVariable.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import java.util.HashSet;
1616

1717
/** Representing a Server Variable for server URL template substitution. */
18-
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.19.0")
18+
@javax.annotation.Generated(value = "JavaGenerator", comments = "Generator version: 7.26.0")
1919
public class ServerVariable {
2020
public String description;
2121
public String defaultValue;

0 commit comments

Comments
 (0)