From cd8f931886ceaaf454380621b7aa4a08c4a82251 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 14 Sep 2026 13:49:38 +0000 Subject: [PATCH] Regenerate client from commit 6fe2c5a of spec repo --- .generator/schemas/v2/openapi.yaml | 26 +- .../SearchCIAppTestEvents.java | 5 +- .../SearchCIAppTestEvents_1675695429.java | 5 +- .../client/v2/api/CiVisibilityTestsApi.java | 6 +- .../v2/model/CIAppTestEventsRequest.java | 10 +- .../v2/model/CIAppTestQueryPageLimit.java | 271 ++++++++++++++++++ .../v2/model/CIAppTestQueryPageOptions.java | 170 +++++++++++ 7 files changed, 480 insertions(+), 13 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v2/model/CIAppTestQueryPageLimit.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/CIAppTestQueryPageOptions.java diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f150f98ea1a..660641eb3a1 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -14574,6 +14574,7 @@ components: type: string x-enum-varnames: ["CIPIPELINE_RESOURCE_REQUEST"] CIAppEventAttributes: + additionalProperties: {} description: JSON object containing all event attributes and their associated values. properties: attributes: @@ -14895,6 +14896,7 @@ components: $ref: "#/components/schemas/CIAppPipelineEventTypeName" type: object CIAppPipelineEventAttributes: + additionalProperties: {} description: JSON object containing all event attributes and their associated values. properties: attributes: @@ -15789,7 +15791,7 @@ components: options: $ref: "#/components/schemas/CIAppQueryOptions" page: - $ref: "#/components/schemas/CIAppQueryPageOptions" + $ref: "#/components/schemas/CIAppTestQueryPageOptions" sort: $ref: "#/components/schemas/CIAppSort" type: object @@ -15812,6 +15814,28 @@ components: example: test type: string x-enum-varnames: ["SESSION", "MODULE", "SUITE", "TEST"] + CIAppTestQueryPageLimit: + default: 10 + description: Maximum number of events in the response, supplied as an integer or a string containing decimal digits. + example: 25 + oneOf: + - format: int32 + maximum: 1000 + minimum: 0 + type: integer + - pattern: "^(?:[0-9]{1,3}|1000)$" + type: string + CIAppTestQueryPageOptions: + description: Paging attributes for listing test events. + properties: + cursor: + description: |- + List following results with a cursor provided in the previous query. + example: "eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==" + type: string + limit: + $ref: "#/components/schemas/CIAppTestQueryPageLimit" + type: object CIAppTestsAggregateRequest: description: The object sent with the request to retrieve aggregation buckets of test events from your organization. properties: diff --git a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents.java b/examples/v2/ci-visibility-tests/SearchCIAppTestEvents.java index 8a5ade1e29e..d08b1d086d3 100644 --- a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents.java +++ b/examples/v2/ci-visibility-tests/SearchCIAppTestEvents.java @@ -5,10 +5,11 @@ import com.datadog.api.client.v2.api.CiVisibilityTestsApi; import com.datadog.api.client.v2.api.CiVisibilityTestsApi.SearchCIAppTestEventsOptionalParameters; import com.datadog.api.client.v2.model.CIAppQueryOptions; -import com.datadog.api.client.v2.model.CIAppQueryPageOptions; import com.datadog.api.client.v2.model.CIAppSort; import com.datadog.api.client.v2.model.CIAppTestEventsRequest; import com.datadog.api.client.v2.model.CIAppTestEventsResponse; +import com.datadog.api.client.v2.model.CIAppTestQueryPageLimit; +import com.datadog.api.client.v2.model.CIAppTestQueryPageOptions; import com.datadog.api.client.v2.model.CIAppTestsQueryFilter; public class Example { @@ -24,7 +25,7 @@ public static void main(String[] args) { .query("@test.service:web-ui-tests AND @test.status:skip") .to("now")) .options(new CIAppQueryOptions().timezone("GMT")) - .page(new CIAppQueryPageOptions().limit(25)) + .page(new CIAppTestQueryPageOptions().limit(new CIAppTestQueryPageLimit(25))) .sort(CIAppSort.TIMESTAMP_ASCENDING); try { diff --git a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.java b/examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.java index 1e1a347828b..0821238800d 100644 --- a/examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.java +++ b/examples/v2/ci-visibility-tests/SearchCIAppTestEvents_1675695429.java @@ -4,10 +4,11 @@ import com.datadog.api.client.PaginationIterable; import com.datadog.api.client.v2.api.CiVisibilityTestsApi; import com.datadog.api.client.v2.api.CiVisibilityTestsApi.SearchCIAppTestEventsOptionalParameters; -import com.datadog.api.client.v2.model.CIAppQueryPageOptions; import com.datadog.api.client.v2.model.CIAppSort; import com.datadog.api.client.v2.model.CIAppTestEvent; import com.datadog.api.client.v2.model.CIAppTestEventsRequest; +import com.datadog.api.client.v2.model.CIAppTestQueryPageLimit; +import com.datadog.api.client.v2.model.CIAppTestQueryPageOptions; import com.datadog.api.client.v2.model.CIAppTestsQueryFilter; public class Example { @@ -22,7 +23,7 @@ public static void main(String[] args) { .from("now-15m") .query("@test.status:pass AND -@language:python") .to("now")) - .page(new CIAppQueryPageOptions().limit(2)) + .page(new CIAppTestQueryPageOptions().limit(new CIAppTestQueryPageLimit(2))) .sort(CIAppSort.TIMESTAMP_ASCENDING); try { diff --git a/src/main/java/com/datadog/api/client/v2/api/CiVisibilityTestsApi.java b/src/main/java/com/datadog/api/client/v2/api/CiVisibilityTestsApi.java index de0625ce5ac..278b7489a52 100644 --- a/src/main/java/com/datadog/api/client/v2/api/CiVisibilityTestsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/CiVisibilityTestsApi.java @@ -5,11 +5,11 @@ import com.datadog.api.client.ApiResponse; import com.datadog.api.client.PaginationIterable; import com.datadog.api.client.Pair; -import com.datadog.api.client.v2.model.CIAppQueryPageOptions; import com.datadog.api.client.v2.model.CIAppSort; import com.datadog.api.client.v2.model.CIAppTestEvent; import com.datadog.api.client.v2.model.CIAppTestEventsRequest; import com.datadog.api.client.v2.model.CIAppTestEventsResponse; +import com.datadog.api.client.v2.model.CIAppTestQueryPageOptions; import com.datadog.api.client.v2.model.CIAppTestsAggregateRequest; import com.datadog.api.client.v2.model.CIAppTestsAnalyticsAggregateResponse; import jakarta.ws.rs.client.Invocation; @@ -600,14 +600,14 @@ public PaginationIterable searchCIAppTestEventsWithPagination( String valueGetterPath = "getMeta.getPage.getAfter"; String valueSetterPath = "body.getPage.setCursor"; Boolean valueSetterParamOptional = true; - Integer limit; + CIAppTestQueryPageLimit limit; if (parameters.body == null) { parameters.body(new CIAppTestEventsRequest()); } if (parameters.body.getPage() == null) { - parameters.body.setPage(new CIAppQueryPageOptions()); + parameters.body.setPage(new CIAppTestQueryPageOptions()); } if (parameters.body.getPage().getLimit() == null) { diff --git a/src/main/java/com/datadog/api/client/v2/model/CIAppTestEventsRequest.java b/src/main/java/com/datadog/api/client/v2/model/CIAppTestEventsRequest.java index fdfc2556de4..a7aa1a93db6 100644 --- a/src/main/java/com/datadog/api/client/v2/model/CIAppTestEventsRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/CIAppTestEventsRequest.java @@ -34,7 +34,7 @@ public class CIAppTestEventsRequest { private CIAppQueryOptions options; public static final String JSON_PROPERTY_PAGE = "page"; - private CIAppQueryPageOptions page; + private CIAppTestQueryPageOptions page; public static final String JSON_PROPERTY_SORT = "sort"; private CIAppSort sort; @@ -90,25 +90,25 @@ public void setOptions(CIAppQueryOptions options) { } } - public CIAppTestEventsRequest page(CIAppQueryPageOptions page) { + public CIAppTestEventsRequest page(CIAppTestQueryPageOptions page) { this.page = page; this.unparsed |= page.unparsed; return this; } /** - * Paging attributes for listing events. + * Paging attributes for listing test events. * * @return page */ @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_PAGE) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public CIAppQueryPageOptions getPage() { + public CIAppTestQueryPageOptions getPage() { return page; } - public void setPage(CIAppQueryPageOptions page) { + public void setPage(CIAppTestQueryPageOptions page) { this.page = page; if (page != null) { this.unparsed |= page.unparsed; diff --git a/src/main/java/com/datadog/api/client/v2/model/CIAppTestQueryPageLimit.java b/src/main/java/com/datadog/api/client/v2/model/CIAppTestQueryPageLimit.java new file mode 100644 index 00000000000..d4666977641 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CIAppTestQueryPageLimit.java @@ -0,0 +1,271 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = CIAppTestQueryPageLimit.CIAppTestQueryPageLimitDeserializer.class) +@JsonSerialize(using = CIAppTestQueryPageLimit.CIAppTestQueryPageLimitSerializer.class) +public class CIAppTestQueryPageLimit extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CIAppTestQueryPageLimit.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class CIAppTestQueryPageLimitSerializer + extends StdSerializer { + public CIAppTestQueryPageLimitSerializer(Class t) { + super(t); + } + + public CIAppTestQueryPageLimitSerializer() { + this(null); + } + + @Override + public void serialize( + CIAppTestQueryPageLimit value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class CIAppTestQueryPageLimitDeserializer + extends StdDeserializer { + public CIAppTestQueryPageLimitDeserializer() { + this(CIAppTestQueryPageLimit.class); + } + + public CIAppTestQueryPageLimitDeserializer(Class vc) { + super(vc); + } + + @Override + public CIAppTestQueryPageLimit deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize Integer + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Integer.class.equals(Integer.class) + || Integer.class.equals(Long.class) + || Integer.class.equals(Float.class) + || Integer.class.equals(Double.class) + || Integer.class.equals(Boolean.class) + || Integer.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((Integer.class.equals(Integer.class) || Integer.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Integer.class.equals(Float.class) || Integer.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (Integer.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Integer.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(Integer.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + deserialized = tmp; + match++; + + log.log(Level.FINER, "Input data matches schema 'Integer'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Integer'", e); + } + + // deserialize String + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (String.class.equals(Integer.class) + || String.class.equals(Long.class) + || String.class.equals(Float.class) + || String.class.equals(Double.class) + || String.class.equals(Boolean.class) + || String.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((String.class.equals(Integer.class) || String.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((String.class.equals(Float.class) || String.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (String.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (String.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(String.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + deserialized = tmp; + match++; + + log.log(Level.FINER, "Input data matches schema 'String'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + + CIAppTestQueryPageLimit ret = new CIAppTestQueryPageLimit(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public CIAppTestQueryPageLimit getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "CIAppTestQueryPageLimit cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public CIAppTestQueryPageLimit() { + super("oneOf", Boolean.FALSE); + } + + public CIAppTestQueryPageLimit(Integer o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public CIAppTestQueryPageLimit(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Integer", new GenericType() {}); + schemas.put("String", new GenericType() {}); + JSON.registerDescendants(CIAppTestQueryPageLimit.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return CIAppTestQueryPageLimit.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: Integer, String + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf(Integer.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(String.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException("Invalid instance type. Must be Integer, String"); + } + + /** + * Get the actual instance, which can be the following: Integer, String + * + * @return The actual instance (Integer, String) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Integer`. If the actual instance is not `Integer`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `Integer` + * @throws ClassCastException if the instance is not `Integer` + */ + public Integer getInteger() throws ClassCastException { + return (Integer) super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/CIAppTestQueryPageOptions.java b/src/main/java/com/datadog/api/client/v2/model/CIAppTestQueryPageOptions.java new file mode 100644 index 00000000000..8738c82b0ad --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/CIAppTestQueryPageOptions.java @@ -0,0 +1,170 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Paging attributes for listing test events. */ +@JsonPropertyOrder({ + CIAppTestQueryPageOptions.JSON_PROPERTY_CURSOR, + CIAppTestQueryPageOptions.JSON_PROPERTY_LIMIT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CIAppTestQueryPageOptions { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CURSOR = "cursor"; + private String cursor; + + public static final String JSON_PROPERTY_LIMIT = "limit"; + private CIAppTestQueryPageLimit limit = new CIAppTestQueryPageLimit(10); + + public CIAppTestQueryPageOptions cursor(String cursor) { + this.cursor = cursor; + return this; + } + + /** + * List following results with a cursor provided in the previous query. + * + * @return cursor + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CURSOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCursor() { + return cursor; + } + + public void setCursor(String cursor) { + this.cursor = cursor; + } + + public CIAppTestQueryPageOptions limit(CIAppTestQueryPageLimit limit) { + this.limit = limit; + this.unparsed |= limit.unparsed; + return this; + } + + /** + * Maximum number of events in the response, supplied as an integer or a string containing decimal + * digits. + * + * @return limit + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public CIAppTestQueryPageLimit getLimit() { + return limit; + } + + public void setLimit(CIAppTestQueryPageLimit limit) { + this.limit = limit; + if (limit != null) { + this.unparsed |= limit.unparsed; + } + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return CIAppTestQueryPageOptions + */ + @JsonAnySetter + public CIAppTestQueryPageOptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this CIAppTestQueryPageOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CIAppTestQueryPageOptions ciAppTestQueryPageOptions = (CIAppTestQueryPageOptions) o; + return Objects.equals(this.cursor, ciAppTestQueryPageOptions.cursor) + && Objects.equals(this.limit, ciAppTestQueryPageOptions.limit) + && Objects.equals( + this.additionalProperties, ciAppTestQueryPageOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cursor, limit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CIAppTestQueryPageOptions {\n"); + sb.append(" cursor: ").append(toIndentedString(cursor)).append("\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +}