diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 6325ee4e374..87d4fa2888c 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -6314,6 +6314,416 @@ components: type: string x-enum-varnames: - AGENT_HEALTH_ISSUES + AgentHealthIssueAttributes: + description: Attributes of an open Agent Health issue. + example: + category: configuration + description: The Agent configuration file contains an invalid value. + first_seen_at: "2026-11-01T10:00:00Z" + issue_name: Invalid Config + issue_type: invalid_config + resource_id: my-hostname + resource_kind: host + resource_type: host + severity: high + state: open + tags: + - env:prod + title: Invalid Agent configuration + updated_at: "2026-11-09T08:00:00Z" + properties: + category: + description: The category of the issue, such as `configuration`. Omitted when not set. + example: configuration + type: string + description: + description: The description of the issue. Omitted when empty. + example: The Agent configuration file contains an invalid value. + type: string + first_seen_at: + description: The time the issue was first seen, in RFC 3339 format. Omitted when empty. + example: "2026-11-01T10:00:00Z" + format: date-time + type: string + issue_name: + description: The human-readable name of the issue. + example: Invalid Config + type: string + issue_type: + description: The machine-readable type of the issue. + example: invalid_config + type: string + resource_id: + description: >- + The identifier of the affected resource, interpreted according to `resource_kind`: hostname for `host`, DaemonSet UID for `deployment` (node Agent), cluster UUID for `cluster`, hostname of the host running the Cluster Agent for `cluster_agent`, or OpenTelemetry collector ID for `otel`. + example: my-hostname + type: string + resource_kind: + description: >- + The kind of affected resource. Known values are `host`, `deployment`, `cluster`, `cluster_agent`, and `otel`. + example: host + type: string + resource_type: + description: The type of the affected resource. Omitted when empty. + example: host + type: string + severity: + description: The severity of the issue. Known values are `low`, `medium`, `high`, and `unknown`. + example: high + type: string + state: + description: The state of the issue. Only issues with state `open` are returned. + example: open + type: string + tags: + $ref: "#/components/schemas/AgentHealthIssueTags" + title: + description: The title of the issue. Omitted when empty. + example: Invalid Agent configuration + type: string + updated_at: + description: The time the issue was last updated, in RFC 3339 format. Omitted when empty. + example: "2026-11-09T08:00:00Z" + format: date-time + type: string + required: + - issue_type + - issue_name + - severity + - state + - resource_kind + - resource_id + type: object + AgentHealthIssueData: + description: An open Agent Health issue. + example: + attributes: + category: configuration + description: The Agent configuration file contains an invalid value. + first_seen_at: "2026-11-01T10:00:00Z" + issue_name: Invalid Config + issue_type: invalid_config + resource_id: my-hostname + resource_kind: host + resource_type: host + severity: high + state: open + tags: + - env:prod + title: Invalid Agent configuration + updated_at: "2026-11-09T08:00:00Z" + id: invalid-config:4828e7d6c704c4a3 + type: agent_health_issues + properties: + attributes: + $ref: "#/components/schemas/AgentHealthIssueAttributes" + id: + description: The unique identifier of the issue. + example: invalid-config:4828e7d6c704c4a3 + type: string + type: + $ref: "#/components/schemas/AgentHealthIssueResourceType" + required: + - id + - type + - attributes + type: object + AgentHealthIssueDataArray: + description: The open Agent Health issues on this page. + example: + - attributes: + category: configuration + description: The Agent configuration file contains an invalid value. + first_seen_at: "2026-11-01T10:00:00Z" + issue_name: Invalid Config + issue_type: invalid_config + resource_id: my-hostname + resource_kind: host + resource_type: host + severity: high + state: open + tags: + - env:prod + title: Invalid Agent configuration + updated_at: "2026-11-09T08:00:00Z" + id: invalid-config:4828e7d6c704c4a3 + type: agent_health_issues + items: + $ref: "#/components/schemas/AgentHealthIssueData" + type: array + AgentHealthIssueDetailAttributes: + description: Attributes of an open Agent Health issue, including available remediation. + example: + category: configuration + description: The Agent configuration file contains an invalid value. + first_seen_at: "2026-11-01T10:00:00Z" + issue_name: Invalid Config + issue_type: invalid_config + remediation: + script: + content: "..." + filename: fix.sh + language: bash + language_version: "5" + requires_root: true + steps: + - order: 1 + text: Open datadog.yaml + summary: Fix the invalid configuration value. + resource_id: my-hostname + resource_kind: host + resource_type: host + severity: high + state: open + tags: + - env:prod + title: Invalid Agent configuration + updated_at: "2026-11-09T08:00:00Z" + properties: + category: + description: The category of the issue, such as `configuration`. Omitted when not set. + example: configuration + type: string + description: + description: The description of the issue. Omitted when empty. + example: The Agent configuration file contains an invalid value. + type: string + first_seen_at: + description: The time the issue was first seen, in RFC 3339 format. Omitted when empty. + example: "2026-11-01T10:00:00Z" + format: date-time + type: string + issue_name: + description: The human-readable name of the issue. + example: Invalid Config + type: string + issue_type: + description: The machine-readable type of the issue. + example: invalid_config + type: string + remediation: + $ref: "#/components/schemas/AgentHealthRemediation" + resource_id: + description: >- + The identifier of the affected resource, interpreted according to `resource_kind`: hostname for `host`, DaemonSet UID for `deployment` (node Agent), cluster UUID for `cluster`, hostname of the host running the Cluster Agent for `cluster_agent`, or OpenTelemetry collector ID for `otel`. + example: my-hostname + type: string + resource_kind: + description: >- + The kind of affected resource. Known values are `host`, `deployment`, `cluster`, `cluster_agent`, and `otel`. + example: host + type: string + resource_type: + description: The type of the affected resource. Omitted when empty. + example: host + type: string + severity: + description: The severity of the issue. Known values are `low`, `medium`, `high`, and `unknown`. + example: high + type: string + state: + description: The state of the issue. Only issues with state `open` are returned. + example: open + type: string + tags: + $ref: "#/components/schemas/AgentHealthIssueTags" + title: + description: The title of the issue. Omitted when empty. + example: Invalid Agent configuration + type: string + updated_at: + description: The time the issue was last updated, in RFC 3339 format. Omitted when empty. + example: "2026-11-09T08:00:00Z" + format: date-time + type: string + required: + - issue_type + - issue_name + - severity + - state + - resource_kind + - resource_id + type: object + AgentHealthIssueDetailData: + description: An open Agent Health issue with available remediation. + example: + attributes: + category: configuration + description: The Agent configuration file contains an invalid value. + first_seen_at: "2026-11-01T10:00:00Z" + issue_name: Invalid Config + issue_type: invalid_config + remediation: + script: + content: "..." + filename: fix.sh + language: bash + language_version: "5" + requires_root: true + steps: + - order: 1 + text: Open datadog.yaml + summary: Fix the invalid configuration value. + resource_id: my-hostname + resource_kind: host + resource_type: host + severity: high + state: open + tags: + - env:prod + title: Invalid Agent configuration + updated_at: "2026-11-09T08:00:00Z" + id: invalid-config:4828e7d6c704c4a3 + type: agent_health_issues + properties: + attributes: + $ref: "#/components/schemas/AgentHealthIssueDetailAttributes" + id: + description: The unique identifier of the issue. + example: invalid-config:4828e7d6c704c4a3 + type: string + type: + $ref: "#/components/schemas/AgentHealthIssueResourceType" + required: + - id + - type + - attributes + type: object + AgentHealthIssueResourceType: + description: The Agent Health issue resource type. + enum: + - agent_health_issues + example: agent_health_issues + type: string + x-enum-varnames: + - AGENT_HEALTH_ISSUES + AgentHealthIssueResponse: + description: A response containing an open Agent Health issue and available remediation. + properties: + data: + $ref: "#/components/schemas/AgentHealthIssueDetailData" + required: + - data + type: object + AgentHealthIssueTags: + description: Tags associated with the issue. Omitted when empty. + example: + - env:prod + items: + description: A tag associated with the issue. + type: string + type: array + AgentHealthIssuesResponse: + description: A paginated response containing open Agent Health issues. + properties: + data: + $ref: "#/components/schemas/AgentHealthIssueDataArray" + meta: + $ref: "#/components/schemas/AgentHealthIssuesResponseMeta" + required: + - data + - meta + type: object + AgentHealthIssuesResponseMeta: + description: Pagination metadata for the matching Agent Health issues. + example: + page: + total_count: 3 + total_filtered_count: 1 + properties: + page: + $ref: "#/components/schemas/AgentHealthIssuesResponsePage" + required: + - page + type: object + AgentHealthIssuesResponsePage: + description: Pagination counts for the Agent Health issues. + example: + total_count: 3 + total_filtered_count: 1 + properties: + total_count: + description: The total number of open issues in the organization, ignoring filters. + example: 3 + format: int64 + type: integer + total_filtered_count: + description: The total number of open issues matching the filters, across all pages. + example: 1 + format: int64 + type: integer + required: + - total_count + - total_filtered_count + type: object + AgentHealthRemediation: + description: Remediation for the issue. Omitted when no remediation is available. + example: + script: + content: "..." + filename: fix.sh + language: bash + language_version: "5" + requires_root: true + steps: + - order: 1 + text: Open datadog.yaml + summary: Fix the invalid configuration value. + properties: + script: + $ref: "#/components/schemas/AgentHealthRemediationScript" + steps: + $ref: "#/components/schemas/AgentHealthRemediationSteps" + summary: + description: A summary of how to remediate the issue. + example: Fix the invalid configuration value. + type: string + type: object + AgentHealthRemediationScript: + description: A script that can be used to remediate the issue. + properties: + content: + description: The content of the script. + example: "..." + type: string + filename: + description: The filename of the script. + example: fix.sh + type: string + language: + description: The language of the script. + example: bash + type: string + language_version: + description: The language version used by the script. + example: "5" + type: string + requires_root: + description: Whether the script requires root privileges. + example: true + type: boolean + type: object + AgentHealthRemediationStep: + description: A step to remediate the issue. + properties: + order: + description: The order in which to perform the step. + example: 1 + format: int64 + type: integer + text: + description: The instructions for the step. + example: Open datadog.yaml + type: string + type: object + AgentHealthRemediationSteps: + description: Steps to remediate the issue. + example: + - order: 1 + text: Open datadog.yaml + items: + $ref: "#/components/schemas/AgentHealthRemediationStep" + type: array AgentTrigger: description: "Trigger a workflow from an agent via the MCP execute tool. Workflow can be executed from Bits Chat, Bits Agent Builder, Claude Code, Codex, Cursor, and any other coding agent using the Datadog MCP." properties: @@ -157232,6 +157642,263 @@ paths: summary: List active Agent Health issues tags: - Agent Health + /api/v2/agenthealth/issues: + get: + description: |- + List Agent Health issues across your organization. Only open issues are returned. + Returns `403` if you lack the `hosts_read` permission. + + Results use a stable order: severity rank (`high`, `medium`, `low`, then other values), + then `first_seen_at` descending with missing timestamps last, then issue ID ascending. + Use `page[size]` and the zero-based `page[number]` to paginate. Invalid page values + return a `400` JSON:API error response. `meta.page.total_filtered_count` is the number + of issues matching the filters, and `meta.page.total_count` the number of open issues + in the organization. + + Each filter accepts up to 50 comma-separated exact values of at most 256 characters + each, combined with OR within a filter and AND across filters. Blank entries are ignored; an all-blank filter + is treated as absent. + operationId: ListAgentHealthIssues + parameters: + - description: The number of issues to return per page, from 1 to 100. Defaults to 25. + example: 25 + in: query + name: page[size] + required: false + schema: + default: 25 + format: int64 + maximum: 100 + minimum: 1 + type: integer + - description: The zero-based page number, from 0 to 1000000. Defaults to 0. + example: 0 + in: query + name: page[number] + required: false + schema: + default: 0 + format: int64 + maximum: 1000000 + minimum: 0 + type: integer + - description: |- + Filter by a comma-separated list of exact `severity` values, up to 50 values + of at most 256 characters each. Values are combined with OR within this filter and AND across filters. + Blank entries are ignored; an all-blank filter is treated as absent. + example: high,medium + in: query + name: filter[severity] + required: false + schema: + maxLength: 12850 + type: string + - description: |- + Filter by a comma-separated list of exact `category` values, up to 50 values + of at most 256 characters each. Values are combined with OR within this filter and AND across filters. + Blank entries are ignored; an all-blank filter is treated as absent. + example: configuration + in: query + name: filter[category] + required: false + schema: + maxLength: 12850 + type: string + - description: |- + Filter by a comma-separated list of exact `issue_type` values, up to 50 values + of at most 256 characters each. Values are combined with OR within this filter and AND across filters. + Blank entries are ignored; an all-blank filter is treated as absent. + example: invalid_config + in: query + name: filter[issue_type] + required: false + schema: + maxLength: 12850 + type: string + - description: |- + Filter by a comma-separated list of exact `resource_kind` values, up to 50 values + of at most 256 characters each. Values are combined with OR within this filter and AND across filters. + Blank entries are ignored; an all-blank filter is treated as absent. + example: host,deployment + in: query + name: filter[resource_kind] + required: false + schema: + maxLength: 12850 + type: string + - description: |- + Filter by a comma-separated list of exact `resource_id` values, up to 50 values + of at most 256 characters each. Values are combined with OR within this filter and AND across filters. + Blank entries are ignored; an all-blank filter is treated as absent. + example: my-hostname + in: query + name: filter[resource_id] + required: false + schema: + maxLength: 12850 + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + category: configuration + description: The Agent configuration file contains an invalid value. + first_seen_at: "2026-11-01T10:00:00Z" + issue_name: Invalid Config + issue_type: invalid_config + resource_id: my-hostname + resource_kind: host + resource_type: host + severity: high + state: open + tags: + - env:prod + title: Invalid Agent configuration + updated_at: "2026-11-09T08:00:00Z" + id: invalid-config:4828e7d6c704c4a3 + type: agent_health_issues + meta: + page: + total_count: 3 + total_filtered_count: 1 + schema: + $ref: "#/components/schemas/AgentHealthIssuesResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - hosts_read + summary: List Agent Health issues + tags: + - Agent Health + x-permission: + operator: OR + permissions: + - hosts_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/agenthealth/issues/{issue_id}: + get: + description: |- + Get an Agent Health issue and its available remediation in your organization. + Only open issues are returned. The `remediation` attribute is omitted when + the issue has no remediation. + + Returns `404` if the issue does not exist, is not open, belongs to another + organization, or you do not have access to its data. This response does not + reveal whether the issue exists. Returns `403` if you lack the `hosts_read` permission. + operationId: GetAgentHealthIssue + parameters: + - description: |- + The unique identifier of the issue. It can contain `:` and must be percent-encoded + by clients when included in the path. + example: invalid-config:4828e7d6c704c4a3 + in: path + name: issue_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + category: configuration + description: The Agent configuration file contains an invalid value. + first_seen_at: "2026-11-01T10:00:00Z" + issue_name: Invalid Config + issue_type: invalid_config + remediation: + script: + content: "..." + filename: fix.sh + language: bash + language_version: "5" + requires_root: true + steps: + - order: 1 + text: Open datadog.yaml + summary: Fix the invalid configuration value. + resource_id: my-hostname + resource_kind: host + resource_type: host + severity: high + state: open + tags: + - env:prod + title: Invalid Agent configuration + updated_at: "2026-11-09T08:00:00Z" + id: invalid-config:4828e7d6c704c4a3 + type: agent_health_issues + schema: + $ref: "#/components/schemas/AgentHealthIssueResponse" + description: OK + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - hosts_read + summary: Get an Agent Health issue + tags: + - Agent Health + x-permission: + operator: OR + permissions: + - hosts_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/agentless_scanning/accounts/aws: get: description: Fetches the scan options configured for AWS accounts. @@ -272635,7 +273302,8 @@ tags: externalDocs: url: https://docs.datadoghq.com/actions/datastore name: Actions Datastores - - description: View Agent Health issues reported for node Agents and Cluster Agents. + - description: >- + List open Agent Health issues across your organization and get an issue with its available remediation. Issues are reported by node Agents, Cluster Agents, and OpenTelemetry collectors. The meaning of `resource_id` depends on `resource_kind`: hostname for `host`, DaemonSet UID for `deployment` (node Agent), cluster UUID for `cluster`, hostname of the host running the Cluster Agent for `cluster_agent`, or OpenTelemetry collector ID for `otel`. name: Agent Health - description: >- Manage Agent Observability spans, data, projects, datasets, dataset records, experiments, prompts, and annotations. diff --git a/examples/v2/agent-health/GetAgentHealthIssue.java b/examples/v2/agent-health/GetAgentHealthIssue.java new file mode 100644 index 00000000000..1fbe2b2266e --- /dev/null +++ b/examples/v2/agent-health/GetAgentHealthIssue.java @@ -0,0 +1,27 @@ +// Get an Agent Health issue returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AgentHealthApi; +import com.datadog.api.client.v2.model.AgentHealthIssueResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.getAgentHealthIssue", true); + AgentHealthApi apiInstance = new AgentHealthApi(defaultClient); + + try { + AgentHealthIssueResponse result = + apiInstance.getAgentHealthIssue("invalid-config:4828e7d6c704c4a3"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AgentHealthApi#getAgentHealthIssue"); + 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/agent-health/ListAgentHealthIssues.java b/examples/v2/agent-health/ListAgentHealthIssues.java new file mode 100644 index 00000000000..e0296d86dcc --- /dev/null +++ b/examples/v2/agent-health/ListAgentHealthIssues.java @@ -0,0 +1,26 @@ +// List Agent Health issues returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.AgentHealthApi; +import com.datadog.api.client.v2.model.AgentHealthIssuesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN")); + defaultClient.setUnstableOperationEnabled("v2.listAgentHealthIssues", true); + AgentHealthApi apiInstance = new AgentHealthApi(defaultClient); + + try { + AgentHealthIssuesResponse result = apiInstance.listAgentHealthIssues(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling AgentHealthApi#listAgentHealthIssues"); + 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 39a8c9f10ba..97354e98085 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1145,6 +1145,8 @@ public class ApiClient { put("v2.getExecutionPolicy", false); put("v2.listExecutionPolicies", false); put("v2.updateExecutionPolicy", false); + put("v2.getAgentHealthIssue", false); + put("v2.listAgentHealthIssues", false); put("v2.evaluateAIGuardRequest", false); put("v2.createAnnotation", false); put("v2.deleteAnnotation", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/AgentHealthApi.java b/src/main/java/com/datadog/api/client/v2/api/AgentHealthApi.java index 34ef01aaa82..79f78278ba2 100644 --- a/src/main/java/com/datadog/api/client/v2/api/AgentHealthApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/AgentHealthApi.java @@ -6,6 +6,8 @@ import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.AgentHealthAgentType; import com.datadog.api.client.v2.model.AgentHealthHostIssuesResponse; +import com.datadog.api.client.v2.model.AgentHealthIssueResponse; +import com.datadog.api.client.v2.model.AgentHealthIssuesResponse; import jakarta.ws.rs.client.Invocation; import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; @@ -45,6 +47,169 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** + * Get an Agent Health issue. + * + *

See {@link #getAgentHealthIssueWithHttpInfo}. + * + * @param issueId The unique identifier of the issue. It can contain : and must be + * percent-encoded by clients when included in the path. (required) + * @return AgentHealthIssueResponse + * @throws ApiException if fails to make API call + */ + public AgentHealthIssueResponse getAgentHealthIssue(String issueId) throws ApiException { + return getAgentHealthIssueWithHttpInfo(issueId).getData(); + } + + /** + * Get an Agent Health issue. + * + *

See {@link #getAgentHealthIssueWithHttpInfoAsync}. + * + * @param issueId The unique identifier of the issue. It can contain : and must be + * percent-encoded by clients when included in the path. (required) + * @return CompletableFuture<AgentHealthIssueResponse> + */ + public CompletableFuture getAgentHealthIssueAsync(String issueId) { + return getAgentHealthIssueWithHttpInfoAsync(issueId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get an Agent Health issue and its available remediation in your organization. Only open issues + * are returned. The remediation attribute is omitted when the issue has no + * remediation. + * + *

Returns 404 if the issue does not exist, is not open, belongs to another + * organization, or you do not have access to its data. This response does not reveal whether the + * issue exists. Returns 403 if you lack the hosts_read permission. + * + * @param issueId The unique identifier of the issue. It can contain : and must be + * percent-encoded by clients when included in the path. (required) + * @return ApiResponse<AgentHealthIssueResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
401 Unauthorized -
403 Forbidden -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getAgentHealthIssueWithHttpInfo(String issueId) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getAgentHealthIssue"; + 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 'issueId' is set + if (issueId == null) { + throw new ApiException( + 400, "Missing the required parameter 'issueId' when calling getAgentHealthIssue"); + } + // create path and map variables + String localVarPath = + "/api/v2/agenthealth/issues/{issue_id}" + .replaceAll("\\{" + "issue_id" + "\\}", apiClient.escapeString(issueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AgentHealthApi.getAgentHealthIssue", + 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 an Agent Health issue. + * + *

See {@link #getAgentHealthIssueWithHttpInfo}. + * + * @param issueId The unique identifier of the issue. It can contain : and must be + * percent-encoded by clients when included in the path. (required) + * @return CompletableFuture<ApiResponse<AgentHealthIssueResponse>> + */ + public CompletableFuture> + getAgentHealthIssueWithHttpInfoAsync(String issueId) { + // Check if unstable operation is enabled + String operationId = "getAgentHealthIssue"; + 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 'issueId' is set + if (issueId == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'issueId' when calling getAgentHealthIssue")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/agenthealth/issues/{issue_id}" + .replaceAll("\\{" + "issue_id" + "\\}", apiClient.escapeString(issueId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AgentHealthApi.getAgentHealthIssue", + 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 listAgentHealthHostIssues. */ public static class ListAgentHealthHostIssuesOptionalParameters { private AgentHealthAgentType agentType; @@ -260,4 +425,323 @@ public ApiResponse listAgentHealthHostIssuesWithH false, new GenericType() {}); } + + /** Manage optional parameters to listAgentHealthIssues. */ + public static class ListAgentHealthIssuesOptionalParameters { + private Long pageSize; + private Long pageNumber; + private String filterSeverity; + private String filterCategory; + private String filterIssueType; + private String filterResourceKind; + private String filterResourceId; + + /** + * Set pageSize. + * + * @param pageSize The number of issues to return per page, from 1 to 100. Defaults to 25. + * (optional, default to 25) + * @return ListAgentHealthIssuesOptionalParameters + */ + public ListAgentHealthIssuesOptionalParameters pageSize(Long pageSize) { + this.pageSize = pageSize; + return this; + } + + /** + * Set pageNumber. + * + * @param pageNumber The zero-based page number, from 0 to 1000000. Defaults to 0. (optional, + * default to 0) + * @return ListAgentHealthIssuesOptionalParameters + */ + public ListAgentHealthIssuesOptionalParameters pageNumber(Long pageNumber) { + this.pageNumber = pageNumber; + return this; + } + + /** + * Set filterSeverity. + * + * @param filterSeverity Filter by a comma-separated list of exact severity values, + * up to 50 values of at most 256 characters each. Values are combined with OR within this + * filter and AND across filters. Blank entries are ignored; an all-blank filter is treated + * as absent. (optional) + * @return ListAgentHealthIssuesOptionalParameters + */ + public ListAgentHealthIssuesOptionalParameters filterSeverity(String filterSeverity) { + this.filterSeverity = filterSeverity; + return this; + } + + /** + * Set filterCategory. + * + * @param filterCategory Filter by a comma-separated list of exact category values, + * up to 50 values of at most 256 characters each. Values are combined with OR within this + * filter and AND across filters. Blank entries are ignored; an all-blank filter is treated + * as absent. (optional) + * @return ListAgentHealthIssuesOptionalParameters + */ + public ListAgentHealthIssuesOptionalParameters filterCategory(String filterCategory) { + this.filterCategory = filterCategory; + return this; + } + + /** + * Set filterIssueType. + * + * @param filterIssueType Filter by a comma-separated list of exact issue_type + * values, up to 50 values of at most 256 characters each. Values are combined with OR + * within this filter and AND across filters. Blank entries are ignored; an all-blank filter + * is treated as absent. (optional) + * @return ListAgentHealthIssuesOptionalParameters + */ + public ListAgentHealthIssuesOptionalParameters filterIssueType(String filterIssueType) { + this.filterIssueType = filterIssueType; + return this; + } + + /** + * Set filterResourceKind. + * + * @param filterResourceKind Filter by a comma-separated list of exact resource_kind + * values, up to 50 values of at most 256 characters each. Values are combined with + * OR within this filter and AND across filters. Blank entries are ignored; an all-blank + * filter is treated as absent. (optional) + * @return ListAgentHealthIssuesOptionalParameters + */ + public ListAgentHealthIssuesOptionalParameters filterResourceKind(String filterResourceKind) { + this.filterResourceKind = filterResourceKind; + return this; + } + + /** + * Set filterResourceId. + * + * @param filterResourceId Filter by a comma-separated list of exact resource_id + * values, up to 50 values of at most 256 characters each. Values are combined with OR + * within this filter and AND across filters. Blank entries are ignored; an all-blank filter + * is treated as absent. (optional) + * @return ListAgentHealthIssuesOptionalParameters + */ + public ListAgentHealthIssuesOptionalParameters filterResourceId(String filterResourceId) { + this.filterResourceId = filterResourceId; + return this; + } + } + + /** + * List Agent Health issues. + * + *

See {@link #listAgentHealthIssuesWithHttpInfo}. + * + * @return AgentHealthIssuesResponse + * @throws ApiException if fails to make API call + */ + public AgentHealthIssuesResponse listAgentHealthIssues() throws ApiException { + return listAgentHealthIssuesWithHttpInfo(new ListAgentHealthIssuesOptionalParameters()) + .getData(); + } + + /** + * List Agent Health issues. + * + *

See {@link #listAgentHealthIssuesWithHttpInfoAsync}. + * + * @return CompletableFuture<AgentHealthIssuesResponse> + */ + public CompletableFuture listAgentHealthIssuesAsync() { + return listAgentHealthIssuesWithHttpInfoAsync(new ListAgentHealthIssuesOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Agent Health issues. + * + *

See {@link #listAgentHealthIssuesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return AgentHealthIssuesResponse + * @throws ApiException if fails to make API call + */ + public AgentHealthIssuesResponse listAgentHealthIssues( + ListAgentHealthIssuesOptionalParameters parameters) throws ApiException { + return listAgentHealthIssuesWithHttpInfo(parameters).getData(); + } + + /** + * List Agent Health issues. + * + *

See {@link #listAgentHealthIssuesWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<AgentHealthIssuesResponse> + */ + public CompletableFuture listAgentHealthIssuesAsync( + ListAgentHealthIssuesOptionalParameters parameters) { + return listAgentHealthIssuesWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List Agent Health issues across your organization. Only open issues are returned. Returns + * 403 if you lack the hosts_read permission. + * + *

Results use a stable order: severity rank (high, medium, low + * , then other values), then first_seen_at descending with missing timestamps + * last, then issue ID ascending. Use page[size] and the zero-based + * page[number] to paginate. Invalid page values return a 400 JSON:API error + * response. meta.page.total_filtered_count is the number of issues matching the + * filters, and meta.page.total_count the number of open issues in the organization. + * + *

Each filter accepts up to 50 comma-separated exact values of at most 256 characters each, + * combined with OR within a filter and AND across filters. Blank entries are ignored; an + * all-blank filter is treated as absent. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<AgentHealthIssuesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
401 Unauthorized -
403 Forbidden -
429 Too many requests -
+ */ + public ApiResponse listAgentHealthIssuesWithHttpInfo( + ListAgentHealthIssuesOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listAgentHealthIssues"; + 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 pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String filterSeverity = parameters.filterSeverity; + String filterCategory = parameters.filterCategory; + String filterIssueType = parameters.filterIssueType; + String filterResourceKind = parameters.filterResourceKind; + String filterResourceId = parameters.filterResourceId; + // create path and map variables + String localVarPath = "/api/v2/agenthealth/issues"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[severity]", filterSeverity)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[category]", filterCategory)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[issue_type]", filterIssueType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[resource_kind]", filterResourceKind)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[resource_id]", filterResourceId)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.AgentHealthApi.listAgentHealthIssues", + 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 Agent Health issues. + * + *

See {@link #listAgentHealthIssuesWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<AgentHealthIssuesResponse>> + */ + public CompletableFuture> + listAgentHealthIssuesWithHttpInfoAsync(ListAgentHealthIssuesOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listAgentHealthIssues"; + 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 pageSize = parameters.pageSize; + Long pageNumber = parameters.pageNumber; + String filterSeverity = parameters.filterSeverity; + String filterCategory = parameters.filterCategory; + String filterIssueType = parameters.filterIssueType; + String filterResourceKind = parameters.filterResourceKind; + String filterResourceId = parameters.filterResourceId; + // create path and map variables + String localVarPath = "/api/v2/agenthealth/issues"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[size]", pageSize)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "page[number]", pageNumber)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[severity]", filterSeverity)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "filter[category]", filterCategory)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[issue_type]", filterIssueType)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[resource_kind]", filterResourceKind)); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "filter[resource_id]", filterResourceId)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.AgentHealthApi.listAgentHealthIssues", + 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() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueAttributes.java new file mode 100644 index 00000000000..8e91fceb8ff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueAttributes.java @@ -0,0 +1,505 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an open Agent Health issue. */ +@JsonPropertyOrder({ + AgentHealthIssueAttributes.JSON_PROPERTY_CATEGORY, + AgentHealthIssueAttributes.JSON_PROPERTY_DESCRIPTION, + AgentHealthIssueAttributes.JSON_PROPERTY_FIRST_SEEN_AT, + AgentHealthIssueAttributes.JSON_PROPERTY_ISSUE_NAME, + AgentHealthIssueAttributes.JSON_PROPERTY_ISSUE_TYPE, + AgentHealthIssueAttributes.JSON_PROPERTY_RESOURCE_ID, + AgentHealthIssueAttributes.JSON_PROPERTY_RESOURCE_KIND, + AgentHealthIssueAttributes.JSON_PROPERTY_RESOURCE_TYPE, + AgentHealthIssueAttributes.JSON_PROPERTY_SEVERITY, + AgentHealthIssueAttributes.JSON_PROPERTY_STATE, + AgentHealthIssueAttributes.JSON_PROPERTY_TAGS, + AgentHealthIssueAttributes.JSON_PROPERTY_TITLE, + AgentHealthIssueAttributes.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthIssueAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_FIRST_SEEN_AT = "first_seen_at"; + private OffsetDateTime firstSeenAt; + + public static final String JSON_PROPERTY_ISSUE_NAME = "issue_name"; + private String issueName; + + public static final String JSON_PROPERTY_ISSUE_TYPE = "issue_type"; + private String issueType; + + public static final String JSON_PROPERTY_RESOURCE_ID = "resource_id"; + private String resourceId; + + public static final String JSON_PROPERTY_RESOURCE_KIND = "resource_kind"; + private String resourceKind; + + public static final String JSON_PROPERTY_RESOURCE_TYPE = "resource_type"; + private String resourceType; + + public static final String JSON_PROPERTY_SEVERITY = "severity"; + private String severity; + + public static final String JSON_PROPERTY_STATE = "state"; + private String state; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private OffsetDateTime updatedAt; + + public AgentHealthIssueAttributes() {} + + @JsonCreator + public AgentHealthIssueAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ISSUE_NAME) String issueName, + @JsonProperty(required = true, value = JSON_PROPERTY_ISSUE_TYPE) String issueType, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_ID) String resourceId, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_KIND) String resourceKind, + @JsonProperty(required = true, value = JSON_PROPERTY_SEVERITY) String severity, + @JsonProperty(required = true, value = JSON_PROPERTY_STATE) String state) { + this.issueName = issueName; + this.issueType = issueType; + this.resourceId = resourceId; + this.resourceKind = resourceKind; + this.severity = severity; + this.state = state; + } + + public AgentHealthIssueAttributes category(String category) { + this.category = category; + return this; + } + + /** + * The category of the issue, such as configuration. Omitted when not set. + * + * @return category + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public AgentHealthIssueAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the issue. Omitted when empty. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AgentHealthIssueAttributes firstSeenAt(OffsetDateTime firstSeenAt) { + this.firstSeenAt = firstSeenAt; + return this; + } + + /** + * The time the issue was first seen, in RFC 3339 format. Omitted when empty. + * + * @return firstSeenAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_SEEN_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getFirstSeenAt() { + return firstSeenAt; + } + + public void setFirstSeenAt(OffsetDateTime firstSeenAt) { + this.firstSeenAt = firstSeenAt; + } + + public AgentHealthIssueAttributes issueName(String issueName) { + this.issueName = issueName; + return this; + } + + /** + * The human-readable name of the issue. + * + * @return issueName + */ + @JsonProperty(JSON_PROPERTY_ISSUE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIssueName() { + return issueName; + } + + public void setIssueName(String issueName) { + this.issueName = issueName; + } + + public AgentHealthIssueAttributes issueType(String issueType) { + this.issueType = issueType; + return this; + } + + /** + * The machine-readable type of the issue. + * + * @return issueType + */ + @JsonProperty(JSON_PROPERTY_ISSUE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIssueType() { + return issueType; + } + + public void setIssueType(String issueType) { + this.issueType = issueType; + } + + public AgentHealthIssueAttributes resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * The identifier of the affected resource, interpreted according to resource_kind: + * hostname for host, DaemonSet UID for deployment (node Agent), cluster + * UUID for cluster, hostname of the host running the Cluster Agent for + * cluster_agent, or OpenTelemetry collector ID for otel. + * + * @return resourceId + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public AgentHealthIssueAttributes resourceKind(String resourceKind) { + this.resourceKind = resourceKind; + return this; + } + + /** + * The kind of affected resource. Known values are host, deployment, + * cluster, cluster_agent, and otel. + * + * @return resourceKind + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_KIND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResourceKind() { + return resourceKind; + } + + public void setResourceKind(String resourceKind) { + this.resourceKind = resourceKind; + } + + public AgentHealthIssueAttributes resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * The type of the affected resource. Omitted when empty. + * + * @return resourceType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResourceType() { + return resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public AgentHealthIssueAttributes severity(String severity) { + this.severity = severity; + return this; + } + + /** + * The severity of the issue. Known values are low, medium, high + * , and unknown. + * + * @return severity + */ + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSeverity() { + return severity; + } + + public void setSeverity(String severity) { + this.severity = severity; + } + + public AgentHealthIssueAttributes state(String state) { + this.state = state; + return this; + } + + /** + * The state of the issue. Only issues with state open are returned. + * + * @return state + */ + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public AgentHealthIssueAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public AgentHealthIssueAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags associated with the issue. Omitted when empty. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public AgentHealthIssueAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the issue. Omitted when empty. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public AgentHealthIssueAttributes updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The time the issue was last updated, in RFC 3339 format. Omitted when empty. + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 AgentHealthIssueAttributes + */ + @JsonAnySetter + public AgentHealthIssueAttributes 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 AgentHealthIssueAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthIssueAttributes agentHealthIssueAttributes = (AgentHealthIssueAttributes) o; + return Objects.equals(this.category, agentHealthIssueAttributes.category) + && Objects.equals(this.description, agentHealthIssueAttributes.description) + && Objects.equals(this.firstSeenAt, agentHealthIssueAttributes.firstSeenAt) + && Objects.equals(this.issueName, agentHealthIssueAttributes.issueName) + && Objects.equals(this.issueType, agentHealthIssueAttributes.issueType) + && Objects.equals(this.resourceId, agentHealthIssueAttributes.resourceId) + && Objects.equals(this.resourceKind, agentHealthIssueAttributes.resourceKind) + && Objects.equals(this.resourceType, agentHealthIssueAttributes.resourceType) + && Objects.equals(this.severity, agentHealthIssueAttributes.severity) + && Objects.equals(this.state, agentHealthIssueAttributes.state) + && Objects.equals(this.tags, agentHealthIssueAttributes.tags) + && Objects.equals(this.title, agentHealthIssueAttributes.title) + && Objects.equals(this.updatedAt, agentHealthIssueAttributes.updatedAt) + && Objects.equals( + this.additionalProperties, agentHealthIssueAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + category, + description, + firstSeenAt, + issueName, + issueType, + resourceId, + resourceKind, + resourceType, + severity, + state, + tags, + title, + updatedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthIssueAttributes {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" firstSeenAt: ").append(toIndentedString(firstSeenAt)).append("\n"); + sb.append(" issueName: ").append(toIndentedString(issueName)).append("\n"); + sb.append(" issueType: ").append(toIndentedString(issueType)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" resourceKind: ").append(toIndentedString(resourceKind)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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/AgentHealthIssueData.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueData.java new file mode 100644 index 00000000000..29498795371 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueData.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; + +/** An open Agent Health issue. */ +@JsonPropertyOrder({ + AgentHealthIssueData.JSON_PROPERTY_ATTRIBUTES, + AgentHealthIssueData.JSON_PROPERTY_ID, + AgentHealthIssueData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthIssueData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AgentHealthIssueAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AgentHealthIssueResourceType type; + + public AgentHealthIssueData() {} + + @JsonCreator + public AgentHealthIssueData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + AgentHealthIssueAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + AgentHealthIssueResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AgentHealthIssueData attributes(AgentHealthIssueAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an open Agent Health issue. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AgentHealthIssueAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AgentHealthIssueAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public AgentHealthIssueData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the issue. + * + * @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 AgentHealthIssueData type(AgentHealthIssueResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The Agent Health issue resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AgentHealthIssueResourceType getType() { + return type; + } + + public void setType(AgentHealthIssueResourceType 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 AgentHealthIssueData + */ + @JsonAnySetter + public AgentHealthIssueData 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 AgentHealthIssueData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthIssueData agentHealthIssueData = (AgentHealthIssueData) o; + return Objects.equals(this.attributes, agentHealthIssueData.attributes) + && Objects.equals(this.id, agentHealthIssueData.id) + && Objects.equals(this.type, agentHealthIssueData.type) + && Objects.equals(this.additionalProperties, agentHealthIssueData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthIssueData {\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/AgentHealthIssueDetailAttributes.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueDetailAttributes.java new file mode 100644 index 00000000000..32e27591383 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueDetailAttributes.java @@ -0,0 +1,538 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an open Agent Health issue, including available remediation. */ +@JsonPropertyOrder({ + AgentHealthIssueDetailAttributes.JSON_PROPERTY_CATEGORY, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_DESCRIPTION, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_FIRST_SEEN_AT, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_ISSUE_NAME, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_ISSUE_TYPE, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_REMEDIATION, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_RESOURCE_ID, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_RESOURCE_KIND, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_RESOURCE_TYPE, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_SEVERITY, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_STATE, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_TAGS, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_TITLE, + AgentHealthIssueDetailAttributes.JSON_PROPERTY_UPDATED_AT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthIssueDetailAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CATEGORY = "category"; + private String category; + + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_FIRST_SEEN_AT = "first_seen_at"; + private OffsetDateTime firstSeenAt; + + public static final String JSON_PROPERTY_ISSUE_NAME = "issue_name"; + private String issueName; + + public static final String JSON_PROPERTY_ISSUE_TYPE = "issue_type"; + private String issueType; + + public static final String JSON_PROPERTY_REMEDIATION = "remediation"; + private AgentHealthRemediation remediation; + + public static final String JSON_PROPERTY_RESOURCE_ID = "resource_id"; + private String resourceId; + + public static final String JSON_PROPERTY_RESOURCE_KIND = "resource_kind"; + private String resourceKind; + + public static final String JSON_PROPERTY_RESOURCE_TYPE = "resource_type"; + private String resourceType; + + public static final String JSON_PROPERTY_SEVERITY = "severity"; + private String severity; + + public static final String JSON_PROPERTY_STATE = "state"; + private String state; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public static final String JSON_PROPERTY_UPDATED_AT = "updated_at"; + private OffsetDateTime updatedAt; + + public AgentHealthIssueDetailAttributes() {} + + @JsonCreator + public AgentHealthIssueDetailAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_ISSUE_NAME) String issueName, + @JsonProperty(required = true, value = JSON_PROPERTY_ISSUE_TYPE) String issueType, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_ID) String resourceId, + @JsonProperty(required = true, value = JSON_PROPERTY_RESOURCE_KIND) String resourceKind, + @JsonProperty(required = true, value = JSON_PROPERTY_SEVERITY) String severity, + @JsonProperty(required = true, value = JSON_PROPERTY_STATE) String state) { + this.issueName = issueName; + this.issueType = issueType; + this.resourceId = resourceId; + this.resourceKind = resourceKind; + this.severity = severity; + this.state = state; + } + + public AgentHealthIssueDetailAttributes category(String category) { + this.category = category; + return this; + } + + /** + * The category of the issue, such as configuration. Omitted when not set. + * + * @return category + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public AgentHealthIssueDetailAttributes description(String description) { + this.description = description; + return this; + } + + /** + * The description of the issue. Omitted when empty. + * + * @return description + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public AgentHealthIssueDetailAttributes firstSeenAt(OffsetDateTime firstSeenAt) { + this.firstSeenAt = firstSeenAt; + return this; + } + + /** + * The time the issue was first seen, in RFC 3339 format. Omitted when empty. + * + * @return firstSeenAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_SEEN_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getFirstSeenAt() { + return firstSeenAt; + } + + public void setFirstSeenAt(OffsetDateTime firstSeenAt) { + this.firstSeenAt = firstSeenAt; + } + + public AgentHealthIssueDetailAttributes issueName(String issueName) { + this.issueName = issueName; + return this; + } + + /** + * The human-readable name of the issue. + * + * @return issueName + */ + @JsonProperty(JSON_PROPERTY_ISSUE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIssueName() { + return issueName; + } + + public void setIssueName(String issueName) { + this.issueName = issueName; + } + + public AgentHealthIssueDetailAttributes issueType(String issueType) { + this.issueType = issueType; + return this; + } + + /** + * The machine-readable type of the issue. + * + * @return issueType + */ + @JsonProperty(JSON_PROPERTY_ISSUE_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIssueType() { + return issueType; + } + + public void setIssueType(String issueType) { + this.issueType = issueType; + } + + public AgentHealthIssueDetailAttributes remediation(AgentHealthRemediation remediation) { + this.remediation = remediation; + this.unparsed |= remediation.unparsed; + return this; + } + + /** + * Remediation for the issue. Omitted when no remediation is available. + * + * @return remediation + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REMEDIATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AgentHealthRemediation getRemediation() { + return remediation; + } + + public void setRemediation(AgentHealthRemediation remediation) { + this.remediation = remediation; + if (remediation != null) { + this.unparsed |= remediation.unparsed; + } + } + + public AgentHealthIssueDetailAttributes resourceId(String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * The identifier of the affected resource, interpreted according to resource_kind: + * hostname for host, DaemonSet UID for deployment (node Agent), cluster + * UUID for cluster, hostname of the host running the Cluster Agent for + * cluster_agent, or OpenTelemetry collector ID for otel. + * + * @return resourceId + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResourceId() { + return resourceId; + } + + public void setResourceId(String resourceId) { + this.resourceId = resourceId; + } + + public AgentHealthIssueDetailAttributes resourceKind(String resourceKind) { + this.resourceKind = resourceKind; + return this; + } + + /** + * The kind of affected resource. Known values are host, deployment, + * cluster, cluster_agent, and otel. + * + * @return resourceKind + */ + @JsonProperty(JSON_PROPERTY_RESOURCE_KIND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getResourceKind() { + return resourceKind; + } + + public void setResourceKind(String resourceKind) { + this.resourceKind = resourceKind; + } + + public AgentHealthIssueDetailAttributes resourceType(String resourceType) { + this.resourceType = resourceType; + return this; + } + + /** + * The type of the affected resource. Omitted when empty. + * + * @return resourceType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESOURCE_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getResourceType() { + return resourceType; + } + + public void setResourceType(String resourceType) { + this.resourceType = resourceType; + } + + public AgentHealthIssueDetailAttributes severity(String severity) { + this.severity = severity; + return this; + } + + /** + * The severity of the issue. Known values are low, medium, high + * , and unknown. + * + * @return severity + */ + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSeverity() { + return severity; + } + + public void setSeverity(String severity) { + this.severity = severity; + } + + public AgentHealthIssueDetailAttributes state(String state) { + this.state = state; + return this; + } + + /** + * The state of the issue. Only issues with state open are returned. + * + * @return state + */ + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public AgentHealthIssueDetailAttributes tags(List tags) { + this.tags = tags; + return this; + } + + public AgentHealthIssueDetailAttributes addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags associated with the issue. Omitted when empty. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public AgentHealthIssueDetailAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the issue. Omitted when empty. + * + * @return title + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public AgentHealthIssueDetailAttributes updatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + return this; + } + + /** + * The time the issue was last updated, in RFC 3339 format. Omitted when empty. + * + * @return updatedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_UPDATED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getUpdatedAt() { + return updatedAt; + } + + public void setUpdatedAt(OffsetDateTime updatedAt) { + this.updatedAt = updatedAt; + } + + /** + * 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 AgentHealthIssueDetailAttributes + */ + @JsonAnySetter + public AgentHealthIssueDetailAttributes 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 AgentHealthIssueDetailAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthIssueDetailAttributes agentHealthIssueDetailAttributes = + (AgentHealthIssueDetailAttributes) o; + return Objects.equals(this.category, agentHealthIssueDetailAttributes.category) + && Objects.equals(this.description, agentHealthIssueDetailAttributes.description) + && Objects.equals(this.firstSeenAt, agentHealthIssueDetailAttributes.firstSeenAt) + && Objects.equals(this.issueName, agentHealthIssueDetailAttributes.issueName) + && Objects.equals(this.issueType, agentHealthIssueDetailAttributes.issueType) + && Objects.equals(this.remediation, agentHealthIssueDetailAttributes.remediation) + && Objects.equals(this.resourceId, agentHealthIssueDetailAttributes.resourceId) + && Objects.equals(this.resourceKind, agentHealthIssueDetailAttributes.resourceKind) + && Objects.equals(this.resourceType, agentHealthIssueDetailAttributes.resourceType) + && Objects.equals(this.severity, agentHealthIssueDetailAttributes.severity) + && Objects.equals(this.state, agentHealthIssueDetailAttributes.state) + && Objects.equals(this.tags, agentHealthIssueDetailAttributes.tags) + && Objects.equals(this.title, agentHealthIssueDetailAttributes.title) + && Objects.equals(this.updatedAt, agentHealthIssueDetailAttributes.updatedAt) + && Objects.equals( + this.additionalProperties, agentHealthIssueDetailAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + category, + description, + firstSeenAt, + issueName, + issueType, + remediation, + resourceId, + resourceKind, + resourceType, + severity, + state, + tags, + title, + updatedAt, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthIssueDetailAttributes {\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" firstSeenAt: ").append(toIndentedString(firstSeenAt)).append("\n"); + sb.append(" issueName: ").append(toIndentedString(issueName)).append("\n"); + sb.append(" issueType: ").append(toIndentedString(issueType)).append("\n"); + sb.append(" remediation: ").append(toIndentedString(remediation)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" resourceKind: ").append(toIndentedString(resourceKind)).append("\n"); + sb.append(" resourceType: ").append(toIndentedString(resourceType)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" updatedAt: ").append(toIndentedString(updatedAt)).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/AgentHealthIssueDetailData.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueDetailData.java new file mode 100644 index 00000000000..6cb671befbe --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueDetailData.java @@ -0,0 +1,214 @@ +/* + * 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; + +/** An open Agent Health issue with available remediation. */ +@JsonPropertyOrder({ + AgentHealthIssueDetailData.JSON_PROPERTY_ATTRIBUTES, + AgentHealthIssueDetailData.JSON_PROPERTY_ID, + AgentHealthIssueDetailData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthIssueDetailData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private AgentHealthIssueDetailAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private AgentHealthIssueResourceType type; + + public AgentHealthIssueDetailData() {} + + @JsonCreator + public AgentHealthIssueDetailData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + AgentHealthIssueDetailAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + AgentHealthIssueResourceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public AgentHealthIssueDetailData attributes(AgentHealthIssueDetailAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of an open Agent Health issue, including available remediation. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AgentHealthIssueDetailAttributes getAttributes() { + return attributes; + } + + public void setAttributes(AgentHealthIssueDetailAttributes attributes) { + this.attributes = attributes; + if (attributes != null) { + this.unparsed |= attributes.unparsed; + } + } + + public AgentHealthIssueDetailData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the issue. + * + * @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 AgentHealthIssueDetailData type(AgentHealthIssueResourceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The Agent Health issue resource type. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AgentHealthIssueResourceType getType() { + return type; + } + + public void setType(AgentHealthIssueResourceType 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 AgentHealthIssueDetailData + */ + @JsonAnySetter + public AgentHealthIssueDetailData 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 AgentHealthIssueDetailData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthIssueDetailData agentHealthIssueDetailData = (AgentHealthIssueDetailData) o; + return Objects.equals(this.attributes, agentHealthIssueDetailData.attributes) + && Objects.equals(this.id, agentHealthIssueDetailData.id) + && Objects.equals(this.type, agentHealthIssueDetailData.type) + && Objects.equals( + this.additionalProperties, agentHealthIssueDetailData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthIssueDetailData {\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/AgentHealthIssueResourceType.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueResourceType.java new file mode 100644 index 00000000000..7a90dc217b5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueResourceType.java @@ -0,0 +1,57 @@ +/* + * 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 Agent Health issue resource type. */ +@JsonSerialize(using = AgentHealthIssueResourceType.AgentHealthIssueResourceTypeSerializer.class) +public class AgentHealthIssueResourceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("agent_health_issues")); + + public static final AgentHealthIssueResourceType AGENT_HEALTH_ISSUES = + new AgentHealthIssueResourceType("agent_health_issues"); + + AgentHealthIssueResourceType(String value) { + super(value, allowedValues); + } + + public static class AgentHealthIssueResourceTypeSerializer + extends StdSerializer { + public AgentHealthIssueResourceTypeSerializer(Class t) { + super(t); + } + + public AgentHealthIssueResourceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + AgentHealthIssueResourceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static AgentHealthIssueResourceType fromValue(String value) { + return new AgentHealthIssueResourceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueResponse.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueResponse.java new file mode 100644 index 00000000000..329bae29adf --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssueResponse.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; + +/** A response containing an open Agent Health issue and available remediation. */ +@JsonPropertyOrder({AgentHealthIssueResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthIssueResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private AgentHealthIssueDetailData data; + + public AgentHealthIssueResponse() {} + + @JsonCreator + public AgentHealthIssueResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) AgentHealthIssueDetailData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public AgentHealthIssueResponse data(AgentHealthIssueDetailData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * An open Agent Health issue with available remediation. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AgentHealthIssueDetailData getData() { + return data; + } + + public void setData(AgentHealthIssueDetailData data) { + this.data = data; + if (data != null) { + this.unparsed |= data.unparsed; + } + } + + /** + * 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 AgentHealthIssueResponse + */ + @JsonAnySetter + public AgentHealthIssueResponse 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 AgentHealthIssueResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthIssueResponse agentHealthIssueResponse = (AgentHealthIssueResponse) o; + return Objects.equals(this.data, agentHealthIssueResponse.data) + && Objects.equals(this.additionalProperties, agentHealthIssueResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthIssueResponse {\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/AgentHealthIssuesResponse.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssuesResponse.java new file mode 100644 index 00000000000..5d88be34e47 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssuesResponse.java @@ -0,0 +1,199 @@ +/* + * 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; + +/** A paginated response containing open Agent Health issues. */ +@JsonPropertyOrder({ + AgentHealthIssuesResponse.JSON_PROPERTY_DATA, + AgentHealthIssuesResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthIssuesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private AgentHealthIssuesResponseMeta meta; + + public AgentHealthIssuesResponse() {} + + @JsonCreator + public AgentHealthIssuesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) List data, + @JsonProperty(required = true, value = JSON_PROPERTY_META) + AgentHealthIssuesResponseMeta meta) { + this.data = data; + for (AgentHealthIssueData item : data) { + this.unparsed |= item.unparsed; + } + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public AgentHealthIssuesResponse data(List data) { + this.data = data; + for (AgentHealthIssueData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public AgentHealthIssuesResponse addDataItem(AgentHealthIssueData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The open Agent Health issues on this page. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + if (data != null) { + for (AgentHealthIssueData item : data) { + this.unparsed |= item.unparsed; + } + } + } + + public AgentHealthIssuesResponse meta(AgentHealthIssuesResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Pagination metadata for the matching Agent Health issues. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AgentHealthIssuesResponseMeta getMeta() { + return meta; + } + + public void setMeta(AgentHealthIssuesResponseMeta meta) { + this.meta = meta; + if (meta != null) { + this.unparsed |= meta.unparsed; + } + } + + /** + * 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 AgentHealthIssuesResponse + */ + @JsonAnySetter + public AgentHealthIssuesResponse 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 AgentHealthIssuesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthIssuesResponse agentHealthIssuesResponse = (AgentHealthIssuesResponse) o; + return Objects.equals(this.data, agentHealthIssuesResponse.data) + && Objects.equals(this.meta, agentHealthIssuesResponse.meta) + && Objects.equals( + this.additionalProperties, agentHealthIssuesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthIssuesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).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/AgentHealthIssuesResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssuesResponseMeta.java new file mode 100644 index 00000000000..cd7fb2a2809 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssuesResponseMeta.java @@ -0,0 +1,150 @@ +/* + * 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 for the matching Agent Health issues. */ +@JsonPropertyOrder({AgentHealthIssuesResponseMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthIssuesResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private AgentHealthIssuesResponsePage page; + + public AgentHealthIssuesResponseMeta() {} + + @JsonCreator + public AgentHealthIssuesResponseMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_PAGE) + AgentHealthIssuesResponsePage page) { + this.page = page; + this.unparsed |= page.unparsed; + } + + public AgentHealthIssuesResponseMeta page(AgentHealthIssuesResponsePage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination counts for the Agent Health issues. + * + * @return page + */ + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public AgentHealthIssuesResponsePage getPage() { + return page; + } + + public void setPage(AgentHealthIssuesResponsePage page) { + this.page = page; + if (page != null) { + this.unparsed |= page.unparsed; + } + } + + /** + * 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 AgentHealthIssuesResponseMeta + */ + @JsonAnySetter + public AgentHealthIssuesResponseMeta 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 AgentHealthIssuesResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthIssuesResponseMeta agentHealthIssuesResponseMeta = (AgentHealthIssuesResponseMeta) o; + return Objects.equals(this.page, agentHealthIssuesResponseMeta.page) + && Objects.equals( + this.additionalProperties, agentHealthIssuesResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthIssuesResponseMeta {\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/AgentHealthIssuesResponsePage.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssuesResponsePage.java new file mode 100644 index 00000000000..33795fdb142 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthIssuesResponsePage.java @@ -0,0 +1,175 @@ +/* + * 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 counts for the Agent Health issues. */ +@JsonPropertyOrder({ + AgentHealthIssuesResponsePage.JSON_PROPERTY_TOTAL_COUNT, + AgentHealthIssuesResponsePage.JSON_PROPERTY_TOTAL_FILTERED_COUNT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthIssuesResponsePage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TOTAL_COUNT = "total_count"; + private Long totalCount; + + public static final String JSON_PROPERTY_TOTAL_FILTERED_COUNT = "total_filtered_count"; + private Long totalFilteredCount; + + public AgentHealthIssuesResponsePage() {} + + @JsonCreator + public AgentHealthIssuesResponsePage( + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_COUNT) Long totalCount, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL_FILTERED_COUNT) + Long totalFilteredCount) { + this.totalCount = totalCount; + this.totalFilteredCount = totalFilteredCount; + } + + public AgentHealthIssuesResponsePage totalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * The total number of open issues in the organization, ignoring filters. + * + * @return totalCount + */ + @JsonProperty(JSON_PROPERTY_TOTAL_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalCount() { + return totalCount; + } + + public void setTotalCount(Long totalCount) { + this.totalCount = totalCount; + } + + public AgentHealthIssuesResponsePage totalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + return this; + } + + /** + * The total number of open issues matching the filters, across all pages. + * + * @return totalFilteredCount + */ + @JsonProperty(JSON_PROPERTY_TOTAL_FILTERED_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotalFilteredCount() { + return totalFilteredCount; + } + + public void setTotalFilteredCount(Long totalFilteredCount) { + this.totalFilteredCount = totalFilteredCount; + } + + /** + * 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 AgentHealthIssuesResponsePage + */ + @JsonAnySetter + public AgentHealthIssuesResponsePage 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 AgentHealthIssuesResponsePage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthIssuesResponsePage agentHealthIssuesResponsePage = (AgentHealthIssuesResponsePage) o; + return Objects.equals(this.totalCount, agentHealthIssuesResponsePage.totalCount) + && Objects.equals(this.totalFilteredCount, agentHealthIssuesResponsePage.totalFilteredCount) + && Objects.equals( + this.additionalProperties, agentHealthIssuesResponsePage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(totalCount, totalFilteredCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthIssuesResponsePage {\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); + sb.append(" totalFilteredCount: ").append(toIndentedString(totalFilteredCount)).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/AgentHealthRemediation.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthRemediation.java new file mode 100644 index 00000000000..f147f493fb9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthRemediation.java @@ -0,0 +1,216 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Remediation for the issue. Omitted when no remediation is available. */ +@JsonPropertyOrder({ + AgentHealthRemediation.JSON_PROPERTY_SCRIPT, + AgentHealthRemediation.JSON_PROPERTY_STEPS, + AgentHealthRemediation.JSON_PROPERTY_SUMMARY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthRemediation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_SCRIPT = "script"; + private AgentHealthRemediationScript script; + + public static final String JSON_PROPERTY_STEPS = "steps"; + private List steps = null; + + public static final String JSON_PROPERTY_SUMMARY = "summary"; + private String summary; + + public AgentHealthRemediation script(AgentHealthRemediationScript script) { + this.script = script; + this.unparsed |= script.unparsed; + return this; + } + + /** + * A script that can be used to remediate the issue. + * + * @return script + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCRIPT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public AgentHealthRemediationScript getScript() { + return script; + } + + public void setScript(AgentHealthRemediationScript script) { + this.script = script; + if (script != null) { + this.unparsed |= script.unparsed; + } + } + + public AgentHealthRemediation steps(List steps) { + this.steps = steps; + if (steps != null) { + for (AgentHealthRemediationStep item : steps) { + this.unparsed |= item.unparsed; + } + } + return this; + } + + public AgentHealthRemediation addStepsItem(AgentHealthRemediationStep stepsItem) { + if (this.steps == null) { + this.steps = new ArrayList<>(); + } + this.steps.add(stepsItem); + this.unparsed |= stepsItem.unparsed; + return this; + } + + /** + * Steps to remediate the issue. + * + * @return steps + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STEPS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSteps() { + return steps; + } + + public void setSteps(List steps) { + this.steps = steps; + if (steps != null) { + for (AgentHealthRemediationStep item : steps) { + this.unparsed |= item.unparsed; + } + } + } + + public AgentHealthRemediation summary(String summary) { + this.summary = summary; + return this; + } + + /** + * A summary of how to remediate the issue. + * + * @return summary + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUMMARY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + /** + * 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 AgentHealthRemediation + */ + @JsonAnySetter + public AgentHealthRemediation 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 AgentHealthRemediation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthRemediation agentHealthRemediation = (AgentHealthRemediation) o; + return Objects.equals(this.script, agentHealthRemediation.script) + && Objects.equals(this.steps, agentHealthRemediation.steps) + && Objects.equals(this.summary, agentHealthRemediation.summary) + && Objects.equals(this.additionalProperties, agentHealthRemediation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(script, steps, summary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthRemediation {\n"); + sb.append(" script: ").append(toIndentedString(script)).append("\n"); + sb.append(" steps: ").append(toIndentedString(steps)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).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/AgentHealthRemediationScript.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthRemediationScript.java new file mode 100644 index 00000000000..ef2a02d2eb3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthRemediationScript.java @@ -0,0 +1,247 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A script that can be used to remediate the issue. */ +@JsonPropertyOrder({ + AgentHealthRemediationScript.JSON_PROPERTY_CONTENT, + AgentHealthRemediationScript.JSON_PROPERTY_FILENAME, + AgentHealthRemediationScript.JSON_PROPERTY_LANGUAGE, + AgentHealthRemediationScript.JSON_PROPERTY_LANGUAGE_VERSION, + AgentHealthRemediationScript.JSON_PROPERTY_REQUIRES_ROOT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthRemediationScript { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONTENT = "content"; + private String content; + + public static final String JSON_PROPERTY_FILENAME = "filename"; + private String filename; + + public static final String JSON_PROPERTY_LANGUAGE = "language"; + private String language; + + public static final String JSON_PROPERTY_LANGUAGE_VERSION = "language_version"; + private String languageVersion; + + public static final String JSON_PROPERTY_REQUIRES_ROOT = "requires_root"; + private Boolean requiresRoot; + + public AgentHealthRemediationScript content(String content) { + this.content = content; + return this; + } + + /** + * The content of the script. + * + * @return content + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CONTENT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getContent() { + return content; + } + + public void setContent(String content) { + this.content = content; + } + + public AgentHealthRemediationScript filename(String filename) { + this.filename = filename; + return this; + } + + /** + * The filename of the script. + * + * @return filename + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FILENAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getFilename() { + return filename; + } + + public void setFilename(String filename) { + this.filename = filename; + } + + public AgentHealthRemediationScript language(String language) { + this.language = language; + return this; + } + + /** + * The language of the script. + * + * @return language + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguage() { + return language; + } + + public void setLanguage(String language) { + this.language = language; + } + + public AgentHealthRemediationScript languageVersion(String languageVersion) { + this.languageVersion = languageVersion; + return this; + } + + /** + * The language version used by the script. + * + * @return languageVersion + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LANGUAGE_VERSION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getLanguageVersion() { + return languageVersion; + } + + public void setLanguageVersion(String languageVersion) { + this.languageVersion = languageVersion; + } + + public AgentHealthRemediationScript requiresRoot(Boolean requiresRoot) { + this.requiresRoot = requiresRoot; + return this; + } + + /** + * Whether the script requires root privileges. + * + * @return requiresRoot + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUIRES_ROOT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getRequiresRoot() { + return requiresRoot; + } + + public void setRequiresRoot(Boolean requiresRoot) { + this.requiresRoot = requiresRoot; + } + + /** + * 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 AgentHealthRemediationScript + */ + @JsonAnySetter + public AgentHealthRemediationScript 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 AgentHealthRemediationScript object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthRemediationScript agentHealthRemediationScript = (AgentHealthRemediationScript) o; + return Objects.equals(this.content, agentHealthRemediationScript.content) + && Objects.equals(this.filename, agentHealthRemediationScript.filename) + && Objects.equals(this.language, agentHealthRemediationScript.language) + && Objects.equals(this.languageVersion, agentHealthRemediationScript.languageVersion) + && Objects.equals(this.requiresRoot, agentHealthRemediationScript.requiresRoot) + && Objects.equals( + this.additionalProperties, agentHealthRemediationScript.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + content, filename, language, languageVersion, requiresRoot, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthRemediationScript {\n"); + sb.append(" content: ").append(toIndentedString(content)).append("\n"); + sb.append(" filename: ").append(toIndentedString(filename)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" languageVersion: ").append(toIndentedString(languageVersion)).append("\n"); + sb.append(" requiresRoot: ").append(toIndentedString(requiresRoot)).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/AgentHealthRemediationStep.java b/src/main/java/com/datadog/api/client/v2/model/AgentHealthRemediationStep.java new file mode 100644 index 00000000000..7441c61af28 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/AgentHealthRemediationStep.java @@ -0,0 +1,165 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A step to remediate the issue. */ +@JsonPropertyOrder({ + AgentHealthRemediationStep.JSON_PROPERTY_ORDER, + AgentHealthRemediationStep.JSON_PROPERTY_TEXT +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class AgentHealthRemediationStep { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ORDER = "order"; + private Long order; + + public static final String JSON_PROPERTY_TEXT = "text"; + private String text; + + public AgentHealthRemediationStep order(Long order) { + this.order = order; + return this; + } + + /** + * The order in which to perform the step. + * + * @return order + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ORDER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOrder() { + return order; + } + + public void setOrder(Long order) { + this.order = order; + } + + public AgentHealthRemediationStep text(String text) { + this.text = text; + return this; + } + + /** + * The instructions for the step. + * + * @return text + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TEXT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + /** + * 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 AgentHealthRemediationStep + */ + @JsonAnySetter + public AgentHealthRemediationStep 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 AgentHealthRemediationStep object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AgentHealthRemediationStep agentHealthRemediationStep = (AgentHealthRemediationStep) o; + return Objects.equals(this.order, agentHealthRemediationStep.order) + && Objects.equals(this.text, agentHealthRemediationStep.text) + && Objects.equals( + this.additionalProperties, agentHealthRemediationStep.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(order, text, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AgentHealthRemediationStep {\n"); + sb.append(" order: ").append(toIndentedString(order)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).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/test/resources/com/datadog/api/client/v2/api/agent_health.feature b/src/test/resources/com/datadog/api/client/v2/api/agent_health.feature index 0e0dc268c74..20143df7800 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/agent_health.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/agent_health.feature @@ -1,21 +1,64 @@ @endpoint(agent-health) @endpoint(agent-health-v2) Feature: Agent Health - View Agent Health issues reported for node Agents and Cluster Agents. + List open Agent Health issues across your organization and get an issue + with its available remediation. Issues are reported by node Agents, + Cluster Agents, and OpenTelemetry collectors. The meaning of `resource_id` + depends on `resource_kind`: hostname for `host`, DaemonSet UID for + `deployment` (node Agent), cluster UUID for `cluster`, hostname of the + host running the Cluster Agent for `cluster_agent`, or OpenTelemetry + collector ID for `otel`. Background: Given a valid "apiKeyAuth" key in the system And an instance of "AgentHealth" API - And new "ListAgentHealthHostIssues" request - And request contains "resource_id" parameter with value "123e4567-e89b-12d3-a456-426614174000" + + @skip @team:ddoghq/fleet-remediation + Scenario: Get an Agent Health issue returns "Not Found" response + Given a valid "appKeyAuth" key in the system + And operation "GetAgentHealthIssue" enabled + And new "GetAgentHealthIssue" request + And request contains "issue_id" parameter with value "does-not-exist" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:ddoghq/fleet-remediation + Scenario: Get an Agent Health issue returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "GetAgentHealthIssue" enabled + And new "GetAgentHealthIssue" request + And request contains "issue_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @skip @team:ddoghq/fleet-remediation + Scenario: List Agent Health issues returns "Bad Request" response + Given a valid "appKeyAuth" key in the system + And operation "ListAgentHealthIssues" enabled + And new "ListAgentHealthIssues" request + And request contains "page[size]" parameter with value 1000 + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:ddoghq/fleet-remediation + Scenario: List Agent Health issues returns "OK" response + Given a valid "appKeyAuth" key in the system + And operation "ListAgentHealthIssues" enabled + And new "ListAgentHealthIssues" request + When the request is sent + Then the response status is 200 OK @skip @team:ddoghq/fleet-remediation Scenario: List active Agent Health issues returns "Bad Request" response - Given request contains "agent_type" parameter with value "process" + Given new "ListAgentHealthHostIssues" request + And request contains "resource_id" parameter with value "123e4567-e89b-12d3-a456-426614174000" + And request contains "agent_type" parameter with value "process" When the request is sent Then the response status is 400 Bad Request @skip @team:ddoghq/fleet-remediation Scenario: List active Agent Health issues returns "OK" response - Given request contains "agent_type" parameter with value "node" + Given new "ListAgentHealthHostIssues" request + And request contains "resource_id" parameter with value "123e4567-e89b-12d3-a456-426614174000" + And request contains "agent_type" parameter with value "node" 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 c8de5bd66d8..e4c54fc4fa2 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 @@ -245,6 +245,18 @@ "type": "safe" } }, + "ListAgentHealthIssues": { + "tag": "Agent Health", + "undo": { + "type": "safe" + } + }, + "GetAgentHealthIssue": { + "tag": "Agent Health", + "undo": { + "type": "safe" + } + }, "ListAwsScanOptions": { "tag": "Agentless Scanning", "undo": {