2424import com .regula .documentreader .webclient .JSON ;
2525import java .io .IOException ;
2626import java .time .OffsetDateTime ;
27+ import java .util .ArrayList ;
28+ import java .util .HashMap ;
2729import java .util .HashSet ;
30+ import java .util .List ;
31+ import java .util .Map ;
2832import java .util .Objects ;
2933
3034/** DeviceInfo */
@@ -56,6 +60,12 @@ public class DeviceInfo {
5660 @ javax .annotation .Nullable
5761 private String licenseSerial ;
5862
63+ public static final String SERIALIZED_NAME_LICENSE_TYPE = "license-type" ;
64+
65+ @ SerializedName (SERIALIZED_NAME_LICENSE_TYPE )
66+ @ javax .annotation .Nullable
67+ private String licenseType ;
68+
5969 public static final String SERIALIZED_NAME_VALID_UNTIL = "valid-until" ;
6070
6171 @ SerializedName (SERIALIZED_NAME_VALID_UNTIL )
@@ -66,7 +76,25 @@ public class DeviceInfo {
6676
6777 @ SerializedName (SERIALIZED_NAME_SERVER_TIME )
6878 @ javax .annotation .Nullable
69- private OffsetDateTime serverTime ;
79+ private String serverTime ;
80+
81+ public static final String SERIALIZED_NAME_SUPPORTED_SCENARIOS = "supported-scenarios" ;
82+
83+ @ SerializedName (SERIALIZED_NAME_SUPPORTED_SCENARIOS )
84+ @ javax .annotation .Nullable
85+ private List <String > supportedScenarios ;
86+
87+ public static final String SERIALIZED_NAME_METADATA = "metadata" ;
88+
89+ @ SerializedName (SERIALIZED_NAME_METADATA )
90+ @ javax .annotation .Nullable
91+ private Map <String , Object > metadata ;
92+
93+ public static final String SERIALIZED_NAME_DOCUMENTS_DATABASE = "documents-database" ;
94+
95+ @ SerializedName (SERIALIZED_NAME_DOCUMENTS_DATABASE )
96+ @ javax .annotation .Nullable
97+ private DeviceInfoDocumentsDatabase documentsDatabase ;
7098
7199 public DeviceInfo () {}
72100
@@ -76,7 +104,7 @@ public DeviceInfo appName(@javax.annotation.Nullable String appName) {
76104 }
77105
78106 /**
79- * Get appName
107+ * Application name.
80108 *
81109 * @return appName
82110 */
@@ -95,7 +123,7 @@ public DeviceInfo version(@javax.annotation.Nullable String version) {
95123 }
96124
97125 /**
98- * Get version
126+ * Product version.
99127 *
100128 * @return version
101129 */
@@ -114,7 +142,7 @@ public DeviceInfo licenseId(@javax.annotation.Nullable String licenseId) {
114142 }
115143
116144 /**
117- * Get licenseId
145+ * Unique license identifier.
118146 *
119147 * @return licenseId
120148 */
@@ -133,7 +161,7 @@ public DeviceInfo licenseSerial(@javax.annotation.Nullable String licenseSerial)
133161 }
134162
135163 /**
136- * Get licenseSerial
164+ * License serial number.
137165 *
138166 * @return licenseSerial
139167 */
@@ -146,13 +174,32 @@ public void setLicenseSerial(@javax.annotation.Nullable String licenseSerial) {
146174 this .licenseSerial = licenseSerial ;
147175 }
148176
177+ public DeviceInfo licenseType (@ javax .annotation .Nullable String licenseType ) {
178+ this .licenseType = licenseType ;
179+ return this ;
180+ }
181+
182+ /**
183+ * Get licenseType
184+ *
185+ * @return licenseType
186+ */
187+ @ javax .annotation .Nullable
188+ public String getLicenseType () {
189+ return licenseType ;
190+ }
191+
192+ public void setLicenseType (@ javax .annotation .Nullable String licenseType ) {
193+ this .licenseType = licenseType ;
194+ }
195+
149196 public DeviceInfo validUntil (@ javax .annotation .Nullable OffsetDateTime validUntil ) {
150197 this .validUntil = validUntil ;
151198 return this ;
152199 }
153200
154201 /**
155- * Get validUntil
202+ * License validity date.
156203 *
157204 * @return validUntil
158205 */
@@ -165,7 +212,7 @@ public void setValidUntil(@javax.annotation.Nullable OffsetDateTime validUntil)
165212 this .validUntil = validUntil ;
166213 }
167214
168- public DeviceInfo serverTime (@ javax .annotation .Nullable OffsetDateTime serverTime ) {
215+ public DeviceInfo serverTime (@ javax .annotation .Nullable String serverTime ) {
169216 this .serverTime = serverTime ;
170217 return this ;
171218 }
@@ -176,14 +223,89 @@ public DeviceInfo serverTime(@javax.annotation.Nullable OffsetDateTime serverTim
176223 * @return serverTime
177224 */
178225 @ javax .annotation .Nullable
179- public OffsetDateTime getServerTime () {
226+ public String getServerTime () {
180227 return serverTime ;
181228 }
182229
183- public void setServerTime (@ javax .annotation .Nullable OffsetDateTime serverTime ) {
230+ public void setServerTime (@ javax .annotation .Nullable String serverTime ) {
184231 this .serverTime = serverTime ;
185232 }
186233
234+ public DeviceInfo supportedScenarios (@ javax .annotation .Nullable List <String > supportedScenarios ) {
235+ this .supportedScenarios = supportedScenarios ;
236+ return this ;
237+ }
238+
239+ public DeviceInfo addSupportedScenariosItem (String supportedScenariosItem ) {
240+ if (this .supportedScenarios == null ) {
241+ this .supportedScenarios = new ArrayList <>();
242+ }
243+ this .supportedScenarios .add (supportedScenariosItem );
244+ return this ;
245+ }
246+
247+ /**
248+ * List of supported scenarios.
249+ *
250+ * @return supportedScenarios
251+ */
252+ @ javax .annotation .Nullable
253+ public List <String > getSupportedScenarios () {
254+ return supportedScenarios ;
255+ }
256+
257+ public void setSupportedScenarios (@ javax .annotation .Nullable List <String > supportedScenarios ) {
258+ this .supportedScenarios = supportedScenarios ;
259+ }
260+
261+ public DeviceInfo metadata (@ javax .annotation .Nullable Map <String , Object > metadata ) {
262+ this .metadata = metadata ;
263+ return this ;
264+ }
265+
266+ public DeviceInfo putMetadataItem (String key , Object metadataItem ) {
267+ if (this .metadata == null ) {
268+ this .metadata = new HashMap <>();
269+ }
270+ this .metadata .put (key , metadataItem );
271+ return this ;
272+ }
273+
274+ /**
275+ * Get metadata
276+ *
277+ * @return metadata
278+ */
279+ @ javax .annotation .Nullable
280+ public Map <String , Object > getMetadata () {
281+ return metadata ;
282+ }
283+
284+ public void setMetadata (@ javax .annotation .Nullable Map <String , Object > metadata ) {
285+ this .metadata = metadata ;
286+ }
287+
288+ public DeviceInfo documentsDatabase (
289+ @ javax .annotation .Nullable DeviceInfoDocumentsDatabase documentsDatabase ) {
290+ this .documentsDatabase = documentsDatabase ;
291+ return this ;
292+ }
293+
294+ /**
295+ * Get documentsDatabase
296+ *
297+ * @return documentsDatabase
298+ */
299+ @ javax .annotation .Nullable
300+ public DeviceInfoDocumentsDatabase getDocumentsDatabase () {
301+ return documentsDatabase ;
302+ }
303+
304+ public void setDocumentsDatabase (
305+ @ javax .annotation .Nullable DeviceInfoDocumentsDatabase documentsDatabase ) {
306+ this .documentsDatabase = documentsDatabase ;
307+ }
308+
187309 @ Override
188310 public boolean equals (Object o ) {
189311 if (this == o ) {
@@ -197,13 +319,27 @@ public boolean equals(Object o) {
197319 && Objects .equals (this .version , deviceInfo .version )
198320 && Objects .equals (this .licenseId , deviceInfo .licenseId )
199321 && Objects .equals (this .licenseSerial , deviceInfo .licenseSerial )
322+ && Objects .equals (this .licenseType , deviceInfo .licenseType )
200323 && Objects .equals (this .validUntil , deviceInfo .validUntil )
201- && Objects .equals (this .serverTime , deviceInfo .serverTime );
324+ && Objects .equals (this .serverTime , deviceInfo .serverTime )
325+ && Objects .equals (this .supportedScenarios , deviceInfo .supportedScenarios )
326+ && Objects .equals (this .metadata , deviceInfo .metadata )
327+ && Objects .equals (this .documentsDatabase , deviceInfo .documentsDatabase );
202328 }
203329
204330 @ Override
205331 public int hashCode () {
206- return Objects .hash (appName , version , licenseId , licenseSerial , validUntil , serverTime );
332+ return Objects .hash (
333+ appName ,
334+ version ,
335+ licenseId ,
336+ licenseSerial ,
337+ licenseType ,
338+ validUntil ,
339+ serverTime ,
340+ supportedScenarios ,
341+ metadata ,
342+ documentsDatabase );
207343 }
208344
209345 @ Override
@@ -214,8 +350,12 @@ public String toString() {
214350 sb .append (" version: " ).append (toIndentedString (version )).append ("\n " );
215351 sb .append (" licenseId: " ).append (toIndentedString (licenseId )).append ("\n " );
216352 sb .append (" licenseSerial: " ).append (toIndentedString (licenseSerial )).append ("\n " );
353+ sb .append (" licenseType: " ).append (toIndentedString (licenseType )).append ("\n " );
217354 sb .append (" validUntil: " ).append (toIndentedString (validUntil )).append ("\n " );
218355 sb .append (" serverTime: " ).append (toIndentedString (serverTime )).append ("\n " );
356+ sb .append (" supportedScenarios: " ).append (toIndentedString (supportedScenarios )).append ("\n " );
357+ sb .append (" metadata: " ).append (toIndentedString (metadata )).append ("\n " );
358+ sb .append (" documentsDatabase: " ).append (toIndentedString (documentsDatabase )).append ("\n " );
219359 sb .append ("}" );
220360 return sb .toString ();
221361 }
@@ -240,8 +380,12 @@ private String toIndentedString(Object o) {
240380 openapiFields .add ("version" );
241381 openapiFields .add ("license-id" );
242382 openapiFields .add ("license-serial" );
383+ openapiFields .add ("license-type" );
243384 openapiFields .add ("valid-until" );
244385 openapiFields .add ("server-time" );
386+ openapiFields .add ("supported-scenarios" );
387+ openapiFields .add ("metadata" );
388+ openapiFields .add ("documents-database" );
245389
246390 // a set of required properties/fields (JSON key names)
247391 openapiRequiredFields = new HashSet <String >();
@@ -293,6 +437,34 @@ public static void validateJsonElement(JsonElement jsonElement) throws IOExcepti
293437 "Expected the field `license-serial` to be a primitive type in the JSON string but got `%s`" ,
294438 jsonObj .get ("license-serial" ).toString ()));
295439 }
440+ if ((jsonObj .get ("license-type" ) != null && !jsonObj .get ("license-type" ).isJsonNull ())
441+ && !jsonObj .get ("license-type" ).isJsonPrimitive ()) {
442+ throw new IllegalArgumentException (
443+ String .format (
444+ "Expected the field `license-type` to be a primitive type in the JSON string but got `%s`" ,
445+ jsonObj .get ("license-type" ).toString ()));
446+ }
447+ if ((jsonObj .get ("server-time" ) != null && !jsonObj .get ("server-time" ).isJsonNull ())
448+ && !jsonObj .get ("server-time" ).isJsonPrimitive ()) {
449+ throw new IllegalArgumentException (
450+ String .format (
451+ "Expected the field `server-time` to be a primitive type in the JSON string but got `%s`" ,
452+ jsonObj .get ("server-time" ).toString ()));
453+ }
454+ // ensure the optional json data is an array if present
455+ if (jsonObj .get ("supported-scenarios" ) != null
456+ && !jsonObj .get ("supported-scenarios" ).isJsonNull ()
457+ && !jsonObj .get ("supported-scenarios" ).isJsonArray ()) {
458+ throw new IllegalArgumentException (
459+ String .format (
460+ "Expected the field `supported-scenarios` to be an array in the JSON string but got `%s`" ,
461+ jsonObj .get ("supported-scenarios" ).toString ()));
462+ }
463+ // validate the optional field `documents-database`
464+ if (jsonObj .get ("documents-database" ) != null
465+ && !jsonObj .get ("documents-database" ).isJsonNull ()) {
466+ DeviceInfoDocumentsDatabase .validateJsonElement (jsonObj .get ("documents-database" ));
467+ }
296468 }
297469
298470 public static class CustomTypeAdapterFactory implements TypeAdapterFactory {
0 commit comments