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": "2025-01-17 19:31:44.131874",
"spec_repo_commit": "45186abe"
"regenerated": "2025-01-17 20:19:14.335908",
"spec_repo_commit": "4e5906d6"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-17 19:31:44.147963",
"spec_repo_commit": "45186abe"
"regenerated": "2025-01-17 20:19:14.351247",
"spec_repo_commit": "4e5906d6"
}
}
}
11 changes: 11 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7378,9 +7378,20 @@ components:
properties:
attributes:
$ref: '#/components/schemas/CreateDataDeletionRequestBodyAttributes'
type:
$ref: '#/components/schemas/CreateDataDeletionRequestBodyDataType'
required:
- attributes
- type
type: object
CreateDataDeletionRequestBodyDataType:
description: The deletion request type.
enum:
- create_deletion_req
example: create_deletion_req
type: string
x-enum-varnames:
- CREATE_DELETION_REQ
CreateDataDeletionResponseBody:
description: The response from the create data deletion request endpoint.
properties:
Expand Down
4 changes: 3 additions & 1 deletion examples/v2/data-deletion/CreateDataDeletionRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.datadog.api.client.v2.model.CreateDataDeletionRequestBody;
import com.datadog.api.client.v2.model.CreateDataDeletionRequestBodyAttributes;
import com.datadog.api.client.v2.model.CreateDataDeletionRequestBodyData;
import com.datadog.api.client.v2.model.CreateDataDeletionRequestBodyDataType;
import com.datadog.api.client.v2.model.CreateDataDeletionResponseBody;
import java.util.Arrays;
import java.util.Map;
Expand All @@ -27,7 +28,8 @@ public static void main(String[] args) {
.query(
Map.ofEntries(
Map.entry("host", "abc"), Map.entry("service", "xyz")))
.to(1704063600000L)));
.to(1704063600000L))
.type(CreateDataDeletionRequestBodyDataType.CREATE_DELETION_REQ));

try {
CreateDataDeletionResponseBody result = apiInstance.createDataDeletionRequest("logs", body);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,32 @@
import java.util.Objects;

/** Data needed to create a data deletion request. */
@JsonPropertyOrder({CreateDataDeletionRequestBodyData.JSON_PROPERTY_ATTRIBUTES})
@JsonPropertyOrder({
CreateDataDeletionRequestBodyData.JSON_PROPERTY_ATTRIBUTES,
CreateDataDeletionRequestBodyData.JSON_PROPERTY_TYPE
})
@jakarta.annotation.Generated(
value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator")
public class CreateDataDeletionRequestBodyData {
@JsonIgnore public boolean unparsed = false;
public static final String JSON_PROPERTY_ATTRIBUTES = "attributes";
private CreateDataDeletionRequestBodyAttributes attributes;

public static final String JSON_PROPERTY_TYPE = "type";
private CreateDataDeletionRequestBodyDataType type;

public CreateDataDeletionRequestBodyData() {}

@JsonCreator
public CreateDataDeletionRequestBodyData(
@JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES)
CreateDataDeletionRequestBodyAttributes attributes) {
CreateDataDeletionRequestBodyAttributes attributes,
@JsonProperty(required = true, value = JSON_PROPERTY_TYPE)
CreateDataDeletionRequestBodyDataType type) {
this.attributes = attributes;
this.unparsed |= attributes.unparsed;
this.type = type;
this.unparsed |= !type.isValid();
}

public CreateDataDeletionRequestBodyData attributes(
Expand All @@ -58,6 +68,30 @@ public void setAttributes(CreateDataDeletionRequestBodyAttributes attributes) {
this.attributes = attributes;
}

public CreateDataDeletionRequestBodyData type(CreateDataDeletionRequestBodyDataType type) {
this.type = type;
this.unparsed |= !type.isValid();
return this;
}

/**
* The deletion request type.
*
* @return type
*/
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public CreateDataDeletionRequestBodyDataType getType() {
return type;
}

public void setType(CreateDataDeletionRequestBodyDataType type) {
if (!type.isValid()) {
this.unparsed = true;
}
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.
Expand Down Expand Up @@ -116,20 +150,22 @@ public boolean equals(Object o) {
CreateDataDeletionRequestBodyData createDataDeletionRequestBodyData =
(CreateDataDeletionRequestBodyData) o;
return Objects.equals(this.attributes, createDataDeletionRequestBodyData.attributes)
&& Objects.equals(this.type, createDataDeletionRequestBodyData.type)
&& Objects.equals(
this.additionalProperties, createDataDeletionRequestBodyData.additionalProperties);
}

@Override
public int hashCode() {
return Objects.hash(attributes, additionalProperties);
return Objects.hash(attributes, type, additionalProperties);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class CreateDataDeletionRequestBodyData {\n");
sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" additionalProperties: ")
.append(toIndentedString(additionalProperties))
.append("\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* 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 deletion request type. */
@JsonSerialize(
using =
CreateDataDeletionRequestBodyDataType.CreateDataDeletionRequestBodyDataTypeSerializer.class)
public class CreateDataDeletionRequestBodyDataType extends ModelEnum<String> {

private static final Set<String> allowedValues =
new HashSet<String>(Arrays.asList("create_deletion_req"));

public static final CreateDataDeletionRequestBodyDataType CREATE_DELETION_REQ =
new CreateDataDeletionRequestBodyDataType("create_deletion_req");

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

public static class CreateDataDeletionRequestBodyDataTypeSerializer
extends StdSerializer<CreateDataDeletionRequestBodyDataType> {
public CreateDataDeletionRequestBodyDataTypeSerializer(
Class<CreateDataDeletionRequestBodyDataType> t) {
super(t);
}

public CreateDataDeletionRequestBodyDataTypeSerializer() {
this(null);
}

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

@JsonCreator
public static CreateDataDeletionRequestBodyDataType fromValue(String value) {
return new CreateDataDeletionRequestBodyDataType(value);
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-05T09:23:41.160Z
2025-01-15T14:25:54.929Z
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-05T09:23:41.674Z
2025-01-15T14:26:08.930Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000}}}"
"json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000},\"type\":\"create_deletion_req\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"523\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-12-05T09:23:42.016613164Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"pending\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-12-05T09:23:42.016613164Z\"}},\"meta\":{\"product\":\"logs\"}}",
"body": "{\"data\":{\"id\":\"753\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2025-01-15T14:26:09.447960191Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"pending\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2025-01-15T14:26:09.447960191Z\"}},\"meta\":{\"product\":\"logs\"}}",
"headers": {
"Content-Type": [
"application/vnd.api+json"
Expand All @@ -27,18 +27,18 @@
"timeToLive": {
"unlimited": true
},
"id": "599b5d26-fcc8-db18-1a6e-dfc958964915"
"id": "516e2b97-25f6-b08c-4d4a-1da22948b32f"
},
{
"httpRequest": {
"headers": {},
"method": "PUT",
"path": "/api/v2/deletion/requests/523/cancel",
"path": "/api/v2/deletion/requests/753/cancel",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"523\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-12-05T09:23:42.016613Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-12-05T09:23:42.384299Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
"body": "{\"data\":{\"id\":\"753\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2025-01-15T14:26:09.44796Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2025-01-15T14:26:10.016496Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
"headers": {
"Content-Type": [
"application/vnd.api+json"
Expand All @@ -53,18 +53,18 @@
"timeToLive": {
"unlimited": true
},
"id": "ec6f7ff8-dba2-9b00-6429-8e9f391044e3"
"id": "27d9e777-6874-6fc9-c5aa-33278aaaef7a"
},
{
"httpRequest": {
"headers": {},
"method": "PUT",
"path": "/api/v2/deletion/requests/523/cancel",
"path": "/api/v2/deletion/requests/753/cancel",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"523\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-12-05T09:23:42.016613Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-12-05T09:23:42.384299Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
"body": "{\"data\":{\"id\":\"753\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2025-01-15T14:26:09.44796Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2025-01-15T14:26:10.016496Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
"headers": {
"Content-Type": [
"application/vnd.api+json"
Expand All @@ -79,6 +79,6 @@
"timeToLive": {
"unlimited": true
},
"id": "ec6f7ff8-dba2-9b00-6429-8e9f391044e4"
"id": "27d9e777-6874-6fc9-c5aa-33278aaaef7b"
}
]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-05T09:23:42.850Z
2025-01-15T14:26:26.195Z
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-05T09:23:43.197Z
2025-01-15T14:27:27.929Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000}}}"
"json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"query\":{\"host\":\"abc\",\"service\":\"xyz\"},\"to\":1704063600000},\"type\":\"create_deletion_req\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -12,7 +12,7 @@
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"524\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-12-05T09:23:43.527574137Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"pending\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-12-05T09:23:43.527574137Z\"}},\"meta\":{\"product\":\"logs\"}}",
"body": "{\"data\":{\"id\":\"754\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2025-01-15T14:27:28.457837225Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"pending\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2025-01-15T14:27:28.457837225Z\"}},\"meta\":{\"product\":\"logs\"}}",
"headers": {
"Content-Type": [
"application/vnd.api+json"
Expand All @@ -27,18 +27,18 @@
"timeToLive": {
"unlimited": true
},
"id": "599b5d26-fcc8-db18-1a6e-dfc958964914"
"id": "516e2b97-25f6-b08c-4d4a-1da22948b32e"
},
{
"httpRequest": {
"headers": {},
"method": "PUT",
"path": "/api/v2/deletion/requests/524/cancel",
"path": "/api/v2/deletion/requests/754/cancel",
"keepAlive": false,
"secure": true
},
"httpResponse": {
"body": "{\"data\":{\"id\":\"524\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2024-12-05T09:23:43.527574Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2024-12-05T09:23:44.017414Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
"body": "{\"data\":{\"id\":\"754\",\"type\":\"deletion_request\",\"attributes\":{\"created_at\":\"2025-01-15T14:27:28.457837Z\",\"created_by\":\"frog@datadoghq.com\",\"from_time\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"is_created\":false,\"org_id\":321813,\"product\":\"logs\",\"query\":\"host:abc service:xyz\",\"starting_at\":\"0001-01-01T00:00:00Z\",\"status\":\"canceled\",\"to_time\":1704063600000,\"total_unrestricted\":0,\"updated_at\":\"2025-01-15T14:27:28.841156Z\"}},\"meta\":{\"product\":\"logs\",\"request_status\":\"canceled\"}}",
"headers": {
"Content-Type": [
"application/vnd.api+json"
Expand All @@ -53,6 +53,6 @@
"timeToLive": {
"unlimited": true
},
"id": "f7d7b19c-0391-4246-c87c-6d32dfeb6b9f"
"id": "6adbfe70-fffd-8207-996f-3bc078e0ba2c"
}
]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-05T09:23:44.038Z
2025-01-15T14:27:45.329Z
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"httpRequest": {
"body": {
"type": "JSON",
"json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"query\":{},\"to\":1704063600000}}}"
"json": "{\"data\":{\"attributes\":{\"from\":1672527600000,\"indexes\":[\"test-index\",\"test-index-2\"],\"query\":{},\"to\":1704063600000},\"type\":\"create_deletion_req\"}}"
},
"headers": {},
"method": "POST",
Expand All @@ -27,6 +27,6 @@
"timeToLive": {
"unlimited": true
},
"id": "dfc8b718-20e3-903c-facc-d726d2607b48"
"id": "85766018-9c75-0a95-ce16-8a08631ea4a9"
}
]
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-12-05T09:23:44.395Z
2025-01-15T14:28:03.053Z
Loading
Loading