diff --git a/.apigentools-info b/.apigentools-info index f586220d426..f40a72ebca5 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-23 18:01:49.215543", - "spec_repo_commit": "9a201ac7" + "regenerated": "2025-06-23 19:18:44.439267", + "spec_repo_commit": "779f1def" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2025-06-23 18:01:49.231296", - "spec_repo_commit": "9a201ac7" + "regenerated": "2025-06-23 19:18:44.455531", + "spec_repo_commit": "779f1def" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 4c7b28f483c..40efcb6b55c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2227,97 +2227,6 @@ components: - id - base_severity type: object - AlertEventCustomAttributes: - additionalProperties: false - description: Alert event attributes. - properties: - custom: - $ref: '#/components/schemas/AlertEventCustomAttributesCustom' - links: - $ref: '#/components/schemas/AlertEventCustomAttributesLinks' - priority: - $ref: '#/components/schemas/AlertEventCustomAttributesPriority' - status: - $ref: '#/components/schemas/AlertEventCustomAttributesStatus' - required: - - status - type: object - AlertEventCustomAttributesCustom: - additionalProperties: {} - description: Free form JSON object for arbitrary data. Supports up to 100 properties - per object and a maximum nesting depth of 10 levels. - example: {} - type: object - AlertEventCustomAttributesLinks: - description: The links related to the event. Maximum of 20 links allowed. - items: - $ref: '#/components/schemas/AlertEventCustomAttributesLinksItems' - maxItems: 20 - minItems: 1 - type: array - AlertEventCustomAttributesLinksItems: - additionalProperties: false - description: A link. - properties: - category: - $ref: '#/components/schemas/AlertEventCustomAttributesLinksItemsCategory' - title: - description: The display text of the link. Limited to 300 characters. - example: Runbook Link - maxLength: 300 - minLength: 1 - type: string - url: - description: The URL of the link. Limited to 2048 characters. - example: https://app.datadoghq.com/runbook - maxLength: 2048 - minLength: 1 - type: string - required: - - url - - category - type: object - AlertEventCustomAttributesLinksItemsCategory: - description: The category of the link. - enum: - - runbook - - documentation - - dashboard - example: runbook - type: string - x-enum-varnames: - - RUNBOOK - - DOCUMENTATION - - DASHBOARD - AlertEventCustomAttributesPriority: - default: '5' - description: The priority of the alert. - enum: - - '1' - - '2' - - '3' - - '4' - - '5' - example: '5' - type: string - x-enum-varnames: - - PRIORITY_ONE - - PRIORITY_TWO - - PRIORITY_THREE - - PRIORITY_FOUR - - PRIORITY_FIVE - AlertEventCustomAttributesStatus: - description: The status of the alert. - enum: - - warn - - error - - ok - example: warn - type: string - x-enum-varnames: - - WARN - - ERROR - - OK Annotation: description: A list of annotations used in the workflow. These are like sticky notes for your workflow! @@ -7010,16 +6919,14 @@ components: type: integer type: object ChangeEventCustomAttributes: - additionalProperties: false - description: Change event attributes. + description: Object representing custom change event attributes. properties: author: $ref: '#/components/schemas/ChangeEventCustomAttributesAuthor' change_metadata: additionalProperties: {} - description: Free form JSON object with information related to the `change` - event. Supports up to 100 properties per object and a maximum nesting - depth of 10 levels. + description: Free form object with information related to the `change` event. + Can be arbitrarily nested and contain any valid JSON. example: dd: team: datadog_team @@ -7034,19 +6941,17 @@ components: description: 'A list of resources impacted by this change. It is recommended to provide an impacted resource to display - the change event at the correct location. Only resources of type `service` - are supported. Maximum of 100 impacted resources allowed.' + the change event at the right location. Only resources of type `service` + are supported.' example: - name: payments_api type: service items: $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItems' - maxItems: 100 type: array new_value: additionalProperties: {} - description: Free form JSON object representing the new state of the changed - resource. + description: Free form object to track new value of the changed resource. example: enabled: true percentage: 50% @@ -7055,8 +6960,7 @@ components: type: object prev_value: additionalProperties: {} - description: Free form JSON object representing the previous state of the - changed resource. + description: Free form object to track previous value of the changed resource. example: enabled: true percentage: 10% @@ -7067,16 +6971,13 @@ components: - changed_resource type: object ChangeEventCustomAttributesAuthor: - additionalProperties: false - description: The entity that made the change. Optional, if provided it must - include `type` and `name`. + description: Object representing the entity which made the change. Optional + field but if provided should include `type` and `name`. properties: name: - description: The name of the user or system that made the change. Limited - to 128 characters. - example: example@datadog.com + description: Author's name. Limited to 128 characters. + example: datadog@datadog.com maxLength: 128 - minLength: 1 type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesAuthorType' @@ -7099,14 +7000,11 @@ components: - API - AUTOMATION ChangeEventCustomAttributesChangedResource: - additionalProperties: false - description: A uniquely identified resource. + description: Object representing a uniquely identified resource. properties: name: - description: The name of the resource that was changed. Limited to 128 characters. + description: Resource's name. example: fallback_payments_test - maxLength: 128 - minLength: 1 type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesChangedResourceType' @@ -7115,7 +7013,7 @@ components: - name type: object ChangeEventCustomAttributesChangedResourceType: - description: The type of the resource that was changed. + description: Resource's type. enum: - feature_flag - configuration @@ -7125,14 +7023,12 @@ components: - FEATURE_FLAG - CONFIGURATION ChangeEventCustomAttributesImpactedResourcesItems: - additionalProperties: false - description: Object representing a uniquely identified resource. + description: Object representing a uniquely identified resource. Only the resource + type `service` is supported. properties: name: - description: The name of the impacted resource. Limited to 128 characters. + description: Resource's name. example: payments_api - maxLength: 128 - minLength: 1 type: string type: $ref: '#/components/schemas/ChangeEventCustomAttributesImpactedResourcesItemsType' @@ -7141,7 +7037,7 @@ components: - name type: object ChangeEventCustomAttributesImpactedResourcesItemsType: - description: The type of the impacted resource. + description: Resource's type. enum: - service example: service @@ -14783,33 +14679,28 @@ components: type: string type: object EventCategory: - description: Event category identifying the type of event. + description: Event category to identify the type of event. Only the value `change` + is supported. Support for other categories are coming. please reach out to + datadog support if you're interested. enum: - change - - alert example: change type: string x-enum-varnames: - CHANGE - - ALERT EventCreateRequest: - description: An event object. + description: Object representing an event creation request. properties: attributes: $ref: '#/components/schemas/EventPayload' type: $ref: '#/components/schemas/EventCreateRequestType' - required: - - type - - attributes type: object EventCreateRequestPayload: description: Payload for creating an event. properties: data: $ref: '#/components/schemas/EventCreateRequest' - required: - - data type: object EventCreateRequestType: description: Entity type. @@ -14820,23 +14711,24 @@ components: x-enum-varnames: - EVENT EventCreateResponse: - description: Event object. + description: Object containing an event response. properties: attributes: $ref: '#/components/schemas/EventCreateResponseAttributes' type: - description: Entity type. + description: Event type example: event type: string type: object EventCreateResponseAttributes: - description: Event attributes. + description: JSON object containing all events attributes and their associated + values. properties: attributes: $ref: '#/components/schemas/EventCreateResponseAttributesAttributes' type: object EventCreateResponseAttributesAttributes: - description: JSON object for category-specific attributes. + description: JSON object of attributes from your events. properties: evt: $ref: '#/components/schemas/EventCreateResponseAttributesAttributesEvt' @@ -14845,71 +14737,41 @@ components: description: JSON object of event system attributes. properties: id: - deprecated: true - description: Event identifier. This field is deprecated and will be removed - in a future version. Use the `uid` field instead. - type: string - uid: - description: A unique identifier for the event. You can use this identifier - to query or reference the event. + description: Event id type: string type: object EventCreateResponsePayload: - description: Event creation response. + description: Response containing information about created event. properties: data: $ref: '#/components/schemas/EventCreateResponse' - links: - $ref: '#/components/schemas/EventCreateResponsePayloadLinks' - type: object - EventCreateResponsePayloadLinks: - description: Links to the event. - properties: - self: - description: The URL of the event. This link is only functional when using - the default subdomain. - type: string type: object EventPayload: - additionalProperties: false description: Event attributes. properties: aggregation_key: - description: A string used for aggregation when [correlating](https://docs.datadoghq.com/service_management/events/correlation/) - events. If you specify a key, events are deduplicated to alerts based - on this key. Limited to 100 characters. - example: aggregation_key_123 + description: An arbitrary string to use for aggregation when correlating + events. Limited to 100 characters. maxLength: 100 - minLength: 1 type: string attributes: $ref: '#/components/schemas/EventPayloadAttributes' category: $ref: '#/components/schemas/EventCategory' - integration_id: - $ref: '#/components/schemas/EventPayloadIntegrationId' message: - description: Free formed text associated with the event. It's suggested - to use `data.attributes.attributes.custom` for well-structured attributes. - Limited to 4000 characters. + description: The body of the event. Limited to 4000 characters. example: payment_processed feature flag has been enabled maxLength: 4000 - minLength: 1 type: string tags: - description: 'A list of tags associated with the event. Maximum of 100 tags - allowed. + description: 'A list of tags to apply to the event. Refer to [Tags docs](https://docs.datadoghq.com/getting_started/tagging/).' example: - - env:api_client_test + - env:test items: description: A tag. - maxLength: 200 - minLength: 1 type: string - maxItems: 100 - minItems: 1 type: array timestamp: description: 'Timestamp when the event occurred. Must follow [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) @@ -14921,10 +14783,9 @@ components: 18 hours.' type: string title: - description: The title of the event. Limited to 500 characters. + description: The event title. Limited to 500 characters. example: payment_processed feature flag updated maxLength: 500 - minLength: 1 type: string required: - title @@ -14932,19 +14793,10 @@ components: - attributes type: object EventPayloadAttributes: - description: JSON object for category-specific attributes. Schema is different - per event category. + description: JSON object for custom attributes. Schema are different per each + event category. oneOf: - $ref: '#/components/schemas/ChangeEventCustomAttributes' - - $ref: '#/components/schemas/AlertEventCustomAttributes' - EventPayloadIntegrationId: - description: Integration ID sourced from integration manifests. - enum: - - custom-events - example: custom-events - type: string - x-enum-varnames: - - CUSTOM_EVENTS EventPriority: description: The priority of the event's monitor. For example, `normal` or `low`. enum: @@ -47307,15 +47159,10 @@ paths: permissions: - events_read post: - description: "This endpoint allows you to publish events.\n\n\u2705 **Only events - with the `change` or `alert` category** are in General Availability. For change - events, see [Change Tracking](https://docs.datadoghq.com/change_tracking) + description: "This endpoint allows you to post events.\n\n\u2705 **Only events + with the `change` category** are in General Availability. See [Change Tracking](https://docs.datadoghq.com/change_tracking) for more details.\n\n\u274C For use cases involving other event categories, - use the V1 endpoint or reach out to [support](https://www.datadoghq.com/support/).\n\n\u274C - Notifications are not yet supported for events sent to this endpoint. Use - the V1 endpoint for notification functionality.\n\n\u274C This endpoint is - not available for the Government (US1-FED) site. Contact your account representative - for more information." + please use the V1 endpoint." operationId: CreateEvent requestBody: content: @@ -47325,10 +47172,9 @@ paths: value: data: attributes: - aggregation_key: aggregation_key_123 attributes: author: - name: example@datadog.com + name: datadog@datadog.com type: user change_metadata: dd: @@ -47354,19 +47200,17 @@ paths: rule: datacenter: devcycle.us1.prod category: change - integration_id: custom-events message: payment_processed feature flag has been enabled tags: - - env:api_client_test - timestamp: '2020-01-01T01:30:15.010000Z' + - env:test title: payment_processed feature flag updated type: event schema: $ref: '#/components/schemas/EventCreateRequestPayload' - description: Event creation request payload. + description: Event request object required: true responses: - '202': + '200': content: application/json: schema: @@ -47389,38 +47233,6 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - servers: - - url: https://{subdomain}.{site} - variables: - site: - default: datadoghq.com - description: The regional site for customers. - enum: - - datadoghq.com - - us3.datadoghq.com - - us5.datadoghq.com - - ap1.datadoghq.com - - datadoghq.eu - - ddog-gov.com - subdomain: - default: event-management-intake - description: The subdomain where the API is deployed. - - url: '{protocol}://{name}' - variables: - name: - default: event-management-intake.datadoghq.com - description: Full site DNS name. - protocol: - default: https - description: The protocol for accessing the API. - - url: https://{subdomain}.{site} - variables: - site: - default: datadoghq.com - description: Any Datadog deployment. - subdomain: - default: event-management-intake - description: The subdomain where the API is deployed. summary: Post an event tags: - Events diff --git a/examples/v2/events/CreateEvent.java b/examples/v2/events/CreateEvent.java index 60b74fa4973..5e754aac948 100644 --- a/examples/v2/events/CreateEvent.java +++ b/examples/v2/events/CreateEvent.java @@ -17,7 +17,6 @@ import com.datadog.api.client.v2.model.EventCreateResponsePayload; import com.datadog.api.client.v2.model.EventPayload; import com.datadog.api.client.v2.model.EventPayloadAttributes; -import com.datadog.api.client.v2.model.EventPayloadIntegrationId; import java.util.Collections; import java.util.Map; @@ -32,13 +31,12 @@ public static void main(String[] args) { new EventCreateRequest() .attributes( new EventPayload() - .aggregationKey("aggregation_key_123") .attributes( new EventPayloadAttributes( new ChangeEventCustomAttributes() .author( new ChangeEventCustomAttributesAuthor() - .name("example@datadog.com") + .name("datadog@datadog.com") .type(ChangeEventCustomAttributesAuthorType.USER)) .changeMetadata( Map.ofEntries( @@ -78,9 +76,8 @@ public static void main(String[] args) { "rule", "{'datacenter': 'devcycle.us1.prod'}"))))) .category(EventCategory.CHANGE) - .integrationId(EventPayloadIntegrationId.CUSTOM_EVENTS) .message("payment_processed feature flag has been enabled") - .tags(Collections.singletonList("env:api_client_test")) + .tags(Collections.singletonList("env:test")) .title("payment_processed feature flag updated")) .type(EventCreateRequestType.EVENT)); diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index d03574cfd14..cfb737701fd 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -277,74 +277,6 @@ public class ApiClient { new HashSet())); } })))); - put( - "v2.EventsApi.createEvent", - new ArrayList( - Arrays.asList( - new ServerConfiguration( - "https://{subdomain}.{site}", - "No description provided", - new HashMap() { - { - put( - "site", - new ServerVariable( - "The regional site for customers.", - "datadoghq.com", - new HashSet( - Arrays.asList( - "datadoghq.com", - "us3.datadoghq.com", - "us5.datadoghq.com", - "ap1.datadoghq.com", - "datadoghq.eu", - "ddog-gov.com")))); - put( - "subdomain", - new ServerVariable( - "The subdomain where the API is deployed.", - "event-management-intake", - new HashSet())); - } - }), - new ServerConfiguration( - "{protocol}://{name}", - "No description provided", - new HashMap() { - { - put( - "name", - new ServerVariable( - "Full site DNS name.", - "event-management-intake.datadoghq.com", - new HashSet())); - put( - "protocol", - new ServerVariable( - "The protocol for accessing the API.", - "https", - new HashSet())); - } - }), - new ServerConfiguration( - "https://{subdomain}.{site}", - "No description provided", - new HashMap() { - { - put( - "site", - new ServerVariable( - "Any Datadog deployment.", - "datadoghq.com", - new HashSet())); - put( - "subdomain", - new ServerVariable( - "The subdomain where the API is deployed.", - "event-management-intake", - new HashSet())); - } - })))); put( "v2.LogsApi.submitLog", new ArrayList( diff --git a/src/main/java/com/datadog/api/client/v2/api/EventsApi.java b/src/main/java/com/datadog/api/client/v2/api/EventsApi.java index 9df000ac014..fc4ab775609 100644 --- a/src/main/java/com/datadog/api/client/v2/api/EventsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/EventsApi.java @@ -57,7 +57,7 @@ public void setApiClient(ApiClient apiClient) { * *

See {@link #createEventWithHttpInfo}. * - * @param body Event creation request payload. (required) + * @param body Event request object (required) * @return EventCreateResponsePayload * @throws ApiException if fails to make API call */ @@ -71,7 +71,7 @@ public EventCreateResponsePayload createEvent(EventCreateRequestPayload body) * *

See {@link #createEventWithHttpInfoAsync}. * - * @param body Event creation request payload. (required) + * @param body Event request object (required) * @return CompletableFuture<EventCreateResponsePayload> */ public CompletableFuture createEventAsync( @@ -84,29 +84,22 @@ public CompletableFuture createEventAsync( } /** - * This endpoint allows you to publish events. + * This endpoint allows you to post events. * - *

Only events with the change or alert category - * are in General Availability. For change events, see Change Tracking for more details. + *

Only events with the change category are in General + * Availability. See Change Tracking for + * more details. * - *

❌ For use cases involving other event categories, use the V1 endpoint or reach out to support. + *

❌ For use cases involving other event categories, please use the V1 endpoint. * - *

❌ Notifications are not yet supported for events sent to this endpoint. Use the V1 endpoint - * for notification functionality. - * - *

❌ This endpoint is not available for the Government (US1-FED) site. Contact your account - * representative for more information. - * - * @param body Event creation request payload. (required) + * @param body Event request object (required) * @return ApiResponse<EventCreateResponsePayload> * @throws ApiException if fails to make API call * @http.response.details * * * - * + * * * * @@ -150,7 +143,7 @@ public ApiResponse createEventWithHttpInfo( * *

See {@link #createEventWithHttpInfo}. * - * @param body Event creation request payload. (required) + * @param body Event request object (required) * @return CompletableFuture<ApiResponse<EventCreateResponsePayload>> */ public CompletableFuture> createEventWithHttpInfoAsync( diff --git a/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributes.java deleted file mode 100644 index 80c179d5957..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributes.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.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; - -/** Alert event attributes. */ -@JsonPropertyOrder({ - AlertEventCustomAttributes.JSON_PROPERTY_CUSTOM, - AlertEventCustomAttributes.JSON_PROPERTY_LINKS, - AlertEventCustomAttributes.JSON_PROPERTY_PRIORITY, - AlertEventCustomAttributes.JSON_PROPERTY_STATUS -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class AlertEventCustomAttributes { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_CUSTOM = "custom"; - private Map custom = null; - - public static final String JSON_PROPERTY_LINKS = "links"; - private List links = null; - - public static final String JSON_PROPERTY_PRIORITY = "priority"; - private AlertEventCustomAttributesPriority priority = - AlertEventCustomAttributesPriority.PRIORITY_FIVE; - - public static final String JSON_PROPERTY_STATUS = "status"; - private AlertEventCustomAttributesStatus status; - - public AlertEventCustomAttributes() {} - - @JsonCreator - public AlertEventCustomAttributes( - @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) - AlertEventCustomAttributesStatus status) { - this.status = status; - this.unparsed |= !status.isValid(); - } - - public AlertEventCustomAttributes custom(Map custom) { - this.custom = custom; - return this; - } - - public AlertEventCustomAttributes putCustomItem(String key, Object customItem) { - if (this.custom == null) { - this.custom = new HashMap<>(); - } - this.custom.put(key, customItem); - return this; - } - - /** - * Free form JSON object for arbitrary data. Supports up to 100 properties per object and a - * maximum nesting depth of 10 levels. - * - * @return custom - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_CUSTOM) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Map getCustom() { - return custom; - } - - public void setCustom(Map custom) { - this.custom = custom; - } - - public AlertEventCustomAttributes links(List links) { - this.links = links; - for (AlertEventCustomAttributesLinksItems item : links) { - this.unparsed |= item.unparsed; - } - return this; - } - - public AlertEventCustomAttributes addLinksItem(AlertEventCustomAttributesLinksItems linksItem) { - if (this.links == null) { - this.links = new ArrayList<>(); - } - this.links.add(linksItem); - this.unparsed |= linksItem.unparsed; - return this; - } - - /** - * The links related to the event. Maximum of 20 links allowed. - * - * @return links - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LINKS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getLinks() { - return links; - } - - public void setLinks(List links) { - this.links = links; - } - - public AlertEventCustomAttributes priority(AlertEventCustomAttributesPriority priority) { - this.priority = priority; - this.unparsed |= !priority.isValid(); - return this; - } - - /** - * The priority of the alert. - * - * @return priority - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_PRIORITY) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public AlertEventCustomAttributesPriority getPriority() { - return priority; - } - - public void setPriority(AlertEventCustomAttributesPriority priority) { - if (!priority.isValid()) { - this.unparsed = true; - } - this.priority = priority; - } - - public AlertEventCustomAttributes status(AlertEventCustomAttributesStatus status) { - this.status = status; - this.unparsed |= !status.isValid(); - return this; - } - - /** - * The status of the alert. - * - * @return status - */ - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public AlertEventCustomAttributesStatus getStatus() { - return status; - } - - public void setStatus(AlertEventCustomAttributesStatus status) { - if (!status.isValid()) { - this.unparsed = true; - } - this.status = status; - } - - /** Return true if this AlertEventCustomAttributes object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlertEventCustomAttributes alertEventCustomAttributes = (AlertEventCustomAttributes) o; - return Objects.equals(this.custom, alertEventCustomAttributes.custom) - && Objects.equals(this.links, alertEventCustomAttributes.links) - && Objects.equals(this.priority, alertEventCustomAttributes.priority) - && Objects.equals(this.status, alertEventCustomAttributes.status); - } - - @Override - public int hashCode() { - return Objects.hash(custom, links, priority, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AlertEventCustomAttributes {\n"); - sb.append(" custom: ").append(toIndentedString(custom)).append("\n"); - sb.append(" links: ").append(toIndentedString(links)).append("\n"); - sb.append(" priority: ").append(toIndentedString(priority)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).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/v2/model/AlertEventCustomAttributesLinksItems.java b/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesLinksItems.java deleted file mode 100644 index f4b3b605ad2..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesLinksItems.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.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; - -/** A link. */ -@JsonPropertyOrder({ - AlertEventCustomAttributesLinksItems.JSON_PROPERTY_CATEGORY, - AlertEventCustomAttributesLinksItems.JSON_PROPERTY_TITLE, - AlertEventCustomAttributesLinksItems.JSON_PROPERTY_URL -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class AlertEventCustomAttributesLinksItems { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_CATEGORY = "category"; - private AlertEventCustomAttributesLinksItemsCategory category; - - public static final String JSON_PROPERTY_TITLE = "title"; - private String title; - - public static final String JSON_PROPERTY_URL = "url"; - private String url; - - public AlertEventCustomAttributesLinksItems() {} - - @JsonCreator - public AlertEventCustomAttributesLinksItems( - @JsonProperty(required = true, value = JSON_PROPERTY_CATEGORY) - AlertEventCustomAttributesLinksItemsCategory category, - @JsonProperty(required = true, value = JSON_PROPERTY_URL) String url) { - this.category = category; - this.unparsed |= !category.isValid(); - this.url = url; - } - - public AlertEventCustomAttributesLinksItems category( - AlertEventCustomAttributesLinksItemsCategory category) { - this.category = category; - this.unparsed |= !category.isValid(); - return this; - } - - /** - * The category of the link. - * - * @return category - */ - @JsonProperty(JSON_PROPERTY_CATEGORY) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public AlertEventCustomAttributesLinksItemsCategory getCategory() { - return category; - } - - public void setCategory(AlertEventCustomAttributesLinksItemsCategory category) { - if (!category.isValid()) { - this.unparsed = true; - } - this.category = category; - } - - public AlertEventCustomAttributesLinksItems title(String title) { - this.title = title; - return this; - } - - /** - * The display text of the link. Limited to 300 characters. - * - * @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 AlertEventCustomAttributesLinksItems url(String url) { - this.url = url; - return this; - } - - /** - * The URL of the link. Limited to 2048 characters. - * - * @return url - */ - @JsonProperty(JSON_PROPERTY_URL) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - /** Return true if this AlertEventCustomAttributesLinksItems object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlertEventCustomAttributesLinksItems alertEventCustomAttributesLinksItems = - (AlertEventCustomAttributesLinksItems) o; - return Objects.equals(this.category, alertEventCustomAttributesLinksItems.category) - && Objects.equals(this.title, alertEventCustomAttributesLinksItems.title) - && Objects.equals(this.url, alertEventCustomAttributesLinksItems.url); - } - - @Override - public int hashCode() { - return Objects.hash(category, title, url); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AlertEventCustomAttributesLinksItems {\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" title: ").append(toIndentedString(title)).append("\n"); - sb.append(" url: ").append(toIndentedString(url)).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/v2/model/AlertEventCustomAttributesLinksItemsCategory.java b/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesLinksItemsCategory.java deleted file mode 100644 index a2adc581ad3..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesLinksItemsCategory.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.datadog.api.client.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; - -/** The category of the link. */ -@JsonSerialize( - using = - AlertEventCustomAttributesLinksItemsCategory - .AlertEventCustomAttributesLinksItemsCategorySerializer.class) -public class AlertEventCustomAttributesLinksItemsCategory extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("runbook", "documentation", "dashboard")); - - public static final AlertEventCustomAttributesLinksItemsCategory RUNBOOK = - new AlertEventCustomAttributesLinksItemsCategory("runbook"); - public static final AlertEventCustomAttributesLinksItemsCategory DOCUMENTATION = - new AlertEventCustomAttributesLinksItemsCategory("documentation"); - public static final AlertEventCustomAttributesLinksItemsCategory DASHBOARD = - new AlertEventCustomAttributesLinksItemsCategory("dashboard"); - - AlertEventCustomAttributesLinksItemsCategory(String value) { - super(value, allowedValues); - } - - public static class AlertEventCustomAttributesLinksItemsCategorySerializer - extends StdSerializer { - public AlertEventCustomAttributesLinksItemsCategorySerializer( - Class t) { - super(t); - } - - public AlertEventCustomAttributesLinksItemsCategorySerializer() { - this(null); - } - - @Override - public void serialize( - AlertEventCustomAttributesLinksItemsCategory value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static AlertEventCustomAttributesLinksItemsCategory fromValue(String value) { - return new AlertEventCustomAttributesLinksItemsCategory(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesPriority.java b/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesPriority.java deleted file mode 100644 index 84b42b1ddd6..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesPriority.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.datadog.api.client.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; - -/** The priority of the alert. */ -@JsonSerialize( - using = AlertEventCustomAttributesPriority.AlertEventCustomAttributesPrioritySerializer.class) -public class AlertEventCustomAttributesPriority extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("1", "2", "3", "4", "5")); - - public static final AlertEventCustomAttributesPriority PRIORITY_ONE = - new AlertEventCustomAttributesPriority("1"); - public static final AlertEventCustomAttributesPriority PRIORITY_TWO = - new AlertEventCustomAttributesPriority("2"); - public static final AlertEventCustomAttributesPriority PRIORITY_THREE = - new AlertEventCustomAttributesPriority("3"); - public static final AlertEventCustomAttributesPriority PRIORITY_FOUR = - new AlertEventCustomAttributesPriority("4"); - public static final AlertEventCustomAttributesPriority PRIORITY_FIVE = - new AlertEventCustomAttributesPriority("5"); - - AlertEventCustomAttributesPriority(String value) { - super(value, allowedValues); - } - - public static class AlertEventCustomAttributesPrioritySerializer - extends StdSerializer { - public AlertEventCustomAttributesPrioritySerializer( - Class t) { - super(t); - } - - public AlertEventCustomAttributesPrioritySerializer() { - this(null); - } - - @Override - public void serialize( - AlertEventCustomAttributesPriority value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static AlertEventCustomAttributesPriority fromValue(String value) { - return new AlertEventCustomAttributesPriority(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesStatus.java b/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesStatus.java deleted file mode 100644 index d2cf39cd203..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/AlertEventCustomAttributesStatus.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.datadog.api.client.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; - -/** The status of the alert. */ -@JsonSerialize( - using = AlertEventCustomAttributesStatus.AlertEventCustomAttributesStatusSerializer.class) -public class AlertEventCustomAttributesStatus extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("warn", "error", "ok")); - - public static final AlertEventCustomAttributesStatus WARN = - new AlertEventCustomAttributesStatus("warn"); - public static final AlertEventCustomAttributesStatus ERROR = - new AlertEventCustomAttributesStatus("error"); - public static final AlertEventCustomAttributesStatus OK = - new AlertEventCustomAttributesStatus("ok"); - - AlertEventCustomAttributesStatus(String value) { - super(value, allowedValues); - } - - public static class AlertEventCustomAttributesStatusSerializer - extends StdSerializer { - public AlertEventCustomAttributesStatusSerializer(Class t) { - super(t); - } - - public AlertEventCustomAttributesStatusSerializer() { - this(null); - } - - @Override - public void serialize( - AlertEventCustomAttributesStatus value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static AlertEventCustomAttributesStatus fromValue(String value) { - return new AlertEventCustomAttributesStatus(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributes.java index ad39e62e56a..1329f7f7bb6 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributes.java @@ -6,6 +6,8 @@ package com.datadog.api.client.v2.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; @@ -17,7 +19,7 @@ import java.util.Map; import java.util.Objects; -/** Change event attributes. */ +/** Object representing custom change event attributes. */ @JsonPropertyOrder({ ChangeEventCustomAttributes.JSON_PROPERTY_AUTHOR, ChangeEventCustomAttributes.JSON_PROPERTY_CHANGE_METADATA, @@ -65,8 +67,8 @@ public ChangeEventCustomAttributes author(ChangeEventCustomAttributesAuthor auth } /** - * The entity that made the change. Optional, if provided it must include type and - * name. + * Object representing the entity which made the change. Optional field but if provided should + * include type and name. * * @return author */ @@ -95,8 +97,8 @@ public ChangeEventCustomAttributes putChangeMetadataItem(String key, Object chan } /** - * Free form JSON object with information related to the change event. Supports up to - * 100 properties per object and a maximum nesting depth of 10 levels. + * Free form object with information related to the change event. Can be arbitrarily + * nested and contain any valid JSON. * * @return changeMetadata */ @@ -119,7 +121,7 @@ public ChangeEventCustomAttributes changedResource( } /** - * A uniquely identified resource. + * Object representing a uniquely identified resource. * * @return changedResource */ @@ -154,8 +156,8 @@ public ChangeEventCustomAttributes addImpactedResourcesItem( /** * A list of resources impacted by this change. It is recommended to provide an impacted resource - * to display the change event at the correct location. Only resources of type service - * are supported. Maximum of 100 impacted resources allowed. + * to display the change event at the right location. Only resources of type service + * are supported. * * @return impactedResources */ @@ -185,7 +187,7 @@ public ChangeEventCustomAttributes putNewValueItem(String key, Object newValueIt } /** - * Free form JSON object representing the new state of the changed resource. + * Free form object to track new value of the changed resource. * * @return newValue */ @@ -214,7 +216,7 @@ public ChangeEventCustomAttributes putPrevValueItem(String key, Object prevValue } /** - * Free form JSON object representing the previous state of the changed resource. + * Free form object to track previous value of the changed resource. * * @return prevValue */ @@ -229,6 +231,52 @@ public void setPrevValue(Map prevValue) { this.prevValue = prevValue; } + /** + * 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 ChangeEventCustomAttributes + */ + @JsonAnySetter + public ChangeEventCustomAttributes 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 ChangeEventCustomAttributes object is equal to o. */ @Override public boolean equals(Object o) { @@ -244,13 +292,21 @@ public boolean equals(Object o) { && Objects.equals(this.changedResource, changeEventCustomAttributes.changedResource) && Objects.equals(this.impactedResources, changeEventCustomAttributes.impactedResources) && Objects.equals(this.newValue, changeEventCustomAttributes.newValue) - && Objects.equals(this.prevValue, changeEventCustomAttributes.prevValue); + && Objects.equals(this.prevValue, changeEventCustomAttributes.prevValue) + && Objects.equals( + this.additionalProperties, changeEventCustomAttributes.additionalProperties); } @Override public int hashCode() { return Objects.hash( - author, changeMetadata, changedResource, impactedResources, newValue, prevValue); + author, + changeMetadata, + changedResource, + impactedResources, + newValue, + prevValue, + additionalProperties); } @Override @@ -263,6 +319,9 @@ public String toString() { sb.append(" impactedResources: ").append(toIndentedString(impactedResources)).append("\n"); sb.append(" newValue: ").append(toIndentedString(newValue)).append("\n"); sb.append(" prevValue: ").append(toIndentedString(prevValue)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append('}'); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesAuthor.java b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesAuthor.java index 98203d486dd..f291f1e4dce 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesAuthor.java +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesAuthor.java @@ -6,16 +6,20 @@ package com.datadog.api.client.v2.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.HashMap; +import java.util.Map; import java.util.Objects; /** - * The entity that made the change. Optional, if provided it must include type and - * name. + * Object representing the entity which made the change. Optional field but if provided should + * include type and name. */ @JsonPropertyOrder({ ChangeEventCustomAttributesAuthor.JSON_PROPERTY_NAME, @@ -49,7 +53,7 @@ public ChangeEventCustomAttributesAuthor name(String name) { } /** - * The name of the user or system that made the change. Limited to 128 characters. + * Author's name. Limited to 128 characters. * * @return name */ @@ -87,6 +91,52 @@ public void setType(ChangeEventCustomAttributesAuthorType type) { 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 ChangeEventCustomAttributesAuthor + */ + @JsonAnySetter + public ChangeEventCustomAttributesAuthor 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 ChangeEventCustomAttributesAuthor object is equal to o. */ @Override public boolean equals(Object o) { @@ -99,12 +149,14 @@ public boolean equals(Object o) { ChangeEventCustomAttributesAuthor changeEventCustomAttributesAuthor = (ChangeEventCustomAttributesAuthor) o; return Objects.equals(this.name, changeEventCustomAttributesAuthor.name) - && Objects.equals(this.type, changeEventCustomAttributesAuthor.type); + && Objects.equals(this.type, changeEventCustomAttributesAuthor.type) + && Objects.equals( + this.additionalProperties, changeEventCustomAttributesAuthor.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, type); + return Objects.hash(name, type, additionalProperties); } @Override @@ -113,6 +165,9 @@ public String toString() { sb.append("class ChangeEventCustomAttributesAuthor {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append('}'); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesChangedResource.java b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesChangedResource.java index acfc8b62824..6d7947796f0 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesChangedResource.java +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesChangedResource.java @@ -6,14 +6,18 @@ package com.datadog.api.client.v2.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.HashMap; +import java.util.Map; import java.util.Objects; -/** A uniquely identified resource. */ +/** Object representing a uniquely identified resource. */ @JsonPropertyOrder({ ChangeEventCustomAttributesChangedResource.JSON_PROPERTY_NAME, ChangeEventCustomAttributesChangedResource.JSON_PROPERTY_TYPE @@ -46,7 +50,7 @@ public ChangeEventCustomAttributesChangedResource name(String name) { } /** - * The name of the resource that was changed. Limited to 128 characters. + * Resource's name. * * @return name */ @@ -68,7 +72,7 @@ public ChangeEventCustomAttributesChangedResource type( } /** - * The type of the resource that was changed. + * Resource's type. * * @return type */ @@ -85,6 +89,53 @@ public void setType(ChangeEventCustomAttributesChangedResourceType type) { 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 ChangeEventCustomAttributesChangedResource + */ + @JsonAnySetter + public ChangeEventCustomAttributesChangedResource 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 ChangeEventCustomAttributesChangedResource object is equal to o. */ @Override public boolean equals(Object o) { @@ -97,12 +148,15 @@ public boolean equals(Object o) { ChangeEventCustomAttributesChangedResource changeEventCustomAttributesChangedResource = (ChangeEventCustomAttributesChangedResource) o; return Objects.equals(this.name, changeEventCustomAttributesChangedResource.name) - && Objects.equals(this.type, changeEventCustomAttributesChangedResource.type); + && Objects.equals(this.type, changeEventCustomAttributesChangedResource.type) + && Objects.equals( + this.additionalProperties, + changeEventCustomAttributesChangedResource.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, type); + return Objects.hash(name, type, additionalProperties); } @Override @@ -111,6 +165,9 @@ public String toString() { sb.append("class ChangeEventCustomAttributesChangedResource {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append('}'); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesChangedResourceType.java b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesChangedResourceType.java index ffcfd74e219..4ffecebad1b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesChangedResourceType.java +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesChangedResourceType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** The type of the resource that was changed. */ +/** Resource's type. */ @JsonSerialize( using = ChangeEventCustomAttributesChangedResourceType diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesImpactedResourcesItems.java b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesImpactedResourcesItems.java index e7276602c3f..c41ea25c2b2 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesImpactedResourcesItems.java +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesImpactedResourcesItems.java @@ -6,14 +6,21 @@ package com.datadog.api.client.v2.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.HashMap; +import java.util.Map; import java.util.Objects; -/** Object representing a uniquely identified resource. */ +/** + * Object representing a uniquely identified resource. Only the resource type service + * is supported. + */ @JsonPropertyOrder({ ChangeEventCustomAttributesImpactedResourcesItems.JSON_PROPERTY_NAME, ChangeEventCustomAttributesImpactedResourcesItems.JSON_PROPERTY_TYPE @@ -46,7 +53,7 @@ public ChangeEventCustomAttributesImpactedResourcesItems name(String name) { } /** - * The name of the impacted resource. Limited to 128 characters. + * Resource's name. * * @return name */ @@ -68,7 +75,7 @@ public ChangeEventCustomAttributesImpactedResourcesItems type( } /** - * The type of the impacted resource. + * Resource's type. * * @return type */ @@ -85,6 +92,53 @@ public void setType(ChangeEventCustomAttributesImpactedResourcesItemsType type) 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 ChangeEventCustomAttributesImpactedResourcesItems + */ + @JsonAnySetter + public ChangeEventCustomAttributesImpactedResourcesItems 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 ChangeEventCustomAttributesImpactedResourcesItems object is equal to o. */ @Override public boolean equals(Object o) { @@ -98,12 +152,15 @@ public boolean equals(Object o) { changeEventCustomAttributesImpactedResourcesItems = (ChangeEventCustomAttributesImpactedResourcesItems) o; return Objects.equals(this.name, changeEventCustomAttributesImpactedResourcesItems.name) - && Objects.equals(this.type, changeEventCustomAttributesImpactedResourcesItems.type); + && Objects.equals(this.type, changeEventCustomAttributesImpactedResourcesItems.type) + && Objects.equals( + this.additionalProperties, + changeEventCustomAttributesImpactedResourcesItems.additionalProperties); } @Override public int hashCode() { - return Objects.hash(name, type); + return Objects.hash(name, type, additionalProperties); } @Override @@ -112,6 +169,9 @@ public String toString() { sb.append("class ChangeEventCustomAttributesImpactedResourcesItems {\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append('}'); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesImpactedResourcesItemsType.java b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesImpactedResourcesItemsType.java index ba627413793..27e2f73e067 100644 --- a/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesImpactedResourcesItemsType.java +++ b/src/main/java/com/datadog/api/client/v2/model/ChangeEventCustomAttributesImpactedResourcesItemsType.java @@ -18,7 +18,7 @@ import java.util.HashSet; import java.util.Set; -/** The type of the impacted resource. */ +/** Resource's type. */ @JsonSerialize( using = ChangeEventCustomAttributesImpactedResourcesItemsType diff --git a/src/main/java/com/datadog/api/client/v2/model/EventCategory.java b/src/main/java/com/datadog/api/client/v2/model/EventCategory.java index 6ad8dd26422..64944dc99bb 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventCategory.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventCategory.java @@ -18,15 +18,17 @@ import java.util.HashSet; import java.util.Set; -/** Event category identifying the type of event. */ +/** + * Event category to identify the type of event. Only the value change is supported. + * Support for other categories are coming. please reach out to datadog support if you're + * interested. + */ @JsonSerialize(using = EventCategory.EventCategorySerializer.class) public class EventCategory extends ModelEnum { - private static final Set allowedValues = - new HashSet(Arrays.asList("change", "alert")); + private static final Set allowedValues = new HashSet(Arrays.asList("change")); public static final EventCategory CHANGE = new EventCategory("change"); - public static final EventCategory ALERT = new EventCategory("alert"); EventCategory(String value) { super(value, allowedValues); diff --git a/src/main/java/com/datadog/api/client/v2/model/EventCreateRequest.java b/src/main/java/com/datadog/api/client/v2/model/EventCreateRequest.java index fce22b58c79..9bd04f4b675 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventCreateRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventCreateRequest.java @@ -8,7 +8,6 @@ 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; @@ -17,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** An event object. */ +/** Object representing an event creation request. */ @JsonPropertyOrder({ EventCreateRequest.JSON_PROPERTY_ATTRIBUTES, EventCreateRequest.JSON_PROPERTY_TYPE @@ -32,18 +31,6 @@ public class EventCreateRequest { public static final String JSON_PROPERTY_TYPE = "type"; private EventCreateRequestType type; - public EventCreateRequest() {} - - @JsonCreator - public EventCreateRequest( - @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) EventPayload attributes, - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) EventCreateRequestType type) { - this.attributes = attributes; - this.unparsed |= attributes.unparsed; - this.type = type; - this.unparsed |= !type.isValid(); - } - public EventCreateRequest attributes(EventPayload attributes) { this.attributes = attributes; this.unparsed |= attributes.unparsed; @@ -55,8 +42,9 @@ public EventCreateRequest attributes(EventPayload attributes) { * * @return attributes */ + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTES) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public EventPayload getAttributes() { return attributes; } @@ -76,8 +64,9 @@ public EventCreateRequest type(EventCreateRequestType type) { * * @return type */ + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public EventCreateRequestType getType() { return type; } diff --git a/src/main/java/com/datadog/api/client/v2/model/EventCreateRequestPayload.java b/src/main/java/com/datadog/api/client/v2/model/EventCreateRequestPayload.java index 545f133e92d..d924800054b 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventCreateRequestPayload.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventCreateRequestPayload.java @@ -8,7 +8,6 @@ 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; @@ -26,15 +25,6 @@ public class EventCreateRequestPayload { public static final String JSON_PROPERTY_DATA = "data"; private EventCreateRequest data; - public EventCreateRequestPayload() {} - - @JsonCreator - public EventCreateRequestPayload( - @JsonProperty(required = true, value = JSON_PROPERTY_DATA) EventCreateRequest data) { - this.data = data; - this.unparsed |= data.unparsed; - } - public EventCreateRequestPayload data(EventCreateRequest data) { this.data = data; this.unparsed |= data.unparsed; @@ -42,12 +32,13 @@ public EventCreateRequestPayload data(EventCreateRequest data) { } /** - * An event object. + * Object representing an event creation request. * * @return data */ + @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public EventCreateRequest getData() { return data; } diff --git a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponse.java b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponse.java index d2dc8de809a..7d5146556b3 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponse.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Event object. */ +/** Object containing an event response. */ @JsonPropertyOrder({ EventCreateResponse.JSON_PROPERTY_ATTRIBUTES, EventCreateResponse.JSON_PROPERTY_TYPE @@ -38,7 +38,7 @@ public EventCreateResponse attributes(EventCreateResponseAttributes attributes) } /** - * Event attributes. + * JSON object containing all events attributes and their associated values. * * @return attributes */ @@ -59,7 +59,7 @@ public EventCreateResponse type(String type) { } /** - * Entity type. + * Event type * * @return type */ diff --git a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributes.java index 230ce4c7d23..7c7069d31cb 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributes.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** Event attributes. */ +/** JSON object containing all events attributes and their associated values. */ @JsonPropertyOrder({EventCreateResponseAttributes.JSON_PROPERTY_ATTRIBUTES}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -33,7 +33,7 @@ public EventCreateResponseAttributes attributes( } /** - * JSON object for category-specific attributes. + * JSON object of attributes from your events. * * @return attributes */ diff --git a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributesAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributesAttributes.java index 5717071786f..cdbfdf23e14 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributesAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributesAttributes.java @@ -16,7 +16,7 @@ import java.util.Map; import java.util.Objects; -/** JSON object for category-specific attributes. */ +/** JSON object of attributes from your events. */ @JsonPropertyOrder({EventCreateResponseAttributesAttributes.JSON_PROPERTY_EVT}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") diff --git a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributesAttributesEvt.java b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributesAttributesEvt.java index d7ff5d3ed70..df56a6c16f9 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributesAttributesEvt.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponseAttributesAttributesEvt.java @@ -17,10 +17,7 @@ import java.util.Objects; /** JSON object of event system attributes. */ -@JsonPropertyOrder({ - EventCreateResponseAttributesAttributesEvt.JSON_PROPERTY_ID, - EventCreateResponseAttributesAttributesEvt.JSON_PROPERTY_UID -}) +@JsonPropertyOrder({EventCreateResponseAttributesAttributesEvt.JSON_PROPERTY_ID}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class EventCreateResponseAttributesAttributesEvt { @@ -28,22 +25,16 @@ public class EventCreateResponseAttributesAttributesEvt { public static final String JSON_PROPERTY_ID = "id"; private String id; - public static final String JSON_PROPERTY_UID = "uid"; - private String uid; - public EventCreateResponseAttributesAttributesEvt id(String id) { this.id = id; return this; } /** - * Event identifier. This field is deprecated and will be removed in a future version. Use the - * uid field instead. + * Event id * * @return id - * @deprecated */ - @Deprecated @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) @@ -51,32 +42,10 @@ public String getId() { return id; } - @Deprecated public void setId(String id) { this.id = id; } - public EventCreateResponseAttributesAttributesEvt uid(String uid) { - this.uid = uid; - return this; - } - - /** - * A unique identifier for the event. You can use this identifier to query or reference the event. - * - * @return uid - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_UID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUid() { - return uid; - } - - public void setUid(String uid) { - this.uid = uid; - } - /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -136,7 +105,6 @@ public boolean equals(Object o) { EventCreateResponseAttributesAttributesEvt eventCreateResponseAttributesAttributesEvt = (EventCreateResponseAttributesAttributesEvt) o; return Objects.equals(this.id, eventCreateResponseAttributesAttributesEvt.id) - && Objects.equals(this.uid, eventCreateResponseAttributesAttributesEvt.uid) && Objects.equals( this.additionalProperties, eventCreateResponseAttributesAttributesEvt.additionalProperties); @@ -144,7 +112,7 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(id, uid, additionalProperties); + return Objects.hash(id, additionalProperties); } @Override @@ -152,7 +120,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EventCreateResponseAttributesAttributesEvt {\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponsePayload.java b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponsePayload.java index 46ee966ebde..dfd0c669635 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponsePayload.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponsePayload.java @@ -16,11 +16,8 @@ import java.util.Map; import java.util.Objects; -/** Event creation response. */ -@JsonPropertyOrder({ - EventCreateResponsePayload.JSON_PROPERTY_DATA, - EventCreateResponsePayload.JSON_PROPERTY_LINKS -}) +/** Response containing information about created event. */ +@JsonPropertyOrder({EventCreateResponsePayload.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class EventCreateResponsePayload { @@ -28,9 +25,6 @@ public class EventCreateResponsePayload { public static final String JSON_PROPERTY_DATA = "data"; private EventCreateResponse data; - public static final String JSON_PROPERTY_LINKS = "links"; - private EventCreateResponsePayloadLinks links; - public EventCreateResponsePayload data(EventCreateResponse data) { this.data = data; this.unparsed |= data.unparsed; @@ -38,7 +32,7 @@ public EventCreateResponsePayload data(EventCreateResponse data) { } /** - * Event object. + * Object containing an event response. * * @return data */ @@ -53,28 +47,6 @@ public void setData(EventCreateResponse data) { this.data = data; } - public EventCreateResponsePayload links(EventCreateResponsePayloadLinks links) { - this.links = links; - this.unparsed |= links.unparsed; - return this; - } - - /** - * Links to the event. - * - * @return links - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_LINKS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EventCreateResponsePayloadLinks getLinks() { - return links; - } - - public void setLinks(EventCreateResponsePayloadLinks links) { - this.links = links; - } - /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -132,14 +104,13 @@ public boolean equals(Object o) { } EventCreateResponsePayload eventCreateResponsePayload = (EventCreateResponsePayload) o; return Objects.equals(this.data, eventCreateResponsePayload.data) - && Objects.equals(this.links, eventCreateResponsePayload.links) && Objects.equals( this.additionalProperties, eventCreateResponsePayload.additionalProperties); } @Override public int hashCode() { - return Objects.hash(data, links, additionalProperties); + return Objects.hash(data, additionalProperties); } @Override @@ -147,7 +118,6 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class EventCreateResponsePayload {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); - sb.append(" links: ").append(toIndentedString(links)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponsePayloadLinks.java b/src/main/java/com/datadog/api/client/v2/model/EventCreateResponsePayloadLinks.java deleted file mode 100644 index f6db4def622..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/EventCreateResponsePayloadLinks.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Links to the event. */ -@JsonPropertyOrder({EventCreateResponsePayloadLinks.JSON_PROPERTY_SELF}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class EventCreateResponsePayloadLinks { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_SELF = "self"; - private String self; - - public EventCreateResponsePayloadLinks self(String self) { - this.self = self; - return this; - } - - /** - * The URL of the event. This link is only functional when using the default subdomain. - * - * @return self - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_SELF) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSelf() { - return self; - } - - public void setSelf(String self) { - this.self = self; - } - - /** - * 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 EventCreateResponsePayloadLinks - */ - @JsonAnySetter - public EventCreateResponsePayloadLinks 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 EventCreateResponsePayloadLinks object is equal to o. */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EventCreateResponsePayloadLinks eventCreateResponsePayloadLinks = - (EventCreateResponsePayloadLinks) o; - return Objects.equals(this.self, eventCreateResponsePayloadLinks.self) - && Objects.equals( - this.additionalProperties, eventCreateResponsePayloadLinks.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(self, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EventCreateResponsePayloadLinks {\n"); - sb.append(" self: ").append(toIndentedString(self)).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/v2/model/EventPayload.java b/src/main/java/com/datadog/api/client/v2/model/EventPayload.java index d4d0409c1af..3c16bacbeef 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventPayload.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventPayload.java @@ -6,13 +6,17 @@ package com.datadog.api.client.v2.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; /** Event attributes. */ @@ -20,7 +24,6 @@ EventPayload.JSON_PROPERTY_AGGREGATION_KEY, EventPayload.JSON_PROPERTY_ATTRIBUTES, EventPayload.JSON_PROPERTY_CATEGORY, - EventPayload.JSON_PROPERTY_INTEGRATION_ID, EventPayload.JSON_PROPERTY_MESSAGE, EventPayload.JSON_PROPERTY_TAGS, EventPayload.JSON_PROPERTY_TIMESTAMP, @@ -39,9 +42,6 @@ public class EventPayload { public static final String JSON_PROPERTY_CATEGORY = "category"; private EventCategory category; - public static final String JSON_PROPERTY_INTEGRATION_ID = "integration_id"; - private EventPayloadIntegrationId integrationId; - public static final String JSON_PROPERTY_MESSAGE = "message"; private String message; @@ -75,10 +75,7 @@ public EventPayload aggregationKey(String aggregationKey) { } /** - * A string used for aggregation when correlating - * events. If you specify a key, events are deduplicated to alerts based on this key. Limited to - * 100 characters. + * An arbitrary string to use for aggregation when correlating events. Limited to 100 characters. * * @return aggregationKey */ @@ -100,7 +97,7 @@ public EventPayload attributes(EventPayloadAttributes attributes) { } /** - * JSON object for category-specific attributes. Schema is different per event category. + * JSON object for custom attributes. Schema are different per each event category. * * @return attributes */ @@ -121,7 +118,9 @@ public EventPayload category(EventCategory category) { } /** - * Event category identifying the type of event. + * Event category to identify the type of event. Only the value change is supported. + * Support for other categories are coming. please reach out to datadog support if you're + * interested. * * @return category */ @@ -138,40 +137,13 @@ public void setCategory(EventCategory category) { this.category = category; } - public EventPayload integrationId(EventPayloadIntegrationId integrationId) { - this.integrationId = integrationId; - this.unparsed |= !integrationId.isValid(); - return this; - } - - /** - * Integration ID sourced from integration manifests. - * - * @return integrationId - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_INTEGRATION_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EventPayloadIntegrationId getIntegrationId() { - return integrationId; - } - - public void setIntegrationId(EventPayloadIntegrationId integrationId) { - if (!integrationId.isValid()) { - this.unparsed = true; - } - this.integrationId = integrationId; - } - public EventPayload message(String message) { this.message = message; return this; } /** - * Free formed text associated with the event. It's suggested to use - * data.attributes.attributes.custom for well-structured attributes. Limited to 4000 - * characters. + * The body of the event. Limited to 4000 characters. * * @return message */ @@ -200,7 +172,7 @@ public EventPayload addTagsItem(String tagsItem) { } /** - * A list of tags associated with the event. Maximum of 100 tags allowed. Refer to Tags docs. * * @return tags @@ -246,7 +218,7 @@ public EventPayload title(String title) { } /** - * The title of the event. Limited to 500 characters. + * The event title. Limited to 500 characters. * * @return title */ @@ -260,6 +232,52 @@ public void setTitle(String title) { this.title = title; } + /** + * 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 EventPayload + */ + @JsonAnySetter + public EventPayload 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 EventPayload object is equal to o. */ @Override public boolean equals(Object o) { @@ -273,17 +291,24 @@ public boolean equals(Object o) { return Objects.equals(this.aggregationKey, eventPayload.aggregationKey) && Objects.equals(this.attributes, eventPayload.attributes) && Objects.equals(this.category, eventPayload.category) - && Objects.equals(this.integrationId, eventPayload.integrationId) && Objects.equals(this.message, eventPayload.message) && Objects.equals(this.tags, eventPayload.tags) && Objects.equals(this.timestamp, eventPayload.timestamp) - && Objects.equals(this.title, eventPayload.title); + && Objects.equals(this.title, eventPayload.title) + && Objects.equals(this.additionalProperties, eventPayload.additionalProperties); } @Override public int hashCode() { return Objects.hash( - aggregationKey, attributes, category, integrationId, message, tags, timestamp, title); + aggregationKey, + attributes, + category, + message, + tags, + timestamp, + title, + additionalProperties); } @Override @@ -293,11 +318,13 @@ public String toString() { sb.append(" aggregationKey: ").append(toIndentedString(aggregationKey)).append("\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" integrationId: ").append(toIndentedString(integrationId)).append("\n"); sb.append(" message: ").append(toIndentedString(message)).append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" timestamp: ").append(toIndentedString(timestamp)).append("\n"); sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); sb.append('}'); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/EventPayloadAttributes.java b/src/main/java/com/datadog/api/client/v2/model/EventPayloadAttributes.java index 603ac723ab8..4a9f038ff9d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/EventPayloadAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/EventPayloadAttributes.java @@ -125,51 +125,6 @@ public EventPayloadAttributes deserialize(JsonParser jp, DeserializationContext log.log(Level.FINER, "Input data does not match schema 'ChangeEventCustomAttributes'", e); } - // deserialize AlertEventCustomAttributes - try { - boolean attemptParsing = true; - // ensure that we respect type coercion as set on the client ObjectMapper - if (AlertEventCustomAttributes.class.equals(Integer.class) - || AlertEventCustomAttributes.class.equals(Long.class) - || AlertEventCustomAttributes.class.equals(Float.class) - || AlertEventCustomAttributes.class.equals(Double.class) - || AlertEventCustomAttributes.class.equals(Boolean.class) - || AlertEventCustomAttributes.class.equals(String.class)) { - attemptParsing = typeCoercion; - if (!attemptParsing) { - attemptParsing |= - ((AlertEventCustomAttributes.class.equals(Integer.class) - || AlertEventCustomAttributes.class.equals(Long.class)) - && token == JsonToken.VALUE_NUMBER_INT); - attemptParsing |= - ((AlertEventCustomAttributes.class.equals(Float.class) - || AlertEventCustomAttributes.class.equals(Double.class)) - && (token == JsonToken.VALUE_NUMBER_FLOAT - || token == JsonToken.VALUE_NUMBER_INT)); - attemptParsing |= - (AlertEventCustomAttributes.class.equals(Boolean.class) - && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); - attemptParsing |= - (AlertEventCustomAttributes.class.equals(String.class) - && token == JsonToken.VALUE_STRING); - } - } - if (attemptParsing) { - tmp = tree.traverse(jp.getCodec()).readValueAs(AlertEventCustomAttributes.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 (!((AlertEventCustomAttributes) tmp).unparsed) { - deserialized = tmp; - match++; - } - log.log(Level.FINER, "Input data matches schema 'AlertEventCustomAttributes'"); - } - } catch (Exception e) { - // deserialization failed, continue - log.log(Level.FINER, "Input data does not match schema 'AlertEventCustomAttributes'", e); - } - EventPayloadAttributes ret = new EventPayloadAttributes(); if (match == 1) { ret.setActualInstance(deserialized); @@ -204,14 +159,8 @@ public EventPayloadAttributes(ChangeEventCustomAttributes o) { setActualInstance(o); } - public EventPayloadAttributes(AlertEventCustomAttributes o) { - super("oneOf", Boolean.FALSE); - setActualInstance(o); - } - static { schemas.put("ChangeEventCustomAttributes", new GenericType() {}); - schemas.put("AlertEventCustomAttributes", new GenericType() {}); JSON.registerDescendants(EventPayloadAttributes.class, Collections.unmodifiableMap(schemas)); } @@ -222,7 +171,7 @@ public Map getSchemas() { /** * Set the instance that matches the oneOf child schema, check the instance parameter is valid - * against the oneOf child schemas: ChangeEventCustomAttributes, AlertEventCustomAttributes + * against the oneOf child schemas: ChangeEventCustomAttributes * *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a * composed schema (allOf, anyOf, oneOf). @@ -233,24 +182,18 @@ public void setActualInstance(Object instance) { super.setActualInstance(instance); return; } - if (JSON.isInstanceOf(AlertEventCustomAttributes.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 ChangeEventCustomAttributes, AlertEventCustomAttributes"); + throw new RuntimeException("Invalid instance type. Must be ChangeEventCustomAttributes"); } /** - * Get the actual instance, which can be the following: ChangeEventCustomAttributes, - * AlertEventCustomAttributes + * Get the actual instance, which can be the following: ChangeEventCustomAttributes * - * @return The actual instance (ChangeEventCustomAttributes, AlertEventCustomAttributes) + * @return The actual instance (ChangeEventCustomAttributes) */ @Override public Object getActualInstance() { @@ -267,15 +210,4 @@ public Object getActualInstance() { public ChangeEventCustomAttributes getChangeEventCustomAttributes() throws ClassCastException { return (ChangeEventCustomAttributes) super.getActualInstance(); } - - /** - * Get the actual instance of `AlertEventCustomAttributes`. If the actual instance is not - * `AlertEventCustomAttributes`, the ClassCastException will be thrown. - * - * @return The actual instance of `AlertEventCustomAttributes` - * @throws ClassCastException if the instance is not `AlertEventCustomAttributes` - */ - public AlertEventCustomAttributes getAlertEventCustomAttributes() throws ClassCastException { - return (AlertEventCustomAttributes) super.getActualInstance(); - } } diff --git a/src/main/java/com/datadog/api/client/v2/model/EventPayloadIntegrationId.java b/src/main/java/com/datadog/api/client/v2/model/EventPayloadIntegrationId.java deleted file mode 100644 index 498513a8a1f..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/EventPayloadIntegrationId.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.datadog.api.client.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; - -/** Integration ID sourced from integration manifests. */ -@JsonSerialize(using = EventPayloadIntegrationId.EventPayloadIntegrationIdSerializer.class) -public class EventPayloadIntegrationId extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("custom-events")); - - public static final EventPayloadIntegrationId CUSTOM_EVENTS = - new EventPayloadIntegrationId("custom-events"); - - EventPayloadIntegrationId(String value) { - super(value, allowedValues); - } - - public static class EventPayloadIntegrationIdSerializer - extends StdSerializer { - public EventPayloadIntegrationIdSerializer(Class t) { - super(t); - } - - public EventPayloadIntegrationIdSerializer() { - this(null); - } - - @Override - public void serialize( - EventPayloadIntegrationId value, JsonGenerator jgen, SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static EventPayloadIntegrationId fromValue(String value) { - return new EventPayloadIntegrationId(value); - } -} diff --git a/src/test/resources/cassettes/features/v2/Post_an_event_returns_Bad_request_response.freeze b/src/test/resources/cassettes/features/v2/Post_an_event_returns_Bad_request_response.freeze deleted file mode 100644 index a1cd4e8e4ac..00000000000 --- a/src/test/resources/cassettes/features/v2/Post_an_event_returns_Bad_request_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-10T15:38:58.529Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Post_an_event_returns_Bad_request_response.json b/src/test/resources/cassettes/features/v2/Post_an_event_returns_Bad_request_response.json deleted file mode 100644 index acfc4bd4ef0..00000000000 --- a/src/test/resources/cassettes/features/v2/Post_an_event_returns_Bad_request_response.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"aggregation_key\":\"aggregation_key_123\",\"attributes\":{\"author\":{\"name\":\"example@datadog.com\",\"type\":\"user\"},\"change_metadata\":{\"dd\":{\"team\":\"datadog_team\",\"user_email\":\"datadog@datadog.com\",\"user_id\":\"datadog_user_id\",\"user_name\":\"datadog_username\"},\"resource_link\":\"datadog.com/feature/fallback_payments_test\"},\"changed_resource\":{\"name\":\"fallback_payments_test\",\"type\":\"feature_flag\"},\"impacted_resources\":[{\"name\":\"payments_api\",\"type\":\"service\"}],\"new_value\":{\"enabled\":true,\"percentage\":\"50%\",\"rule\":{\"datacenter\":\"devcycle.us1.prod\"}},\"prev_value\":{\"enabled\":true,\"percentage\":\"10%\",\"rule\":{\"datacenter\":\"devcycle.us1.prod\"}}},\"category\":\"invalid\",\"integration_id\":\"custom-events\",\"message\":\"payment_processed feature flag has been enabled\",\"tags\":[\"env:api_client_test\"],\"title\":\"payment_processed feature flag updated\"},\"type\":\"event\"}}" - }, - "headers": {}, - "method": "POST", - "path": "/api/v2/events", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "body": "{\"errors\":[{\"status\":\"400\",\"title\":\"Bad Request\",\"detail\":\"JSON validation failed at $.data.attributes.category: value must be one of: [\\\"alert\\\", \\\"change\\\"].\"}]}", - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "statusCode": 400, - "reasonPhrase": "Bad Request" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "b35f8f84-50dc-70b8-3d76-61b05817ff7e" - } -] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Post_an_event_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Post_an_event_returns_OK_response.freeze deleted file mode 100644 index 42309286e25..00000000000 --- a/src/test/resources/cassettes/features/v2/Post_an_event_returns_OK_response.freeze +++ /dev/null @@ -1 +0,0 @@ -2025-06-10T15:38:58.954Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Post_an_event_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Post_an_event_returns_OK_response.json deleted file mode 100644 index 3f4701e821a..00000000000 --- a/src/test/resources/cassettes/features/v2/Post_an_event_returns_OK_response.json +++ /dev/null @@ -1,32 +0,0 @@ -[ - { - "httpRequest": { - "body": { - "type": "JSON", - "json": "{\"data\":{\"attributes\":{\"aggregation_key\":\"aggregation_key_123\",\"attributes\":{\"author\":{\"name\":\"example@datadog.com\",\"type\":\"user\"},\"change_metadata\":{\"dd\":{\"team\":\"datadog_team\",\"user_email\":\"datadog@datadog.com\",\"user_id\":\"datadog_user_id\",\"user_name\":\"datadog_username\"},\"resource_link\":\"datadog.com/feature/fallback_payments_test\"},\"changed_resource\":{\"name\":\"fallback_payments_test\",\"type\":\"feature_flag\"},\"impacted_resources\":[{\"name\":\"payments_api\",\"type\":\"service\"}],\"new_value\":{\"enabled\":true,\"percentage\":\"50%\",\"rule\":{\"datacenter\":\"devcycle.us1.prod\"}},\"prev_value\":{\"enabled\":true,\"percentage\":\"10%\",\"rule\":{\"datacenter\":\"devcycle.us1.prod\"}}},\"category\":\"change\",\"integration_id\":\"custom-events\",\"message\":\"payment_processed feature flag has been enabled\",\"tags\":[\"env:api_client_test\"],\"title\":\"payment_processed feature flag updated\"},\"type\":\"event\"}}" - }, - "headers": {}, - "method": "POST", - "path": "/api/v2/events", - "keepAlive": false, - "secure": true - }, - "httpResponse": { - "body": "{\"data\":{\"attributes\":{\"attributes\":{\"evt\":{\"uid\":\"AZdafqaTAACKG_iMQ82pmAAA\"}}},\"id\":\"_\",\"type\":\"event\"},\"links\":{\"self\":\"https://app.datadoghq.com/event/event?uid=AZdafqaTAACKG_iMQ82pmAAA\"}}", - "headers": { - "Content-Type": [ - "application/json" - ] - }, - "statusCode": 202, - "reasonPhrase": "Accepted" - }, - "times": { - "remainingTimes": 1 - }, - "timeToLive": { - "unlimited": true - }, - "id": "12f2ce8c-e9b9-19c0-6a47-1c2b7d261fb3" - } -] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/events.feature b/src/test/resources/com/datadog/api/client/v2/api/events.feature index 0a69d195201..a8c1307ac68 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/events.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/events.feature @@ -50,21 +50,19 @@ Feature: Events Then the response status is 200 OK And the response "data" has length 0 - @team:DataDog/event-management + @generated @skip @team:DataDog/event-management Scenario: Post an event returns "Bad request" response Given new "CreateEvent" request - And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "example@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "invalid", "integration_id": "custom-events", "message": "payment_processed feature flag has been enabled", "tags": ["env:api_client_test"], "title": "payment_processed feature flag updated"}, "type": "event"}} + And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} When the request is sent Then the response status is 400 Bad request - @skip-validation @team:DataDog/event-management + @generated @skip @team:DataDog/event-management Scenario: Post an event returns "OK" response Given new "CreateEvent" request - And body with value {"data": {"attributes": {"aggregation_key": "aggregation_key_123", "attributes": {"author": {"name": "example@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "integration_id": "custom-events", "message": "payment_processed feature flag has been enabled", "tags": ["env:api_client_test"], "title": "payment_processed feature flag updated"}, "type": "event"}} + And body with value {"data": {"attributes": {"attributes": {"author": {"name": "datadog@datadog.com", "type": "user"}, "change_metadata": {"dd": {"team": "datadog_team", "user_email": "datadog@datadog.com", "user_id": "datadog_user_id", "user_name": "datadog_username"}, "resource_link": "datadog.com/feature/fallback_payments_test"}, "changed_resource": {"name": "fallback_payments_test", "type": "feature_flag"}, "impacted_resources": [{"name": "payments_api", "type": "service"}], "new_value": {"enabled": true, "percentage": "50%", "rule": {"datacenter": "devcycle.us1.prod"}}, "prev_value": {"enabled": true, "percentage": "10%", "rule": {"datacenter": "devcycle.us1.prod"}}}, "category": "change", "message": "payment_processed feature flag has been enabled", "tags": ["env:test"], "title": "payment_processed feature flag updated"}, "type": "event"}} When the request is sent - Then the response status is 202 OK - And the response "data.type" is equal to "event" - And the response "data.attributes.attributes.evt" has field "uid" + Then the response status is 200 OK @team:DataDog/event-management Scenario: Search events returns "Bad Request" response diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 3cc857a7365..e81cb7b7ce1 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -934,7 +934,7 @@ "CreateEvent": { "tag": "Events", "undo": { - "type": "safe" + "type": "unsafe" } }, "SearchEvents": {

Response details
Status Code Description Response Headers
202 OK -
200 OK -
400 Bad request -
403 Forbidden -
429 Too many requests -