From f33c203c2f79b29fbba9f49d85c1edf16ab77926 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Wed, 9 Sep 2026 19:57:46 +0000 Subject: [PATCH] Regenerate client from commit 4e999a5 of spec repo --- .generator/schemas/v1/openapi.yaml | 117 +++ .../v1/model/EmbeddedAppWidgetDefinition.java | 401 ++++++++++ .../EmbeddedAppWidgetDefinitionType.java | 58 ++ .../v1/model/EmbeddedAppWidgetInput.java | 126 ++++ .../v1/model/EmbeddedAppWidgetInputValue.java | 710 ++++++++++++++++++ ...beddedAppWidgetInputValueBooleanArray.java | 116 +++ ...mbeddedAppWidgetInputValueNumberArray.java | 116 +++ ...mbeddedAppWidgetInputValueObjectArray.java | 116 +++ ...mbeddedAppWidgetInputValueStringArray.java | 116 +++ .../api/client/v1/model/WidgetDefinition.java | 147 +++- 10 files changed, 1985 insertions(+), 38 deletions(-) create mode 100644 src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetDefinition.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetDefinitionType.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInput.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValue.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueBooleanArray.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueNumberArray.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueObjectArray.java create mode 100644 src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueStringArray.java diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 8f7dd59808d..614dd8c0731 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -2623,6 +2623,122 @@ components: nullable: true type: array type: object + EmbeddedAppWidgetDefinition: + additionalProperties: false + anyOf: + - required: + - app_id + - required: + - template_id + description: The embedded app widget displays an App Builder app on a dashboard. Exactly one of `app_id` or `template_id` must be provided; they cannot be provided together. + properties: + app_id: + description: UUID of the App Builder app to embed. + example: "7e7745f9-4343-4927-b038-80934a355915" + type: string + custom_links: + description: List of custom links. + items: + $ref: '#/components/schemas/WidgetCustomLink' + type: array + description: + description: The description of the widget. + maxLength: 5000 + type: string + inputs: + description: Inputs passed to the embedded app. + items: + $ref: '#/components/schemas/EmbeddedAppWidgetInput' + type: array + template_id: + description: ID of the built-in app template to embed. + example: ec2_manager + type: string + time: + $ref: '#/components/schemas/WidgetTime' + title: + description: Title of the widget. + type: string + title_align: + $ref: '#/components/schemas/WidgetTextAlign' + title_size: + description: Size of the title. + type: string + type: + $ref: '#/components/schemas/EmbeddedAppWidgetDefinitionType' + required: + - type + type: object + EmbeddedAppWidgetDefinitionType: + default: embedded_app + description: Type of the embedded app widget. + enum: + - embedded_app + example: embedded_app + type: string + x-enum-varnames: + - EMBEDDED_APP + EmbeddedAppWidgetInput: + additionalProperties: false + description: An input passed to the embedded app. + properties: + name: + description: Name of the app input. + example: environment + type: string + value: + $ref: '#/components/schemas/EmbeddedAppWidgetInputValue' + required: + - name + - value + type: object + EmbeddedAppWidgetInputValue: + description: Value of the app input. This can be a string, number, boolean, object, or a non-empty homogeneous array of those types. + example: production + oneOf: + - type: string + - format: double + type: number + - type: boolean + - $ref: '#/components/schemas/EmbeddedAppWidgetInputValueObject' + - $ref: '#/components/schemas/EmbeddedAppWidgetInputValueStringArray' + - $ref: '#/components/schemas/EmbeddedAppWidgetInputValueNumberArray' + - $ref: '#/components/schemas/EmbeddedAppWidgetInputValueBooleanArray' + - $ref: '#/components/schemas/EmbeddedAppWidgetInputValueObjectArray' + EmbeddedAppWidgetInputValueBooleanArray: + description: An array of boolean values passed to the embedded app. + items: + description: A boolean value passed to the embedded app. + type: boolean + type: array + x-generate-alias-as-model: true + EmbeddedAppWidgetInputValueNumberArray: + description: An array of numeric values passed to the embedded app. + items: + description: A numeric value passed to the embedded app. + format: double + type: number + type: array + x-generate-alias-as-model: true + EmbeddedAppWidgetInputValueObject: + additionalProperties: {} + description: An arbitrary object value passed to the embedded app. + type: object + EmbeddedAppWidgetInputValueObjectArray: + description: An array of object values passed to the embedded app. + items: + additionalProperties: {} + description: An object value passed to the embedded app. + type: object + type: array + x-generate-alias-as-model: true + EmbeddedAppWidgetInputValueStringArray: + description: An array of string values passed to the embedded app. + items: + description: A string value passed to the embedded app. + type: string + type: array + x-generate-alias-as-model: true Event: description: Object representing an event. properties: @@ -28167,6 +28283,7 @@ components: - $ref: '#/components/schemas/CheckStatusWidgetDefinition' - $ref: '#/components/schemas/CohortWidgetDefinition' - $ref: '#/components/schemas/DistributionWidgetDefinition' + - $ref: '#/components/schemas/EmbeddedAppWidgetDefinition' - $ref: '#/components/schemas/EventStreamWidgetDefinition' - $ref: '#/components/schemas/EventTimelineWidgetDefinition' - $ref: '#/components/schemas/FreeTextWidgetDefinition' diff --git a/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetDefinition.java b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetDefinition.java new file mode 100644 index 00000000000..c72c7454509 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetDefinition.java @@ -0,0 +1,401 @@ +/* + * 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.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +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.ArrayList; +import java.util.List; +import java.util.Objects; + +/** + * The embedded app widget displays an App Builder app on a dashboard. Exactly one of app_id + * or template_id must be provided; they cannot be provided together. + */ +@JsonPropertyOrder({ + EmbeddedAppWidgetDefinition.JSON_PROPERTY_APP_ID, + EmbeddedAppWidgetDefinition.JSON_PROPERTY_CUSTOM_LINKS, + EmbeddedAppWidgetDefinition.JSON_PROPERTY_DESCRIPTION, + EmbeddedAppWidgetDefinition.JSON_PROPERTY_INPUTS, + EmbeddedAppWidgetDefinition.JSON_PROPERTY_TEMPLATE_ID, + EmbeddedAppWidgetDefinition.JSON_PROPERTY_TIME, + EmbeddedAppWidgetDefinition.JSON_PROPERTY_TITLE, + EmbeddedAppWidgetDefinition.JSON_PROPERTY_TITLE_ALIGN, + EmbeddedAppWidgetDefinition.JSON_PROPERTY_TITLE_SIZE, + EmbeddedAppWidgetDefinition.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EmbeddedAppWidgetDefinition { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_APP_ID = "app_id"; + private String appId; + + public static final String JSON_PROPERTY_CUSTOM_LINKS = "custom_links"; + private List customLinks = null; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_INPUTS = "inputs"; + private List inputs = null; + + public static final String JSON_PROPERTY_TEMPLATE_ID = "template_id"; + private String templateId; + + public static final String JSON_PROPERTY_TIME = "time"; + private WidgetTime time; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_TITLE_ALIGN = "title_align"; + private WidgetTextAlign titleAlign; + + public static final String JSON_PROPERTY_TITLE_SIZE = "title_size"; + private String titleSize; + + public static final String JSON_PROPERTY_TYPE = "type"; + private EmbeddedAppWidgetDefinitionType type = EmbeddedAppWidgetDefinitionType.EMBEDDED_APP; + + public EmbeddedAppWidgetDefinition() {} + + @JsonCreator + public EmbeddedAppWidgetDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + EmbeddedAppWidgetDefinitionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + } + + public EmbeddedAppWidgetDefinition appId(String appId) { + this.appId = appId; + return this; + } + + /** + * UUID of the App Builder app to embed. + * + * @return appId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_APP_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public EmbeddedAppWidgetDefinition customLinks(List customLinks) { + this.customLinks = customLinks; + if (customLinks != null) { + for (WidgetCustomLink item : customLinks) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public EmbeddedAppWidgetDefinition addCustomLinksItem(WidgetCustomLink customLinksItem) { + if (this.customLinks == null) { + this.customLinks = new ArrayList<>(); + } + this.customLinks.add(customLinksItem); + this.unparsed |= customLinksItem.unparsed; + return this; + } + + /** + * List of custom links. + * + * @return customLinks + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOM_LINKS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCustomLinks() { + return customLinks; + } + + public void setCustomLinks(List customLinks) { + this.customLinks = customLinks; + if (customLinks != null) { + for (WidgetCustomLink item : customLinks) { + this.unparsed |= item.unparsed; + } + } + } + + public EmbeddedAppWidgetDefinition description(String description) { + this.description = description; + return this; + } + + /** + * The description of the widget. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public EmbeddedAppWidgetDefinition inputs(List inputs) { + this.inputs = inputs; + if (inputs != null) { + for (EmbeddedAppWidgetInput item : inputs) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public EmbeddedAppWidgetDefinition addInputsItem(EmbeddedAppWidgetInput inputsItem) { + if (this.inputs == null) { + this.inputs = new ArrayList<>(); + } + this.inputs.add(inputsItem); + this.unparsed |= inputsItem.unparsed; + return this; + } + + /** + * Inputs passed to the embedded app. + * + * @return inputs + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INPUTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getInputs() { + return inputs; + } + + public void setInputs(List inputs) { + this.inputs = inputs; + if (inputs != null) { + for (EmbeddedAppWidgetInput item : inputs) { + this.unparsed |= item.unparsed; + } + } + } + + public EmbeddedAppWidgetDefinition templateId(String templateId) { + this.templateId = templateId; + return this; + } + + /** + * ID of the built-in app template to embed. + * + * @return templateId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEMPLATE_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTemplateId() { + return templateId; + } + + public void setTemplateId(String templateId) { + this.templateId = templateId; + } + + public EmbeddedAppWidgetDefinition time(WidgetTime time) { + this.time = time; + this.unparsed |= time.unparsed; + return this; + } + + /** + * Time setting for the widget. + * + * @return time + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetTime getTime() { + return time; + } + + public void setTime(WidgetTime time) { + this.time = time; + if (time != null) { + this.unparsed |= time.unparsed; + } + } + + public EmbeddedAppWidgetDefinition title(String title) { + this.title = title; + return this; + } + + /** + * Title of the widget. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public EmbeddedAppWidgetDefinition titleAlign(WidgetTextAlign titleAlign) { + this.titleAlign = titleAlign; + this.unparsed |= !titleAlign.isValid(); + return this; + } + + /** + * How to align the text on the widget. + * + * @return titleAlign + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE_ALIGN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public WidgetTextAlign getTitleAlign() { + return titleAlign; + } + + public void setTitleAlign(WidgetTextAlign titleAlign) { + if (!titleAlign.isValid()) { + this.unparsed = true; + } + this.titleAlign = titleAlign; + } + + public EmbeddedAppWidgetDefinition titleSize(String titleSize) { + this.titleSize = titleSize; + return this; + } + + /** + * Size of the title. + * + * @return titleSize + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE_SIZE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitleSize() { + return titleSize; + } + + public void setTitleSize(String titleSize) { + this.titleSize = titleSize; + } + + public EmbeddedAppWidgetDefinition type(EmbeddedAppWidgetDefinitionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the embedded app widget. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EmbeddedAppWidgetDefinitionType getType() { + return type; + } + + public void setType(EmbeddedAppWidgetDefinitionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** Return true if this EmbeddedAppWidgetDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmbeddedAppWidgetDefinition embeddedAppWidgetDefinition = (EmbeddedAppWidgetDefinition) o; + return Objects.equals(this.appId, embeddedAppWidgetDefinition.appId) + && Objects.equals(this.customLinks, embeddedAppWidgetDefinition.customLinks) + && Objects.equals(this.description, embeddedAppWidgetDefinition.description) + && Objects.equals(this.inputs, embeddedAppWidgetDefinition.inputs) + && Objects.equals(this.templateId, embeddedAppWidgetDefinition.templateId) + && Objects.equals(this.time, embeddedAppWidgetDefinition.time) + && Objects.equals(this.title, embeddedAppWidgetDefinition.title) + && Objects.equals(this.titleAlign, embeddedAppWidgetDefinition.titleAlign) + && Objects.equals(this.titleSize, embeddedAppWidgetDefinition.titleSize) + && Objects.equals(this.type, embeddedAppWidgetDefinition.type); + } + + @Override + public int hashCode() { + return Objects.hash( + appId, + customLinks, + description, + inputs, + templateId, + time, + title, + titleAlign, + titleSize, + type); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedAppWidgetDefinition {\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" customLinks: ").append(toIndentedString(customLinks)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" inputs: ").append(toIndentedString(inputs)).append("\n"); + sb.append(" templateId: ").append(toIndentedString(templateId)).append("\n"); + sb.append(" time: ").append(toIndentedString(time)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" titleAlign: ").append(toIndentedString(titleAlign)).append("\n"); + sb.append(" titleSize: ").append(toIndentedString(titleSize)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetDefinitionType.java b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetDefinitionType.java new file mode 100644 index 00000000000..085a31bcea2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetDefinitionType.java @@ -0,0 +1,58 @@ +/* + * 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.v1.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Type of the embedded app widget. */ +@JsonSerialize( + using = EmbeddedAppWidgetDefinitionType.EmbeddedAppWidgetDefinitionTypeSerializer.class) +public class EmbeddedAppWidgetDefinitionType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("embedded_app")); + + public static final EmbeddedAppWidgetDefinitionType EMBEDDED_APP = + new EmbeddedAppWidgetDefinitionType("embedded_app"); + + EmbeddedAppWidgetDefinitionType(String value) { + super(value, allowedValues); + } + + public static class EmbeddedAppWidgetDefinitionTypeSerializer + extends StdSerializer { + public EmbeddedAppWidgetDefinitionTypeSerializer(Class t) { + super(t); + } + + public EmbeddedAppWidgetDefinitionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + EmbeddedAppWidgetDefinitionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static EmbeddedAppWidgetDefinitionType fromValue(String value) { + return new EmbeddedAppWidgetDefinitionType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInput.java b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInput.java new file mode 100644 index 00000000000..c443f294d2c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInput.java @@ -0,0 +1,126 @@ +/* + * 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.v1.model; + +import com.fasterxml.jackson.annotation.JsonCreator; +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.Objects; + +/** An input passed to the embedded app. */ +@JsonPropertyOrder({ + EmbeddedAppWidgetInput.JSON_PROPERTY_NAME, + EmbeddedAppWidgetInput.JSON_PROPERTY_VALUE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EmbeddedAppWidgetInput { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_VALUE = "value"; + private EmbeddedAppWidgetInputValue value; + + public EmbeddedAppWidgetInput() {} + + @JsonCreator + public EmbeddedAppWidgetInput( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) + EmbeddedAppWidgetInputValue value) { + this.name = name; + this.value = value; + this.unparsed |= value.unparsed; + } + + public EmbeddedAppWidgetInput name(String name) { + this.name = name; + return this; + } + + /** + * Name of the app input. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public EmbeddedAppWidgetInput value(EmbeddedAppWidgetInputValue value) { + this.value = value; + this.unparsed |= value.unparsed; + return this; + } + + /** + * Value of the app input. This can be a string, number, boolean, object, or a non-empty + * homogeneous array of those types. + * + * @return value + */ + @JsonProperty(JSON_PROPERTY_VALUE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public EmbeddedAppWidgetInputValue getValue() { + return value; + } + + public void setValue(EmbeddedAppWidgetInputValue value) { + this.value = value; + if (value != null) { + this.unparsed |= value.unparsed; + } + } + + /** Return true if this EmbeddedAppWidgetInput object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmbeddedAppWidgetInput embeddedAppWidgetInput = (EmbeddedAppWidgetInput) o; + return Objects.equals(this.name, embeddedAppWidgetInput.name) + && Objects.equals(this.value, embeddedAppWidgetInput.value); + } + + @Override + public int hashCode() { + return Objects.hash(name, value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedAppWidgetInput {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValue.java b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValue.java new file mode 100644 index 00000000000..06de6f57e8c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValue.java @@ -0,0 +1,710 @@ +/* + * 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.v1.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 = EmbeddedAppWidgetInputValue.EmbeddedAppWidgetInputValueDeserializer.class) +@JsonSerialize(using = EmbeddedAppWidgetInputValue.EmbeddedAppWidgetInputValueSerializer.class) +public class EmbeddedAppWidgetInputValue extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(EmbeddedAppWidgetInputValue.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class EmbeddedAppWidgetInputValueSerializer + extends StdSerializer { + public EmbeddedAppWidgetInputValueSerializer(Class t) { + super(t); + } + + public EmbeddedAppWidgetInputValueSerializer() { + this(null); + } + + @Override + public void serialize( + EmbeddedAppWidgetInputValue value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class EmbeddedAppWidgetInputValueDeserializer + extends StdDeserializer { + public EmbeddedAppWidgetInputValueDeserializer() { + this(EmbeddedAppWidgetInputValue.class); + } + + public EmbeddedAppWidgetInputValueDeserializer(Class vc) { + super(vc); + } + + @Override + public EmbeddedAppWidgetInputValue 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 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); + } + + // deserialize Double + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Double.class.equals(Integer.class) + || Double.class.equals(Long.class) + || Double.class.equals(Float.class) + || Double.class.equals(Double.class) + || Double.class.equals(Boolean.class) + || Double.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((Double.class.equals(Integer.class) || Double.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Double.class.equals(Float.class) || Double.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (Double.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Double.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(Double.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 'Double'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Double'", e); + } + + // deserialize Boolean + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Boolean.class.equals(Integer.class) + || Boolean.class.equals(Long.class) + || Boolean.class.equals(Float.class) + || Boolean.class.equals(Double.class) + || Boolean.class.equals(Boolean.class) + || Boolean.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((Boolean.class.equals(Integer.class) || Boolean.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Boolean.class.equals(Float.class) || Boolean.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (Boolean.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (Boolean.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(Boolean.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 'Boolean'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Boolean'", e); + } + + // deserialize Map + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (Map.class.equals(Integer.class) + || Map.class.equals(Long.class) + || Map.class.equals(Float.class) + || Map.class.equals(Double.class) + || Map.class.equals(Boolean.class) + || Map.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((Map.class.equals(Integer.class) || Map.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((Map.class.equals(Float.class) || Map.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (Map.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= (Map.class.equals(String.class) && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()).readValueAs(new TypeReference>() {}); + // 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 'Map'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'Map'", e); + } + + // deserialize EmbeddedAppWidgetInputValueStringArray + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EmbeddedAppWidgetInputValueStringArray.class.equals(Integer.class) + || EmbeddedAppWidgetInputValueStringArray.class.equals(Long.class) + || EmbeddedAppWidgetInputValueStringArray.class.equals(Float.class) + || EmbeddedAppWidgetInputValueStringArray.class.equals(Double.class) + || EmbeddedAppWidgetInputValueStringArray.class.equals(Boolean.class) + || EmbeddedAppWidgetInputValueStringArray.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((EmbeddedAppWidgetInputValueStringArray.class.equals(Integer.class) + || EmbeddedAppWidgetInputValueStringArray.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EmbeddedAppWidgetInputValueStringArray.class.equals(Float.class) + || EmbeddedAppWidgetInputValueStringArray.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (EmbeddedAppWidgetInputValueStringArray.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EmbeddedAppWidgetInputValueStringArray.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(EmbeddedAppWidgetInputValueStringArray.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. + if (!((EmbeddedAppWidgetInputValueStringArray) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, "Input data matches schema 'EmbeddedAppWidgetInputValueStringArray'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'EmbeddedAppWidgetInputValueStringArray'", + e); + } + + // deserialize EmbeddedAppWidgetInputValueNumberArray + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EmbeddedAppWidgetInputValueNumberArray.class.equals(Integer.class) + || EmbeddedAppWidgetInputValueNumberArray.class.equals(Long.class) + || EmbeddedAppWidgetInputValueNumberArray.class.equals(Float.class) + || EmbeddedAppWidgetInputValueNumberArray.class.equals(Double.class) + || EmbeddedAppWidgetInputValueNumberArray.class.equals(Boolean.class) + || EmbeddedAppWidgetInputValueNumberArray.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((EmbeddedAppWidgetInputValueNumberArray.class.equals(Integer.class) + || EmbeddedAppWidgetInputValueNumberArray.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EmbeddedAppWidgetInputValueNumberArray.class.equals(Float.class) + || EmbeddedAppWidgetInputValueNumberArray.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (EmbeddedAppWidgetInputValueNumberArray.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EmbeddedAppWidgetInputValueNumberArray.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(EmbeddedAppWidgetInputValueNumberArray.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. + if (!((EmbeddedAppWidgetInputValueNumberArray) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, "Input data matches schema 'EmbeddedAppWidgetInputValueNumberArray'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'EmbeddedAppWidgetInputValueNumberArray'", + e); + } + + // deserialize EmbeddedAppWidgetInputValueBooleanArray + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EmbeddedAppWidgetInputValueBooleanArray.class.equals(Integer.class) + || EmbeddedAppWidgetInputValueBooleanArray.class.equals(Long.class) + || EmbeddedAppWidgetInputValueBooleanArray.class.equals(Float.class) + || EmbeddedAppWidgetInputValueBooleanArray.class.equals(Double.class) + || EmbeddedAppWidgetInputValueBooleanArray.class.equals(Boolean.class) + || EmbeddedAppWidgetInputValueBooleanArray.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((EmbeddedAppWidgetInputValueBooleanArray.class.equals(Integer.class) + || EmbeddedAppWidgetInputValueBooleanArray.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EmbeddedAppWidgetInputValueBooleanArray.class.equals(Float.class) + || EmbeddedAppWidgetInputValueBooleanArray.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (EmbeddedAppWidgetInputValueBooleanArray.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EmbeddedAppWidgetInputValueBooleanArray.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(EmbeddedAppWidgetInputValueBooleanArray.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. + if (!((EmbeddedAppWidgetInputValueBooleanArray) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, "Input data matches schema 'EmbeddedAppWidgetInputValueBooleanArray'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'EmbeddedAppWidgetInputValueBooleanArray'", + e); + } + + // deserialize EmbeddedAppWidgetInputValueObjectArray + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EmbeddedAppWidgetInputValueObjectArray.class.equals(Integer.class) + || EmbeddedAppWidgetInputValueObjectArray.class.equals(Long.class) + || EmbeddedAppWidgetInputValueObjectArray.class.equals(Float.class) + || EmbeddedAppWidgetInputValueObjectArray.class.equals(Double.class) + || EmbeddedAppWidgetInputValueObjectArray.class.equals(Boolean.class) + || EmbeddedAppWidgetInputValueObjectArray.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((EmbeddedAppWidgetInputValueObjectArray.class.equals(Integer.class) + || EmbeddedAppWidgetInputValueObjectArray.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EmbeddedAppWidgetInputValueObjectArray.class.equals(Float.class) + || EmbeddedAppWidgetInputValueObjectArray.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (EmbeddedAppWidgetInputValueObjectArray.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EmbeddedAppWidgetInputValueObjectArray.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(EmbeddedAppWidgetInputValueObjectArray.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. + if (!((EmbeddedAppWidgetInputValueObjectArray) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, "Input data matches schema 'EmbeddedAppWidgetInputValueObjectArray'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'EmbeddedAppWidgetInputValueObjectArray'", + e); + } + + EmbeddedAppWidgetInputValue ret = new EmbeddedAppWidgetInputValue(); + 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 EmbeddedAppWidgetInputValue getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException( + ctxt.getParser(), "EmbeddedAppWidgetInputValue cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public EmbeddedAppWidgetInputValue() { + super("oneOf", Boolean.FALSE); + } + + public EmbeddedAppWidgetInputValue(String o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EmbeddedAppWidgetInputValue(Double o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EmbeddedAppWidgetInputValue(Boolean o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EmbeddedAppWidgetInputValue(Map o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EmbeddedAppWidgetInputValue(EmbeddedAppWidgetInputValueStringArray o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EmbeddedAppWidgetInputValue(EmbeddedAppWidgetInputValueNumberArray o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EmbeddedAppWidgetInputValue(EmbeddedAppWidgetInputValueBooleanArray o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public EmbeddedAppWidgetInputValue(EmbeddedAppWidgetInputValueObjectArray o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", new GenericType() {}); + schemas.put("Double", new GenericType() {}); + schemas.put("Boolean", new GenericType() {}); + schemas.put("Map", new GenericType>() {}); + schemas.put( + "EmbeddedAppWidgetInputValueStringArray", + new GenericType() {}); + schemas.put( + "EmbeddedAppWidgetInputValueNumberArray", + new GenericType() {}); + schemas.put( + "EmbeddedAppWidgetInputValueBooleanArray", + new GenericType() {}); + schemas.put( + "EmbeddedAppWidgetInputValueObjectArray", + new GenericType() {}); + JSON.registerDescendants( + EmbeddedAppWidgetInputValue.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return EmbeddedAppWidgetInputValue.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: String, Double, Boolean, Map<String, Object>, + * EmbeddedAppWidgetInputValueStringArray, EmbeddedAppWidgetInputValueNumberArray, + * EmbeddedAppWidgetInputValueBooleanArray, EmbeddedAppWidgetInputValueObjectArray + * + *

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(String.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(Double.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(Boolean.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf(Map.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + EmbeddedAppWidgetInputValueStringArray.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + EmbeddedAppWidgetInputValueNumberArray.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + EmbeddedAppWidgetInputValueBooleanArray.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + EmbeddedAppWidgetInputValueObjectArray.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 String, Double, Boolean, Map," + + " EmbeddedAppWidgetInputValueStringArray, EmbeddedAppWidgetInputValueNumberArray," + + " EmbeddedAppWidgetInputValueBooleanArray, EmbeddedAppWidgetInputValueObjectArray"); + } + + /** + * Get the actual instance, which can be the following: String, Double, Boolean, Map<String, + * Object>, EmbeddedAppWidgetInputValueStringArray, EmbeddedAppWidgetInputValueNumberArray, + * EmbeddedAppWidgetInputValueBooleanArray, EmbeddedAppWidgetInputValueObjectArray + * + * @return The actual instance (String, Double, Boolean, Map<String, Object>, + * EmbeddedAppWidgetInputValueStringArray, EmbeddedAppWidgetInputValueNumberArray, + * EmbeddedAppWidgetInputValueBooleanArray, EmbeddedAppWidgetInputValueObjectArray) + */ + @Override + public Object getActualInstance() { + return 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(); + } + + /** + * Get the actual instance of `Double`. If the actual instance is not `Double`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `Double` + * @throws ClassCastException if the instance is not `Double` + */ + public Double getDouble() throws ClassCastException { + return (Double) super.getActualInstance(); + } + + /** + * Get the actual instance of `Boolean`. If the actual instance is not `Boolean`, the + * ClassCastException will be thrown. + * + * @return The actual instance of `Boolean` + * @throws ClassCastException if the instance is not `Boolean` + */ + public Boolean getBoolean() throws ClassCastException { + return (Boolean) super.getActualInstance(); + } + + /** + * Get the actual instance of `Map<String, Object>`. If the actual instance is not + * `Map<String, Object>`, the ClassCastException will be thrown. + * + * @return The actual instance of `Map<String, Object>` + * @throws ClassCastException if the instance is not `Map<String, Object>` + */ + public Map getMap() throws ClassCastException { + return (Map) super.getActualInstance(); + } + + /** + * Get the actual instance of `EmbeddedAppWidgetInputValueStringArray`. If the actual instance is + * not `EmbeddedAppWidgetInputValueStringArray`, the ClassCastException will be thrown. + * + * @return The actual instance of `EmbeddedAppWidgetInputValueStringArray` + * @throws ClassCastException if the instance is not `EmbeddedAppWidgetInputValueStringArray` + */ + public EmbeddedAppWidgetInputValueStringArray getEmbeddedAppWidgetInputValueStringArray() + throws ClassCastException { + return (EmbeddedAppWidgetInputValueStringArray) super.getActualInstance(); + } + + /** + * Get the actual instance of `EmbeddedAppWidgetInputValueNumberArray`. If the actual instance is + * not `EmbeddedAppWidgetInputValueNumberArray`, the ClassCastException will be thrown. + * + * @return The actual instance of `EmbeddedAppWidgetInputValueNumberArray` + * @throws ClassCastException if the instance is not `EmbeddedAppWidgetInputValueNumberArray` + */ + public EmbeddedAppWidgetInputValueNumberArray getEmbeddedAppWidgetInputValueNumberArray() + throws ClassCastException { + return (EmbeddedAppWidgetInputValueNumberArray) super.getActualInstance(); + } + + /** + * Get the actual instance of `EmbeddedAppWidgetInputValueBooleanArray`. If the actual instance is + * not `EmbeddedAppWidgetInputValueBooleanArray`, the ClassCastException will be thrown. + * + * @return The actual instance of `EmbeddedAppWidgetInputValueBooleanArray` + * @throws ClassCastException if the instance is not `EmbeddedAppWidgetInputValueBooleanArray` + */ + public EmbeddedAppWidgetInputValueBooleanArray getEmbeddedAppWidgetInputValueBooleanArray() + throws ClassCastException { + return (EmbeddedAppWidgetInputValueBooleanArray) super.getActualInstance(); + } + + /** + * Get the actual instance of `EmbeddedAppWidgetInputValueObjectArray`. If the actual instance is + * not `EmbeddedAppWidgetInputValueObjectArray`, the ClassCastException will be thrown. + * + * @return The actual instance of `EmbeddedAppWidgetInputValueObjectArray` + * @throws ClassCastException if the instance is not `EmbeddedAppWidgetInputValueObjectArray` + */ + public EmbeddedAppWidgetInputValueObjectArray getEmbeddedAppWidgetInputValueObjectArray() + throws ClassCastException { + return (EmbeddedAppWidgetInputValueObjectArray) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueBooleanArray.java b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueBooleanArray.java new file mode 100644 index 00000000000..eb243e655fb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueBooleanArray.java @@ -0,0 +1,116 @@ +/* + * 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.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** An array of boolean values passed to the embedded app. */ +@JsonPropertyOrder({}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EmbeddedAppWidgetInputValueBooleanArray extends ArrayList { + @JsonIgnore public boolean unparsed = false; + + public EmbeddedAppWidgetInputValueBooleanArray() {} + + public EmbeddedAppWidgetInputValueBooleanArray(List items) { + super(items); + } + + /** + * 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 EmbeddedAppWidgetInputValueBooleanArray + */ + @JsonAnySetter + public EmbeddedAppWidgetInputValueBooleanArray 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 EmbeddedAppWidgetInputValueBooleanArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(additionalProperties, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedAppWidgetInputValueBooleanArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueNumberArray.java b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueNumberArray.java new file mode 100644 index 00000000000..1b3996c1842 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueNumberArray.java @@ -0,0 +1,116 @@ +/* + * 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.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** An array of numeric values passed to the embedded app. */ +@JsonPropertyOrder({}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EmbeddedAppWidgetInputValueNumberArray extends ArrayList { + @JsonIgnore public boolean unparsed = false; + + public EmbeddedAppWidgetInputValueNumberArray() {} + + public EmbeddedAppWidgetInputValueNumberArray(List items) { + super(items); + } + + /** + * 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 EmbeddedAppWidgetInputValueNumberArray + */ + @JsonAnySetter + public EmbeddedAppWidgetInputValueNumberArray 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 EmbeddedAppWidgetInputValueNumberArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(additionalProperties, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedAppWidgetInputValueNumberArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueObjectArray.java b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueObjectArray.java new file mode 100644 index 00000000000..98e10a3a0b1 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueObjectArray.java @@ -0,0 +1,116 @@ +/* + * 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.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** An array of object values passed to the embedded app. */ +@JsonPropertyOrder({}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EmbeddedAppWidgetInputValueObjectArray extends ArrayList> { + @JsonIgnore public boolean unparsed = false; + + public EmbeddedAppWidgetInputValueObjectArray() {} + + public EmbeddedAppWidgetInputValueObjectArray(List> items) { + super(items); + } + + /** + * 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 EmbeddedAppWidgetInputValueObjectArray + */ + @JsonAnySetter + public EmbeddedAppWidgetInputValueObjectArray 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 EmbeddedAppWidgetInputValueObjectArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(additionalProperties, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedAppWidgetInputValueObjectArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueStringArray.java b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueStringArray.java new file mode 100644 index 00000000000..e087aa045d8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInputValueStringArray.java @@ -0,0 +1,116 @@ +/* + * 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.v1.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** An array of string values passed to the embedded app. */ +@JsonPropertyOrder({}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class EmbeddedAppWidgetInputValueStringArray extends ArrayList { + @JsonIgnore public boolean unparsed = false; + + public EmbeddedAppWidgetInputValueStringArray() {} + + public EmbeddedAppWidgetInputValueStringArray(List items) { + super(items); + } + + /** + * 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 EmbeddedAppWidgetInputValueStringArray + */ + @JsonAnySetter + public EmbeddedAppWidgetInputValueStringArray 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 EmbeddedAppWidgetInputValueStringArray object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + return super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(additionalProperties, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmbeddedAppWidgetInputValueStringArray {\n"); + sb.append(" ").append(toIndentedString(super.toString())).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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/WidgetDefinition.java b/src/main/java/com/datadog/api/client/v1/model/WidgetDefinition.java index fd98c6f5c92..ba0d3d97d46 100644 --- a/src/main/java/com/datadog/api/client/v1/model/WidgetDefinition.java +++ b/src/main/java/com/datadog/api/client/v1/model/WidgetDefinition.java @@ -392,6 +392,53 @@ public WidgetDefinition deserialize(JsonParser jp, DeserializationContext ctxt) log.log(Level.FINER, "Input data does not match schema 'DistributionWidgetDefinition'", e); } + // deserialize EmbeddedAppWidgetDefinition + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (EmbeddedAppWidgetDefinition.class.equals(Integer.class) + || EmbeddedAppWidgetDefinition.class.equals(Long.class) + || EmbeddedAppWidgetDefinition.class.equals(Float.class) + || EmbeddedAppWidgetDefinition.class.equals(Double.class) + || EmbeddedAppWidgetDefinition.class.equals(Boolean.class) + || EmbeddedAppWidgetDefinition.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((EmbeddedAppWidgetDefinition.class.equals(Integer.class) + || EmbeddedAppWidgetDefinition.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((EmbeddedAppWidgetDefinition.class.equals(Float.class) + || EmbeddedAppWidgetDefinition.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (EmbeddedAppWidgetDefinition.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (EmbeddedAppWidgetDefinition.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(EmbeddedAppWidgetDefinition.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. + if (!((EmbeddedAppWidgetDefinition) tmp).unparsed + && !(((EmbeddedAppWidgetDefinition) tmp).getActualInstance() + instanceof UnparsedObject)) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'EmbeddedAppWidgetDefinition'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'EmbeddedAppWidgetDefinition'", e); + } + // deserialize EventStreamWidgetDefinition try { boolean attemptParsing = true; @@ -1995,6 +2042,11 @@ public WidgetDefinition(DistributionWidgetDefinition o) { setActualInstance(o); } + public WidgetDefinition(EmbeddedAppWidgetDefinition o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public WidgetDefinition(EventStreamWidgetDefinition o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -2173,6 +2225,7 @@ public WidgetDefinition(WildcardWidgetDefinition o) { schemas.put("CheckStatusWidgetDefinition", new GenericType() {}); schemas.put("CohortWidgetDefinition", new GenericType() {}); schemas.put("DistributionWidgetDefinition", new GenericType() {}); + schemas.put("EmbeddedAppWidgetDefinition", new GenericType() {}); schemas.put("EventStreamWidgetDefinition", new GenericType() {}); schemas.put( "EventTimelineWidgetDefinition", new GenericType() {}); @@ -2225,18 +2278,19 @@ public Map getSchemas() { * Set the instance that matches the oneOf child schema, check the instance parameter is valid * against the oneOf child schemas: AlertGraphWidgetDefinition, AlertValueWidgetDefinition, * BarChartWidgetDefinition, ChangeWidgetDefinition, CheckStatusWidgetDefinition, - * CohortWidgetDefinition, DistributionWidgetDefinition, EventStreamWidgetDefinition, - * EventTimelineWidgetDefinition, FreeTextWidgetDefinition, FunnelWidgetDefinition, - * ProductAnalyticsFunnelWidgetDefinition, GeomapWidgetDefinition, GroupWidgetDefinition, - * HeatMapWidgetDefinition, HostMapWidgetDefinition, IFrameWidgetDefinition, - * ImageWidgetDefinition, ListStreamWidgetDefinition, LogStreamWidgetDefinition, - * MonitorSummaryWidgetDefinition, NoteWidgetDefinition, PowerpackWidgetDefinition, - * PointPlotWidgetDefinition, QueryValueWidgetDefinition, RetentionCurveWidgetDefinition, - * RunWorkflowWidgetDefinition, SLOListWidgetDefinition, SLOWidgetDefinition, - * ScatterPlotWidgetDefinition, SankeyWidgetDefinition, ServiceMapWidgetDefinition, - * ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, SunburstWidgetDefinition, - * TableWidgetDefinition, TimeseriesWidgetDefinition, ToplistWidgetDefinition, - * TopologyMapWidgetDefinition, TreeMapWidgetDefinition, WildcardWidgetDefinition + * CohortWidgetDefinition, DistributionWidgetDefinition, EmbeddedAppWidgetDefinition, + * EventStreamWidgetDefinition, EventTimelineWidgetDefinition, FreeTextWidgetDefinition, + * FunnelWidgetDefinition, ProductAnalyticsFunnelWidgetDefinition, GeomapWidgetDefinition, + * GroupWidgetDefinition, HeatMapWidgetDefinition, HostMapWidgetDefinition, + * IFrameWidgetDefinition, ImageWidgetDefinition, ListStreamWidgetDefinition, + * LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, NoteWidgetDefinition, + * PowerpackWidgetDefinition, PointPlotWidgetDefinition, QueryValueWidgetDefinition, + * RetentionCurveWidgetDefinition, RunWorkflowWidgetDefinition, SLOListWidgetDefinition, + * SLOWidgetDefinition, ScatterPlotWidgetDefinition, SankeyWidgetDefinition, + * ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, + * SunburstWidgetDefinition, TableWidgetDefinition, TimeseriesWidgetDefinition, + * ToplistWidgetDefinition, TopologyMapWidgetDefinition, TreeMapWidgetDefinition, + * WildcardWidgetDefinition * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -2271,6 +2325,10 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf(EmbeddedAppWidgetDefinition.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(EventStreamWidgetDefinition.class, instance, new HashSet>())) { super.setActualInstance(instance); return; @@ -2419,8 +2477,9 @@ public void setActualInstance(Object instance) { throw new RuntimeException( "Invalid instance type. Must be AlertGraphWidgetDefinition, AlertValueWidgetDefinition," + " BarChartWidgetDefinition, ChangeWidgetDefinition, CheckStatusWidgetDefinition," - + " CohortWidgetDefinition, DistributionWidgetDefinition, EventStreamWidgetDefinition," - + " EventTimelineWidgetDefinition, FreeTextWidgetDefinition, FunnelWidgetDefinition," + + " CohortWidgetDefinition, DistributionWidgetDefinition, EmbeddedAppWidgetDefinition," + + " EventStreamWidgetDefinition, EventTimelineWidgetDefinition," + + " FreeTextWidgetDefinition, FunnelWidgetDefinition," + " ProductAnalyticsFunnelWidgetDefinition, GeomapWidgetDefinition," + " GroupWidgetDefinition, HeatMapWidgetDefinition, HostMapWidgetDefinition," + " IFrameWidgetDefinition, ImageWidgetDefinition, ListStreamWidgetDefinition," @@ -2438,33 +2497,34 @@ public void setActualInstance(Object instance) { * Get the actual instance, which can be the following: AlertGraphWidgetDefinition, * AlertValueWidgetDefinition, BarChartWidgetDefinition, ChangeWidgetDefinition, * CheckStatusWidgetDefinition, CohortWidgetDefinition, DistributionWidgetDefinition, - * EventStreamWidgetDefinition, EventTimelineWidgetDefinition, FreeTextWidgetDefinition, - * FunnelWidgetDefinition, ProductAnalyticsFunnelWidgetDefinition, GeomapWidgetDefinition, - * GroupWidgetDefinition, HeatMapWidgetDefinition, HostMapWidgetDefinition, - * IFrameWidgetDefinition, ImageWidgetDefinition, ListStreamWidgetDefinition, - * LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, NoteWidgetDefinition, - * PowerpackWidgetDefinition, PointPlotWidgetDefinition, QueryValueWidgetDefinition, - * RetentionCurveWidgetDefinition, RunWorkflowWidgetDefinition, SLOListWidgetDefinition, - * SLOWidgetDefinition, ScatterPlotWidgetDefinition, SankeyWidgetDefinition, - * ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, - * SunburstWidgetDefinition, TableWidgetDefinition, TimeseriesWidgetDefinition, - * ToplistWidgetDefinition, TopologyMapWidgetDefinition, TreeMapWidgetDefinition, - * WildcardWidgetDefinition + * EmbeddedAppWidgetDefinition, EventStreamWidgetDefinition, EventTimelineWidgetDefinition, + * FreeTextWidgetDefinition, FunnelWidgetDefinition, ProductAnalyticsFunnelWidgetDefinition, + * GeomapWidgetDefinition, GroupWidgetDefinition, HeatMapWidgetDefinition, + * HostMapWidgetDefinition, IFrameWidgetDefinition, ImageWidgetDefinition, + * ListStreamWidgetDefinition, LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, + * NoteWidgetDefinition, PowerpackWidgetDefinition, PointPlotWidgetDefinition, + * QueryValueWidgetDefinition, RetentionCurveWidgetDefinition, RunWorkflowWidgetDefinition, + * SLOListWidgetDefinition, SLOWidgetDefinition, ScatterPlotWidgetDefinition, + * SankeyWidgetDefinition, ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, + * SplitGraphWidgetDefinition, SunburstWidgetDefinition, TableWidgetDefinition, + * TimeseriesWidgetDefinition, ToplistWidgetDefinition, TopologyMapWidgetDefinition, + * TreeMapWidgetDefinition, WildcardWidgetDefinition * * @return The actual instance (AlertGraphWidgetDefinition, AlertValueWidgetDefinition, * BarChartWidgetDefinition, ChangeWidgetDefinition, CheckStatusWidgetDefinition, - * CohortWidgetDefinition, DistributionWidgetDefinition, EventStreamWidgetDefinition, - * EventTimelineWidgetDefinition, FreeTextWidgetDefinition, FunnelWidgetDefinition, - * ProductAnalyticsFunnelWidgetDefinition, GeomapWidgetDefinition, GroupWidgetDefinition, - * HeatMapWidgetDefinition, HostMapWidgetDefinition, IFrameWidgetDefinition, - * ImageWidgetDefinition, ListStreamWidgetDefinition, LogStreamWidgetDefinition, - * MonitorSummaryWidgetDefinition, NoteWidgetDefinition, PowerpackWidgetDefinition, - * PointPlotWidgetDefinition, QueryValueWidgetDefinition, RetentionCurveWidgetDefinition, - * RunWorkflowWidgetDefinition, SLOListWidgetDefinition, SLOWidgetDefinition, - * ScatterPlotWidgetDefinition, SankeyWidgetDefinition, ServiceMapWidgetDefinition, - * ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, SunburstWidgetDefinition, - * TableWidgetDefinition, TimeseriesWidgetDefinition, ToplistWidgetDefinition, - * TopologyMapWidgetDefinition, TreeMapWidgetDefinition, WildcardWidgetDefinition) + * CohortWidgetDefinition, DistributionWidgetDefinition, EmbeddedAppWidgetDefinition, + * EventStreamWidgetDefinition, EventTimelineWidgetDefinition, FreeTextWidgetDefinition, + * FunnelWidgetDefinition, ProductAnalyticsFunnelWidgetDefinition, GeomapWidgetDefinition, + * GroupWidgetDefinition, HeatMapWidgetDefinition, HostMapWidgetDefinition, + * IFrameWidgetDefinition, ImageWidgetDefinition, ListStreamWidgetDefinition, + * LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, NoteWidgetDefinition, + * PowerpackWidgetDefinition, PointPlotWidgetDefinition, QueryValueWidgetDefinition, + * RetentionCurveWidgetDefinition, RunWorkflowWidgetDefinition, SLOListWidgetDefinition, + * SLOWidgetDefinition, ScatterPlotWidgetDefinition, SankeyWidgetDefinition, + * ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, + * SunburstWidgetDefinition, TableWidgetDefinition, TimeseriesWidgetDefinition, + * ToplistWidgetDefinition, TopologyMapWidgetDefinition, TreeMapWidgetDefinition, + * WildcardWidgetDefinition) */ @Override public Object getActualInstance() { @@ -2548,6 +2608,17 @@ public DistributionWidgetDefinition getDistributionWidgetDefinition() throws Cla return (DistributionWidgetDefinition) super.getActualInstance(); } + /** + * Get the actual instance of `EmbeddedAppWidgetDefinition`. If the actual instance is not + * `EmbeddedAppWidgetDefinition`, the ClassCastException will be thrown. + * + * @return The actual instance of `EmbeddedAppWidgetDefinition` + * @throws ClassCastException if the instance is not `EmbeddedAppWidgetDefinition` + */ + public EmbeddedAppWidgetDefinition getEmbeddedAppWidgetDefinition() throws ClassCastException { + return (EmbeddedAppWidgetDefinition) super.getActualInstance(); + } + /** * Get the actual instance of `EventStreamWidgetDefinition`. If the actual instance is not * `EventStreamWidgetDefinition`, the ClassCastException will be thrown.