diff --git a/algoliasearch/src/main/java/com/algolia/model/recommend/BooleanString.java b/algoliasearch/src/main/java/com/algolia/model/recommend/BooleanString.java new file mode 100644 index 000000000..376687f33 --- /dev/null +++ b/algoliasearch/src/main/java/com/algolia/model/recommend/BooleanString.java @@ -0,0 +1,41 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost +// - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +package com.algolia.model.recommend; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +/** Gets or Sets booleanString */ +@JsonDeserialize(as = BooleanString.class) +public enum BooleanString implements IgnorePlurals { + TRUE("true"), + + FALSE("false"); + + private final String value; + + BooleanString(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static BooleanString fromValue(String value) { + for (BooleanString b : BooleanString.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/algoliasearch/src/main/java/com/algolia/model/recommend/IgnorePlurals.java b/algoliasearch/src/main/java/com/algolia/model/recommend/IgnorePlurals.java index 796ff5313..3a736ba73 100644 --- a/algoliasearch/src/main/java/com/algolia/model/recommend/IgnorePlurals.java +++ b/algoliasearch/src/main/java/com/algolia/model/recommend/IgnorePlurals.java @@ -94,6 +94,15 @@ public IgnorePlurals deserialize(JsonParser jp, DeserializationContext ctxt) thr ); } } + // deserialize BooleanString + if (tree.isTextual()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + return parser.readValueAs(BooleanString.class); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf BooleanString (error: " + e.getMessage() + ") (type: BooleanString)"); + } + } // deserialize Boolean if (tree.isBoolean()) { try (JsonParser parser = tree.traverse(jp.getCodec())) { diff --git a/algoliasearch/src/main/java/com/algolia/model/search/BooleanString.java b/algoliasearch/src/main/java/com/algolia/model/search/BooleanString.java new file mode 100644 index 000000000..a1ea79a42 --- /dev/null +++ b/algoliasearch/src/main/java/com/algolia/model/search/BooleanString.java @@ -0,0 +1,41 @@ +// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost +// - read more on https://github.com/algolia/api-clients-automation. DO NOT EDIT. + +package com.algolia.model.search; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.annotation.*; + +/** Gets or Sets booleanString */ +@JsonDeserialize(as = BooleanString.class) +public enum BooleanString implements IgnorePlurals { + TRUE("true"), + + FALSE("false"); + + private final String value; + + BooleanString(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static BooleanString fromValue(String value) { + for (BooleanString b : BooleanString.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} diff --git a/algoliasearch/src/main/java/com/algolia/model/search/IgnorePlurals.java b/algoliasearch/src/main/java/com/algolia/model/search/IgnorePlurals.java index f802a6081..8c17aba4d 100644 --- a/algoliasearch/src/main/java/com/algolia/model/search/IgnorePlurals.java +++ b/algoliasearch/src/main/java/com/algolia/model/search/IgnorePlurals.java @@ -94,6 +94,15 @@ public IgnorePlurals deserialize(JsonParser jp, DeserializationContext ctxt) thr ); } } + // deserialize BooleanString + if (tree.isTextual()) { + try (JsonParser parser = tree.traverse(jp.getCodec())) { + return parser.readValueAs(BooleanString.class); + } catch (Exception e) { + // deserialization failed, continue + LOGGER.finest("Failed to deserialize oneOf BooleanString (error: " + e.getMessage() + ") (type: BooleanString)"); + } + } // deserialize Boolean if (tree.isBoolean()) { try (JsonParser parser = tree.traverse(jp.getCodec())) {