Skip to content
Open
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
32 changes: 29 additions & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9117,6 +9117,10 @@ components:
$ref: '#/components/schemas/ServiceNowTicket'
status:
$ref: '#/components/schemas/CaseStatus'
status_group:
$ref: '#/components/schemas/CaseStatusGroup'
status_name:
$ref: '#/components/schemas/CaseStatusName'
title:
description: Title
example: Memory leak investigation on API
Expand Down Expand Up @@ -9183,6 +9187,8 @@ components:
type: string
priority:
$ref: '#/components/schemas/CasePriority'
status_name:
$ref: '#/components/schemas/CaseStatusName'
title:
description: Title
example: Security breach investigation
Expand Down Expand Up @@ -9351,7 +9357,9 @@ components:
- PRIORITY
- STATUS
CaseStatus:
description: Case status
deprecated: true
description: Deprecated way of representing the case status, which only supports
OPEN, IN_PROGRESS, and CLOSED statuses. Use `status_name` instead.
enum:
- OPEN
- IN_PROGRESS
Expand All @@ -9362,6 +9370,23 @@ components:
- OPEN
- IN_PROGRESS
- CLOSED
CaseStatusGroup:
description: Status group of the case.
enum:
- SG_OPEN
- SG_IN_PROGRESS
- SG_CLOSED
example: SG_OPEN
type: string
x-enum-varnames:
- SG_OPEN
- SG_IN_PROGRESS
- SG_CLOSED
CaseStatusName:
description: Status of the case. Must be one of the existing statuses for the
case's type.
example: Open
type: string
CaseTrigger:
description: Trigger a workflow from a Case. For automatic triggering a handle
must be configured and the workflow must be published.
Expand Down Expand Up @@ -9585,8 +9610,9 @@ components:
properties:
status:
$ref: '#/components/schemas/CaseStatus'
required:
- status
deprecated: true
status_name:
$ref: '#/components/schemas/CaseStatusName'
type: object
CaseUpdateStatusRequest:
description: Case update status request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
CaseAttributes.JSON_PROPERTY_PRIORITY,
CaseAttributes.JSON_PROPERTY_SERVICE_NOW_TICKET,
CaseAttributes.JSON_PROPERTY_STATUS,
CaseAttributes.JSON_PROPERTY_STATUS_GROUP,
CaseAttributes.JSON_PROPERTY_STATUS_NAME,
CaseAttributes.JSON_PROPERTY_TITLE,
CaseAttributes.JSON_PROPERTY_TYPE,
CaseAttributes.JSON_PROPERTY_TYPE_ID
Expand Down Expand Up @@ -78,6 +80,12 @@ public class CaseAttributes {
public static final String JSON_PROPERTY_STATUS = "status";
private CaseStatus status;

public static final String JSON_PROPERTY_STATUS_GROUP = "status_group";
private CaseStatusGroup statusGroup;

public static final String JSON_PROPERTY_STATUS_NAME = "status_name";
private String statusName;

public static final String JSON_PROPERTY_TITLE = "title";
private String title;

Expand Down Expand Up @@ -362,24 +370,74 @@ public CaseAttributes status(CaseStatus status) {
}

/**
* Case status
* Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and
* CLOSED statuses. Use <code>status_name</code> instead.
*
* @return status
* @deprecated
*/
@Deprecated
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STATUS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public CaseStatus getStatus() {
return status;
}

@Deprecated
public void setStatus(CaseStatus status) {
if (!status.isValid()) {
this.unparsed = true;
}
this.status = status;
}

public CaseAttributes statusGroup(CaseStatusGroup statusGroup) {
this.statusGroup = statusGroup;
this.unparsed |= !statusGroup.isValid();
return this;
}

/**
* Status group of the case.
*
* @return statusGroup
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STATUS_GROUP)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public CaseStatusGroup getStatusGroup() {
return statusGroup;
}

public void setStatusGroup(CaseStatusGroup statusGroup) {
if (!statusGroup.isValid()) {
this.unparsed = true;
}
this.statusGroup = statusGroup;
}

public CaseAttributes statusName(String statusName) {
this.statusName = statusName;
return this;
}

/**
* Status of the case. Must be one of the existing statuses for the case's type.
*
* @return statusName
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STATUS_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getStatusName() {
return statusName;
}

public void setStatusName(String statusName) {
this.statusName = statusName;
}

public CaseAttributes title(String title) {
this.title = title;
return this;
Expand Down Expand Up @@ -518,6 +576,8 @@ public boolean equals(Object o) {
&& Objects.equals(this.priority, caseAttributes.priority)
&& Objects.equals(this.serviceNowTicket, caseAttributes.serviceNowTicket)
&& Objects.equals(this.status, caseAttributes.status)
&& Objects.equals(this.statusGroup, caseAttributes.statusGroup)
&& Objects.equals(this.statusName, caseAttributes.statusName)
&& Objects.equals(this.title, caseAttributes.title)
&& Objects.equals(this.type, caseAttributes.type)
&& Objects.equals(this.typeId, caseAttributes.typeId)
Expand All @@ -539,6 +599,8 @@ public int hashCode() {
priority,
serviceNowTicket,
status,
statusGroup,
statusName,
title,
type,
typeId,
Expand All @@ -561,6 +623,8 @@ public String toString() {
sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
sb.append(" serviceNowTicket: ").append(toIndentedString(serviceNowTicket)).append("\n");
sb.append(" status: ").append(toIndentedString(status)).append("\n");
sb.append(" statusGroup: ").append(toIndentedString(statusGroup)).append("\n");
sb.append(" statusName: ").append(toIndentedString(statusName)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
CaseCreateAttributes.JSON_PROPERTY_CUSTOM_ATTRIBUTES,
CaseCreateAttributes.JSON_PROPERTY_DESCRIPTION,
CaseCreateAttributes.JSON_PROPERTY_PRIORITY,
CaseCreateAttributes.JSON_PROPERTY_STATUS_NAME,
CaseCreateAttributes.JSON_PROPERTY_TITLE,
CaseCreateAttributes.JSON_PROPERTY_TYPE_ID
})
Expand All @@ -38,6 +39,9 @@ public class CaseCreateAttributes {
public static final String JSON_PROPERTY_PRIORITY = "priority";
private CasePriority priority = CasePriority.NOT_DEFINED;

public static final String JSON_PROPERTY_STATUS_NAME = "status_name";
private String statusName;

public static final String JSON_PROPERTY_TITLE = "title";
private String title;

Expand Down Expand Up @@ -130,6 +134,27 @@ public void setPriority(CasePriority priority) {
this.priority = priority;
}

public CaseCreateAttributes statusName(String statusName) {
this.statusName = statusName;
return this;
}

/**
* Status of the case. Must be one of the existing statuses for the case's type.
*
* @return statusName
*/
@jakarta.annotation.Nullable
@JsonProperty(JSON_PROPERTY_STATUS_NAME)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getStatusName() {
return statusName;
}

public void setStatusName(String statusName) {
this.statusName = statusName;
}

public CaseCreateAttributes title(String title) {
this.title = title;
return this;
Expand Down Expand Up @@ -229,6 +254,7 @@ public boolean equals(Object o) {
return Objects.equals(this.customAttributes, caseCreateAttributes.customAttributes)
&& Objects.equals(this.description, caseCreateAttributes.description)
&& Objects.equals(this.priority, caseCreateAttributes.priority)
&& Objects.equals(this.statusName, caseCreateAttributes.statusName)
&& Objects.equals(this.title, caseCreateAttributes.title)
&& Objects.equals(this.typeId, caseCreateAttributes.typeId)
&& Objects.equals(this.additionalProperties, caseCreateAttributes.additionalProperties);
Expand All @@ -237,7 +263,7 @@ public boolean equals(Object o) {
@Override
public int hashCode() {
return Objects.hash(
customAttributes, description, priority, title, typeId, additionalProperties);
customAttributes, description, priority, statusName, title, typeId, additionalProperties);
}

@Override
Expand All @@ -247,6 +273,7 @@ public String toString() {
sb.append(" customAttributes: ").append(toIndentedString(customAttributes)).append("\n");
sb.append(" description: ").append(toIndentedString(description)).append("\n");
sb.append(" priority: ").append(toIndentedString(priority)).append("\n");
sb.append(" statusName: ").append(toIndentedString(statusName)).append("\n");
sb.append(" title: ").append(toIndentedString(title)).append("\n");
sb.append(" typeId: ").append(toIndentedString(typeId)).append("\n");
sb.append(" additionalProperties: ")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@
import java.util.HashSet;
import java.util.Set;

/** Case status */
/**
* Deprecated way of representing the case status, which only supports OPEN, IN_PROGRESS, and CLOSED
* statuses. Use <code>status_name</code> instead.
*/
@JsonSerialize(using = CaseStatus.CaseStatusSerializer.class)
public class CaseStatus extends ModelEnum<String> {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
* 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;

/** Status group of the case. */
@JsonSerialize(using = CaseStatusGroup.CaseStatusGroupSerializer.class)
public class CaseStatusGroup extends ModelEnum<String> {

private static final Set<String> allowedValues =
new HashSet<String>(Arrays.asList("SG_OPEN", "SG_IN_PROGRESS", "SG_CLOSED"));

public static final CaseStatusGroup SG_OPEN = new CaseStatusGroup("SG_OPEN");
public static final CaseStatusGroup SG_IN_PROGRESS = new CaseStatusGroup("SG_IN_PROGRESS");
public static final CaseStatusGroup SG_CLOSED = new CaseStatusGroup("SG_CLOSED");

CaseStatusGroup(String value) {
super(value, allowedValues);
}

public static class CaseStatusGroupSerializer extends StdSerializer<CaseStatusGroup> {
public CaseStatusGroupSerializer(Class<CaseStatusGroup> t) {
super(t);
}

public CaseStatusGroupSerializer() {
this(null);
}

@Override
public void serialize(CaseStatusGroup value, JsonGenerator jgen, SerializerProvider provider)
throws IOException, JsonProcessingException {
jgen.writeObject(value.value);
}
}

@JsonCreator
public static CaseStatusGroup fromValue(String value) {
return new CaseStatusGroup(value);
}
}
Loading
Loading