Skip to content

Commit 94c8c53

Browse files
Generate objectstorage
1 parent 8ea7a79 commit 94c8c53

86 files changed

Lines changed: 2159 additions & 584 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.

‎services/objectstorage/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/objectstorage/oas_commit‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
404d55ddc0cbde39bb4bbc0a3792ea8a56cc58fa
1+
1cb7803383991935e2278722c995a222c96aa43a

‎services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiCallback.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* STACKIT Object Storage API
3-
* STACKIT API to manage the Object Storage
2+
* [DEPRECATED] STACKIT Object Storage API
3+
* ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2
44
*
55
* The version of the OpenAPI document: 1.1.0
66
*

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

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* STACKIT Object Storage API
3-
* STACKIT API to manage the Object Storage
2+
* [DEPRECATED] STACKIT Object Storage API
3+
* ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2
44
*
55
* The version of the OpenAPI document: 1.1.0
66
*
@@ -398,6 +398,17 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
398398
return this;
399399
}
400400

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

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

‎services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ApiResponse.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* STACKIT Object Storage API
3-
* STACKIT API to manage the Object Storage
2+
* [DEPRECATED] STACKIT Object Storage API
3+
* ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2
44
*
55
* The version of the OpenAPI document: 1.1.0
66
*

‎services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/GzipRequestInterceptor.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* STACKIT Object Storage API
3-
* STACKIT API to manage the Object Storage
2+
* [DEPRECATED] STACKIT Object Storage API
3+
* ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2
44
*
55
* The version of the OpenAPI document: 1.1.0
66
*

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

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* STACKIT Object Storage API
3-
* STACKIT API to manage the Object Storage
2+
* [DEPRECATED] STACKIT Object Storage API
3+
* ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2
44
*
55
* The version of the OpenAPI document: 1.1.0
66
*
@@ -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.objectstorage.v1api.model.AccessKey
@@ -175,6 +180,9 @@ private static Class getClassByDiscriminator(
175180
gsonBuilder.registerTypeAdapterFactory(
176181
new cloud.stackit.sdk.objectstorage.v1api.model.SetDefaultRetentionPayload
177182
.CustomTypeAdapterFactory());
183+
gsonBuilder.registerTypeAdapterFactory(
184+
new cloud.stackit.sdk.objectstorage.v1api.model.UpdateServicePayload
185+
.CustomTypeAdapterFactory());
178186
gsonBuilder.registerTypeAdapterFactory(
179187
new cloud.stackit.sdk.objectstorage.v1api.model.ValidationError
180188
.CustomTypeAdapterFactory());
@@ -375,6 +383,53 @@ public LocalDate read(JsonReader in) throws IOException {
375383
}
376384
}
377385

386+
/** Gson TypeAdapter for JSR310 LocalDateTime type */
387+
public static class LocalDateTimeTypeAdapter extends TypeAdapter<LocalDateTime> {
388+
389+
private DateTimeFormatter formatter;
390+
391+
public LocalDateTimeTypeAdapter() {
392+
this(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
393+
}
394+
395+
public LocalDateTimeTypeAdapter(DateTimeFormatter formatter) {
396+
this.formatter = formatter;
397+
}
398+
399+
public void setFormat(DateTimeFormatter dateFormat) {
400+
this.formatter = dateFormat;
401+
}
402+
403+
@Override
404+
public void write(JsonWriter out, LocalDateTime date) throws IOException {
405+
if (date == null) {
406+
out.nullValue();
407+
} else {
408+
out.value(formatter.format(date));
409+
}
410+
}
411+
412+
@Override
413+
public LocalDateTime read(JsonReader in) throws IOException {
414+
switch (in.peek()) {
415+
case NULL:
416+
in.nextNull();
417+
return null;
418+
default:
419+
String date = in.nextString();
420+
try {
421+
return LocalDateTime.parse(date, formatter);
422+
} catch (DateTimeParseException e) {
423+
if (date.length() > 10 && date.charAt(10) == ' ') {
424+
date = date.substring(0, 10) + 'T' + date.substring(11);
425+
return LocalDateTime.parse(date, formatter);
426+
}
427+
throw e;
428+
}
429+
}
430+
}
431+
}
432+
378433
public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
379434
offsetDateTimeTypeAdapter.setFormat(dateFormat);
380435
}
@@ -383,6 +438,10 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
383438
localDateTypeAdapter.setFormat(dateFormat);
384439
}
385440

441+
public static void setLocalDateTimeFormat(DateTimeFormatter dateFormat) {
442+
localDateTimeTypeAdapter.setFormat(dateFormat);
443+
}
444+
386445
/**
387446
* Gson TypeAdapter for java.sql.Date type If the dateFormat is null, a simple "yyyy-MM-dd"
388447
* format will be used (more efficient than SimpleDateFormat).

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* STACKIT Object Storage API
3-
* STACKIT API to manage the Object Storage
2+
* [DEPRECATED] STACKIT Object Storage API
3+
* ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2
44
*
55
* The version of the OpenAPI document: 1.1.0
66
*
@@ -12,7 +12,7 @@
1212

1313
package cloud.stackit.sdk.objectstorage.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/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressRequestBody.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* STACKIT Object Storage API
3-
* STACKIT API to manage the Object Storage
2+
* [DEPRECATED] STACKIT Object Storage API
3+
* ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2
44
*
55
* The version of the OpenAPI document: 1.1.0
66
*

‎services/objectstorage/src/main/java/cloud/stackit/sdk/objectstorage/v1api/ProgressResponseBody.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* STACKIT Object Storage API
3-
* STACKIT API to manage the Object Storage
2+
* [DEPRECATED] STACKIT Object Storage API
3+
* ## ⚠️ WARNING: THIS API IS DEPRECATED Use V2
44
*
55
* The version of the OpenAPI document: 1.1.0
66
*

0 commit comments

Comments
 (0)