diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 4c51085e74e..41081b62187 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -2623,6 +2623,71 @@ components: nullable: true type: array type: object + EmbeddedAppWidgetDefinition: + additionalProperties: false + 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: + description: Value of the app input. The API accepts a string, number, boolean, object, or a non-empty homogeneous array of those types. + example: production + required: + - name + - value + type: object Event: description: Object representing an event. properties: @@ -28167,6 +28232,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..6a85de08ed0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/EmbeddedAppWidgetInput.java @@ -0,0 +1,120 @@ +/* + * 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 Object value = new Object(); + + public EmbeddedAppWidgetInput() {} + + @JsonCreator + public EmbeddedAppWidgetInput( + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_VALUE) Object value) { + this.name = name; + this.value = value; + } + + 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(Object value) { + this.value = value; + return this; + } + + /** + * Value of the app input. The API accepts 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 Object getValue() { + return value; + } + + public void setValue(Object value) { + this.value = value; + } + + /** 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/WidgetDefinition.java b/src/main/java/com/datadog/api/client/v1/model/WidgetDefinition.java index fd98c6f5c92..ff80af69fb4 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,51 @@ 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) { + 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 +2040,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 +2223,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 +2276,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 +2323,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 +2475,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 +2495,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 +2606,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.