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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
- Deprecate `getSchedule` and `listSchedules` methods in `SfsApi` class
- [v0.4.0](services/sfs/CHANGELOG.md#v040)
- **Feature (breaking change):** Introduction of multi API version support. See the GitHub discussion post for more details: https://github.com/stackitcloud/stackit-sdk-java/discussions/530
- [v0.5.0](services/sfs/CHANGELOG.md#v050)
- **Deprecation:** deprecated field `schedules` in model `SnapshotPolicy`
- **Feature:** new field `snapshotSchedules` in model `SnapshotPolicy`
- **Feature:** new field `interval` in model `SnapshotPolicySchedule`
- **Feature:** new model `SnapshotPolicySnapshotPolicySchedule`
- `serverbackup`: [v0.2.0](services/serverbackup/CHANGELOG.md#v020)
- **Feature (breaking change):** Introduction of multi API version support. See the GitHub discussion post for more details: https://github.com/stackitcloud/stackit-sdk-java/discussions/530

Expand Down
6 changes: 6 additions & 0 deletions services/sfs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v0.5.0
- **Deprecation:** deprecated field `schedules` in model `SnapshotPolicy`
- **Feature:** new field `snapshotSchedules` in model `SnapshotPolicy`
- **Feature:** new field `interval` in model `SnapshotPolicySchedule`
- **Feature:** new model `SnapshotPolicySnapshotPolicySchedule`

## v0.4.0
- **Feature (breaking change):** Introduction of multi API version support. See the GitHub discussion post for more details: https://github.com/stackitcloud/stackit-sdk-java/discussions/530

Expand Down
2 changes: 1 addition & 1 deletion services/sfs/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.4.0
0.5.0
2 changes: 1 addition & 1 deletion services/sfs/oas_commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9356c10747db357b4ec533ec97231f1af5530ca0
a896a71ffc1c1152f63b40a0194ac461ce179d6c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,9 @@ private static Class getClassByDiscriminator(
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.sfs.v1api.model.SnapshotPolicySchedule
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.sfs.v1api.model.SnapshotPolicySnapshotPolicySchedule
.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
new cloud.stackit.sdk.sfs.v1api.model.Status.CustomTypeAdapterFactory());
gsonBuilder.registerTypeAdapterFactory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,15 @@ public class SnapshotPolicy {

public static final String SERIALIZED_NAME_SCHEDULES = "schedules";

@Deprecated
@SerializedName(SERIALIZED_NAME_SCHEDULES)
@javax.annotation.Nullable private List<SnapshotPolicySchedule> schedules = new ArrayList<>();

public static final String SERIALIZED_NAME_SNAPSHOT_SCHEDULES = "snapshotSchedules";

@SerializedName(SERIALIZED_NAME_SNAPSHOT_SCHEDULES)
@javax.annotation.Nullable private List<SnapshotPolicySnapshotPolicySchedule> snapshotSchedules = new ArrayList<>();

public SnapshotPolicy() {}

public SnapshotPolicy comment(@javax.annotation.Nullable String comment) {
Expand Down Expand Up @@ -160,6 +166,7 @@ public void setName(@javax.annotation.Nullable String name) {
this.name = name;
}

@Deprecated
public SnapshotPolicy schedules(
@javax.annotation.Nullable List<SnapshotPolicySchedule> schedules) {
this.schedules = schedules;
Expand All @@ -175,18 +182,50 @@ public SnapshotPolicy addSchedulesItem(SnapshotPolicySchedule schedulesItem) {
}

/**
* associated schedules
* (deprecated) associated schedules
*
* @return schedules
* @deprecated
*/
@Deprecated
@javax.annotation.Nullable public List<SnapshotPolicySchedule> getSchedules() {
return schedules;
}

@Deprecated
public void setSchedules(@javax.annotation.Nullable List<SnapshotPolicySchedule> schedules) {
this.schedules = schedules;
}

public SnapshotPolicy snapshotSchedules(
@javax.annotation.Nullable List<SnapshotPolicySnapshotPolicySchedule> snapshotSchedules) {
this.snapshotSchedules = snapshotSchedules;
return this;
}

public SnapshotPolicy addSnapshotSchedulesItem(
SnapshotPolicySnapshotPolicySchedule snapshotSchedulesItem) {
if (this.snapshotSchedules == null) {
this.snapshotSchedules = new ArrayList<>();
}
this.snapshotSchedules.add(snapshotSchedulesItem);
return this;
}

/**
* associated schedules
*
* @return snapshotSchedules
*/
@javax.annotation.Nullable public List<SnapshotPolicySnapshotPolicySchedule> getSnapshotSchedules() {
return snapshotSchedules;
}

public void setSnapshotSchedules(
@javax.annotation.Nullable List<SnapshotPolicySnapshotPolicySchedule> snapshotSchedules) {
this.snapshotSchedules = snapshotSchedules;
}

/**
* A container for additional, undeclared properties. This is a holder for any undeclared
* properties as specified with the 'additionalProperties' keyword in the OAS document.
Expand Down Expand Up @@ -246,12 +285,21 @@ public boolean equals(Object o) {
&& Objects.equals(this.id, snapshotPolicy.id)
&& Objects.equals(this.name, snapshotPolicy.name)
&& Objects.equals(this.schedules, snapshotPolicy.schedules)
&& Objects.equals(this.snapshotSchedules, snapshotPolicy.snapshotSchedules)
&& Objects.equals(this.additionalProperties, snapshotPolicy.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(comment, createdAt, enabled, id, name, schedules, additionalProperties);
return Objects.hash(
comment,
createdAt,
enabled,
id,
name,
schedules,
snapshotSchedules,
additionalProperties);
}

@Override
Expand All @@ -264,6 +312,9 @@ public String toString() {
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" name: ").append(toIndentedString(name)).append("\n");
sb.append(" schedules: ").append(toIndentedString(schedules)).append("\n");
sb.append(" snapshotSchedules: ")
.append(toIndentedString(snapshotSchedules))
.append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand All @@ -290,7 +341,13 @@ private String toIndentedString(Object o) {
openapiFields =
new HashSet<String>(
Arrays.asList(
"comment", "createdAt", "enabled", "id", "name", "schedules"));
"comment",
"createdAt",
"enabled",
"id",
"name",
"schedules",
"snapshotSchedules"));

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>(0);
Expand Down Expand Up @@ -357,6 +414,27 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
;
}
}
if (jsonObj.get("snapshotSchedules") != null
&& !jsonObj.get("snapshotSchedules").isJsonNull()) {
JsonArray jsonArraysnapshotSchedules = jsonObj.getAsJsonArray("snapshotSchedules");
if (jsonArraysnapshotSchedules != null) {
// ensure the json data is an array
if (!jsonObj.get("snapshotSchedules").isJsonArray()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `snapshotSchedules` to be an array in the JSON string but got `%s`",
jsonObj.get("snapshotSchedules").toString()));
}

// validate the optional field `snapshotSchedules` (array)
for (int i = 0; i < jsonArraysnapshotSchedules.size(); i++) {
SnapshotPolicySnapshotPolicySchedule.validateJsonElement(
jsonArraysnapshotSchedules.get(i));
}
;
}
}
}

public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public class SnapshotPolicySchedule {
@SerializedName(SERIALIZED_NAME_COUNT)
@javax.annotation.Nullable private Integer count;

public static final String SERIALIZED_NAME_INTERVAL = "interval";

@SerializedName(SERIALIZED_NAME_INTERVAL)
@javax.annotation.Nullable private String interval;

public static final String SERIALIZED_NAME_PREFIX = "prefix";

@SerializedName(SERIALIZED_NAME_PREFIX)
Expand All @@ -63,7 +68,7 @@ public SnapshotPolicySchedule count(@javax.annotation.Nullable Integer count) {
}

/**
* Get count
* Retention Count
*
* @return count
*/
Expand All @@ -75,13 +80,31 @@ public void setCount(@javax.annotation.Nullable Integer count) {
this.count = count;
}

public SnapshotPolicySchedule interval(@javax.annotation.Nullable String interval) {
this.interval = interval;
return this;
}

/**
* Interval of the Schedule (follows the cron schedule expression in Unix-like systems)
*
* @return interval
*/
@javax.annotation.Nullable public String getInterval() {
return interval;
}

public void setInterval(@javax.annotation.Nullable String interval) {
this.interval = interval;
}

public SnapshotPolicySchedule prefix(@javax.annotation.Nullable String prefix) {
this.prefix = prefix;
return this;
}

/**
* Get prefix
* Prefix used for the snapshots created by this policy
*
* @return prefix
*/
Expand All @@ -100,7 +123,7 @@ public SnapshotPolicySchedule retentionPeriod(
}

/**
* Get retentionPeriod
* Retention Period (ISO 8601 format or \&quot;infinite\&quot;)
*
* @return retentionPeriod
*/
Expand All @@ -118,7 +141,7 @@ public SnapshotPolicySchedule scheduleId(@javax.annotation.Nullable String sched
}

/**
* Get scheduleId
* ID of the Schedule
*
* @return scheduleId
*/
Expand Down Expand Up @@ -184,6 +207,7 @@ public boolean equals(Object o) {
}
SnapshotPolicySchedule snapshotPolicySchedule = (SnapshotPolicySchedule) o;
return Objects.equals(this.count, snapshotPolicySchedule.count)
&& Objects.equals(this.interval, snapshotPolicySchedule.interval)
&& Objects.equals(this.prefix, snapshotPolicySchedule.prefix)
&& Objects.equals(this.retentionPeriod, snapshotPolicySchedule.retentionPeriod)
&& Objects.equals(this.scheduleId, snapshotPolicySchedule.scheduleId)
Expand All @@ -193,14 +217,16 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(count, prefix, retentionPeriod, scheduleId, additionalProperties);
return Objects.hash(
count, interval, prefix, retentionPeriod, scheduleId, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class SnapshotPolicySchedule {\n");
sb.append(" count: ").append(toIndentedString(count)).append("\n");
sb.append(" interval: ").append(toIndentedString(interval)).append("\n");
sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n");
sb.append(" retentionPeriod: ").append(toIndentedString(retentionPeriod)).append("\n");
sb.append(" scheduleId: ").append(toIndentedString(scheduleId)).append("\n");
Expand Down Expand Up @@ -229,7 +255,8 @@ private String toIndentedString(Object o) {
// a set of all properties/fields (JSON key names)
openapiFields =
new HashSet<String>(
Arrays.asList("count", "prefix", "retentionPeriod", "scheduleId"));
Arrays.asList(
"count", "interval", "prefix", "retentionPeriod", "scheduleId"));

// a set of required properties/fields (JSON key names)
openapiRequiredFields = new HashSet<String>(0);
Expand All @@ -253,6 +280,14 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
}
}
JsonObject jsonObj = jsonElement.getAsJsonObject();
if ((jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull())
&& !jsonObj.get("interval").isJsonPrimitive()) {
throw new IllegalArgumentException(
String.format(
java.util.Locale.ROOT,
"Expected the field `interval` to be a primitive type in the JSON string but got `%s`",
jsonObj.get("interval").toString()));
}
if ((jsonObj.get("prefix") != null && !jsonObj.get("prefix").isJsonNull())
&& !jsonObj.get("prefix").isJsonPrimitive()) {
throw new IllegalArgumentException(
Expand Down
Loading