@@ -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 ,
0 commit comments