Skip to content

Commit 2258228

Browse files
Generate sfs
1 parent a5e2c41 commit 2258228

File tree

4 files changed

+49
-20
lines changed

4 files changed

+49
-20
lines changed

services/sfs/oas_commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
a2700649defb7b45c9c4d8c1de6212374519e42c
1+
fe212a12ec79a23b81cb53d9a7728f5706bddc23

services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/CreateShareExportPolicyPayload.java

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public class CreateShareExportPolicyPayload {
4545
public static final String SERIALIZED_NAME_NAME = "name";
4646

4747
@SerializedName(SERIALIZED_NAME_NAME)
48-
@javax.annotation.Nullable private String name;
48+
@javax.annotation.Nonnull
49+
private String name;
4950

5051
public static final String SERIALIZED_NAME_RULES = "rules";
5152

@@ -84,7 +85,7 @@ public void setLabels(@javax.annotation.Nullable Map<String, String> labels) {
8485
this.labels = labels;
8586
}
8687

87-
public CreateShareExportPolicyPayload name(@javax.annotation.Nullable String name) {
88+
public CreateShareExportPolicyPayload name(@javax.annotation.Nonnull String name) {
8889
this.name = name;
8990
return this;
9091
}
@@ -94,11 +95,12 @@ public CreateShareExportPolicyPayload name(@javax.annotation.Nullable String nam
9495
*
9596
* @return name
9697
*/
97-
@javax.annotation.Nullable public String getName() {
98+
@javax.annotation.Nonnull
99+
public String getName() {
98100
return name;
99101
}
100102

101-
public void setName(@javax.annotation.Nullable String name) {
103+
public void setName(@javax.annotation.Nonnull String name) {
102104
this.name = name;
103105
}
104106

@@ -232,7 +234,7 @@ private String toIndentedString(Object o) {
232234
openapiFields = new HashSet<String>(Arrays.asList("labels", "name", "rules"));
233235

234236
// a set of required properties/fields (JSON key names)
235-
openapiRequiredFields = new HashSet<String>(0);
237+
openapiRequiredFields = new HashSet<String>(Arrays.asList("name"));
236238
}
237239

238240
/**
@@ -253,9 +255,20 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
253255
CreateShareExportPolicyPayload.openapiRequiredFields.toString()));
254256
}
255257
}
258+
259+
// check to make sure all required properties/fields are present in the JSON string
260+
for (String requiredField : CreateShareExportPolicyPayload.openapiRequiredFields) {
261+
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
262+
throw new IllegalArgumentException(
263+
String.format(
264+
java.util.Locale.ROOT,
265+
"The required field `%s` is not found in the JSON string: %s",
266+
requiredField,
267+
jsonElement.toString()));
268+
}
269+
}
256270
JsonObject jsonObj = jsonElement.getAsJsonObject();
257-
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull())
258-
&& !jsonObj.get("name").isJsonPrimitive()) {
271+
if (!jsonObj.get("name").isJsonPrimitive()) {
259272
throw new IllegalArgumentException(
260273
String.format(
261274
java.util.Locale.ROOT,

services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/CreateSharePayload.java

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,15 @@ public class CreateSharePayload {
4949
public static final String SERIALIZED_NAME_NAME = "name";
5050

5151
@SerializedName(SERIALIZED_NAME_NAME)
52-
@javax.annotation.Nullable private String name;
52+
@javax.annotation.Nonnull
53+
private String name;
5354

5455
public static final String SERIALIZED_NAME_SPACE_HARD_LIMIT_GIGABYTES =
5556
"spaceHardLimitGigabytes";
5657

5758
@SerializedName(SERIALIZED_NAME_SPACE_HARD_LIMIT_GIGABYTES)
58-
@javax.annotation.Nullable private Integer spaceHardLimitGigabytes;
59+
@javax.annotation.Nonnull
60+
private Integer spaceHardLimitGigabytes;
5961

6062
public CreateSharePayload() {}
6163

@@ -107,7 +109,7 @@ public void setLabels(@javax.annotation.Nullable Map<String, String> labels) {
107109
this.labels = labels;
108110
}
109111

110-
public CreateSharePayload name(@javax.annotation.Nullable String name) {
112+
public CreateSharePayload name(@javax.annotation.Nonnull String name) {
111113
this.name = name;
112114
return this;
113115
}
@@ -117,16 +119,17 @@ public CreateSharePayload name(@javax.annotation.Nullable String name) {
117119
*
118120
* @return name
119121
*/
120-
@javax.annotation.Nullable public String getName() {
122+
@javax.annotation.Nonnull
123+
public String getName() {
121124
return name;
122125
}
123126

124-
public void setName(@javax.annotation.Nullable String name) {
127+
public void setName(@javax.annotation.Nonnull String name) {
125128
this.name = name;
126129
}
127130

128131
public CreateSharePayload spaceHardLimitGigabytes(
129-
@javax.annotation.Nullable Integer spaceHardLimitGigabytes) {
132+
@javax.annotation.Nonnull Integer spaceHardLimitGigabytes) {
130133
this.spaceHardLimitGigabytes = spaceHardLimitGigabytes;
131134
return this;
132135
}
@@ -137,12 +140,13 @@ public CreateSharePayload spaceHardLimitGigabytes(
137140
*
138141
* @return spaceHardLimitGigabytes
139142
*/
140-
@javax.annotation.Nullable public Integer getSpaceHardLimitGigabytes() {
143+
@javax.annotation.Nonnull
144+
public Integer getSpaceHardLimitGigabytes() {
141145
return spaceHardLimitGigabytes;
142146
}
143147

144148
public void setSpaceHardLimitGigabytes(
145-
@javax.annotation.Nullable Integer spaceHardLimitGigabytes) {
149+
@javax.annotation.Nonnull Integer spaceHardLimitGigabytes) {
146150
this.spaceHardLimitGigabytes = spaceHardLimitGigabytes;
147151
}
148152

@@ -269,7 +273,8 @@ private String toIndentedString(Object o) {
269273
"exportPolicyName", "labels", "name", "spaceHardLimitGigabytes"));
270274

271275
// a set of required properties/fields (JSON key names)
272-
openapiRequiredFields = new HashSet<String>(0);
276+
openapiRequiredFields =
277+
new HashSet<String>(Arrays.asList("name", "spaceHardLimitGigabytes"));
273278
}
274279

275280
/**
@@ -289,6 +294,18 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
289294
CreateSharePayload.openapiRequiredFields.toString()));
290295
}
291296
}
297+
298+
// check to make sure all required properties/fields are present in the JSON string
299+
for (String requiredField : CreateSharePayload.openapiRequiredFields) {
300+
if (jsonElement.getAsJsonObject().get(requiredField) == null) {
301+
throw new IllegalArgumentException(
302+
String.format(
303+
java.util.Locale.ROOT,
304+
"The required field `%s` is not found in the JSON string: %s",
305+
requiredField,
306+
jsonElement.toString()));
307+
}
308+
}
292309
JsonObject jsonObj = jsonElement.getAsJsonObject();
293310
if ((jsonObj.get("exportPolicyName") != null
294311
&& !jsonObj.get("exportPolicyName").isJsonNull())
@@ -299,8 +316,7 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
299316
"Expected the field `exportPolicyName` to be a primitive type in the JSON string but got `%s`",
300317
jsonObj.get("exportPolicyName").toString()));
301318
}
302-
if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull())
303-
&& !jsonObj.get("name").isJsonPrimitive()) {
319+
if (!jsonObj.get("name").isJsonPrimitive()) {
304320
throw new IllegalArgumentException(
305321
String.format(
306322
java.util.Locale.ROOT,

services/sfs/src/main/java/cloud/stackit/sdk/sfs/model/ResourcePool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public class ResourcePool {
9696
public static final String SERIALIZED_NAME_SNAPSHOTS_ARE_VISIBLE = "snapshotsAreVisible";
9797

9898
@SerializedName(SERIALIZED_NAME_SNAPSHOTS_ARE_VISIBLE)
99-
@javax.annotation.Nullable private Boolean snapshotsAreVisible;
99+
@javax.annotation.Nullable private Boolean snapshotsAreVisible = false;
100100

101101
public static final String SERIALIZED_NAME_SPACE = "space";
102102

0 commit comments

Comments
 (0)