diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 008c85ab912..4db3d56c9fd 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -1282,6 +1282,123 @@ components: type: string x-enum-varnames: - CHECK_STATUS + CloudcraftWidgetDefinition: + description: This widget displays a Cloudcraft topology of cloud resources for the selected provider. + properties: + custom_links: + description: List of custom links. + items: + $ref: "#/components/schemas/WidgetCustomLink" + type: array + description: + description: The description of the widget. + type: string + group_by: + description: List of tags or attributes used to group the cloud resources in the widget. + example: + - "" + items: + description: Tag or attribute used to group cloud resources. + type: string + type: array + highlighted: + description: Search query that visually highlights matching resources in the diagram. + example: "" + type: string + overlay: + $ref: "#/components/schemas/CloudcraftWidgetDefinitionOverlay" + overlay_filter: + description: Filter applied to the selected overlay. + example: "" + type: string + projection: + $ref: "#/components/schemas/CloudcraftWidgetDefinitionProjection" + provider: + $ref: "#/components/schemas/CloudcraftWidgetDefinitionProvider" + query_string: + description: Query string used to filter the cloud resources displayed in the widget. + example: "" + type: string + show_empty_groups: + description: Whether to show empty outline groups in the diagram. + example: false + type: boolean + title: + description: Title of your widget. + type: string + title_align: + $ref: "#/components/schemas/WidgetTextAlign" + title_size: + description: Size of the title. + type: string + type: + $ref: "#/components/schemas/CloudcraftWidgetDefinitionType" + required: + - type + - query_string + - provider + - overlay + - overlay_filter + - group_by + - projection + - highlighted + - show_empty_groups + type: object + CloudcraftWidgetDefinitionOverlay: + description: Overlay applied on top of the Cloudcraft topology. + enum: + - Observability + - CloudCost + - Security + - NDMReachability + - Monitors + - APM + - Default + example: Observability + type: string + x-enum-varnames: + - OBSERVABILITY + - CLOUD_COST + - SECURITY + - NDM_REACHABILITY + - MONITORS + - APM + - DEFAULT + CloudcraftWidgetDefinitionProjection: + description: Projection used to render the Cloudcraft topology. + enum: + - isometric + - 2d + example: isometric + type: string + x-enum-varnames: + - ISOMETRIC + - TWO_D + CloudcraftWidgetDefinitionProvider: + description: Cloud provider for the Cloudcraft widget. + enum: + - aws + - azure + - gcp + - ndm + - oci + example: aws + type: string + x-enum-varnames: + - AWS + - AZURE + - GCP + - NDM + - OCI + CloudcraftWidgetDefinitionType: + default: cloudcraft + description: Type of Cloudcraft widget. + enum: + - cloudcraft + example: cloudcraft + type: string + x-enum-varnames: + - CLOUDCRAFT CohortWidgetDefinition: additionalProperties: false description: The cohort widget visualizes user retention over time. @@ -25597,6 +25714,7 @@ components: - $ref: "#/components/schemas/BarChartWidgetDefinition" - $ref: "#/components/schemas/ChangeWidgetDefinition" - $ref: "#/components/schemas/CheckStatusWidgetDefinition" + - $ref: "#/components/schemas/CloudcraftWidgetDefinition" - $ref: "#/components/schemas/CohortWidgetDefinition" - $ref: "#/components/schemas/DistributionWidgetDefinition" - $ref: "#/components/schemas/EventStreamWidgetDefinition" diff --git a/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinition.java b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinition.java new file mode 100644 index 00000000000..ddbf210ca4b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinition.java @@ -0,0 +1,568 @@ +/* + * 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.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.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** This widget displays a Cloudcraft topology of cloud resources for the selected provider. */ +@JsonPropertyOrder({ + CloudcraftWidgetDefinition.JSON_PROPERTY_CUSTOM_LINKS, + CloudcraftWidgetDefinition.JSON_PROPERTY_DESCRIPTION, + CloudcraftWidgetDefinition.JSON_PROPERTY_GROUP_BY, + CloudcraftWidgetDefinition.JSON_PROPERTY_HIGHLIGHTED, + CloudcraftWidgetDefinition.JSON_PROPERTY_OVERLAY, + CloudcraftWidgetDefinition.JSON_PROPERTY_OVERLAY_FILTER, + CloudcraftWidgetDefinition.JSON_PROPERTY_PROJECTION, + CloudcraftWidgetDefinition.JSON_PROPERTY_PROVIDER, + CloudcraftWidgetDefinition.JSON_PROPERTY_QUERY_STRING, + CloudcraftWidgetDefinition.JSON_PROPERTY_SHOW_EMPTY_GROUPS, + CloudcraftWidgetDefinition.JSON_PROPERTY_TITLE, + CloudcraftWidgetDefinition.JSON_PROPERTY_TITLE_ALIGN, + CloudcraftWidgetDefinition.JSON_PROPERTY_TITLE_SIZE, + CloudcraftWidgetDefinition.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class CloudcraftWidgetDefinition { + @JsonIgnore public boolean unparsed = false; + 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_GROUP_BY = "group_by"; + private List groupBy = new ArrayList<>(); + + public static final String JSON_PROPERTY_HIGHLIGHTED = "highlighted"; + private String highlighted; + + public static final String JSON_PROPERTY_OVERLAY = "overlay"; + private CloudcraftWidgetDefinitionOverlay overlay; + + public static final String JSON_PROPERTY_OVERLAY_FILTER = "overlay_filter"; + private String overlayFilter; + + public static final String JSON_PROPERTY_PROJECTION = "projection"; + private CloudcraftWidgetDefinitionProjection projection; + + public static final String JSON_PROPERTY_PROVIDER = "provider"; + private CloudcraftWidgetDefinitionProvider provider; + + public static final String JSON_PROPERTY_QUERY_STRING = "query_string"; + private String queryString; + + public static final String JSON_PROPERTY_SHOW_EMPTY_GROUPS = "show_empty_groups"; + private Boolean showEmptyGroups; + + 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 CloudcraftWidgetDefinitionType type = CloudcraftWidgetDefinitionType.CLOUDCRAFT; + + public CloudcraftWidgetDefinition() {} + + @JsonCreator + public CloudcraftWidgetDefinition( + @JsonProperty(required = true, value = JSON_PROPERTY_GROUP_BY) List groupBy, + @JsonProperty(required = true, value = JSON_PROPERTY_HIGHLIGHTED) String highlighted, + @JsonProperty(required = true, value = JSON_PROPERTY_OVERLAY) + CloudcraftWidgetDefinitionOverlay overlay, + @JsonProperty(required = true, value = JSON_PROPERTY_OVERLAY_FILTER) String overlayFilter, + @JsonProperty(required = true, value = JSON_PROPERTY_PROJECTION) + CloudcraftWidgetDefinitionProjection projection, + @JsonProperty(required = true, value = JSON_PROPERTY_PROVIDER) + CloudcraftWidgetDefinitionProvider provider, + @JsonProperty(required = true, value = JSON_PROPERTY_QUERY_STRING) String queryString, + @JsonProperty(required = true, value = JSON_PROPERTY_SHOW_EMPTY_GROUPS) + Boolean showEmptyGroups, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + CloudcraftWidgetDefinitionType type) { + this.groupBy = groupBy; + this.highlighted = highlighted; + this.overlay = overlay; + this.unparsed |= !overlay.isValid(); + this.overlayFilter = overlayFilter; + this.projection = projection; + this.unparsed |= !projection.isValid(); + this.provider = provider; + this.unparsed |= !provider.isValid(); + this.queryString = queryString; + this.showEmptyGroups = showEmptyGroups; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public CloudcraftWidgetDefinition customLinks(List customLinks) { + this.customLinks = customLinks; + for (WidgetCustomLink item : customLinks) { + this.unparsed |= item.unparsed; + } + return this; + } + + public CloudcraftWidgetDefinition 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; + } + + public CloudcraftWidgetDefinition 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 CloudcraftWidgetDefinition groupBy(List groupBy) { + this.groupBy = groupBy; + return this; + } + + public CloudcraftWidgetDefinition addGroupByItem(String groupByItem) { + this.groupBy.add(groupByItem); + return this; + } + + /** + * List of tags or attributes used to group the cloud resources in the widget. + * + * @return groupBy + */ + @JsonProperty(JSON_PROPERTY_GROUP_BY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getGroupBy() { + return groupBy; + } + + public void setGroupBy(List groupBy) { + this.groupBy = groupBy; + } + + public CloudcraftWidgetDefinition highlighted(String highlighted) { + this.highlighted = highlighted; + return this; + } + + /** + * Search query that visually highlights matching resources in the diagram. + * + * @return highlighted + */ + @JsonProperty(JSON_PROPERTY_HIGHLIGHTED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHighlighted() { + return highlighted; + } + + public void setHighlighted(String highlighted) { + this.highlighted = highlighted; + } + + public CloudcraftWidgetDefinition overlay(CloudcraftWidgetDefinitionOverlay overlay) { + this.overlay = overlay; + this.unparsed |= !overlay.isValid(); + return this; + } + + /** + * Overlay applied on top of the Cloudcraft topology. + * + * @return overlay + */ + @JsonProperty(JSON_PROPERTY_OVERLAY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudcraftWidgetDefinitionOverlay getOverlay() { + return overlay; + } + + public void setOverlay(CloudcraftWidgetDefinitionOverlay overlay) { + if (!overlay.isValid()) { + this.unparsed = true; + } + this.overlay = overlay; + } + + public CloudcraftWidgetDefinition overlayFilter(String overlayFilter) { + this.overlayFilter = overlayFilter; + return this; + } + + /** + * Filter applied to the selected overlay. + * + * @return overlayFilter + */ + @JsonProperty(JSON_PROPERTY_OVERLAY_FILTER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getOverlayFilter() { + return overlayFilter; + } + + public void setOverlayFilter(String overlayFilter) { + this.overlayFilter = overlayFilter; + } + + public CloudcraftWidgetDefinition projection(CloudcraftWidgetDefinitionProjection projection) { + this.projection = projection; + this.unparsed |= !projection.isValid(); + return this; + } + + /** + * Projection used to render the Cloudcraft topology. + * + * @return projection + */ + @JsonProperty(JSON_PROPERTY_PROJECTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudcraftWidgetDefinitionProjection getProjection() { + return projection; + } + + public void setProjection(CloudcraftWidgetDefinitionProjection projection) { + if (!projection.isValid()) { + this.unparsed = true; + } + this.projection = projection; + } + + public CloudcraftWidgetDefinition provider(CloudcraftWidgetDefinitionProvider provider) { + this.provider = provider; + this.unparsed |= !provider.isValid(); + return this; + } + + /** + * Cloud provider for the Cloudcraft widget. + * + * @return provider + */ + @JsonProperty(JSON_PROPERTY_PROVIDER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudcraftWidgetDefinitionProvider getProvider() { + return provider; + } + + public void setProvider(CloudcraftWidgetDefinitionProvider provider) { + if (!provider.isValid()) { + this.unparsed = true; + } + this.provider = provider; + } + + public CloudcraftWidgetDefinition queryString(String queryString) { + this.queryString = queryString; + return this; + } + + /** + * Query string used to filter the cloud resources displayed in the widget. + * + * @return queryString + */ + @JsonProperty(JSON_PROPERTY_QUERY_STRING) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getQueryString() { + return queryString; + } + + public void setQueryString(String queryString) { + this.queryString = queryString; + } + + public CloudcraftWidgetDefinition showEmptyGroups(Boolean showEmptyGroups) { + this.showEmptyGroups = showEmptyGroups; + return this; + } + + /** + * Whether to show empty outline groups in the diagram. + * + * @return showEmptyGroups + */ + @JsonProperty(JSON_PROPERTY_SHOW_EMPTY_GROUPS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getShowEmptyGroups() { + return showEmptyGroups; + } + + public void setShowEmptyGroups(Boolean showEmptyGroups) { + this.showEmptyGroups = showEmptyGroups; + } + + public CloudcraftWidgetDefinition title(String title) { + this.title = title; + return this; + } + + /** + * Title of your 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 CloudcraftWidgetDefinition 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 CloudcraftWidgetDefinition 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 CloudcraftWidgetDefinition type(CloudcraftWidgetDefinitionType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of Cloudcraft widget. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public CloudcraftWidgetDefinitionType getType() { + return type; + } + + public void setType(CloudcraftWidgetDefinitionType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * 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 CloudcraftWidgetDefinition + */ + @JsonAnySetter + public CloudcraftWidgetDefinition 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 CloudcraftWidgetDefinition object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudcraftWidgetDefinition cloudcraftWidgetDefinition = (CloudcraftWidgetDefinition) o; + return Objects.equals(this.customLinks, cloudcraftWidgetDefinition.customLinks) + && Objects.equals(this.description, cloudcraftWidgetDefinition.description) + && Objects.equals(this.groupBy, cloudcraftWidgetDefinition.groupBy) + && Objects.equals(this.highlighted, cloudcraftWidgetDefinition.highlighted) + && Objects.equals(this.overlay, cloudcraftWidgetDefinition.overlay) + && Objects.equals(this.overlayFilter, cloudcraftWidgetDefinition.overlayFilter) + && Objects.equals(this.projection, cloudcraftWidgetDefinition.projection) + && Objects.equals(this.provider, cloudcraftWidgetDefinition.provider) + && Objects.equals(this.queryString, cloudcraftWidgetDefinition.queryString) + && Objects.equals(this.showEmptyGroups, cloudcraftWidgetDefinition.showEmptyGroups) + && Objects.equals(this.title, cloudcraftWidgetDefinition.title) + && Objects.equals(this.titleAlign, cloudcraftWidgetDefinition.titleAlign) + && Objects.equals(this.titleSize, cloudcraftWidgetDefinition.titleSize) + && Objects.equals(this.type, cloudcraftWidgetDefinition.type) + && Objects.equals( + this.additionalProperties, cloudcraftWidgetDefinition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + customLinks, + description, + groupBy, + highlighted, + overlay, + overlayFilter, + projection, + provider, + queryString, + showEmptyGroups, + title, + titleAlign, + titleSize, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CloudcraftWidgetDefinition {\n"); + sb.append(" customLinks: ").append(toIndentedString(customLinks)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" groupBy: ").append(toIndentedString(groupBy)).append("\n"); + sb.append(" highlighted: ").append(toIndentedString(highlighted)).append("\n"); + sb.append(" overlay: ").append(toIndentedString(overlay)).append("\n"); + sb.append(" overlayFilter: ").append(toIndentedString(overlayFilter)).append("\n"); + sb.append(" projection: ").append(toIndentedString(projection)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" queryString: ").append(toIndentedString(queryString)).append("\n"); + sb.append(" showEmptyGroups: ").append(toIndentedString(showEmptyGroups)).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(" 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/CloudcraftWidgetDefinitionOverlay.java b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionOverlay.java new file mode 100644 index 00000000000..df574119fbc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionOverlay.java @@ -0,0 +1,78 @@ +/* + * 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; + +/** Overlay applied on top of the Cloudcraft topology. */ +@JsonSerialize( + using = CloudcraftWidgetDefinitionOverlay.CloudcraftWidgetDefinitionOverlaySerializer.class) +public class CloudcraftWidgetDefinitionOverlay extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "Observability", + "CloudCost", + "Security", + "NDMReachability", + "Monitors", + "APM", + "Default")); + + public static final CloudcraftWidgetDefinitionOverlay OBSERVABILITY = + new CloudcraftWidgetDefinitionOverlay("Observability"); + public static final CloudcraftWidgetDefinitionOverlay CLOUD_COST = + new CloudcraftWidgetDefinitionOverlay("CloudCost"); + public static final CloudcraftWidgetDefinitionOverlay SECURITY = + new CloudcraftWidgetDefinitionOverlay("Security"); + public static final CloudcraftWidgetDefinitionOverlay NDM_REACHABILITY = + new CloudcraftWidgetDefinitionOverlay("NDMReachability"); + public static final CloudcraftWidgetDefinitionOverlay MONITORS = + new CloudcraftWidgetDefinitionOverlay("Monitors"); + public static final CloudcraftWidgetDefinitionOverlay APM = + new CloudcraftWidgetDefinitionOverlay("APM"); + public static final CloudcraftWidgetDefinitionOverlay DEFAULT = + new CloudcraftWidgetDefinitionOverlay("Default"); + + CloudcraftWidgetDefinitionOverlay(String value) { + super(value, allowedValues); + } + + public static class CloudcraftWidgetDefinitionOverlaySerializer + extends StdSerializer { + public CloudcraftWidgetDefinitionOverlaySerializer(Class t) { + super(t); + } + + public CloudcraftWidgetDefinitionOverlaySerializer() { + this(null); + } + + @Override + public void serialize( + CloudcraftWidgetDefinitionOverlay value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CloudcraftWidgetDefinitionOverlay fromValue(String value) { + return new CloudcraftWidgetDefinitionOverlay(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionProjection.java b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionProjection.java new file mode 100644 index 00000000000..cfa430d8022 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionProjection.java @@ -0,0 +1,62 @@ +/* + * 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; + +/** Projection used to render the Cloudcraft topology. */ +@JsonSerialize( + using = + CloudcraftWidgetDefinitionProjection.CloudcraftWidgetDefinitionProjectionSerializer.class) +public class CloudcraftWidgetDefinitionProjection extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("isometric", "2d")); + + public static final CloudcraftWidgetDefinitionProjection ISOMETRIC = + new CloudcraftWidgetDefinitionProjection("isometric"); + public static final CloudcraftWidgetDefinitionProjection TWO_D = + new CloudcraftWidgetDefinitionProjection("2d"); + + CloudcraftWidgetDefinitionProjection(String value) { + super(value, allowedValues); + } + + public static class CloudcraftWidgetDefinitionProjectionSerializer + extends StdSerializer { + public CloudcraftWidgetDefinitionProjectionSerializer( + Class t) { + super(t); + } + + public CloudcraftWidgetDefinitionProjectionSerializer() { + this(null); + } + + @Override + public void serialize( + CloudcraftWidgetDefinitionProjection value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CloudcraftWidgetDefinitionProjection fromValue(String value) { + return new CloudcraftWidgetDefinitionProjection(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionProvider.java b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionProvider.java new file mode 100644 index 00000000000..547ccd83345 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionProvider.java @@ -0,0 +1,67 @@ +/* + * 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; + +/** Cloud provider for the Cloudcraft widget. */ +@JsonSerialize( + using = CloudcraftWidgetDefinitionProvider.CloudcraftWidgetDefinitionProviderSerializer.class) +public class CloudcraftWidgetDefinitionProvider extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("aws", "azure", "gcp", "ndm", "oci")); + + public static final CloudcraftWidgetDefinitionProvider AWS = + new CloudcraftWidgetDefinitionProvider("aws"); + public static final CloudcraftWidgetDefinitionProvider AZURE = + new CloudcraftWidgetDefinitionProvider("azure"); + public static final CloudcraftWidgetDefinitionProvider GCP = + new CloudcraftWidgetDefinitionProvider("gcp"); + public static final CloudcraftWidgetDefinitionProvider NDM = + new CloudcraftWidgetDefinitionProvider("ndm"); + public static final CloudcraftWidgetDefinitionProvider OCI = + new CloudcraftWidgetDefinitionProvider("oci"); + + CloudcraftWidgetDefinitionProvider(String value) { + super(value, allowedValues); + } + + public static class CloudcraftWidgetDefinitionProviderSerializer + extends StdSerializer { + public CloudcraftWidgetDefinitionProviderSerializer( + Class t) { + super(t); + } + + public CloudcraftWidgetDefinitionProviderSerializer() { + this(null); + } + + @Override + public void serialize( + CloudcraftWidgetDefinitionProvider value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CloudcraftWidgetDefinitionProvider fromValue(String value) { + return new CloudcraftWidgetDefinitionProvider(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionType.java b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionType.java new file mode 100644 index 00000000000..41baa14cb09 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v1/model/CloudcraftWidgetDefinitionType.java @@ -0,0 +1,57 @@ +/* + * 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 Cloudcraft widget. */ +@JsonSerialize( + using = CloudcraftWidgetDefinitionType.CloudcraftWidgetDefinitionTypeSerializer.class) +public class CloudcraftWidgetDefinitionType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("cloudcraft")); + + public static final CloudcraftWidgetDefinitionType CLOUDCRAFT = + new CloudcraftWidgetDefinitionType("cloudcraft"); + + CloudcraftWidgetDefinitionType(String value) { + super(value, allowedValues); + } + + public static class CloudcraftWidgetDefinitionTypeSerializer + extends StdSerializer { + public CloudcraftWidgetDefinitionTypeSerializer(Class t) { + super(t); + } + + public CloudcraftWidgetDefinitionTypeSerializer() { + this(null); + } + + @Override + public void serialize( + CloudcraftWidgetDefinitionType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static CloudcraftWidgetDefinitionType fromValue(String value) { + return new CloudcraftWidgetDefinitionType(value); + } +} 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 2de071864af..7d4f87f3442 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 @@ -302,6 +302,51 @@ public WidgetDefinition deserialize(JsonParser jp, DeserializationContext ctxt) log.log(Level.FINER, "Input data does not match schema 'CheckStatusWidgetDefinition'", e); } + // deserialize CloudcraftWidgetDefinition + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (CloudcraftWidgetDefinition.class.equals(Integer.class) + || CloudcraftWidgetDefinition.class.equals(Long.class) + || CloudcraftWidgetDefinition.class.equals(Float.class) + || CloudcraftWidgetDefinition.class.equals(Double.class) + || CloudcraftWidgetDefinition.class.equals(Boolean.class) + || CloudcraftWidgetDefinition.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((CloudcraftWidgetDefinition.class.equals(Integer.class) + || CloudcraftWidgetDefinition.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((CloudcraftWidgetDefinition.class.equals(Float.class) + || CloudcraftWidgetDefinition.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (CloudcraftWidgetDefinition.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (CloudcraftWidgetDefinition.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(CloudcraftWidgetDefinition.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 (!((CloudcraftWidgetDefinition) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'CloudcraftWidgetDefinition'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log(Level.FINER, "Input data does not match schema 'CloudcraftWidgetDefinition'", e); + } + // deserialize CohortWidgetDefinition try { boolean attemptParsing = true; @@ -1938,6 +1983,11 @@ public WidgetDefinition(CheckStatusWidgetDefinition o) { setActualInstance(o); } + public WidgetDefinition(CloudcraftWidgetDefinition o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + public WidgetDefinition(CohortWidgetDefinition o) { super("oneOf", Boolean.FALSE); setActualInstance(o); @@ -2119,6 +2169,7 @@ public WidgetDefinition(WildcardWidgetDefinition o) { schemas.put("BarChartWidgetDefinition", new GenericType() {}); schemas.put("ChangeWidgetDefinition", new GenericType() {}); schemas.put("CheckStatusWidgetDefinition", new GenericType() {}); + schemas.put("CloudcraftWidgetDefinition", new GenericType() {}); schemas.put("CohortWidgetDefinition", new GenericType() {}); schemas.put("DistributionWidgetDefinition", new GenericType() {}); schemas.put("EventStreamWidgetDefinition", new GenericType() {}); @@ -2172,18 +2223,18 @@ 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, - * QueryValueWidgetDefinition, RetentionCurveWidgetDefinition, RunWorkflowWidgetDefinition, - * SLOListWidgetDefinition, SLOWidgetDefinition, ScatterPlotWidgetDefinition, - * SankeyWidgetDefinition, ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, - * SplitGraphWidgetDefinition, SunburstWidgetDefinition, TableWidgetDefinition, - * TimeseriesWidgetDefinition, ToplistWidgetDefinition, TopologyMapWidgetDefinition, - * TreeMapWidgetDefinition, WildcardWidgetDefinition + * CloudcraftWidgetDefinition, CohortWidgetDefinition, DistributionWidgetDefinition, + * EventStreamWidgetDefinition, EventTimelineWidgetDefinition, FreeTextWidgetDefinition, + * FunnelWidgetDefinition, ProductAnalyticsFunnelWidgetDefinition, GeomapWidgetDefinition, + * GroupWidgetDefinition, HeatMapWidgetDefinition, HostMapWidgetDefinition, + * IFrameWidgetDefinition, ImageWidgetDefinition, ListStreamWidgetDefinition, + * LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, NoteWidgetDefinition, + * PowerpackWidgetDefinition, 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). @@ -2210,6 +2261,10 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } + if (JSON.isInstanceOf(CloudcraftWidgetDefinition.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } if (JSON.isInstanceOf(CohortWidgetDefinition.class, instance, new HashSet>())) { super.setActualInstance(instance); return; @@ -2362,8 +2417,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," + + " CloudcraftWidgetDefinition, CohortWidgetDefinition, DistributionWidgetDefinition," + + " EventStreamWidgetDefinition, EventTimelineWidgetDefinition," + + " FreeTextWidgetDefinition, FunnelWidgetDefinition," + " ProductAnalyticsFunnelWidgetDefinition, GeomapWidgetDefinition," + " GroupWidgetDefinition, HeatMapWidgetDefinition, HostMapWidgetDefinition," + " IFrameWidgetDefinition, ImageWidgetDefinition, ListStreamWidgetDefinition," @@ -2380,33 +2436,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, QueryValueWidgetDefinition, RetentionCurveWidgetDefinition, - * RunWorkflowWidgetDefinition, SLOListWidgetDefinition, SLOWidgetDefinition, - * ScatterPlotWidgetDefinition, SankeyWidgetDefinition, ServiceMapWidgetDefinition, - * ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, SunburstWidgetDefinition, - * TableWidgetDefinition, TimeseriesWidgetDefinition, ToplistWidgetDefinition, - * TopologyMapWidgetDefinition, TreeMapWidgetDefinition, WildcardWidgetDefinition + * CheckStatusWidgetDefinition, CloudcraftWidgetDefinition, CohortWidgetDefinition, + * DistributionWidgetDefinition, EventStreamWidgetDefinition, EventTimelineWidgetDefinition, + * FreeTextWidgetDefinition, FunnelWidgetDefinition, ProductAnalyticsFunnelWidgetDefinition, + * GeomapWidgetDefinition, GroupWidgetDefinition, HeatMapWidgetDefinition, + * HostMapWidgetDefinition, IFrameWidgetDefinition, ImageWidgetDefinition, + * ListStreamWidgetDefinition, LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, + * NoteWidgetDefinition, PowerpackWidgetDefinition, 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, - * QueryValueWidgetDefinition, RetentionCurveWidgetDefinition, RunWorkflowWidgetDefinition, - * SLOListWidgetDefinition, SLOWidgetDefinition, ScatterPlotWidgetDefinition, - * SankeyWidgetDefinition, ServiceMapWidgetDefinition, ServiceSummaryWidgetDefinition, - * SplitGraphWidgetDefinition, SunburstWidgetDefinition, TableWidgetDefinition, - * TimeseriesWidgetDefinition, ToplistWidgetDefinition, TopologyMapWidgetDefinition, - * TreeMapWidgetDefinition, WildcardWidgetDefinition) + * CloudcraftWidgetDefinition, CohortWidgetDefinition, DistributionWidgetDefinition, + * EventStreamWidgetDefinition, EventTimelineWidgetDefinition, FreeTextWidgetDefinition, + * FunnelWidgetDefinition, ProductAnalyticsFunnelWidgetDefinition, GeomapWidgetDefinition, + * GroupWidgetDefinition, HeatMapWidgetDefinition, HostMapWidgetDefinition, + * IFrameWidgetDefinition, ImageWidgetDefinition, ListStreamWidgetDefinition, + * LogStreamWidgetDefinition, MonitorSummaryWidgetDefinition, NoteWidgetDefinition, + * PowerpackWidgetDefinition, QueryValueWidgetDefinition, RetentionCurveWidgetDefinition, + * RunWorkflowWidgetDefinition, SLOListWidgetDefinition, SLOWidgetDefinition, + * ScatterPlotWidgetDefinition, SankeyWidgetDefinition, ServiceMapWidgetDefinition, + * ServiceSummaryWidgetDefinition, SplitGraphWidgetDefinition, SunburstWidgetDefinition, + * TableWidgetDefinition, TimeseriesWidgetDefinition, ToplistWidgetDefinition, + * TopologyMapWidgetDefinition, TreeMapWidgetDefinition, WildcardWidgetDefinition) */ @Override public Object getActualInstance() { @@ -2468,6 +2525,17 @@ public CheckStatusWidgetDefinition getCheckStatusWidgetDefinition() throws Class return (CheckStatusWidgetDefinition) super.getActualInstance(); } + /** + * Get the actual instance of `CloudcraftWidgetDefinition`. If the actual instance is not + * `CloudcraftWidgetDefinition`, the ClassCastException will be thrown. + * + * @return The actual instance of `CloudcraftWidgetDefinition` + * @throws ClassCastException if the instance is not `CloudcraftWidgetDefinition` + */ + public CloudcraftWidgetDefinition getCloudcraftWidgetDefinition() throws ClassCastException { + return (CloudcraftWidgetDefinition) super.getActualInstance(); + } + /** * Get the actual instance of `CohortWidgetDefinition`. If the actual instance is not * `CohortWidgetDefinition`, the ClassCastException will be thrown.