Skip to content

Commit 5634625

Browse files
committed
Regenerates for latest OpenAPI Generator CLI
Picks up: OpenAPITools/openapi-generator#24643
1 parent 381a475 commit 5634625

31 files changed

Lines changed: 116 additions & 29 deletions

‎src/main/java/com/zamzar/api/invoker/ApiClient.java‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,17 @@ public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) {
384384
return this;
385385
}
386386

387+
/**
388+
* <p>Set LocalDateTimeFormat.</p>
389+
*
390+
* @param dateFormat a {@link java.time.format.DateTimeFormatter} object
391+
* @return a {@link com.zamzar.api.invoker.ApiClient} object
392+
*/
393+
public ApiClient setLocalDateTimeFormat(DateTimeFormatter dateFormat) {
394+
JSON.setLocalDateTimeFormat(dateFormat);
395+
return this;
396+
}
397+
387398
/**
388399
* <p>Set LenientOnJson.</p>
389400
*

‎src/main/java/com/zamzar/api/invoker/ApiException.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* <p>ApiException class.</p>
2222
*/
2323
@SuppressWarnings("serial")
24-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.24.0")
24+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.25.0")
2525
public class ApiException extends Exception {
2626
private static final long serialVersionUID = 1L;
2727

‎src/main/java/com/zamzar/api/invoker/Configuration.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import java.util.concurrent.atomic.AtomicReference;
1818
import java.util.function.Supplier;
1919

20-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.24.0")
20+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.25.0")
2121
public class Configuration {
2222
public static final String VERSION = "1.1.12";
2323

‎src/main/java/com/zamzar/api/invoker/JSON.java‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
import java.text.ParseException;
3737
import java.text.ParsePosition;
3838
import java.time.LocalDate;
39+
import java.time.LocalDateTime;
3940
import java.time.OffsetDateTime;
4041
import java.time.format.DateTimeFormatter;
42+
import java.time.format.DateTimeParseException;
4143
import java.util.Date;
4244
import java.util.Locale;
4345
import java.util.Map;
@@ -56,6 +58,7 @@ public class JSON {
5658
private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter();
5759
private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter();
5860
private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter();
61+
private static LocalDateTimeTypeAdapter localDateTimeTypeAdapter = new LocalDateTimeTypeAdapter();
5962
private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter();
6063

6164
@SuppressWarnings("unchecked")
@@ -95,6 +98,7 @@ private static Class getClassByDiscriminator(Map classByDiscriminatorValue, Stri
9598
gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter);
9699
gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter);
97100
gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter);
101+
gsonBuilder.registerTypeAdapter(LocalDateTime.class, localDateTimeTypeAdapter);
98102
gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter);
99103
gsonBuilder.registerTypeAdapterFactory(new com.zamzar.api.model.Account.CustomTypeAdapterFactory());
100104
gsonBuilder.registerTypeAdapterFactory(new com.zamzar.api.model.AccountPlan.CustomTypeAdapterFactory());
@@ -315,6 +319,55 @@ public LocalDate read(JsonReader in) throws IOException {
315319
}
316320
}
317321

322+
/**
323+
* Gson TypeAdapter for JSR310 LocalDateTime type
324+
*/
325+
public static class LocalDateTimeTypeAdapter extends TypeAdapter<LocalDateTime> {
326+
327+
private DateTimeFormatter formatter;
328+
329+
public LocalDateTimeTypeAdapter() {
330+
this(DateTimeFormatter.ISO_LOCAL_DATE_TIME);
331+
}
332+
333+
public LocalDateTimeTypeAdapter(DateTimeFormatter formatter) {
334+
this.formatter = formatter;
335+
}
336+
337+
public void setFormat(DateTimeFormatter dateFormat) {
338+
this.formatter = dateFormat;
339+
}
340+
341+
@Override
342+
public void write(JsonWriter out, LocalDateTime date) throws IOException {
343+
if (date == null) {
344+
out.nullValue();
345+
} else {
346+
out.value(formatter.format(date));
347+
}
348+
}
349+
350+
@Override
351+
public LocalDateTime read(JsonReader in) throws IOException {
352+
switch (in.peek()) {
353+
case NULL:
354+
in.nextNull();
355+
return null;
356+
default:
357+
String date = in.nextString();
358+
try {
359+
return LocalDateTime.parse(date, formatter);
360+
} catch (DateTimeParseException e) {
361+
if (date.length() > 10 && date.charAt(10) == ' ') {
362+
date = date.substring(0, 10) + 'T' + date.substring(11);
363+
return LocalDateTime.parse(date, formatter);
364+
}
365+
throw e;
366+
}
367+
}
368+
}
369+
}
370+
318371
public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) {
319372
offsetDateTimeTypeAdapter.setFormat(dateFormat);
320373
}
@@ -323,6 +376,10 @@ public static void setLocalDateFormat(DateTimeFormatter dateFormat) {
323376
localDateTypeAdapter.setFormat(dateFormat);
324377
}
325378

379+
public static void setLocalDateTimeFormat(DateTimeFormatter dateFormat) {
380+
localDateTimeTypeAdapter.setFormat(dateFormat);
381+
}
382+
326383
/**
327384
* Gson TypeAdapter for java.sql.Date type
328385
* If the dateFormat is null, a simple "yyyy-MM-dd" format will be used

‎src/main/java/com/zamzar/api/invoker/Pair.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
package com.zamzar.api.invoker;
1515

16-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.24.0")
16+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.25.0")
1717
public class Pair {
1818
private final String name;
1919
private final String value;

‎src/main/java/com/zamzar/api/invoker/ServerConfiguration.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* Representing a Server configuration.
2020
*/
21-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.24.0")
21+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.25.0")
2222
public class ServerConfiguration {
2323
public String URL;
2424
public String description;

‎src/main/java/com/zamzar/api/invoker/ServerVariable.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
/**
1919
* Representing a Server Variable for server URL template substitution.
2020
*/
21-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.24.0")
21+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.25.0")
2222
public class ServerVariable {
2323
public String description;
2424
public String defaultValue;

‎src/main/java/com/zamzar/api/invoker/StringUtil.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import java.util.Collection;
1717
import java.util.Iterator;
1818

19-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.24.0")
19+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.25.0")
2020
public class StringUtil {
2121
/**
2222
* Check if the given array contains the given value (with case-insensitive comparison).

‎src/main/java/com/zamzar/api/invoker/auth/ApiKeyAuth.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Map;
2121
import java.util.List;
2222

23-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.24.0")
23+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.25.0")
2424
public class ApiKeyAuth implements Authentication {
2525
private final String location;
2626
private final String paramName;

‎src/main/java/com/zamzar/api/invoker/auth/Authentication.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import java.util.Map;
2121
import java.util.List;
2222

23-
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.24.0")
23+
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.25.0")
2424
public interface Authentication {
2525
/**
2626
* Apply authentication settings to header and query params.

0 commit comments

Comments
 (0)