Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-01-19 15:18:17.130808",
"spec_repo_commit": "b407748b"
"regenerated": "2024-01-19 16:05:49.610998",
"spec_repo_commit": "20461e26"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-01-19 15:18:17.146445",
"spec_repo_commit": "b407748b"
"regenerated": "2024-01-19 16:05:49.628950",
"spec_repo_commit": "20461e26"
}
}
}
8 changes: 8 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4930,6 +4930,10 @@ components:
DORADeploymentRequestAttributes:
description: Attributes to create a DORA deployment event.
properties:
env:
description: Environment name to where the service was deployed.
example: staging
type: string
finished_at:
description: Unix timestamp in nanoseconds when the deployment finished.
It should not be older than 3 hours.
Expand Down Expand Up @@ -5018,6 +5022,10 @@ components:
DORAIncidentRequestAttributes:
description: Attributes to create a DORA incident event.
properties:
env:
description: Environment name that was impacted by the incident.
example: staging
type: string
finished_at:
description: Unix timestamp in nanoseconds when the incident finished. It
should not be older than 3 hours.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

/** Attributes to create a DORA deployment event. */
@JsonPropertyOrder({
DORADeploymentRequestAttributes.JSON_PROPERTY_ENV,
DORADeploymentRequestAttributes.JSON_PROPERTY_FINISHED_AT,
DORADeploymentRequestAttributes.JSON_PROPERTY_GIT,
DORADeploymentRequestAttributes.JSON_PROPERTY_ID,
Expand All @@ -30,6 +31,9 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class DORADeploymentRequestAttributes {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_ENV = "env";
private String env;

public static final String JSON_PROPERTY_FINISHED_AT = "finished_at";
private Long finishedAt;

Expand Down Expand Up @@ -60,6 +64,27 @@ public DORADeploymentRequestAttributes(
this.startedAt = startedAt;
}

public DORADeploymentRequestAttributes env(String env) {
this.env = env;
return this;
}

/**
* Environment name to where the service was deployed.
*
* @return env
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ENV)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getEnv() {
return env;
}

public void setEnv(String env) {
this.env = env;
}

public DORADeploymentRequestAttributes finishedAt(Long finishedAt) {
this.finishedAt = finishedAt;
return this;
Expand Down Expand Up @@ -244,7 +269,8 @@ public boolean equals(Object o) {
}
DORADeploymentRequestAttributes doraDeploymentRequestAttributes =
(DORADeploymentRequestAttributes) o;
return Objects.equals(this.finishedAt, doraDeploymentRequestAttributes.finishedAt)
return Objects.equals(this.env, doraDeploymentRequestAttributes.env)
&& Objects.equals(this.finishedAt, doraDeploymentRequestAttributes.finishedAt)
&& Objects.equals(this.git, doraDeploymentRequestAttributes.git)
&& Objects.equals(this.id, doraDeploymentRequestAttributes.id)
&& Objects.equals(this.service, doraDeploymentRequestAttributes.service)
Expand All @@ -256,13 +282,15 @@ public boolean equals(Object o) {

@Override
public int hashCode() {
return Objects.hash(finishedAt, git, id, service, startedAt, version, additionalProperties);
return Objects.hash(
env, finishedAt, git, id, service, startedAt, version, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DORADeploymentRequestAttributes {\n");
sb.append(" env: ").append(toIndentedString(env)).append("\n");
sb.append(" finishedAt: ").append(toIndentedString(finishedAt)).append("\n");
sb.append(" git: ").append(toIndentedString(git)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

/** Attributes to create a DORA incident event. */
@JsonPropertyOrder({
DORAIncidentRequestAttributes.JSON_PROPERTY_ENV,
DORAIncidentRequestAttributes.JSON_PROPERTY_FINISHED_AT,
DORAIncidentRequestAttributes.JSON_PROPERTY_GIT,
DORAIncidentRequestAttributes.JSON_PROPERTY_ID,
Expand All @@ -32,6 +33,9 @@
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class DORAIncidentRequestAttributes {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_ENV = "env";
private String env;

public static final String JSON_PROPERTY_FINISHED_AT = "finished_at";
private Long finishedAt;

Expand Down Expand Up @@ -66,6 +70,27 @@ public DORAIncidentRequestAttributes(
this.startedAt = startedAt;
}

public DORAIncidentRequestAttributes env(String env) {
this.env = env;
return this;
}

/**
* Environment name that was impacted by the incident.
*
* @return env
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_ENV)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getEnv() {
return env;
}

public void setEnv(String env) {
this.env = env;
}

public DORAIncidentRequestAttributes finishedAt(Long finishedAt) {
this.finishedAt = finishedAt;
return this;
Expand Down Expand Up @@ -291,7 +316,8 @@ public boolean equals(Object o) {
return false;
}
DORAIncidentRequestAttributes doraIncidentRequestAttributes = (DORAIncidentRequestAttributes) o;
return Objects.equals(this.finishedAt, doraIncidentRequestAttributes.finishedAt)
return Objects.equals(this.env, doraIncidentRequestAttributes.env)
&& Objects.equals(this.finishedAt, doraIncidentRequestAttributes.finishedAt)
&& Objects.equals(this.git, doraIncidentRequestAttributes.git)
&& Objects.equals(this.id, doraIncidentRequestAttributes.id)
&& Objects.equals(this.name, doraIncidentRequestAttributes.name)
Expand All @@ -306,13 +332,23 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
finishedAt, git, id, name, service, severity, startedAt, version, additionalProperties);
env,
finishedAt,
git,
id,
name,
service,
severity,
startedAt,
version,
additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class DORAIncidentRequestAttributes {\n");
sb.append(" env: ").append(toIndentedString(env)).append("\n");
sb.append(" finishedAt: ").append(toIndentedString(finishedAt)).append("\n");
sb.append(" git: ").append(toIndentedString(git)).append("\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Feature: DORA Metrics
Scenario: Send an incident event for DORA Metrics returns "OK - but delayed due to incident" response
Given operation "CreateDORAIncident" enabled
And new "CreateDORAIncident" request
And body with value {"data": {"attributes": {"finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests", "service": "shopist", "severity": "High", "started_at": 1693491974000000000, "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests", "service": "shopist", "severity": "High", "started_at": 1693491974000000000, "version": "v1.12.07"}}}
When the request is sent
Then the response status is 202 OK - but delayed due to incident

Expand Down