diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e24a358f1bd..43de804db31 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29903,6 +29903,35 @@ components: type: string nullable: true type: array + DORADeploymentAveragedMetrics: + description: Averaged DORA and delivery metrics computed across the commits and pull requests included in the deployment. + properties: + change_lead_time: + description: The averaged change lead time, in seconds. + example: 166821 + format: int64 + type: integer + merge_time: + description: The averaged merge time, in seconds. + example: 5852 + format: int64 + type: integer + review_time: + description: The averaged review time, in seconds. + example: 140 + format: int64 + type: integer + time_to_deploy: + description: The averaged time to deploy, in seconds. + example: 164481 + format: int64 + type: integer + time_to_pr_ready: + description: The averaged time until the pull request was ready for review, in seconds. + example: 27 + format: int64 + type: integer + type: object DORADeploymentFetchResponse: description: Response for fetching a single deployment event. properties: @@ -29940,8 +29969,43 @@ components: DORADeploymentObjectAttributes: description: The attributes of the deployment event. properties: + ai: + additionalProperties: {} + description: AI-assisted development metrics aggregated across the commits and pull requests included in the deployment. + type: object + averaged_metrics: + $ref: "#/components/schemas/DORADeploymentAveragedMetrics" + change_failure: + description: Whether the deployment is flagged as a change failure. + example: false + type: boolean + commits: + description: The list of commits included in the deployment. + items: + additionalProperties: {} + type: object + type: array + created_at: + description: The time when the deployment event was recorded. + example: "2023-08-31T14:26:24Z" + format: date-time + type: string + custom: + additionalProperties: {} + description: A map of custom metadata associated with the deployment. + example: {"service": ["courier-cloud"]} + type: object custom_tags: $ref: "#/components/schemas/DORACustomTags" + deployment_type: + description: The type of the deployment. + example: standard + type: string + duration: + description: The duration of the deployment. + example: 0 + format: int64 + type: integer env: description: Environment name to where the service was deployed. example: production @@ -29953,10 +30017,37 @@ components: type: string git: $ref: "#/components/schemas/DORAGitInfoResponse" + number_of_commits: + description: The number of commits associated with the deployment. + example: 5 + format: int64 + type: integer + number_of_pull_requests: + description: The number of pull requests associated with the deployment. + example: 1 + format: int64 + type: integer + pull_requests: + description: The list of pull requests included in the deployment. + items: + additionalProperties: {} + type: object + type: array + recovery_time_sec: + description: The recovery time, in seconds, for a deployment flagged as a change failure. + example: 28230 + format: int64 + type: integer + remediation: + $ref: "#/components/schemas/DORADeploymentRemediation" service: description: Service name. example: shopist type: string + source: + description: The source of the deployment event. + example: apm_deployments + type: string started_at: description: The time when the deployment started. example: "2023-08-31T14:26:14Z" @@ -30148,6 +30239,18 @@ components: type: string x-enum-varnames: - DORA_DEPLOYMENT_PATCH_REQUEST + DORADeploymentRemediation: + description: Remediation details for a deployment that was flagged as a change failure. + properties: + id: + description: The ID of the remediation deployment. + example: eG42zNIkVjM + type: string + type: + description: The type of remediation, such as a rollback. + example: rollback + type: string + type: object DORADeploymentRequest: description: Request to create a DORA deployment event. properties: diff --git a/src/main/java/com/datadog/api/client/v2/model/DORADeploymentAveragedMetrics.java b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentAveragedMetrics.java new file mode 100644 index 00000000000..3eb402f44cf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentAveragedMetrics.java @@ -0,0 +1,250 @@ +/* + * 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; + +/** + * Averaged DORA and delivery metrics computed across the commits and pull requests included in the + * deployment. + */ +@JsonPropertyOrder({ + DORADeploymentAveragedMetrics.JSON_PROPERTY_CHANGE_LEAD_TIME, + DORADeploymentAveragedMetrics.JSON_PROPERTY_MERGE_TIME, + DORADeploymentAveragedMetrics.JSON_PROPERTY_REVIEW_TIME, + DORADeploymentAveragedMetrics.JSON_PROPERTY_TIME_TO_DEPLOY, + DORADeploymentAveragedMetrics.JSON_PROPERTY_TIME_TO_PR_READY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORADeploymentAveragedMetrics { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CHANGE_LEAD_TIME = "change_lead_time"; + private Long changeLeadTime; + + public static final String JSON_PROPERTY_MERGE_TIME = "merge_time"; + private Long mergeTime; + + public static final String JSON_PROPERTY_REVIEW_TIME = "review_time"; + private Long reviewTime; + + public static final String JSON_PROPERTY_TIME_TO_DEPLOY = "time_to_deploy"; + private Long timeToDeploy; + + public static final String JSON_PROPERTY_TIME_TO_PR_READY = "time_to_pr_ready"; + private Long timeToPrReady; + + public DORADeploymentAveragedMetrics changeLeadTime(Long changeLeadTime) { + this.changeLeadTime = changeLeadTime; + return this; + } + + /** + * The averaged change lead time, in seconds. + * + * @return changeLeadTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_LEAD_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getChangeLeadTime() { + return changeLeadTime; + } + + public void setChangeLeadTime(Long changeLeadTime) { + this.changeLeadTime = changeLeadTime; + } + + public DORADeploymentAveragedMetrics mergeTime(Long mergeTime) { + this.mergeTime = mergeTime; + return this; + } + + /** + * The averaged merge time, in seconds. + * + * @return mergeTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MERGE_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMergeTime() { + return mergeTime; + } + + public void setMergeTime(Long mergeTime) { + this.mergeTime = mergeTime; + } + + public DORADeploymentAveragedMetrics reviewTime(Long reviewTime) { + this.reviewTime = reviewTime; + return this; + } + + /** + * The averaged review time, in seconds. + * + * @return reviewTime + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REVIEW_TIME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getReviewTime() { + return reviewTime; + } + + public void setReviewTime(Long reviewTime) { + this.reviewTime = reviewTime; + } + + public DORADeploymentAveragedMetrics timeToDeploy(Long timeToDeploy) { + this.timeToDeploy = timeToDeploy; + return this; + } + + /** + * The averaged time to deploy, in seconds. + * + * @return timeToDeploy + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIME_TO_DEPLOY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimeToDeploy() { + return timeToDeploy; + } + + public void setTimeToDeploy(Long timeToDeploy) { + this.timeToDeploy = timeToDeploy; + } + + public DORADeploymentAveragedMetrics timeToPrReady(Long timeToPrReady) { + this.timeToPrReady = timeToPrReady; + return this; + } + + /** + * The averaged time until the pull request was ready for review, in seconds. + * + * @return timeToPrReady + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIME_TO_PR_READY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimeToPrReady() { + return timeToPrReady; + } + + public void setTimeToPrReady(Long timeToPrReady) { + this.timeToPrReady = timeToPrReady; + } + + /** + * 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 DORADeploymentAveragedMetrics + */ + @JsonAnySetter + public DORADeploymentAveragedMetrics 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 DORADeploymentAveragedMetrics object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORADeploymentAveragedMetrics doraDeploymentAveragedMetrics = (DORADeploymentAveragedMetrics) o; + return Objects.equals(this.changeLeadTime, doraDeploymentAveragedMetrics.changeLeadTime) + && Objects.equals(this.mergeTime, doraDeploymentAveragedMetrics.mergeTime) + && Objects.equals(this.reviewTime, doraDeploymentAveragedMetrics.reviewTime) + && Objects.equals(this.timeToDeploy, doraDeploymentAveragedMetrics.timeToDeploy) + && Objects.equals(this.timeToPrReady, doraDeploymentAveragedMetrics.timeToPrReady) + && Objects.equals( + this.additionalProperties, doraDeploymentAveragedMetrics.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + changeLeadTime, mergeTime, reviewTime, timeToDeploy, timeToPrReady, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORADeploymentAveragedMetrics {\n"); + sb.append(" changeLeadTime: ").append(toIndentedString(changeLeadTime)).append("\n"); + sb.append(" mergeTime: ").append(toIndentedString(mergeTime)).append("\n"); + sb.append(" reviewTime: ").append(toIndentedString(reviewTime)).append("\n"); + sb.append(" timeToDeploy: ").append(toIndentedString(timeToDeploy)).append("\n"); + sb.append(" timeToPrReady: ").append(toIndentedString(timeToPrReady)).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/DORADeploymentObjectAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentObjectAttributes.java index 9162b63cf7b..0f94d6fd2fc 100644 --- a/src/main/java/com/datadog/api/client/v2/model/DORADeploymentObjectAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentObjectAttributes.java @@ -23,11 +23,25 @@ /** The attributes of the deployment event. */ @JsonPropertyOrder({ + DORADeploymentObjectAttributes.JSON_PROPERTY_AI, + DORADeploymentObjectAttributes.JSON_PROPERTY_AVERAGED_METRICS, + DORADeploymentObjectAttributes.JSON_PROPERTY_CHANGE_FAILURE, + DORADeploymentObjectAttributes.JSON_PROPERTY_COMMITS, + DORADeploymentObjectAttributes.JSON_PROPERTY_CREATED_AT, + DORADeploymentObjectAttributes.JSON_PROPERTY_CUSTOM, DORADeploymentObjectAttributes.JSON_PROPERTY_CUSTOM_TAGS, + DORADeploymentObjectAttributes.JSON_PROPERTY_DEPLOYMENT_TYPE, + DORADeploymentObjectAttributes.JSON_PROPERTY_DURATION, DORADeploymentObjectAttributes.JSON_PROPERTY_ENV, DORADeploymentObjectAttributes.JSON_PROPERTY_FINISHED_AT, DORADeploymentObjectAttributes.JSON_PROPERTY_GIT, + DORADeploymentObjectAttributes.JSON_PROPERTY_NUMBER_OF_COMMITS, + DORADeploymentObjectAttributes.JSON_PROPERTY_NUMBER_OF_PULL_REQUESTS, + DORADeploymentObjectAttributes.JSON_PROPERTY_PULL_REQUESTS, + DORADeploymentObjectAttributes.JSON_PROPERTY_RECOVERY_TIME_SEC, + DORADeploymentObjectAttributes.JSON_PROPERTY_REMEDIATION, DORADeploymentObjectAttributes.JSON_PROPERTY_SERVICE, + DORADeploymentObjectAttributes.JSON_PROPERTY_SOURCE, DORADeploymentObjectAttributes.JSON_PROPERTY_STARTED_AT, DORADeploymentObjectAttributes.JSON_PROPERTY_TEAM, DORADeploymentObjectAttributes.JSON_PROPERTY_VERSION @@ -36,9 +50,33 @@ value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") public class DORADeploymentObjectAttributes { @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AI = "ai"; + private Map ai = null; + + public static final String JSON_PROPERTY_AVERAGED_METRICS = "averaged_metrics"; + private DORADeploymentAveragedMetrics averagedMetrics; + + public static final String JSON_PROPERTY_CHANGE_FAILURE = "change_failure"; + private Boolean changeFailure; + + public static final String JSON_PROPERTY_COMMITS = "commits"; + private List> commits = null; + + public static final String JSON_PROPERTY_CREATED_AT = "created_at"; + private OffsetDateTime createdAt; + + public static final String JSON_PROPERTY_CUSTOM = "custom"; + private Map custom = null; + public static final String JSON_PROPERTY_CUSTOM_TAGS = "custom_tags"; private JsonNullable> customTags = JsonNullable.>undefined(); + public static final String JSON_PROPERTY_DEPLOYMENT_TYPE = "deployment_type"; + private String deploymentType; + + public static final String JSON_PROPERTY_DURATION = "duration"; + private Long duration; + public static final String JSON_PROPERTY_ENV = "env"; private String env; @@ -48,9 +86,27 @@ public class DORADeploymentObjectAttributes { public static final String JSON_PROPERTY_GIT = "git"; private DORAGitInfoResponse git; + public static final String JSON_PROPERTY_NUMBER_OF_COMMITS = "number_of_commits"; + private Long numberOfCommits; + + public static final String JSON_PROPERTY_NUMBER_OF_PULL_REQUESTS = "number_of_pull_requests"; + private Long numberOfPullRequests; + + public static final String JSON_PROPERTY_PULL_REQUESTS = "pull_requests"; + private List> pullRequests = null; + + public static final String JSON_PROPERTY_RECOVERY_TIME_SEC = "recovery_time_sec"; + private Long recoveryTimeSec; + + public static final String JSON_PROPERTY_REMEDIATION = "remediation"; + private DORADeploymentRemediation remediation; + public static final String JSON_PROPERTY_SERVICE = "service"; private String service; + public static final String JSON_PROPERTY_SOURCE = "source"; + private String source; + public static final String JSON_PROPERTY_STARTED_AT = "started_at"; private OffsetDateTime startedAt; @@ -70,6 +126,163 @@ public DORADeploymentObjectAttributes( this.startedAt = startedAt; } + public DORADeploymentObjectAttributes ai(Map ai) { + this.ai = ai; + return this; + } + + public DORADeploymentObjectAttributes putAiItem(String key, Object aiItem) { + if (this.ai == null) { + this.ai = new HashMap<>(); + } + this.ai.put(key, aiItem); + return this; + } + + /** + * AI-assisted development metrics aggregated across the commits and pull requests included in the + * deployment. + * + * @return ai + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AI) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getAi() { + return ai; + } + + public void setAi(Map ai) { + this.ai = ai; + } + + public DORADeploymentObjectAttributes averagedMetrics( + DORADeploymentAveragedMetrics averagedMetrics) { + this.averagedMetrics = averagedMetrics; + this.unparsed |= averagedMetrics.unparsed; + return this; + } + + /** + * Averaged DORA and delivery metrics computed across the commits and pull requests included in + * the deployment. + * + * @return averagedMetrics + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AVERAGED_METRICS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORADeploymentAveragedMetrics getAveragedMetrics() { + return averagedMetrics; + } + + public void setAveragedMetrics(DORADeploymentAveragedMetrics averagedMetrics) { + this.averagedMetrics = averagedMetrics; + if (averagedMetrics != null) { + this.unparsed |= averagedMetrics.unparsed; + } + } + + public DORADeploymentObjectAttributes changeFailure(Boolean changeFailure) { + this.changeFailure = changeFailure; + return this; + } + + /** + * Whether the deployment is flagged as a change failure. + * + * @return changeFailure + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CHANGE_FAILURE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getChangeFailure() { + return changeFailure; + } + + public void setChangeFailure(Boolean changeFailure) { + this.changeFailure = changeFailure; + } + + public DORADeploymentObjectAttributes commits(List> commits) { + this.commits = commits; + return this; + } + + public DORADeploymentObjectAttributes addCommitsItem(Map commitsItem) { + if (this.commits == null) { + this.commits = new ArrayList<>(); + } + this.commits.add(commitsItem); + return this; + } + + /** + * The list of commits included in the deployment. + * + * @return commits + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COMMITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getCommits() { + return commits; + } + + public void setCommits(List> commits) { + this.commits = commits; + } + + public DORADeploymentObjectAttributes createdAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The time when the deployment event was recorded. + * + * @return createdAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CREATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + public DORADeploymentObjectAttributes custom(Map custom) { + this.custom = custom; + return this; + } + + public DORADeploymentObjectAttributes putCustomItem(String key, Object customItem) { + if (this.custom == null) { + this.custom = new HashMap<>(); + } + this.custom.put(key, customItem); + return this; + } + + /** + * A map of custom metadata associated with the deployment. + * + * @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 DORADeploymentObjectAttributes customTags(List customTags) { this.customTags = JsonNullable.>of(customTags); return this; @@ -114,6 +327,48 @@ public void setCustomTags(List customTags) { this.customTags = JsonNullable.>of(customTags); } + public DORADeploymentObjectAttributes deploymentType(String deploymentType) { + this.deploymentType = deploymentType; + return this; + } + + /** + * The type of the deployment. + * + * @return deploymentType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DEPLOYMENT_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeploymentType() { + return deploymentType; + } + + public void setDeploymentType(String deploymentType) { + this.deploymentType = deploymentType; + } + + public DORADeploymentObjectAttributes duration(Long duration) { + this.duration = duration; + return this; + } + + /** + * The duration of the deployment. + * + * @return duration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getDuration() { + return duration; + } + + public void setDuration(Long duration) { + this.duration = duration; + } + public DORADeploymentObjectAttributes env(String env) { this.env = env; return this; @@ -181,6 +436,123 @@ public void setGit(DORAGitInfoResponse git) { } } + public DORADeploymentObjectAttributes numberOfCommits(Long numberOfCommits) { + this.numberOfCommits = numberOfCommits; + return this; + } + + /** + * The number of commits associated with the deployment. + * + * @return numberOfCommits + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_COMMITS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumberOfCommits() { + return numberOfCommits; + } + + public void setNumberOfCommits(Long numberOfCommits) { + this.numberOfCommits = numberOfCommits; + } + + public DORADeploymentObjectAttributes numberOfPullRequests(Long numberOfPullRequests) { + this.numberOfPullRequests = numberOfPullRequests; + return this; + } + + /** + * The number of pull requests associated with the deployment. + * + * @return numberOfPullRequests + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NUMBER_OF_PULL_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getNumberOfPullRequests() { + return numberOfPullRequests; + } + + public void setNumberOfPullRequests(Long numberOfPullRequests) { + this.numberOfPullRequests = numberOfPullRequests; + } + + public DORADeploymentObjectAttributes pullRequests(List> pullRequests) { + this.pullRequests = pullRequests; + return this; + } + + public DORADeploymentObjectAttributes addPullRequestsItem(Map pullRequestsItem) { + if (this.pullRequests == null) { + this.pullRequests = new ArrayList<>(); + } + this.pullRequests.add(pullRequestsItem); + return this; + } + + /** + * The list of pull requests included in the deployment. + * + * @return pullRequests + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PULL_REQUESTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List> getPullRequests() { + return pullRequests; + } + + public void setPullRequests(List> pullRequests) { + this.pullRequests = pullRequests; + } + + public DORADeploymentObjectAttributes recoveryTimeSec(Long recoveryTimeSec) { + this.recoveryTimeSec = recoveryTimeSec; + return this; + } + + /** + * The recovery time, in seconds, for a deployment flagged as a change failure. + * + * @return recoveryTimeSec + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RECOVERY_TIME_SEC) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRecoveryTimeSec() { + return recoveryTimeSec; + } + + public void setRecoveryTimeSec(Long recoveryTimeSec) { + this.recoveryTimeSec = recoveryTimeSec; + } + + public DORADeploymentObjectAttributes remediation(DORADeploymentRemediation remediation) { + this.remediation = remediation; + this.unparsed |= remediation.unparsed; + return this; + } + + /** + * Remediation details for a deployment that was flagged as a change failure. + * + * @return remediation + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMEDIATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DORADeploymentRemediation getRemediation() { + return remediation; + } + + public void setRemediation(DORADeploymentRemediation remediation) { + this.remediation = remediation; + if (remediation != null) { + this.unparsed |= remediation.unparsed; + } + } + public DORADeploymentObjectAttributes service(String service) { this.service = service; return this; @@ -201,6 +573,27 @@ public void setService(String service) { this.service = service; } + public DORADeploymentObjectAttributes source(String source) { + this.source = source; + return this; + } + + /** + * The source of the deployment event. + * + * @return source + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSource() { + return source; + } + + public void setSource(String source) { + this.source = source; + } + public DORADeploymentObjectAttributes startedAt(OffsetDateTime startedAt) { this.startedAt = startedAt; return this; @@ -320,11 +713,26 @@ public boolean equals(Object o) { } DORADeploymentObjectAttributes doraDeploymentObjectAttributes = (DORADeploymentObjectAttributes) o; - return Objects.equals(this.customTags, doraDeploymentObjectAttributes.customTags) + return Objects.equals(this.ai, doraDeploymentObjectAttributes.ai) + && Objects.equals(this.averagedMetrics, doraDeploymentObjectAttributes.averagedMetrics) + && Objects.equals(this.changeFailure, doraDeploymentObjectAttributes.changeFailure) + && Objects.equals(this.commits, doraDeploymentObjectAttributes.commits) + && Objects.equals(this.createdAt, doraDeploymentObjectAttributes.createdAt) + && Objects.equals(this.custom, doraDeploymentObjectAttributes.custom) + && Objects.equals(this.customTags, doraDeploymentObjectAttributes.customTags) + && Objects.equals(this.deploymentType, doraDeploymentObjectAttributes.deploymentType) + && Objects.equals(this.duration, doraDeploymentObjectAttributes.duration) && Objects.equals(this.env, doraDeploymentObjectAttributes.env) && Objects.equals(this.finishedAt, doraDeploymentObjectAttributes.finishedAt) && Objects.equals(this.git, doraDeploymentObjectAttributes.git) + && Objects.equals(this.numberOfCommits, doraDeploymentObjectAttributes.numberOfCommits) + && Objects.equals( + this.numberOfPullRequests, doraDeploymentObjectAttributes.numberOfPullRequests) + && Objects.equals(this.pullRequests, doraDeploymentObjectAttributes.pullRequests) + && Objects.equals(this.recoveryTimeSec, doraDeploymentObjectAttributes.recoveryTimeSec) + && Objects.equals(this.remediation, doraDeploymentObjectAttributes.remediation) && Objects.equals(this.service, doraDeploymentObjectAttributes.service) + && Objects.equals(this.source, doraDeploymentObjectAttributes.source) && Objects.equals(this.startedAt, doraDeploymentObjectAttributes.startedAt) && Objects.equals(this.team, doraDeploymentObjectAttributes.team) && Objects.equals(this.version, doraDeploymentObjectAttributes.version) @@ -335,18 +743,56 @@ public boolean equals(Object o) { @Override public int hashCode() { return Objects.hash( - customTags, env, finishedAt, git, service, startedAt, team, version, additionalProperties); + ai, + averagedMetrics, + changeFailure, + commits, + createdAt, + custom, + customTags, + deploymentType, + duration, + env, + finishedAt, + git, + numberOfCommits, + numberOfPullRequests, + pullRequests, + recoveryTimeSec, + remediation, + service, + source, + startedAt, + team, + version, + additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class DORADeploymentObjectAttributes {\n"); + sb.append(" ai: ").append(toIndentedString(ai)).append("\n"); + sb.append(" averagedMetrics: ").append(toIndentedString(averagedMetrics)).append("\n"); + sb.append(" changeFailure: ").append(toIndentedString(changeFailure)).append("\n"); + sb.append(" commits: ").append(toIndentedString(commits)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" custom: ").append(toIndentedString(custom)).append("\n"); sb.append(" customTags: ").append(toIndentedString(customTags)).append("\n"); + sb.append(" deploymentType: ").append(toIndentedString(deploymentType)).append("\n"); + sb.append(" duration: ").append(toIndentedString(duration)).append("\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(" numberOfCommits: ").append(toIndentedString(numberOfCommits)).append("\n"); + sb.append(" numberOfPullRequests: ") + .append(toIndentedString(numberOfPullRequests)) + .append("\n"); + sb.append(" pullRequests: ").append(toIndentedString(pullRequests)).append("\n"); + sb.append(" recoveryTimeSec: ").append(toIndentedString(recoveryTimeSec)).append("\n"); + sb.append(" remediation: ").append(toIndentedString(remediation)).append("\n"); sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); sb.append(" startedAt: ").append(toIndentedString(startedAt)).append("\n"); sb.append(" team: ").append(toIndentedString(team)).append("\n"); sb.append(" version: ").append(toIndentedString(version)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/DORADeploymentRemediation.java b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentRemediation.java new file mode 100644 index 00000000000..17d01361aee --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DORADeploymentRemediation.java @@ -0,0 +1,165 @@ +/* + * 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; + +/** Remediation details for a deployment that was flagged as a change failure. */ +@JsonPropertyOrder({ + DORADeploymentRemediation.JSON_PROPERTY_ID, + DORADeploymentRemediation.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DORADeploymentRemediation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public DORADeploymentRemediation id(String id) { + this.id = id; + return this; + } + + /** + * The ID of the remediation deployment. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DORADeploymentRemediation type(String type) { + this.type = type; + return this; + } + + /** + * The type of remediation, such as a rollback. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String 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 DORADeploymentRemediation + */ + @JsonAnySetter + public DORADeploymentRemediation 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 DORADeploymentRemediation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DORADeploymentRemediation doraDeploymentRemediation = (DORADeploymentRemediation) o; + return Objects.equals(this.id, doraDeploymentRemediation.id) + && Objects.equals(this.type, doraDeploymentRemediation.type) + && Objects.equals( + this.additionalProperties, doraDeploymentRemediation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DORADeploymentRemediation {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +}