From d7efbbe197f38172c12351eb811784b21fcf24bf Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 May 2023 17:54:18 +0000 Subject: [PATCH] Regenerate client from commit 6b2e8b39 of spec repo --- .apigentools-info | 8 ++--- .generator/schemas/v2/openapi.yaml | 5 +++ .../v2/model/IncidentCreateAttributes.java | 35 +++++++++++++++++-- .../api/client/v2/api/incidents.feature | 4 +-- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/.apigentools-info b/.apigentools-info index c4f33b9edde..8705bbb63bc 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-01 17:21:10.702976", - "spec_repo_commit": "4d58341b" + "regenerated": "2023-05-01 17:52:56.443984", + "spec_repo_commit": "6b2e8b39" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-01 17:21:10.716036", - "spec_repo_commit": "4d58341b" + "regenerated": "2023-05-01 17:52:56.457713", + "spec_repo_commit": "6b2e8b39" } } } \ No newline at end of file diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index c09ac7267a7..da3aa3d161c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -4498,6 +4498,11 @@ components: IncidentCreateAttributes: description: The incident's attributes for a create request. properties: + customer_impact_scope: + description: Required if `customer_impacted:"true"`. A summary of the impact + customers experienced during the incident. + example: Example customer impact scope + type: string customer_impacted: description: A flag indicating whether the incident caused customer impact. example: false diff --git a/src/main/java/com/datadog/api/client/v2/model/IncidentCreateAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IncidentCreateAttributes.java index 5587e320490..e84ade33461 100644 --- a/src/main/java/com/datadog/api/client/v2/model/IncidentCreateAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/IncidentCreateAttributes.java @@ -19,6 +19,7 @@ /** The incident's attributes for a create request. */ @JsonPropertyOrder({ + IncidentCreateAttributes.JSON_PROPERTY_CUSTOMER_IMPACT_SCOPE, IncidentCreateAttributes.JSON_PROPERTY_CUSTOMER_IMPACTED, IncidentCreateAttributes.JSON_PROPERTY_FIELDS, IncidentCreateAttributes.JSON_PROPERTY_INITIAL_CELLS, @@ -29,6 +30,9 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class IncidentCreateAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CUSTOMER_IMPACT_SCOPE = "customer_impact_scope"; + private String customerImpactScope; + public static final String JSON_PROPERTY_CUSTOMER_IMPACTED = "customer_impacted"; private Boolean customerImpacted; @@ -55,6 +59,28 @@ public IncidentCreateAttributes( this.title = title; } + public IncidentCreateAttributes customerImpactScope(String customerImpactScope) { + this.customerImpactScope = customerImpactScope; + return this; + } + + /** + * Required if customer_impacted:"true". A summary of the impact customers + * experienced during the incident. + * + * @return customerImpactScope + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CUSTOMER_IMPACT_SCOPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCustomerImpactScope() { + return customerImpactScope; + } + + public void setCustomerImpactScope(String customerImpactScope) { + this.customerImpactScope = customerImpactScope; + } + public IncidentCreateAttributes customerImpacted(Boolean customerImpacted) { this.customerImpacted = customerImpacted; return this; @@ -204,7 +230,8 @@ public boolean equals(Object o) { return false; } IncidentCreateAttributes incidentCreateAttributes = (IncidentCreateAttributes) o; - return Objects.equals(this.customerImpacted, incidentCreateAttributes.customerImpacted) + return Objects.equals(this.customerImpactScope, incidentCreateAttributes.customerImpactScope) + && Objects.equals(this.customerImpacted, incidentCreateAttributes.customerImpacted) && Objects.equals(this.fields, incidentCreateAttributes.fields) && Objects.equals(this.initialCells, incidentCreateAttributes.initialCells) && Objects.equals(this.notificationHandles, incidentCreateAttributes.notificationHandles) @@ -213,13 +240,17 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(customerImpacted, fields, initialCells, notificationHandles, title); + return Objects.hash( + customerImpactScope, customerImpacted, fields, initialCells, notificationHandles, title); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class IncidentCreateAttributes {\n"); + sb.append(" customerImpactScope: ") + .append(toIndentedString(customerImpactScope)) + .append("\n"); sb.append(" customerImpacted: ").append(toIndentedString(customerImpacted)).append("\n"); sb.append(" fields: ").append(toIndentedString(fields)).append("\n"); sb.append(" initialCells: ").append(toIndentedString(initialCells)).append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/incidents.feature b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature index 3e70df63734..54f536bee12 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/incidents.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/incidents.feature @@ -67,7 +67,7 @@ Feature: Incidents Scenario: Create an incident returns "Bad Request" response Given operation "CreateIncident" enabled And new "CreateIncident" request - And body with value {"data": {"attributes": {"customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}} + And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}} When the request is sent Then the response status is 400 Bad Request @@ -86,7 +86,7 @@ Feature: Incidents Scenario: Create an incident returns "Not Found" response Given operation "CreateIncident" enabled And new "CreateIncident" request - And body with value {"data": {"attributes": {"customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}} + And body with value {"data": {"attributes": {"customer_impact_scope": "Example customer impact scope", "customer_impacted": false, "fields": {"severity": {"type": "dropdown", "value": "SEV-5"}}, "initial_cells": [{"cell_type": "markdown", "content": {"content": "An example timeline cell message."}, "important": false}], "notification_handles": [{"display_name": "Jane Doe", "handle": "@test.user@test.com"}], "title": "A test incident title"}, "relationships": {"commander_user": {"data": {"id": "00000000-0000-0000-0000-000000000000", "type": "users"}}}, "type": "incidents"}} When the request is sent Then the response status is 404 Not Found