From ee6936f843d42fb321603ca3c4a0893bf75b1780 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 7 Apr 2026 16:42:13 +0000 Subject: [PATCH] Regenerate client from commit 8fbe29a of spec repo --- .generator/schemas/v2/openapi.yaml | 523 +++++++++++++++ examples/v2/bits-ai/GetInvestigation.java | 26 + examples/v2/bits-ai/ListInvestigations.java | 25 + .../bits-ai/ListInvestigations_130750454.java | 27 + examples/v2/bits-ai/TriggerInvestigation.java | 48 ++ .../com/datadog/api/client/ApiClient.java | 3 + .../datadog/api/client/v2/api/BitsAiApi.java | 628 ++++++++++++++++++ .../v2/model/GetInvestigationResponse.java | 178 +++++ .../model/GetInvestigationResponseData.java | 211 ++++++ ...etInvestigationResponseDataAttributes.java | 217 ++++++ .../model/GetInvestigationResponseLinks.java | 144 ++++ .../v2/model/InvestigationConclusion.java | 201 ++++++ .../client/v2/model/InvestigationType.java | 54 ++ .../v2/model/ListInvestigationsResponse.java | 220 ++++++ .../model/ListInvestigationsResponseData.java | 212 ++++++ ...tInvestigationsResponseDataAttributes.java | 176 +++++ .../ListInvestigationsResponseLinks.java | 278 ++++++++ .../model/ListInvestigationsResponseMeta.java | 148 +++++ .../ListInvestigationsResponseMetaPage.java | 203 ++++++ .../model/MonitorAlertTriggerAttributes.java | 202 ++++++ .../client/v2/model/TriggerAttributes.java | 183 +++++ .../v2/model/TriggerInvestigationRequest.java | 147 ++++ .../TriggerInvestigationRequestData.java | 185 ++++++ ...gerInvestigationRequestDataAttributes.java | 148 +++++ .../TriggerInvestigationRequestType.java | 58 ++ .../model/TriggerInvestigationResponse.java | 147 ++++ .../TriggerInvestigationResponseData.java | 213 ++++++ ...erInvestigationResponseDataAttributes.java | 149 +++++ .../TriggerInvestigationResponseType.java | 58 ++ .../api/client/v2/model/TriggerType.java | 54 ++ .../datadog/api/client/v2/api/bits_ai.feature | 69 ++ .../com/datadog/api/client/v2/api/undo.json | 18 + 32 files changed, 5153 insertions(+) create mode 100644 examples/v2/bits-ai/GetInvestigation.java create mode 100644 examples/v2/bits-ai/ListInvestigations.java create mode 100644 examples/v2/bits-ai/ListInvestigations_130750454.java create mode 100644 examples/v2/bits-ai/TriggerInvestigation.java create mode 100644 src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseLinks.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/InvestigationConclusion.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/InvestigationType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseLinks.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMeta.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMetaPage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/MonitorAlertTriggerAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/TriggerType.java create mode 100644 src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e83df8269e5..730cce5a68f 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -28854,6 +28854,64 @@ components: $ref: "#/components/schemas/GetInterfacesData" type: array type: object + GetInvestigationResponse: + description: Response for a single Bits AI investigation. + properties: + data: + $ref: "#/components/schemas/GetInvestigationResponseData" + links: + $ref: "#/components/schemas/GetInvestigationResponseLinks" + required: + - data + - links + type: object + GetInvestigationResponseData: + description: Data for the get investigation response. + properties: + attributes: + $ref: "#/components/schemas/GetInvestigationResponseDataAttributes" + id: + description: The unique identifier of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + type: + $ref: "#/components/schemas/InvestigationType" + required: + - id + - type + - attributes + type: object + GetInvestigationResponseDataAttributes: + description: Attributes of the investigation. + properties: + conclusions: + description: The conclusions drawn from the investigation. + items: + $ref: "#/components/schemas/InvestigationConclusion" + type: array + status: + description: The current status of the investigation. + example: "conclusive" + type: string + title: + description: The title of the investigation. + example: "Monitor alert investigation for web-server-01" + type: string + required: + - title + - status + - conclusions + type: object + GetInvestigationResponseLinks: + description: Links related to the investigation. + properties: + self: + description: The URL to the investigation in the Datadog app. + example: "https://app.datadoghq.com/bits-ai/investigations/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + required: + - self + type: object GetIssueIncludeQueryParameterItem: description: Relationship object that should be included in the response. enum: @@ -34312,6 +34370,34 @@ components: - DOWN - WARNING - "OFF" + InvestigationConclusion: + description: A full explanation of the finding, including root cause analysis and supporting evidence. + properties: + description: + description: A full explanation of the finding, including root cause analysis and supporting evidence. + example: "The investigation found that a memory leak in payments-service caused CPU usage to spike above 95% starting at 14:32 UTC." + type: string + summary: + description: A summary of the finding, including affected components and timeframe. + example: "CPU usage exceeded 95% for over 10 minutes on web-server-01." + type: string + title: + description: The title of the conclusion. + example: "High CPU usage detected on web-server-01" + type: string + required: + - title + - summary + - description + type: object + InvestigationType: + description: The resource type for investigations. + enum: + - investigation + example: investigation + type: string + x-enum-varnames: + - INVESTIGATION Issue: description: The issue matching the request. properties: @@ -37692,6 +37778,113 @@ components: description: The type of the resource. The value should always be tags. type: string type: object + ListInvestigationsResponse: + description: Response for listing investigations. + properties: + data: + description: List of investigations. + items: + $ref: "#/components/schemas/ListInvestigationsResponseData" + type: array + links: + $ref: "#/components/schemas/ListInvestigationsResponseLinks" + meta: + $ref: "#/components/schemas/ListInvestigationsResponseMeta" + required: + - data + - meta + - links + type: object + ListInvestigationsResponseData: + description: Data for an investigation list item. + properties: + attributes: + $ref: "#/components/schemas/ListInvestigationsResponseDataAttributes" + id: + description: The unique identifier of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + type: + $ref: "#/components/schemas/InvestigationType" + required: + - id + - type + - attributes + type: object + ListInvestigationsResponseDataAttributes: + description: Attributes of an investigation list item. + properties: + status: + description: The current status of the investigation. + example: "conclusive" + type: string + title: + description: The title of the investigation. + example: "Monitor alert investigation for web-server-01" + type: string + required: + - status + - title + type: object + ListInvestigationsResponseLinks: + description: Pagination links for the list investigations response. + properties: + first: + description: Link to the first page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=10&page[limit]=10" + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + type: string + required: + - first + - next + - self + type: object + ListInvestigationsResponseMeta: + description: Metadata for the list investigations response. + properties: + page: + $ref: "#/components/schemas/ListInvestigationsResponseMetaPage" + required: + - page + type: object + ListInvestigationsResponseMetaPage: + description: Pagination metadata. + properties: + limit: + description: Maximum number of results per page. + example: 10 + format: int64 + type: integer + offset: + description: Offset of the current page. + example: 0 + format: int64 + type: integer + total: + description: Total number of investigations. + example: 50 + format: int64 + type: integer + required: + - total + - limit + - offset + type: object ListKindCatalogResponse: description: List kind response. properties: @@ -41050,6 +41243,28 @@ components: maxLength: 255 type: string type: object + MonitorAlertTriggerAttributes: + description: Attributes for a monitor alert trigger. + properties: + event_id: + description: The event ID associated with the monitor alert. + example: "1234567890123456789" + type: string + event_ts: + description: The timestamp of the event in Unix milliseconds. + example: 1700000000000 + format: int64 + type: integer + monitor_id: + description: The monitor ID that triggered the alert. + example: 12345678 + format: int64 + type: integer + required: + - monitor_id + - event_id + - event_ts + type: object MonitorConfigPolicyAttributeCreateRequest: description: Policy and policy type for a monitor configuration policy. properties: @@ -70410,6 +70625,94 @@ components: - $ref: "#/components/schemas/SlackTriggerWrapper" - $ref: "#/components/schemas/SoftwareCatalogTriggerWrapper" - $ref: "#/components/schemas/WorkflowTriggerWrapper" + TriggerAttributes: + description: The trigger definition for starting an investigation. + properties: + monitor_alert_trigger: + $ref: "#/components/schemas/MonitorAlertTriggerAttributes" + type: + $ref: "#/components/schemas/TriggerType" + required: + - type + - monitor_alert_trigger + type: object + TriggerInvestigationRequest: + description: Request to trigger a new investigation. + properties: + data: + $ref: "#/components/schemas/TriggerInvestigationRequestData" + required: + - data + type: object + TriggerInvestigationRequestData: + description: Data for the trigger investigation request. + properties: + attributes: + $ref: "#/components/schemas/TriggerInvestigationRequestDataAttributes" + type: + $ref: "#/components/schemas/TriggerInvestigationRequestType" + required: + - type + - attributes + type: object + TriggerInvestigationRequestDataAttributes: + description: Attributes for the trigger investigation request. + properties: + trigger: + $ref: "#/components/schemas/TriggerAttributes" + required: + - trigger + type: object + TriggerInvestigationRequestType: + description: The resource type for trigger investigation requests. + enum: + - trigger_investigation_request + example: trigger_investigation_request + type: string + x-enum-varnames: + - TRIGGER_INVESTIGATION_REQUEST + TriggerInvestigationResponse: + description: Response after triggering an investigation. + properties: + data: + $ref: "#/components/schemas/TriggerInvestigationResponseData" + required: + - data + type: object + TriggerInvestigationResponseData: + description: Data for the trigger investigation response. + properties: + attributes: + $ref: "#/components/schemas/TriggerInvestigationResponseDataAttributes" + id: + description: Unique identifier for the trigger response. + example: "f5e6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" + type: string + type: + $ref: "#/components/schemas/TriggerInvestigationResponseType" + required: + - id + - type + - attributes + type: object + TriggerInvestigationResponseDataAttributes: + description: Attributes for the trigger investigation response. + properties: + investigation_id: + description: The ID of the investigation that was created. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + required: + - investigation_id + type: object + TriggerInvestigationResponseType: + description: The resource type for trigger investigation responses. + enum: + - trigger_investigation_response + example: trigger_investigation_response + type: string + x-enum-varnames: + - TRIGGER_INVESTIGATION_RESPONSE TriggerRateLimit: description: Defines a rate limit for a trigger. properties: @@ -70433,6 +70736,14 @@ components: x-enum-varnames: - SECURITY_FINDINGS - SECURITY_SIGNALS + TriggerType: + description: The type of trigger for the investigation. + enum: + - monitor_alert_trigger + example: monitor_alert_trigger + type: string + x-enum-varnames: + - MONITOR_ALERT_TRIGGER UCConfigPair: description: The definition of `UCConfigPair` object. example: @@ -74236,6 +74547,8 @@ components: apm_service_catalog_write: Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog. appsec_vm_read: View infrastructure, application code, and library vulnerability findings. billing_read: View your organization's billing information. + bits_investigations_read: View Bits AI investigations. + bits_investigations_write: Create and manage Bits AI investigations. cases_read: View Cases. cases_write: Create and update cases. ci_visibility_pipelines_write: Create CI Visibility pipeline spans using the API. @@ -78326,6 +78639,213 @@ paths: operator: OR permissions: - user_access_manage + /api/v2/bits-ai/investigations: + get: + description: List all Bits AI investigations for the organization. + operationId: ListInvestigations + parameters: + - description: Offset for pagination. + example: 0 + in: query + name: page[offset] + required: false + schema: + format: int64 + type: integer + - description: Maximum number of investigations to return. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 25 + format: int64 + maximum: 100 + type: integer + - description: Filter investigations by monitor ID. + example: 12345678 + in: query + name: filter[monitor_id] + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + status: "conclusive" + title: "Monitor alert investigation for web-server-01" + id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: investigation + links: + first: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + next: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=10&page[limit]=10" + self: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + meta: + page: + limit: 10 + offset: 0 + total: 50 + schema: + $ref: "#/components/schemas/ListInvestigationsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_read + summary: List Bits AI investigations + tags: + - Bits AI + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data + "x-permission": + operator: OR + permissions: + - bits_investigations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Trigger a new Bits AI investigation based on a monitor alert. + operationId: TriggerInvestigation + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + trigger: + monitor_alert_trigger: + event_id: "1234567890123456789" + event_ts: 1700000000000 + monitor_id: 12345678 + type: monitor_alert_trigger + type: trigger_investigation_request + schema: + $ref: "#/components/schemas/TriggerInvestigationRequest" + description: Trigger investigation request body. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + investigation_id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + id: "f5e6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" + type: trigger_investigation_response + schema: + $ref: "#/components/schemas/TriggerInvestigationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_write + summary: Trigger a Bits AI investigation + tags: + - Bits AI + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - bits_investigations_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/bits-ai/investigations/{id}: + get: + description: Get a specific Bits AI investigation by ID. + operationId: GetInvestigation + parameters: + - description: The ID of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + conclusions: + - description: "The investigation found that a memory leak in payments-service caused CPU usage to spike above 95% starting at 14:32 UTC." + summary: "CPU usage exceeded 95% for over 10 minutes on web-server-01." + title: "High CPU usage detected on web-server-01" + status: "conclusive" + title: "Monitor alert investigation for web-server-01" + id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: investigation + links: + self: "https://app.datadoghq.com/bits-ai/investigations/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + schema: + $ref: "#/components/schemas/GetInvestigationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_read + summary: Get a Bits AI investigation + tags: + - Bits AI + "x-permission": + operator: OR + permissions: + - bits_investigations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cases: get: description: >- @@ -114317,6 +114837,9 @@ tags: is used to automatically map groups of users to roles in Datadog using attributes sent from Identity Providers. Use these endpoints to manage your AuthN Mappings. name: AuthN Mappings + - description: |- + Use the Bits AI endpoints to retrieve AI-powered investigations. + name: Bits AI - description: |- Search or aggregate your CI Visibility pipeline events and send them to your Datadog site over HTTP. See the [CI Pipeline Visibility in Datadog page](https://docs.datadoghq.com/continuous_integration/pipelines/) for more information. name: CI Visibility Pipelines diff --git a/examples/v2/bits-ai/GetInvestigation.java b/examples/v2/bits-ai/GetInvestigation.java new file mode 100644 index 00000000000..0ce9cbf637d --- /dev/null +++ b/examples/v2/bits-ai/GetInvestigation.java @@ -0,0 +1,26 @@ +// Get a Bits AI investigation returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.BitsAiApi; +import com.datadog.api.client.v2.model.GetInvestigationResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getInvestigation", true); + BitsAiApi apiInstance = new BitsAiApi(defaultClient); + + try { + GetInvestigationResponse result = + apiInstance.getInvestigation("a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BitsAiApi#getInvestigation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/bits-ai/ListInvestigations.java b/examples/v2/bits-ai/ListInvestigations.java new file mode 100644 index 00000000000..4c9dd713a29 --- /dev/null +++ b/examples/v2/bits-ai/ListInvestigations.java @@ -0,0 +1,25 @@ +// List Bits AI investigations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.BitsAiApi; +import com.datadog.api.client.v2.model.ListInvestigationsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listInvestigations", true); + BitsAiApi apiInstance = new BitsAiApi(defaultClient); + + try { + ListInvestigationsResponse result = apiInstance.listInvestigations(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BitsAiApi#listInvestigations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/bits-ai/ListInvestigations_130750454.java b/examples/v2/bits-ai/ListInvestigations_130750454.java new file mode 100644 index 00000000000..f4a98b8a4e5 --- /dev/null +++ b/examples/v2/bits-ai/ListInvestigations_130750454.java @@ -0,0 +1,27 @@ +// List Bits AI investigations returns "OK" response with pagination + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.v2.api.BitsAiApi; +import com.datadog.api.client.v2.model.ListInvestigationsResponseData; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listInvestigations", true); + BitsAiApi apiInstance = new BitsAiApi(defaultClient); + + try { + PaginationIterable iterable = + apiInstance.listInvestigationsWithPagination(); + + for (ListInvestigationsResponseData item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println("Exception when calling BitsAiApi#listInvestigationsWithPagination"); + System.err.println("Reason: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/bits-ai/TriggerInvestigation.java b/examples/v2/bits-ai/TriggerInvestigation.java new file mode 100644 index 00000000000..fc5ea035d8a --- /dev/null +++ b/examples/v2/bits-ai/TriggerInvestigation.java @@ -0,0 +1,48 @@ +// Trigger a Bits AI investigation returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.BitsAiApi; +import com.datadog.api.client.v2.model.MonitorAlertTriggerAttributes; +import com.datadog.api.client.v2.model.TriggerAttributes; +import com.datadog.api.client.v2.model.TriggerInvestigationRequest; +import com.datadog.api.client.v2.model.TriggerInvestigationRequestData; +import com.datadog.api.client.v2.model.TriggerInvestigationRequestDataAttributes; +import com.datadog.api.client.v2.model.TriggerInvestigationRequestType; +import com.datadog.api.client.v2.model.TriggerInvestigationResponse; +import com.datadog.api.client.v2.model.TriggerType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.triggerInvestigation", true); + BitsAiApi apiInstance = new BitsAiApi(defaultClient); + + TriggerInvestigationRequest body = + new TriggerInvestigationRequest() + .data( + new TriggerInvestigationRequestData() + .attributes( + new TriggerInvestigationRequestDataAttributes() + .trigger( + new TriggerAttributes() + .monitorAlertTrigger( + new MonitorAlertTriggerAttributes() + .eventId("1234567890123456789") + .eventTs(1700000000000L) + .monitorId(12345678L)) + .type(TriggerType.MONITOR_ALERT_TRIGGER))) + .type(TriggerInvestigationRequestType.TRIGGER_INVESTIGATION_REQUEST)); + + try { + TriggerInvestigationResponse result = apiInstance.triggerInvestigation(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BitsAiApi#triggerInvestigation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/ApiClient.java b/src/main/java/com/datadog/api/client/ApiClient.java index 2f10dceeb03..9c4426e5c87 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -769,6 +769,9 @@ public class ApiClient { put("v2.getOpenAPI", false); put("v2.listAPIs", false); put("v2.updateOpenAPI", false); + put("v2.getInvestigation", false); + put("v2.listInvestigations", false); + put("v2.triggerInvestigation", false); put("v2.createCaseJiraIssue", false); put("v2.createCaseNotebook", false); put("v2.createCaseServiceNowTicket", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java b/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java new file mode 100644 index 00000000000..12af8e44f39 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java @@ -0,0 +1,628 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.GetInvestigationResponse; +import com.datadog.api.client.v2.model.ListInvestigationsResponse; +import com.datadog.api.client.v2.model.ListInvestigationsResponseData; +import com.datadog.api.client.v2.model.TriggerInvestigationRequest; +import com.datadog.api.client.v2.model.TriggerInvestigationResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BitsAiApi { + private ApiClient apiClient; + + public BitsAiApi() { + this(ApiClient.getDefaultApiClient()); + } + + public BitsAiApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get a Bits AI investigation. + * + *

See {@link #getInvestigationWithHttpInfo}. + * + * @param id The ID of the investigation. (required) + * @return GetInvestigationResponse + * @throws ApiException if fails to make API call + */ + public GetInvestigationResponse getInvestigation(String id) throws ApiException { + return getInvestigationWithHttpInfo(id).getData(); + } + + /** + * Get a Bits AI investigation. + * + *

See {@link #getInvestigationWithHttpInfoAsync}. + * + * @param id The ID of the investigation. (required) + * @return CompletableFuture<GetInvestigationResponse> + */ + public CompletableFuture getInvestigationAsync(String id) { + return getInvestigationWithHttpInfoAsync(id) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a specific Bits AI investigation by ID. + * + * @param id The ID of the investigation. (required) + * @return ApiResponse<GetInvestigationResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getInvestigationWithHttpInfo(String id) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getInvestigation"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException( + 400, "Missing the required parameter 'id' when calling getInvestigation"); + } + // create path and map variables + String localVarPath = + "/api/v2/bits-ai/investigations/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.BitsAiApi.getInvestigation", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get a Bits AI investigation. + * + *

See {@link #getInvestigationWithHttpInfo}. + * + * @param id The ID of the investigation. (required) + * @return CompletableFuture<ApiResponse<GetInvestigationResponse>> + */ + public CompletableFuture> getInvestigationWithHttpInfoAsync( + String id) { + // Check if unstable operation is enabled + String operationId = "getInvestigation"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + + // verify the required parameter 'id' is set + if (id == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'id' when calling getInvestigation")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/bits-ai/investigations/{id}" + .replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.BitsAiApi.getInvestigation", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** Manage optional parameters to listInvestigations. */ + public static class ListInvestigationsOptionalParameters { + private Long pageOffset; + private Long pageLimit; + private Long filterMonitorId; + + /** + * Set pageOffset. + * + * @param pageOffset Offset for pagination. (optional) + * @return ListInvestigationsOptionalParameters + */ + public ListInvestigationsOptionalParameters pageOffset(Long pageOffset) { + this.pageOffset = pageOffset; + return this; + } + + /** + * Set pageLimit. + * + * @param pageLimit Maximum number of investigations to return. (optional, default to 25) + * @return ListInvestigationsOptionalParameters + */ + public ListInvestigationsOptionalParameters pageLimit(Long pageLimit) { + this.pageLimit = pageLimit; + return this; + } + + /** + * Set filterMonitorId. + * + * @param filterMonitorId Filter investigations by monitor ID. (optional) + * @return ListInvestigationsOptionalParameters + */ + public ListInvestigationsOptionalParameters filterMonitorId(Long filterMonitorId) { + this.filterMonitorId = filterMonitorId; + return this; + } + } + + /** + * List Bits AI investigations. + * + *

See {@link #listInvestigationsWithHttpInfo}. + * + * @return ListInvestigationsResponse + * @throws ApiException if fails to make API call + */ + public ListInvestigationsResponse listInvestigations() throws ApiException { + return listInvestigationsWithHttpInfo(new ListInvestigationsOptionalParameters()).getData(); + } + + /** + * List Bits AI investigations. + * + *

See {@link #listInvestigationsWithHttpInfoAsync}. + * + * @return CompletableFuture<ListInvestigationsResponse> + */ + public CompletableFuture listInvestigationsAsync() { + return listInvestigationsWithHttpInfoAsync(new ListInvestigationsOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Bits AI investigations. + * + *

See {@link #listInvestigationsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return ListInvestigationsResponse + * @throws ApiException if fails to make API call + */ + public ListInvestigationsResponse listInvestigations( + ListInvestigationsOptionalParameters parameters) throws ApiException { + return listInvestigationsWithHttpInfo(parameters).getData(); + } + + /** + * List Bits AI investigations. + * + *

See {@link #listInvestigationsWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ListInvestigationsResponse> + */ + public CompletableFuture listInvestigationsAsync( + ListInvestigationsOptionalParameters parameters) { + return listInvestigationsWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Bits AI investigations. + * + *

See {@link #listInvestigationsWithHttpInfo}. + * + * @return PaginationIterable<ListInvestigationsResponseData> + */ + public PaginationIterable listInvestigationsWithPagination() { + ListInvestigationsOptionalParameters parameters = new ListInvestigationsOptionalParameters(); + return listInvestigationsWithPagination(parameters); + } + + /** + * List Bits AI investigations. + * + *

See {@link #listInvestigationsWithHttpInfo}. + * + * @return ListInvestigationsResponse + */ + public PaginationIterable listInvestigationsWithPagination( + ListInvestigationsOptionalParameters parameters) { + String resultsPath = "getData"; + String valueGetterPath = ""; + String valueSetterPath = "pageOffset"; + Boolean valueSetterParamOptional = true; + Long limit; + + if (parameters.pageLimit == null) { + limit = 25l; + parameters.pageLimit(limit); + } else { + limit = parameters.pageLimit; + } + + LinkedHashMap args = new LinkedHashMap(); + args.put("optionalParams", parameters); + + PaginationIterable iterator = + new PaginationIterable( + this, + "listInvestigations", + resultsPath, + valueGetterPath, + valueSetterPath, + valueSetterParamOptional, + true, + limit, + args, + 0); + + return iterator; + } + + /** + * List all Bits AI investigations for the organization. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<ListInvestigationsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse listInvestigationsWithHttpInfo( + ListInvestigationsOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listInvestigations"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = null; + Long pageOffset = parameters.pageOffset; + Long pageLimit = parameters.pageLimit; + Long filterMonitorId = parameters.filterMonitorId; + // create path and map variables + String localVarPath = "/api/v2/bits-ai/investigations"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[monitor_id]", filterMonitorId)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.BitsAiApi.listInvestigations", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * List Bits AI investigations. + * + *

See {@link #listInvestigationsWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<ListInvestigationsResponse>> + */ + public CompletableFuture> + listInvestigationsWithHttpInfoAsync(ListInvestigationsOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listInvestigations"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = null; + Long pageOffset = parameters.pageOffset; + Long pageLimit = parameters.pageLimit; + Long filterMonitorId = parameters.filterMonitorId; + // create path and map variables + String localVarPath = "/api/v2/bits-ai/investigations"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[offset]", pageOffset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[limit]", pageLimit)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[monitor_id]", filterMonitorId)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.BitsAiApi.listInvestigations", + localVarPath, + localVarQueryParams, + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Trigger a Bits AI investigation. + * + *

See {@link #triggerInvestigationWithHttpInfo}. + * + * @param body Trigger investigation request body. (required) + * @return TriggerInvestigationResponse + * @throws ApiException if fails to make API call + */ + public TriggerInvestigationResponse triggerInvestigation(TriggerInvestigationRequest body) + throws ApiException { + return triggerInvestigationWithHttpInfo(body).getData(); + } + + /** + * Trigger a Bits AI investigation. + * + *

See {@link #triggerInvestigationWithHttpInfoAsync}. + * + * @param body Trigger investigation request body. (required) + * @return CompletableFuture<TriggerInvestigationResponse> + */ + public CompletableFuture triggerInvestigationAsync( + TriggerInvestigationRequest body) { + return triggerInvestigationWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Trigger a new Bits AI investigation based on a monitor alert. + * + * @param body Trigger investigation request body. (required) + * @return ApiResponse<TriggerInvestigationResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
429 Too many requests -
+ */ + public ApiResponse triggerInvestigationWithHttpInfo( + TriggerInvestigationRequest body) throws ApiException { + // Check if unstable operation is enabled + String operationId = "triggerInvestigation"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling triggerInvestigation"); + } + // create path and map variables + String localVarPath = "/api/v2/bits-ai/investigations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.BitsAiApi.triggerInvestigation", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Trigger a Bits AI investigation. + * + *

See {@link #triggerInvestigationWithHttpInfo}. + * + * @param body Trigger investigation request body. (required) + * @return CompletableFuture<ApiResponse<TriggerInvestigationResponse>> + */ + public CompletableFuture> + triggerInvestigationWithHttpInfoAsync(TriggerInvestigationRequest body) { + // Check if unstable operation is enabled + String operationId = "triggerInvestigation"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling triggerInvestigation")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/bits-ai/investigations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.BitsAiApi.triggerInvestigation", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponse.java b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponse.java new file mode 100644 index 00000000000..3867e55078a --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponse.java @@ -0,0 +1,178 @@ +/* + * 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.JsonCreator; +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; + +/** Response for a single Bits AI investigation. */ +@JsonPropertyOrder({ + GetInvestigationResponse.JSON_PROPERTY_DATA, + GetInvestigationResponse.JSON_PROPERTY_LINKS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetInvestigationResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GetInvestigationResponseData data; + + public static final String JSON_PROPERTY_LINKS = "links"; + private GetInvestigationResponseLinks links; + + public GetInvestigationResponse() {} + + @JsonCreator + public GetInvestigationResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) GetInvestigationResponseData data, + @JsonProperty(required = true, value = JSON_PROPERTY_LINKS) + GetInvestigationResponseLinks links) { + this.data = data; + this.unparsed |= data.unparsed; + this.links = links; + this.unparsed |= links.unparsed; + } + + public GetInvestigationResponse data(GetInvestigationResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for the get investigation response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetInvestigationResponseData getData() { + return data; + } + + public void setData(GetInvestigationResponseData data) { + this.data = data; + } + + public GetInvestigationResponse links(GetInvestigationResponseLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Links related to the investigation. + * + * @return links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetInvestigationResponseLinks getLinks() { + return links; + } + + public void setLinks(GetInvestigationResponseLinks links) { + this.links = links; + } + + /** + * 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 GetInvestigationResponse + */ + @JsonAnySetter + public GetInvestigationResponse 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 GetInvestigationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInvestigationResponse getInvestigationResponse = (GetInvestigationResponse) o; + return Objects.equals(this.data, getInvestigationResponse.data) + && Objects.equals(this.links, getInvestigationResponse.links) + && Objects.equals(this.additionalProperties, getInvestigationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvestigationResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).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/GetInvestigationResponseData.java b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseData.java new file mode 100644 index 00000000000..5b306309a57 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseData.java @@ -0,0 +1,211 @@ +/* + * 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.JsonCreator; +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; + +/** Data for the get investigation response. */ +@JsonPropertyOrder({ + GetInvestigationResponseData.JSON_PROPERTY_ATTRIBUTES, + GetInvestigationResponseData.JSON_PROPERTY_ID, + GetInvestigationResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetInvestigationResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GetInvestigationResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private InvestigationType type; + + public GetInvestigationResponseData() {} + + @JsonCreator + public GetInvestigationResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GetInvestigationResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InvestigationType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GetInvestigationResponseData attributes( + GetInvestigationResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the investigation. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetInvestigationResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GetInvestigationResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public GetInvestigationResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the investigation. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GetInvestigationResponseData type(InvestigationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for investigations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InvestigationType getType() { + return type; + } + + public void setType(InvestigationType 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. + */ + 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 GetInvestigationResponseData + */ + @JsonAnySetter + public GetInvestigationResponseData 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 GetInvestigationResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInvestigationResponseData getInvestigationResponseData = (GetInvestigationResponseData) o; + return Objects.equals(this.attributes, getInvestigationResponseData.attributes) + && Objects.equals(this.id, getInvestigationResponseData.id) + && Objects.equals(this.type, getInvestigationResponseData.type) + && Objects.equals( + this.additionalProperties, getInvestigationResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvestigationResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseDataAttributes.java new file mode 100644 index 00000000000..02133586a36 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseDataAttributes.java @@ -0,0 +1,217 @@ +/* + * 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.JsonCreator; +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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the investigation. */ +@JsonPropertyOrder({ + GetInvestigationResponseDataAttributes.JSON_PROPERTY_CONCLUSIONS, + GetInvestigationResponseDataAttributes.JSON_PROPERTY_STATUS, + GetInvestigationResponseDataAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetInvestigationResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONCLUSIONS = "conclusions"; + private List conclusions = new ArrayList<>(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public GetInvestigationResponseDataAttributes() {} + + @JsonCreator + public GetInvestigationResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CONCLUSIONS) + List conclusions, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.conclusions = conclusions; + this.status = status; + this.title = title; + } + + public GetInvestigationResponseDataAttributes conclusions( + List conclusions) { + this.conclusions = conclusions; + for (InvestigationConclusion item : conclusions) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GetInvestigationResponseDataAttributes addConclusionsItem( + InvestigationConclusion conclusionsItem) { + this.conclusions.add(conclusionsItem); + this.unparsed |= conclusionsItem.unparsed; + return this; + } + + /** + * The conclusions drawn from the investigation. + * + * @return conclusions + */ + @JsonProperty(JSON_PROPERTY_CONCLUSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getConclusions() { + return conclusions; + } + + public void setConclusions(List conclusions) { + this.conclusions = conclusions; + } + + public GetInvestigationResponseDataAttributes status(String status) { + this.status = status; + return this; + } + + /** + * The current status of the investigation. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public GetInvestigationResponseDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the investigation. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * 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 GetInvestigationResponseDataAttributes + */ + @JsonAnySetter + public GetInvestigationResponseDataAttributes 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 GetInvestigationResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInvestigationResponseDataAttributes getInvestigationResponseDataAttributes = + (GetInvestigationResponseDataAttributes) o; + return Objects.equals(this.conclusions, getInvestigationResponseDataAttributes.conclusions) + && Objects.equals(this.status, getInvestigationResponseDataAttributes.status) + && Objects.equals(this.title, getInvestigationResponseDataAttributes.title) + && Objects.equals( + this.additionalProperties, getInvestigationResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conclusions, status, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvestigationResponseDataAttributes {\n"); + sb.append(" conclusions: ").append(toIndentedString(conclusions)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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/GetInvestigationResponseLinks.java b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseLinks.java new file mode 100644 index 00000000000..c2cb621880e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseLinks.java @@ -0,0 +1,144 @@ +/* + * 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.JsonCreator; +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; + +/** Links related to the investigation. */ +@JsonPropertyOrder({GetInvestigationResponseLinks.JSON_PROPERTY_SELF}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetInvestigationResponseLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SELF = "self"; + private String self; + + public GetInvestigationResponseLinks() {} + + @JsonCreator + public GetInvestigationResponseLinks( + @JsonProperty(required = true, value = JSON_PROPERTY_SELF) String self) { + this.self = self; + } + + public GetInvestigationResponseLinks self(String self) { + this.self = self; + return this; + } + + /** + * The URL to the investigation in the Datadog app. + * + * @return self + */ + @JsonProperty(JSON_PROPERTY_SELF) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSelf() { + return self; + } + + public void setSelf(String self) { + this.self = self; + } + + /** + * 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 GetInvestigationResponseLinks + */ + @JsonAnySetter + public GetInvestigationResponseLinks 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 GetInvestigationResponseLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInvestigationResponseLinks getInvestigationResponseLinks = (GetInvestigationResponseLinks) o; + return Objects.equals(this.self, getInvestigationResponseLinks.self) + && Objects.equals( + this.additionalProperties, getInvestigationResponseLinks.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(self, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvestigationResponseLinks {\n"); + sb.append(" self: ").append(toIndentedString(self)).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/InvestigationConclusion.java b/src/main/java/com/datadog/api/client/v2/model/InvestigationConclusion.java new file mode 100644 index 00000000000..2b647b8dc79 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InvestigationConclusion.java @@ -0,0 +1,201 @@ +/* + * 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.JsonCreator; +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; + +/** A full explanation of the finding, including root cause analysis and supporting evidence. */ +@JsonPropertyOrder({ + InvestigationConclusion.JSON_PROPERTY_DESCRIPTION, + InvestigationConclusion.JSON_PROPERTY_SUMMARY, + InvestigationConclusion.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class InvestigationConclusion { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_SUMMARY = "summary"; + private String summary; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public InvestigationConclusion() {} + + @JsonCreator + public InvestigationConclusion( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_SUMMARY) String summary, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.description = description; + this.summary = summary; + this.title = title; + } + + public InvestigationConclusion description(String description) { + this.description = description; + return this; + } + + /** + * A full explanation of the finding, including root cause analysis and supporting evidence. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public InvestigationConclusion summary(String summary) { + this.summary = summary; + return this; + } + + /** + * A summary of the finding, including affected components and timeframe. + * + * @return summary + */ + @JsonProperty(JSON_PROPERTY_SUMMARY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public InvestigationConclusion title(String title) { + this.title = title; + return this; + } + + /** + * The title of the conclusion. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * 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 InvestigationConclusion + */ + @JsonAnySetter + public InvestigationConclusion 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 InvestigationConclusion object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvestigationConclusion investigationConclusion = (InvestigationConclusion) o; + return Objects.equals(this.description, investigationConclusion.description) + && Objects.equals(this.summary, investigationConclusion.summary) + && Objects.equals(this.title, investigationConclusion.title) + && Objects.equals(this.additionalProperties, investigationConclusion.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, summary, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvestigationConclusion {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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/InvestigationType.java b/src/main/java/com/datadog/api/client/v2/model/InvestigationType.java new file mode 100644 index 00000000000..dc92118e017 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InvestigationType.java @@ -0,0 +1,54 @@ +/* + * 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 resource type for investigations. */ +@JsonSerialize(using = InvestigationType.InvestigationTypeSerializer.class) +public class InvestigationType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("investigation")); + + public static final InvestigationType INVESTIGATION = new InvestigationType("investigation"); + + InvestigationType(String value) { + super(value, allowedValues); + } + + public static class InvestigationTypeSerializer extends StdSerializer { + public InvestigationTypeSerializer(Class t) { + super(t); + } + + public InvestigationTypeSerializer() { + this(null); + } + + @Override + public void serialize(InvestigationType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static InvestigationType fromValue(String value) { + return new InvestigationType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponse.java new file mode 100644 index 00000000000..24f94793b54 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponse.java @@ -0,0 +1,220 @@ +/* + * 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.JsonCreator; +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.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response for listing investigations. */ +@JsonPropertyOrder({ + ListInvestigationsResponse.JSON_PROPERTY_DATA, + ListInvestigationsResponse.JSON_PROPERTY_LINKS, + ListInvestigationsResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_LINKS = "links"; + private ListInvestigationsResponseLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private ListInvestigationsResponseMeta meta; + + public ListInvestigationsResponse() {} + + @JsonCreator + public ListInvestigationsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data, + @JsonProperty(required = true, value = JSON_PROPERTY_LINKS) + ListInvestigationsResponseLinks links, + @JsonProperty(required = true, value = JSON_PROPERTY_META) + ListInvestigationsResponseMeta meta) { + this.data = data; + this.links = links; + this.unparsed |= links.unparsed; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public ListInvestigationsResponse data(List data) { + this.data = data; + for (ListInvestigationsResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListInvestigationsResponse addDataItem(ListInvestigationsResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of investigations. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListInvestigationsResponse links(ListInvestigationsResponseLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Pagination links for the list investigations response. + * + * @return links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListInvestigationsResponseLinks getLinks() { + return links; + } + + public void setLinks(ListInvestigationsResponseLinks links) { + this.links = links; + } + + public ListInvestigationsResponse meta(ListInvestigationsResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for the list investigations response. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListInvestigationsResponseMeta getMeta() { + return meta; + } + + public void setMeta(ListInvestigationsResponseMeta meta) { + this.meta = meta; + } + + /** + * 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 ListInvestigationsResponse + */ + @JsonAnySetter + public ListInvestigationsResponse 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 ListInvestigationsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponse listInvestigationsResponse = (ListInvestigationsResponse) o; + return Objects.equals(this.data, listInvestigationsResponse.data) + && Objects.equals(this.links, listInvestigationsResponse.links) + && Objects.equals(this.meta, listInvestigationsResponse.meta) + && Objects.equals( + this.additionalProperties, listInvestigationsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).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/ListInvestigationsResponseData.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseData.java new file mode 100644 index 00000000000..4f8b9574669 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseData.java @@ -0,0 +1,212 @@ +/* + * 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.JsonCreator; +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; + +/** Data for an investigation list item. */ +@JsonPropertyOrder({ + ListInvestigationsResponseData.JSON_PROPERTY_ATTRIBUTES, + ListInvestigationsResponseData.JSON_PROPERTY_ID, + ListInvestigationsResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ListInvestigationsResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private InvestigationType type; + + public ListInvestigationsResponseData() {} + + @JsonCreator + public ListInvestigationsResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ListInvestigationsResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InvestigationType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ListInvestigationsResponseData attributes( + ListInvestigationsResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an investigation list item. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListInvestigationsResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ListInvestigationsResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public ListInvestigationsResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the investigation. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ListInvestigationsResponseData type(InvestigationType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for investigations. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InvestigationType getType() { + return type; + } + + public void setType(InvestigationType 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. + */ + 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 ListInvestigationsResponseData + */ + @JsonAnySetter + public ListInvestigationsResponseData 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 ListInvestigationsResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponseData listInvestigationsResponseData = + (ListInvestigationsResponseData) o; + return Objects.equals(this.attributes, listInvestigationsResponseData.attributes) + && Objects.equals(this.id, listInvestigationsResponseData.id) + && Objects.equals(this.type, listInvestigationsResponseData.type) + && Objects.equals( + this.additionalProperties, listInvestigationsResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseDataAttributes.java new file mode 100644 index 00000000000..ef3e1b048a5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseDataAttributes.java @@ -0,0 +1,176 @@ +/* + * 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.JsonCreator; +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; + +/** Attributes of an investigation list item. */ +@JsonPropertyOrder({ + ListInvestigationsResponseDataAttributes.JSON_PROPERTY_STATUS, + ListInvestigationsResponseDataAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public ListInvestigationsResponseDataAttributes() {} + + @JsonCreator + public ListInvestigationsResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.status = status; + this.title = title; + } + + public ListInvestigationsResponseDataAttributes status(String status) { + this.status = status; + return this; + } + + /** + * The current status of the investigation. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public ListInvestigationsResponseDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the investigation. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * 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 ListInvestigationsResponseDataAttributes + */ + @JsonAnySetter + public ListInvestigationsResponseDataAttributes 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 ListInvestigationsResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponseDataAttributes listInvestigationsResponseDataAttributes = + (ListInvestigationsResponseDataAttributes) o; + return Objects.equals(this.status, listInvestigationsResponseDataAttributes.status) + && Objects.equals(this.title, listInvestigationsResponseDataAttributes.title) + && Objects.equals( + this.additionalProperties, + listInvestigationsResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(status, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponseDataAttributes {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).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/ListInvestigationsResponseLinks.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseLinks.java new file mode 100644 index 00000000000..807088bff23 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseLinks.java @@ -0,0 +1,278 @@ +/* + * 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.JsonCreator; +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; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Pagination links for the list investigations response. */ +@JsonPropertyOrder({ + ListInvestigationsResponseLinks.JSON_PROPERTY_FIRST, + ListInvestigationsResponseLinks.JSON_PROPERTY_LAST, + ListInvestigationsResponseLinks.JSON_PROPERTY_NEXT, + ListInvestigationsResponseLinks.JSON_PROPERTY_PREV, + ListInvestigationsResponseLinks.JSON_PROPERTY_SELF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponseLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST = "first"; + private String first; + + public static final String JSON_PROPERTY_LAST = "last"; + private JsonNullable last = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NEXT = "next"; + private String next; + + public static final String JSON_PROPERTY_PREV = "prev"; + private JsonNullable prev = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SELF = "self"; + private String self; + + public ListInvestigationsResponseLinks() {} + + @JsonCreator + public ListInvestigationsResponseLinks( + @JsonProperty(required = true, value = JSON_PROPERTY_FIRST) String first, + @JsonProperty(required = true, value = JSON_PROPERTY_NEXT) String next, + @JsonProperty(required = true, value = JSON_PROPERTY_SELF) String self) { + this.first = first; + this.next = next; + this.self = self; + } + + public ListInvestigationsResponseLinks first(String first) { + this.first = first; + return this; + } + + /** + * Link to the first page. + * + * @return first + */ + @JsonProperty(JSON_PROPERTY_FIRST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFirst() { + return first; + } + + public void setFirst(String first) { + this.first = first; + } + + public ListInvestigationsResponseLinks last(String last) { + this.last = JsonNullable.of(last); + return this; + } + + /** + * Link to the last page. + * + * @return last + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getLast() { + return last.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLast_JsonNullable() { + return last; + } + + @JsonProperty(JSON_PROPERTY_LAST) + public void setLast_JsonNullable(JsonNullable last) { + this.last = last; + } + + public void setLast(String last) { + this.last = JsonNullable.of(last); + } + + public ListInvestigationsResponseLinks next(String next) { + this.next = next; + return this; + } + + /** + * Link to the next page. + * + * @return next + */ + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + public ListInvestigationsResponseLinks prev(String prev) { + this.prev = JsonNullable.of(prev); + return this; + } + + /** + * Link to the previous page. + * + * @return prev + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrev() { + return prev.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrev_JsonNullable() { + return prev; + } + + @JsonProperty(JSON_PROPERTY_PREV) + public void setPrev_JsonNullable(JsonNullable prev) { + this.prev = prev; + } + + public void setPrev(String prev) { + this.prev = JsonNullable.of(prev); + } + + public ListInvestigationsResponseLinks self(String self) { + this.self = self; + return this; + } + + /** + * Link to the current page. + * + * @return self + */ + @JsonProperty(JSON_PROPERTY_SELF) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSelf() { + return self; + } + + public void setSelf(String self) { + this.self = self; + } + + /** + * 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 ListInvestigationsResponseLinks + */ + @JsonAnySetter + public ListInvestigationsResponseLinks 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 ListInvestigationsResponseLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponseLinks listInvestigationsResponseLinks = + (ListInvestigationsResponseLinks) o; + return Objects.equals(this.first, listInvestigationsResponseLinks.first) + && Objects.equals(this.last, listInvestigationsResponseLinks.last) + && Objects.equals(this.next, listInvestigationsResponseLinks.next) + && Objects.equals(this.prev, listInvestigationsResponseLinks.prev) + && Objects.equals(this.self, listInvestigationsResponseLinks.self) + && Objects.equals( + this.additionalProperties, listInvestigationsResponseLinks.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(first, last, next, prev, self, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponseLinks {\n"); + sb.append(" first: ").append(toIndentedString(first)).append("\n"); + sb.append(" last: ").append(toIndentedString(last)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" prev: ").append(toIndentedString(prev)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).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/ListInvestigationsResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMeta.java new file mode 100644 index 00000000000..1a2a8d30c2d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMeta.java @@ -0,0 +1,148 @@ +/* + * 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.JsonCreator; +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; + +/** Metadata for the list investigations response. */ +@JsonPropertyOrder({ListInvestigationsResponseMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private ListInvestigationsResponseMetaPage page; + + public ListInvestigationsResponseMeta() {} + + @JsonCreator + public ListInvestigationsResponseMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_PAGE) + ListInvestigationsResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + } + + public ListInvestigationsResponseMeta page(ListInvestigationsResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination metadata. + * + * @return page + */ + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListInvestigationsResponseMetaPage getPage() { + return page; + } + + public void setPage(ListInvestigationsResponseMetaPage page) { + this.page = page; + } + + /** + * 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 ListInvestigationsResponseMeta + */ + @JsonAnySetter + public ListInvestigationsResponseMeta 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 ListInvestigationsResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponseMeta listInvestigationsResponseMeta = + (ListInvestigationsResponseMeta) o; + return Objects.equals(this.page, listInvestigationsResponseMeta.page) + && Objects.equals( + this.additionalProperties, listInvestigationsResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponseMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).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/ListInvestigationsResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMetaPage.java new file mode 100644 index 00000000000..6cd4b0f52fe --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMetaPage.java @@ -0,0 +1,203 @@ +/* + * 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.JsonCreator; +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; + +/** Pagination metadata. */ +@JsonPropertyOrder({ + ListInvestigationsResponseMetaPage.JSON_PROPERTY_LIMIT, + ListInvestigationsResponseMetaPage.JSON_PROPERTY_OFFSET, + ListInvestigationsResponseMetaPage.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponseMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_OFFSET = "offset"; + private Long offset; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public ListInvestigationsResponseMetaPage() {} + + @JsonCreator + public ListInvestigationsResponseMetaPage( + @JsonProperty(required = true, value = JSON_PROPERTY_LIMIT) Long limit, + @JsonProperty(required = true, value = JSON_PROPERTY_OFFSET) Long offset, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL) Long total) { + this.limit = limit; + this.offset = offset; + this.total = total; + } + + public ListInvestigationsResponseMetaPage limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of results per page. + * + * @return limit + */ + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getLimit() { + return limit; + } + + public void setLimit(Long limit) { + this.limit = limit; + } + + public ListInvestigationsResponseMetaPage offset(Long offset) { + this.offset = offset; + return this; + } + + /** + * Offset of the current page. + * + * @return offset + */ + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getOffset() { + return offset; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public ListInvestigationsResponseMetaPage total(Long total) { + this.total = total; + return this; + } + + /** + * Total number of investigations. + * + * @return total + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + /** + * 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 ListInvestigationsResponseMetaPage + */ + @JsonAnySetter + public ListInvestigationsResponseMetaPage 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 ListInvestigationsResponseMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponseMetaPage listInvestigationsResponseMetaPage = + (ListInvestigationsResponseMetaPage) o; + return Objects.equals(this.limit, listInvestigationsResponseMetaPage.limit) + && Objects.equals(this.offset, listInvestigationsResponseMetaPage.offset) + && Objects.equals(this.total, listInvestigationsResponseMetaPage.total) + && Objects.equals( + this.additionalProperties, listInvestigationsResponseMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(limit, offset, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponseMetaPage {\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).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/MonitorAlertTriggerAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTriggerAttributes.java new file mode 100644 index 00000000000..7696311016d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTriggerAttributes.java @@ -0,0 +1,202 @@ +/* + * 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.JsonCreator; +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; + +/** Attributes for a monitor alert trigger. */ +@JsonPropertyOrder({ + MonitorAlertTriggerAttributes.JSON_PROPERTY_EVENT_ID, + MonitorAlertTriggerAttributes.JSON_PROPERTY_EVENT_TS, + MonitorAlertTriggerAttributes.JSON_PROPERTY_MONITOR_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MonitorAlertTriggerAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EVENT_ID = "event_id"; + private String eventId; + + public static final String JSON_PROPERTY_EVENT_TS = "event_ts"; + private Long eventTs; + + public static final String JSON_PROPERTY_MONITOR_ID = "monitor_id"; + private Long monitorId; + + public MonitorAlertTriggerAttributes() {} + + @JsonCreator + public MonitorAlertTriggerAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_EVENT_ID) String eventId, + @JsonProperty(required = true, value = JSON_PROPERTY_EVENT_TS) Long eventTs, + @JsonProperty(required = true, value = JSON_PROPERTY_MONITOR_ID) Long monitorId) { + this.eventId = eventId; + this.eventTs = eventTs; + this.monitorId = monitorId; + } + + public MonitorAlertTriggerAttributes eventId(String eventId) { + this.eventId = eventId; + return this; + } + + /** + * The event ID associated with the monitor alert. + * + * @return eventId + */ + @JsonProperty(JSON_PROPERTY_EVENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public MonitorAlertTriggerAttributes eventTs(Long eventTs) { + this.eventTs = eventTs; + return this; + } + + /** + * The timestamp of the event in Unix milliseconds. + * + * @return eventTs + */ + @JsonProperty(JSON_PROPERTY_EVENT_TS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getEventTs() { + return eventTs; + } + + public void setEventTs(Long eventTs) { + this.eventTs = eventTs; + } + + public MonitorAlertTriggerAttributes monitorId(Long monitorId) { + this.monitorId = monitorId; + return this; + } + + /** + * The monitor ID that triggered the alert. + * + * @return monitorId + */ + @JsonProperty(JSON_PROPERTY_MONITOR_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMonitorId() { + return monitorId; + } + + public void setMonitorId(Long monitorId) { + this.monitorId = monitorId; + } + + /** + * 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 MonitorAlertTriggerAttributes + */ + @JsonAnySetter + public MonitorAlertTriggerAttributes 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 MonitorAlertTriggerAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MonitorAlertTriggerAttributes monitorAlertTriggerAttributes = (MonitorAlertTriggerAttributes) o; + return Objects.equals(this.eventId, monitorAlertTriggerAttributes.eventId) + && Objects.equals(this.eventTs, monitorAlertTriggerAttributes.eventTs) + && Objects.equals(this.monitorId, monitorAlertTriggerAttributes.monitorId) + && Objects.equals( + this.additionalProperties, monitorAlertTriggerAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(eventId, eventTs, monitorId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MonitorAlertTriggerAttributes {\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" eventTs: ").append(toIndentedString(eventTs)).append("\n"); + sb.append(" monitorId: ").append(toIndentedString(monitorId)).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/TriggerAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java new file mode 100644 index 00000000000..26d635731a9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java @@ -0,0 +1,183 @@ +/* + * 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.JsonCreator; +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; + +/** The trigger definition for starting an investigation. */ +@JsonPropertyOrder({ + TriggerAttributes.JSON_PROPERTY_MONITOR_ALERT_TRIGGER, + TriggerAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MONITOR_ALERT_TRIGGER = "monitor_alert_trigger"; + private MonitorAlertTriggerAttributes monitorAlertTrigger; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TriggerType type; + + public TriggerAttributes() {} + + @JsonCreator + public TriggerAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_MONITOR_ALERT_TRIGGER) + MonitorAlertTriggerAttributes monitorAlertTrigger, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TriggerType type) { + this.monitorAlertTrigger = monitorAlertTrigger; + this.unparsed |= monitorAlertTrigger.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TriggerAttributes monitorAlertTrigger(MonitorAlertTriggerAttributes monitorAlertTrigger) { + this.monitorAlertTrigger = monitorAlertTrigger; + this.unparsed |= monitorAlertTrigger.unparsed; + return this; + } + + /** + * Attributes for a monitor alert trigger. + * + * @return monitorAlertTrigger + */ + @JsonProperty(JSON_PROPERTY_MONITOR_ALERT_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MonitorAlertTriggerAttributes getMonitorAlertTrigger() { + return monitorAlertTrigger; + } + + public void setMonitorAlertTrigger(MonitorAlertTriggerAttributes monitorAlertTrigger) { + this.monitorAlertTrigger = monitorAlertTrigger; + } + + public TriggerAttributes type(TriggerType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of trigger for the investigation. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerType getType() { + return type; + } + + public void setType(TriggerType 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. + */ + 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 TriggerAttributes + */ + @JsonAnySetter + public TriggerAttributes 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 TriggerAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerAttributes triggerAttributes = (TriggerAttributes) o; + return Objects.equals(this.monitorAlertTrigger, triggerAttributes.monitorAlertTrigger) + && Objects.equals(this.type, triggerAttributes.type) + && Objects.equals(this.additionalProperties, triggerAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(monitorAlertTrigger, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerAttributes {\n"); + sb.append(" monitorAlertTrigger: ") + .append(toIndentedString(monitorAlertTrigger)) + .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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequest.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequest.java new file mode 100644 index 00000000000..ffa584c06a3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequest.java @@ -0,0 +1,147 @@ +/* + * 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.JsonCreator; +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; + +/** Request to trigger a new investigation. */ +@JsonPropertyOrder({TriggerInvestigationRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerInvestigationRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TriggerInvestigationRequestData data; + + public TriggerInvestigationRequest() {} + + @JsonCreator + public TriggerInvestigationRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TriggerInvestigationRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TriggerInvestigationRequest data(TriggerInvestigationRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for the trigger investigation request. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerInvestigationRequestData getData() { + return data; + } + + public void setData(TriggerInvestigationRequestData data) { + this.data = data; + } + + /** + * 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 TriggerInvestigationRequest + */ + @JsonAnySetter + public TriggerInvestigationRequest 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 TriggerInvestigationRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerInvestigationRequest triggerInvestigationRequest = (TriggerInvestigationRequest) o; + return Objects.equals(this.data, triggerInvestigationRequest.data) + && Objects.equals( + this.additionalProperties, triggerInvestigationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerInvestigationRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/TriggerInvestigationRequestData.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestData.java new file mode 100644 index 00000000000..37047aa49e8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestData.java @@ -0,0 +1,185 @@ +/* + * 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.JsonCreator; +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; + +/** Data for the trigger investigation request. */ +@JsonPropertyOrder({ + TriggerInvestigationRequestData.JSON_PROPERTY_ATTRIBUTES, + TriggerInvestigationRequestData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerInvestigationRequestData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TriggerInvestigationRequestDataAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TriggerInvestigationRequestType type; + + public TriggerInvestigationRequestData() {} + + @JsonCreator + public TriggerInvestigationRequestData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TriggerInvestigationRequestDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TriggerInvestigationRequestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TriggerInvestigationRequestData attributes( + TriggerInvestigationRequestDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for the trigger investigation request. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerInvestigationRequestDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TriggerInvestigationRequestDataAttributes attributes) { + this.attributes = attributes; + } + + public TriggerInvestigationRequestData type(TriggerInvestigationRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for trigger investigation requests. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerInvestigationRequestType getType() { + return type; + } + + public void setType(TriggerInvestigationRequestType 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. + */ + 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 TriggerInvestigationRequestData + */ + @JsonAnySetter + public TriggerInvestigationRequestData 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 TriggerInvestigationRequestData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerInvestigationRequestData triggerInvestigationRequestData = + (TriggerInvestigationRequestData) o; + return Objects.equals(this.attributes, triggerInvestigationRequestData.attributes) + && Objects.equals(this.type, triggerInvestigationRequestData.type) + && Objects.equals( + this.additionalProperties, triggerInvestigationRequestData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerInvestigationRequestData {\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"); + 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/TriggerInvestigationRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestDataAttributes.java new file mode 100644 index 00000000000..8916a0aa9cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestDataAttributes.java @@ -0,0 +1,148 @@ +/* + * 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.JsonCreator; +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; + +/** Attributes for the trigger investigation request. */ +@JsonPropertyOrder({TriggerInvestigationRequestDataAttributes.JSON_PROPERTY_TRIGGER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerInvestigationRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private TriggerAttributes trigger; + + public TriggerInvestigationRequestDataAttributes() {} + + @JsonCreator + public TriggerInvestigationRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TRIGGER) TriggerAttributes trigger) { + this.trigger = trigger; + this.unparsed |= trigger.unparsed; + } + + public TriggerInvestigationRequestDataAttributes trigger(TriggerAttributes trigger) { + this.trigger = trigger; + this.unparsed |= trigger.unparsed; + return this; + } + + /** + * The trigger definition for starting an investigation. + * + * @return trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerAttributes getTrigger() { + return trigger; + } + + public void setTrigger(TriggerAttributes trigger) { + this.trigger = trigger; + } + + /** + * 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 TriggerInvestigationRequestDataAttributes + */ + @JsonAnySetter + public TriggerInvestigationRequestDataAttributes 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 TriggerInvestigationRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerInvestigationRequestDataAttributes triggerInvestigationRequestDataAttributes = + (TriggerInvestigationRequestDataAttributes) o; + return Objects.equals(this.trigger, triggerInvestigationRequestDataAttributes.trigger) + && Objects.equals( + this.additionalProperties, + triggerInvestigationRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(trigger, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerInvestigationRequestDataAttributes {\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).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/TriggerInvestigationRequestType.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestType.java new file mode 100644 index 00000000000..2ed674d9139 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestType.java @@ -0,0 +1,58 @@ +/* + * 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 resource type for trigger investigation requests. */ +@JsonSerialize( + using = TriggerInvestigationRequestType.TriggerInvestigationRequestTypeSerializer.class) +public class TriggerInvestigationRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("trigger_investigation_request")); + + public static final TriggerInvestigationRequestType TRIGGER_INVESTIGATION_REQUEST = + new TriggerInvestigationRequestType("trigger_investigation_request"); + + TriggerInvestigationRequestType(String value) { + super(value, allowedValues); + } + + public static class TriggerInvestigationRequestTypeSerializer + extends StdSerializer { + public TriggerInvestigationRequestTypeSerializer(Class t) { + super(t); + } + + public TriggerInvestigationRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TriggerInvestigationRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TriggerInvestigationRequestType fromValue(String value) { + return new TriggerInvestigationRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponse.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponse.java new file mode 100644 index 00000000000..5d3de60086d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponse.java @@ -0,0 +1,147 @@ +/* + * 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.JsonCreator; +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; + +/** Response after triggering an investigation. */ +@JsonPropertyOrder({TriggerInvestigationResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerInvestigationResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private TriggerInvestigationResponseData data; + + public TriggerInvestigationResponse() {} + + @JsonCreator + public TriggerInvestigationResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TriggerInvestigationResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TriggerInvestigationResponse data(TriggerInvestigationResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Data for the trigger investigation response. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerInvestigationResponseData getData() { + return data; + } + + public void setData(TriggerInvestigationResponseData data) { + this.data = data; + } + + /** + * 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 TriggerInvestigationResponse + */ + @JsonAnySetter + public TriggerInvestigationResponse 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 TriggerInvestigationResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerInvestigationResponse triggerInvestigationResponse = (TriggerInvestigationResponse) o; + return Objects.equals(this.data, triggerInvestigationResponse.data) + && Objects.equals( + this.additionalProperties, triggerInvestigationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerInvestigationResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/TriggerInvestigationResponseData.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseData.java new file mode 100644 index 00000000000..6b5ca0ef6a4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseData.java @@ -0,0 +1,213 @@ +/* + * 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.JsonCreator; +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; + +/** Data for the trigger investigation response. */ +@JsonPropertyOrder({ + TriggerInvestigationResponseData.JSON_PROPERTY_ATTRIBUTES, + TriggerInvestigationResponseData.JSON_PROPERTY_ID, + TriggerInvestigationResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerInvestigationResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TriggerInvestigationResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TriggerInvestigationResponseType type; + + public TriggerInvestigationResponseData() {} + + @JsonCreator + public TriggerInvestigationResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TriggerInvestigationResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TriggerInvestigationResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TriggerInvestigationResponseData attributes( + TriggerInvestigationResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for the trigger investigation response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerInvestigationResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TriggerInvestigationResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public TriggerInvestigationResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the trigger response. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TriggerInvestigationResponseData type(TriggerInvestigationResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for trigger investigation responses. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerInvestigationResponseType getType() { + return type; + } + + public void setType(TriggerInvestigationResponseType 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. + */ + 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 TriggerInvestigationResponseData + */ + @JsonAnySetter + public TriggerInvestigationResponseData 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 TriggerInvestigationResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerInvestigationResponseData triggerInvestigationResponseData = + (TriggerInvestigationResponseData) o; + return Objects.equals(this.attributes, triggerInvestigationResponseData.attributes) + && Objects.equals(this.id, triggerInvestigationResponseData.id) + && Objects.equals(this.type, triggerInvestigationResponseData.type) + && Objects.equals( + this.additionalProperties, triggerInvestigationResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerInvestigationResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\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 "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseDataAttributes.java new file mode 100644 index 00000000000..1503fd60036 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseDataAttributes.java @@ -0,0 +1,149 @@ +/* + * 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.JsonCreator; +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; + +/** Attributes for the trigger investigation response. */ +@JsonPropertyOrder({TriggerInvestigationResponseDataAttributes.JSON_PROPERTY_INVESTIGATION_ID}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerInvestigationResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_INVESTIGATION_ID = "investigation_id"; + private String investigationId; + + public TriggerInvestigationResponseDataAttributes() {} + + @JsonCreator + public TriggerInvestigationResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_INVESTIGATION_ID) + String investigationId) { + this.investigationId = investigationId; + } + + public TriggerInvestigationResponseDataAttributes investigationId(String investigationId) { + this.investigationId = investigationId; + return this; + } + + /** + * The ID of the investigation that was created. + * + * @return investigationId + */ + @JsonProperty(JSON_PROPERTY_INVESTIGATION_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getInvestigationId() { + return investigationId; + } + + public void setInvestigationId(String investigationId) { + this.investigationId = investigationId; + } + + /** + * 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 TriggerInvestigationResponseDataAttributes + */ + @JsonAnySetter + public TriggerInvestigationResponseDataAttributes 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 TriggerInvestigationResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerInvestigationResponseDataAttributes triggerInvestigationResponseDataAttributes = + (TriggerInvestigationResponseDataAttributes) o; + return Objects.equals( + this.investigationId, triggerInvestigationResponseDataAttributes.investigationId) + && Objects.equals( + this.additionalProperties, + triggerInvestigationResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(investigationId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerInvestigationResponseDataAttributes {\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).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/TriggerInvestigationResponseType.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseType.java new file mode 100644 index 00000000000..d373b11c2be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseType.java @@ -0,0 +1,58 @@ +/* + * 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 resource type for trigger investigation responses. */ +@JsonSerialize( + using = TriggerInvestigationResponseType.TriggerInvestigationResponseTypeSerializer.class) +public class TriggerInvestigationResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("trigger_investigation_response")); + + public static final TriggerInvestigationResponseType TRIGGER_INVESTIGATION_RESPONSE = + new TriggerInvestigationResponseType("trigger_investigation_response"); + + TriggerInvestigationResponseType(String value) { + super(value, allowedValues); + } + + public static class TriggerInvestigationResponseTypeSerializer + extends StdSerializer { + public TriggerInvestigationResponseTypeSerializer(Class t) { + super(t); + } + + public TriggerInvestigationResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TriggerInvestigationResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TriggerInvestigationResponseType fromValue(String value) { + return new TriggerInvestigationResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerType.java b/src/main/java/com/datadog/api/client/v2/model/TriggerType.java new file mode 100644 index 00000000000..ad95927b728 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerType.java @@ -0,0 +1,54 @@ +/* + * 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 type of trigger for the investigation. */ +@JsonSerialize(using = TriggerType.TriggerTypeSerializer.class) +public class TriggerType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("monitor_alert_trigger")); + + public static final TriggerType MONITOR_ALERT_TRIGGER = new TriggerType("monitor_alert_trigger"); + + TriggerType(String value) { + super(value, allowedValues); + } + + public static class TriggerTypeSerializer extends StdSerializer { + public TriggerTypeSerializer(Class t) { + super(t); + } + + public TriggerTypeSerializer() { + this(null); + } + + @Override + public void serialize(TriggerType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TriggerType fromValue(String value) { + return new TriggerType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature b/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature new file mode 100644 index 00000000000..bc5ec941d8f --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature @@ -0,0 +1,69 @@ +@endpoint(bits-ai) @endpoint(bits-ai-v2) +Feature: Bits AI + Use the Bits AI endpoints to retrieve AI-powered investigations. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "BitsAI" API + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI investigation returns "Bad Request" response + Given operation "GetInvestigation" enabled + And new "GetInvestigation" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI investigation returns "Not Found" response + Given operation "GetInvestigation" enabled + And new "GetInvestigation" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI investigation returns "OK" response + Given operation "GetInvestigation" enabled + And new "GetInvestigation" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bits-ai + Scenario: List Bits AI investigations returns "Bad Request" response + Given operation "ListInvestigations" enabled + And new "ListInvestigations" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bits-ai + Scenario: List Bits AI investigations returns "OK" response + Given operation "ListInvestigations" enabled + And new "ListInvestigations" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bits-ai @with-pagination + Scenario: List Bits AI investigations returns "OK" response with pagination + Given operation "ListInvestigations" enabled + And new "ListInvestigations" request + When the request with pagination is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bits-ai + Scenario: Trigger a Bits AI investigation returns "Bad Request" response + Given operation "TriggerInvestigation" enabled + And new "TriggerInvestigation" request + And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bits-ai + Scenario: Trigger a Bits AI investigation returns "OK" response + Given operation "TriggerInvestigation" enabled + And new "TriggerInvestigation" request + And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index 1f11ffb7e77..f1934b08c4c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -650,6 +650,24 @@ "type": "idempotent" } }, + "ListInvestigations": { + "tag": "Bits AI", + "undo": { + "type": "safe" + } + }, + "TriggerInvestigation": { + "tag": "Bits AI", + "undo": { + "type": "unsafe" + } + }, + "GetInvestigation": { + "tag": "Bits AI", + "undo": { + "type": "safe" + } + }, "SearchCases": { "tag": "Case Management", "undo": {