From 5e334132302371fa9b710c66f36044703cb48b3c Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 16 Apr 2026 13:25:47 +0000 Subject: [PATCH] Regenerate client from commit c21727e of spec repo --- .generator/schemas/v2/openapi.yaml | 423 ++++++ .../GetIndicatorOfCompromise.java | 27 + .../ListIndicatorsOfCompromise.java | 28 + .../com/datadog/api/client/ApiClient.java | 2 + .../client/v2/api/SecurityMonitoringApi.java | 419 ++++++ .../v2/model/GetIoCIndicatorResponse.java | 136 ++ .../GetIoCIndicatorResponseAttributes.java | 138 ++ .../v2/model/GetIoCIndicatorResponseData.java | 193 +++ .../v2/model/IoCExplorerListResponse.java | 136 ++ .../IoCExplorerListResponseAttributes.java | 209 +++ .../v2/model/IoCExplorerListResponseData.java | 193 +++ .../IoCExplorerListResponseMetadata.java | 137 ++ .../model/IoCExplorerListResponsePaging.java | 136 ++ .../api/client/v2/model/IoCGeoLocation.java | 191 +++ .../api/client/v2/model/IoCIndicator.java | 808 ++++++++++++ .../client/v2/model/IoCIndicatorDetailed.java | 1148 +++++++++++++++++ .../api/client/v2/model/IoCScoreEffect.java | 56 + .../v2/model/IoCSignalSeverityCount.java | 164 +++ .../api/client/v2/model/IoCSource.java | 135 ++ ...mpromise_returns_Not_Found_response.freeze | 1 + ...compromise_returns_Not_Found_response.json | 33 + ...r_of_compromise_returns_OK_response.freeze | 1 + ...tor_of_compromise_returns_OK_response.json | 33 + ...romise_returns_Bad_Request_response.freeze | 1 + ...mpromise_returns_Bad_Request_response.json | 33 + ...s_of_compromise_returns_OK_response.freeze | 1 + ...ors_of_compromise_returns_OK_response.json | 33 + .../client/v2/api/security_monitoring.feature | 40 + .../com/datadog/api/client/v2/api/undo.json | 12 + 29 files changed, 4867 insertions(+) create mode 100644 examples/v2/security-monitoring/GetIndicatorOfCompromise.java create mode 100644 examples/v2/security-monitoring/ListIndicatorsOfCompromise.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponseAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponseMetadata.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponsePaging.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCGeoLocation.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCIndicator.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCIndicatorDetailed.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCScoreEffect.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCSignalSeverityCount.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/IoCSource.java create mode 100644 src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_Not_Found_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_Not_Found_response.json create mode 100644 src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_Bad_Request_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_Bad_Request_response.json create mode 100644 src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_OK_response.json diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8a51fd127ec..800c3477a46 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29884,6 +29884,30 @@ components: required: - self type: object + GetIoCIndicatorResponse: + description: Response for the get indicator of compromise endpoint. + properties: + data: + $ref: "#/components/schemas/GetIoCIndicatorResponseData" + type: object + GetIoCIndicatorResponseAttributes: + description: Attributes of the get indicator response. + properties: + data: + $ref: "#/components/schemas/IoCIndicatorDetailed" + type: object + GetIoCIndicatorResponseData: + description: IoC indicator response data object. + properties: + attributes: + $ref: "#/components/schemas/GetIoCIndicatorResponseAttributes" + id: + description: Unique identifier for the response. + type: string + type: + description: Response type identifier. + type: string + type: object GetIssueIncludeQueryParameterItem: description: Relationship object that should be included in the response. enum: @@ -35391,6 +35415,301 @@ components: type: string x-enum-varnames: - INVESTIGATION + IoCExplorerListResponse: + description: Response for the list indicators of compromise endpoint. + properties: + data: + $ref: "#/components/schemas/IoCExplorerListResponseData" + type: object + IoCExplorerListResponseAttributes: + description: Attributes of the IoC Explorer list response. + properties: + data: + description: List of indicators of compromise. + items: + $ref: "#/components/schemas/IoCIndicator" + type: array + metadata: + $ref: "#/components/schemas/IoCExplorerListResponseMetadata" + paging: + $ref: "#/components/schemas/IoCExplorerListResponsePaging" + type: object + IoCExplorerListResponseData: + description: IoC Explorer list response data object. + properties: + attributes: + $ref: "#/components/schemas/IoCExplorerListResponseAttributes" + id: + description: Unique identifier for the response. + type: string + type: + description: Response type identifier. + type: string + type: object + IoCExplorerListResponseMetadata: + description: Response metadata. + properties: + count: + description: Total number of indicators matching the query. + format: int64 + type: integer + type: object + IoCExplorerListResponsePaging: + description: Pagination information. + properties: + offset: + description: Current pagination offset. + format: int64 + type: integer + type: object + IoCGeoLocation: + description: Geographic location information for an IP indicator. + properties: + city: + description: City name. + type: string + country_code: + description: ISO country code. + type: string + country_name: + description: Full country name. + type: string + type: object + IoCIndicator: + description: An indicator of compromise with threat intelligence data. + properties: + as_geo: + $ref: "#/components/schemas/IoCGeoLocation" + as_type: + description: Autonomous system type. + type: string + benign_sources: + description: Threat intelligence sources that flagged this indicator as benign. + items: + $ref: "#/components/schemas/IoCSource" + nullable: true + type: array + categories: + description: Threat categories associated with the indicator. + items: + type: string + type: array + first_seen: + description: Timestamp when the indicator was first seen. + format: date-time + type: string + id: + description: Unique identifier for the indicator. + type: string + indicator: + description: The indicator value (for example, an IP address or domain). + type: string + indicator_type: + description: Type of indicator (for example, IP address or domain). + type: string + last_seen: + description: Timestamp when the indicator was last seen. + format: date-time + type: string + log_matches: + description: Number of logs that matched this indicator. + format: int64 + type: integer + m_as_type: + $ref: "#/components/schemas/IoCScoreEffect" + m_persistence: + $ref: "#/components/schemas/IoCScoreEffect" + m_signal: + $ref: "#/components/schemas/IoCScoreEffect" + m_sources: + $ref: "#/components/schemas/IoCScoreEffect" + malicious_sources: + description: Threat intelligence sources that flagged this indicator as malicious. + items: + $ref: "#/components/schemas/IoCSource" + nullable: true + type: array + max_trust_score: + $ref: "#/components/schemas/IoCScoreEffect" + score: + description: Threat score for the indicator (0-100). + format: double + type: number + signal_matches: + description: Number of security signals that matched this indicator. + format: int64 + type: integer + signal_tier: + description: Signal tier level. + format: int64 + type: integer + suspicious_sources: + description: Threat intelligence sources that flagged this indicator as suspicious. + items: + $ref: "#/components/schemas/IoCSource" + nullable: true + type: array + tags: + description: Tags associated with the indicator. + items: + type: string + type: array + type: object + IoCIndicatorDetailed: + description: An indicator of compromise with extended context from your environment. + properties: + additional_data: + additionalProperties: {} + description: Additional domain-specific context from threat intelligence sources. + type: object + as_cidr_block: + description: Autonomous system CIDR block. + type: string + as_geo: + $ref: "#/components/schemas/IoCGeoLocation" + as_number: + description: Autonomous system number. + type: string + as_organization: + description: Autonomous system organization name. + type: string + as_type: + description: Autonomous system type. + type: string + benign_sources: + description: Threat intelligence sources that flagged this indicator as benign. + items: + $ref: "#/components/schemas/IoCSource" + nullable: true + type: array + categories: + description: Threat categories associated with the indicator. + items: + type: string + type: array + critical_assets: + description: Critical assets associated with this indicator. + items: + type: string + type: array + first_seen: + description: Timestamp when the indicator was first seen. + format: date-time + type: string + hosts: + description: Hosts associated with this indicator. + items: + type: string + type: array + id: + description: Unique identifier for the indicator. + type: string + indicator: + description: The indicator value (for example, an IP address or domain). + type: string + indicator_type: + description: Type of indicator (for example, IP address or domain). + type: string + last_seen: + description: Timestamp when the indicator was last seen. + format: date-time + type: string + log_matches: + description: Number of logs that matched this indicator. + format: int64 + type: integer + log_sources: + description: Log sources where this indicator was observed. + items: + type: string + type: array + m_as_type: + $ref: "#/components/schemas/IoCScoreEffect" + m_persistence: + $ref: "#/components/schemas/IoCScoreEffect" + m_signal: + $ref: "#/components/schemas/IoCScoreEffect" + m_sources: + $ref: "#/components/schemas/IoCScoreEffect" + malicious_sources: + description: Threat intelligence sources that flagged this indicator as malicious. + items: + $ref: "#/components/schemas/IoCSource" + nullable: true + type: array + max_trust_score: + $ref: "#/components/schemas/IoCScoreEffect" + score: + description: Threat score for the indicator (0-100). + format: double + type: number + services: + description: Services where this indicator was observed. + items: + type: string + type: array + signal_matches: + description: Number of security signals that matched this indicator. + format: int64 + type: integer + signal_severity: + description: Breakdown of security signals by severity. + items: + $ref: "#/components/schemas/IoCSignalSeverityCount" + type: array + signal_tier: + description: Signal tier level. + format: int64 + type: integer + suspicious_sources: + description: Threat intelligence sources that flagged this indicator as suspicious. + items: + $ref: "#/components/schemas/IoCSource" + nullable: true + type: array + tags: + description: Tags associated with the indicator. + items: + type: string + type: array + users: + additionalProperties: + description: List of user identifiers in this category. + items: + type: string + type: array + description: Users associated with this indicator, grouped by category. + type: object + type: object + IoCScoreEffect: + description: Effect of a scoring factor on the indicator's threat score. + enum: + - RAISE_SCORE + - LOWER_SCORE + - NO_EFFECT + type: string + x-enum-varnames: + - RAISE_SCORE + - LOWER_SCORE + - NO_EFFECT + IoCSignalSeverityCount: + description: Count of security signals by severity level. + properties: + count: + description: Number of signals at this severity level. + format: int64 + type: integer + severity: + description: Severity level (for example, critical, high, medium, low, info). + type: string + type: object + IoCSource: + description: A threat intelligence source that has flagged an indicator. + properties: + name: + description: Name of the threat intelligence source. + type: string + type: object Issue: description: The issue matching the request. properties: @@ -110601,6 +110920,110 @@ paths: x-unstable: |- **Note**: This endpoint is a private preview. If you are interested in accessing this API, [fill out this form](https://forms.gle/kMYC1sDr6WDUBDsx9). + /api/v2/security/siem/ioc-explorer: + get: + description: |- + Get a list of indicators of compromise (IoCs) matching the specified filters. + operationId: ListIndicatorsOfCompromise + parameters: + - description: Number of results per page. + in: query + name: limit + required: false + schema: + default: 50 + format: int32 + maximum: 2147483647 + type: integer + - description: Pagination offset. + in: query + name: offset + required: false + schema: + default: 0 + format: int32 + maximum: 2147483647 + type: integer + - description: Search/filter query (supports field:value syntax). + in: query + name: query + required: false + schema: + type: string + - description: "Sort column: score, first_seen_ts_epoch, last_seen_ts_epoch, indicator, indicator_type, signal_count, log_count, category, as_type." + in: query + name: sort[column] + required: false + schema: + default: score + type: string + - description: "Sort order: asc or desc." + in: query + name: sort[order] + required: false + schema: + default: desc + type: string + responses: + "200": + content: + "application/json": + schema: + $ref: "#/components/schemas/IoCExplorerListResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_signals_read + summary: List indicators of compromise + tags: ["Security Monitoring"] + x-unstable: |- + **Note**: This endpoint is in beta and may be subject to changes. + Please check the documentation regularly for updates. + /api/v2/security/siem/ioc-explorer/indicator: + get: + description: |- + Get detailed information about a specific indicator of compromise (IoC). + operationId: GetIndicatorOfCompromise + parameters: + - description: The indicator value to look up (for example, an IP address or domain). + in: query + name: indicator + required: true + schema: + type: string + responses: + "200": + content: + "application/json": + schema: + $ref: "#/components/schemas/GetIoCIndicatorResponse" + description: OK + "400": + $ref: "#/components/responses/BadRequestResponse" + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - security_monitoring_signals_read + summary: Get an indicator of compromise + tags: ["Security Monitoring"] + x-unstable: |- + **Note**: This endpoint is in beta and may be subject to changes. + Please check the documentation regularly for updates. /api/v2/security/signals/notification_rules: get: description: Returns the list of notification rules for security signals. diff --git a/examples/v2/security-monitoring/GetIndicatorOfCompromise.java b/examples/v2/security-monitoring/GetIndicatorOfCompromise.java new file mode 100644 index 00000000000..175c536de1e --- /dev/null +++ b/examples/v2/security-monitoring/GetIndicatorOfCompromise.java @@ -0,0 +1,27 @@ +// Get an indicator of compromise returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.model.GetIoCIndicatorResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getIndicatorOfCompromise", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + GetIoCIndicatorResponse result = + apiInstance.getIndicatorOfCompromise( + "masscan/1.3 (https://github.com/robertdavidgraham/masscan)"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#getIndicatorOfCompromise"); + 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/security-monitoring/ListIndicatorsOfCompromise.java b/examples/v2/security-monitoring/ListIndicatorsOfCompromise.java new file mode 100644 index 00000000000..d7df1daebf2 --- /dev/null +++ b/examples/v2/security-monitoring/ListIndicatorsOfCompromise.java @@ -0,0 +1,28 @@ +// List indicators of compromise returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SecurityMonitoringApi; +import com.datadog.api.client.v2.api.SecurityMonitoringApi.ListIndicatorsOfCompromiseOptionalParameters; +import com.datadog.api.client.v2.model.IoCExplorerListResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listIndicatorsOfCompromise", true); + SecurityMonitoringApi apiInstance = new SecurityMonitoringApi(defaultClient); + + try { + IoCExplorerListResponse result = + apiInstance.listIndicatorsOfCompromise( + new ListIndicatorsOfCompromiseOptionalParameters().limit(1)); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SecurityMonitoringApi#listIndicatorsOfCompromise"); + 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 06a633a7e75..9c01c7b086e 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -807,12 +807,14 @@ public class ApiClient { put("v2.deleteThreatHuntingJob", false); put("v2.getContentPacksStates", false); put("v2.getFinding", false); + put("v2.getIndicatorOfCompromise", false); put("v2.getRuleVersionHistory", false); put("v2.getSecretsRules", false); put("v2.getSecurityMonitoringHistsignal", false); put("v2.getSecurityMonitoringHistsignalsByJobId", false); put("v2.getThreatHuntingJob", false); put("v2.listFindings", false); + put("v2.listIndicatorsOfCompromise", false); put("v2.listMultipleRulesets", false); put("v2.listScannedAssetsMetadata", false); put("v2.listSecurityMonitoringHistsignals", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java index f940565e4f8..eb545900a81 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SecurityMonitoringApi.java @@ -27,12 +27,14 @@ import com.datadog.api.client.v2.model.FindingVulnerabilityType; import com.datadog.api.client.v2.model.GetCustomFrameworkResponse; import com.datadog.api.client.v2.model.GetFindingResponse; +import com.datadog.api.client.v2.model.GetIoCIndicatorResponse; import com.datadog.api.client.v2.model.GetMultipleRulesetsRequest; import com.datadog.api.client.v2.model.GetMultipleRulesetsResponse; import com.datadog.api.client.v2.model.GetResourceEvaluationFiltersResponse; import com.datadog.api.client.v2.model.GetRuleVersionHistoryResponse; import com.datadog.api.client.v2.model.GetSBOMResponse; import com.datadog.api.client.v2.model.GetSuppressionVersionHistoryResponse; +import com.datadog.api.client.v2.model.IoCExplorerListResponse; import com.datadog.api.client.v2.model.JobCreateResponse; import com.datadog.api.client.v2.model.ListAssetsSBOMsResponse; import com.datadog.api.client.v2.model.ListFindingsResponse; @@ -5473,6 +5475,167 @@ public CompletableFuture> getFindingWithHttpInfo new GenericType() {}); } + /** + * Get an indicator of compromise. + * + *

See {@link #getIndicatorOfCompromiseWithHttpInfo}. + * + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @return GetIoCIndicatorResponse + * @throws ApiException if fails to make API call + */ + public GetIoCIndicatorResponse getIndicatorOfCompromise(String indicator) throws ApiException { + return getIndicatorOfCompromiseWithHttpInfo(indicator).getData(); + } + + /** + * Get an indicator of compromise. + * + *

See {@link #getIndicatorOfCompromiseWithHttpInfoAsync}. + * + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @return CompletableFuture<GetIoCIndicatorResponse> + */ + public CompletableFuture getIndicatorOfCompromiseAsync( + String indicator) { + return getIndicatorOfCompromiseWithHttpInfoAsync(indicator) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get detailed information about a specific indicator of compromise (IoC). + * + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @return ApiResponse<GetIoCIndicatorResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
+ */ + public ApiResponse getIndicatorOfCompromiseWithHttpInfo(String indicator) + throws ApiException { + // Check if unstable operation is enabled + String operationId = "getIndicatorOfCompromise"; + 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 'indicator' is set + if (indicator == null) { + throw new ApiException( + 400, "Missing the required parameter 'indicator' when calling getIndicatorOfCompromise"); + } + // create path and map variables + String localVarPath = "/api/v2/security/siem/ioc-explorer/indicator"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "indicator", indicator)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getIndicatorOfCompromise", + 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() {}); + } + + /** + * Get an indicator of compromise. + * + *

See {@link #getIndicatorOfCompromiseWithHttpInfo}. + * + * @param indicator The indicator value to look up (for example, an IP address or domain). + * (required) + * @return CompletableFuture<ApiResponse<GetIoCIndicatorResponse>> + */ + public CompletableFuture> + getIndicatorOfCompromiseWithHttpInfoAsync(String indicator) { + // Check if unstable operation is enabled + String operationId = "getIndicatorOfCompromise"; + 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 'indicator' is set + if (indicator == null) { + CompletableFuture> result = new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'indicator' when calling getIndicatorOfCompromise")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/security/siem/ioc-explorer/indicator"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "indicator", indicator)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.getIndicatorOfCompromise", + 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() {}); + } + /** * Get investigation queries for a signal. * @@ -9792,6 +9955,262 @@ public CompletableFuture> listFindingsWithHttp new GenericType() {}); } + /** Manage optional parameters to listIndicatorsOfCompromise. */ + public static class ListIndicatorsOfCompromiseOptionalParameters { + private Integer limit; + private Integer offset; + private String query; + private String sortColumn; + private String sortOrder; + + /** + * Set limit. + * + * @param limit Number of results per page. (optional, default to 50) + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters limit(Integer limit) { + this.limit = limit; + return this; + } + + /** + * Set offset. + * + * @param offset Pagination offset. (optional, default to 0) + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters offset(Integer offset) { + this.offset = offset; + return this; + } + + /** + * Set query. + * + * @param query Search/filter query (supports field:value syntax). (optional) + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters query(String query) { + this.query = query; + return this; + } + + /** + * Set sortColumn. + * + * @param sortColumn Sort column: score, first_seen_ts_epoch, last_seen_ts_epoch, indicator, + * indicator_type, signal_count, log_count, category, as_type. (optional, default to + * "score") + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters sortColumn(String sortColumn) { + this.sortColumn = sortColumn; + return this; + } + + /** + * Set sortOrder. + * + * @param sortOrder Sort order: asc or desc. (optional, default to "desc") + * @return ListIndicatorsOfCompromiseOptionalParameters + */ + public ListIndicatorsOfCompromiseOptionalParameters sortOrder(String sortOrder) { + this.sortOrder = sortOrder; + return this; + } + } + + /** + * List indicators of compromise. + * + *

See {@link #listIndicatorsOfCompromiseWithHttpInfo}. + * + * @return IoCExplorerListResponse + * @throws ApiException if fails to make API call + */ + public IoCExplorerListResponse listIndicatorsOfCompromise() throws ApiException { + return listIndicatorsOfCompromiseWithHttpInfo( + new ListIndicatorsOfCompromiseOptionalParameters()) + .getData(); + } + + /** + * List indicators of compromise. + * + *

See {@link #listIndicatorsOfCompromiseWithHttpInfoAsync}. + * + * @return CompletableFuture<IoCExplorerListResponse> + */ + public CompletableFuture listIndicatorsOfCompromiseAsync() { + return listIndicatorsOfCompromiseWithHttpInfoAsync( + new ListIndicatorsOfCompromiseOptionalParameters()) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * List indicators of compromise. + * + *

See {@link #listIndicatorsOfCompromiseWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return IoCExplorerListResponse + * @throws ApiException if fails to make API call + */ + public IoCExplorerListResponse listIndicatorsOfCompromise( + ListIndicatorsOfCompromiseOptionalParameters parameters) throws ApiException { + return listIndicatorsOfCompromiseWithHttpInfo(parameters).getData(); + } + + /** + * List indicators of compromise. + * + *

See {@link #listIndicatorsOfCompromiseWithHttpInfoAsync}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<IoCExplorerListResponse> + */ + public CompletableFuture listIndicatorsOfCompromiseAsync( + ListIndicatorsOfCompromiseOptionalParameters parameters) { + return listIndicatorsOfCompromiseWithHttpInfoAsync(parameters) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Get a list of indicators of compromise (IoCs) matching the specified filters. + * + * @param parameters Optional parameters for the request. + * @return ApiResponse<IoCExplorerListResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse listIndicatorsOfCompromiseWithHttpInfo( + ListIndicatorsOfCompromiseOptionalParameters parameters) throws ApiException { + // Check if unstable operation is enabled + String operationId = "listIndicatorsOfCompromise"; + 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; + Integer limit = parameters.limit; + Integer offset = parameters.offset; + String query = parameters.query; + String sortColumn = parameters.sortColumn; + String sortOrder = parameters.sortOrder; + // create path and map variables + String localVarPath = "/api/v2/security/siem/ioc-explorer"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[column]", sortColumn)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[order]", sortOrder)); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listIndicatorsOfCompromise", + 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 indicators of compromise. + * + *

See {@link #listIndicatorsOfCompromiseWithHttpInfo}. + * + * @param parameters Optional parameters for the request. + * @return CompletableFuture<ApiResponse<IoCExplorerListResponse>> + */ + public CompletableFuture> + listIndicatorsOfCompromiseWithHttpInfoAsync( + ListIndicatorsOfCompromiseOptionalParameters parameters) { + // Check if unstable operation is enabled + String operationId = "listIndicatorsOfCompromise"; + 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; + Integer limit = parameters.limit; + Integer offset = parameters.offset; + String query = parameters.query; + String sortColumn = parameters.sortColumn; + String sortOrder = parameters.sortOrder; + // create path and map variables + String localVarPath = "/api/v2/security/siem/ioc-explorer"; + + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "offset", offset)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[column]", sortColumn)); + localVarQueryParams.addAll(apiClient.parameterToPairs("", "sort[order]", sortOrder)); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SecurityMonitoringApi.listIndicatorsOfCompromise", + 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() {}); + } + /** * Ruleset get multiple. * diff --git a/src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponse.java b/src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponse.java new file mode 100644 index 00000000000..ee9dca5f939 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponse.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** Response for the get indicator of compromise endpoint. */ +@JsonPropertyOrder({GetIoCIndicatorResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetIoCIndicatorResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private GetIoCIndicatorResponseData data; + + public GetIoCIndicatorResponse data(GetIoCIndicatorResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * IoC indicator response data object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetIoCIndicatorResponseData getData() { + return data; + } + + public void setData(GetIoCIndicatorResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GetIoCIndicatorResponse + */ + @JsonAnySetter + public GetIoCIndicatorResponse 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 GetIoCIndicatorResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetIoCIndicatorResponse getIoCIndicatorResponse = (GetIoCIndicatorResponse) o; + return Objects.equals(this.data, getIoCIndicatorResponse.data) + && Objects.equals(this.additionalProperties, getIoCIndicatorResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetIoCIndicatorResponse {\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/GetIoCIndicatorResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponseAttributes.java new file mode 100644 index 00000000000..9b776b7fd99 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponseAttributes.java @@ -0,0 +1,138 @@ +/* + * 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; + +/** Attributes of the get indicator response. */ +@JsonPropertyOrder({GetIoCIndicatorResponseAttributes.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetIoCIndicatorResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IoCIndicatorDetailed data; + + public GetIoCIndicatorResponseAttributes data(IoCIndicatorDetailed data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * An indicator of compromise with extended context from your environment. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCIndicatorDetailed getData() { + return data; + } + + public void setData(IoCIndicatorDetailed data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GetIoCIndicatorResponseAttributes + */ + @JsonAnySetter + public GetIoCIndicatorResponseAttributes 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 GetIoCIndicatorResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetIoCIndicatorResponseAttributes getIoCIndicatorResponseAttributes = + (GetIoCIndicatorResponseAttributes) o; + return Objects.equals(this.data, getIoCIndicatorResponseAttributes.data) + && Objects.equals( + this.additionalProperties, getIoCIndicatorResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetIoCIndicatorResponseAttributes {\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/GetIoCIndicatorResponseData.java b/src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponseData.java new file mode 100644 index 00000000000..fb3ee1dabf0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetIoCIndicatorResponseData.java @@ -0,0 +1,193 @@ +/* + * 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; + +/** IoC indicator response data object. */ +@JsonPropertyOrder({ + GetIoCIndicatorResponseData.JSON_PROPERTY_ATTRIBUTES, + GetIoCIndicatorResponseData.JSON_PROPERTY_ID, + GetIoCIndicatorResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetIoCIndicatorResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private GetIoCIndicatorResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public GetIoCIndicatorResponseData attributes(GetIoCIndicatorResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the get indicator response. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public GetIoCIndicatorResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(GetIoCIndicatorResponseAttributes attributes) { + this.attributes = attributes; + } + + public GetIoCIndicatorResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the response. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public GetIoCIndicatorResponseData type(String type) { + this.type = type; + return this; + } + + /** + * Response type identifier. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GetIoCIndicatorResponseData + */ + @JsonAnySetter + public GetIoCIndicatorResponseData 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 GetIoCIndicatorResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetIoCIndicatorResponseData getIoCIndicatorResponseData = (GetIoCIndicatorResponseData) o; + return Objects.equals(this.attributes, getIoCIndicatorResponseData.attributes) + && Objects.equals(this.id, getIoCIndicatorResponseData.id) + && Objects.equals(this.type, getIoCIndicatorResponseData.type) + && Objects.equals( + this.additionalProperties, getIoCIndicatorResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetIoCIndicatorResponseData {\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/IoCExplorerListResponse.java b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponse.java new file mode 100644 index 00000000000..01610f6ee7d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponse.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** Response for the list indicators of compromise endpoint. */ +@JsonPropertyOrder({IoCExplorerListResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCExplorerListResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private IoCExplorerListResponseData data; + + public IoCExplorerListResponse data(IoCExplorerListResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * IoC Explorer list response data object. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCExplorerListResponseData getData() { + return data; + } + + public void setData(IoCExplorerListResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IoCExplorerListResponse + */ + @JsonAnySetter + public IoCExplorerListResponse 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 IoCExplorerListResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCExplorerListResponse ioCExplorerListResponse = (IoCExplorerListResponse) o; + return Objects.equals(this.data, ioCExplorerListResponse.data) + && Objects.equals(this.additionalProperties, ioCExplorerListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCExplorerListResponse {\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/IoCExplorerListResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponseAttributes.java new file mode 100644 index 00000000000..5f61cd53042 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponseAttributes.java @@ -0,0 +1,209 @@ +/* + * 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; + +/** Attributes of the IoC Explorer list response. */ +@JsonPropertyOrder({ + IoCExplorerListResponseAttributes.JSON_PROPERTY_DATA, + IoCExplorerListResponseAttributes.JSON_PROPERTY_METADATA, + IoCExplorerListResponseAttributes.JSON_PROPERTY_PAGING +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCExplorerListResponseAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public static final String JSON_PROPERTY_METADATA = "metadata"; + private IoCExplorerListResponseMetadata metadata; + + public static final String JSON_PROPERTY_PAGING = "paging"; + private IoCExplorerListResponsePaging paging; + + public IoCExplorerListResponseAttributes data(List data) { + this.data = data; + for (IoCIndicator item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IoCExplorerListResponseAttributes addDataItem(IoCIndicator dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of indicators of compromise. + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public IoCExplorerListResponseAttributes metadata(IoCExplorerListResponseMetadata metadata) { + this.metadata = metadata; + this.unparsed |= metadata.unparsed; + return this; + } + + /** + * Response metadata. + * + * @return metadata + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_METADATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCExplorerListResponseMetadata getMetadata() { + return metadata; + } + + public void setMetadata(IoCExplorerListResponseMetadata metadata) { + this.metadata = metadata; + } + + public IoCExplorerListResponseAttributes paging(IoCExplorerListResponsePaging paging) { + this.paging = paging; + this.unparsed |= paging.unparsed; + return this; + } + + /** + * Pagination information. + * + * @return paging + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PAGING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCExplorerListResponsePaging getPaging() { + return paging; + } + + public void setPaging(IoCExplorerListResponsePaging paging) { + this.paging = paging; + } + + /** + * 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 IoCExplorerListResponseAttributes + */ + @JsonAnySetter + public IoCExplorerListResponseAttributes 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 IoCExplorerListResponseAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCExplorerListResponseAttributes ioCExplorerListResponseAttributes = + (IoCExplorerListResponseAttributes) o; + return Objects.equals(this.data, ioCExplorerListResponseAttributes.data) + && Objects.equals(this.metadata, ioCExplorerListResponseAttributes.metadata) + && Objects.equals(this.paging, ioCExplorerListResponseAttributes.paging) + && Objects.equals( + this.additionalProperties, ioCExplorerListResponseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, metadata, paging, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCExplorerListResponseAttributes {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" paging: ").append(toIndentedString(paging)).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/IoCExplorerListResponseData.java b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponseData.java new file mode 100644 index 00000000000..cb5d16337f2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponseData.java @@ -0,0 +1,193 @@ +/* + * 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; + +/** IoC Explorer list response data object. */ +@JsonPropertyOrder({ + IoCExplorerListResponseData.JSON_PROPERTY_ATTRIBUTES, + IoCExplorerListResponseData.JSON_PROPERTY_ID, + IoCExplorerListResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCExplorerListResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private IoCExplorerListResponseAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type; + + public IoCExplorerListResponseData attributes(IoCExplorerListResponseAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes of the IoC Explorer list response. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCExplorerListResponseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(IoCExplorerListResponseAttributes attributes) { + this.attributes = attributes; + } + + public IoCExplorerListResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the response. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IoCExplorerListResponseData type(String type) { + this.type = type; + return this; + } + + /** + * Response type identifier. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return IoCExplorerListResponseData + */ + @JsonAnySetter + public IoCExplorerListResponseData 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 IoCExplorerListResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCExplorerListResponseData ioCExplorerListResponseData = (IoCExplorerListResponseData) o; + return Objects.equals(this.attributes, ioCExplorerListResponseData.attributes) + && Objects.equals(this.id, ioCExplorerListResponseData.id) + && Objects.equals(this.type, ioCExplorerListResponseData.type) + && Objects.equals( + this.additionalProperties, ioCExplorerListResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCExplorerListResponseData {\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/IoCExplorerListResponseMetadata.java b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponseMetadata.java new file mode 100644 index 00000000000..1908281609f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponseMetadata.java @@ -0,0 +1,137 @@ +/* + * 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; + +/** Response metadata. */ +@JsonPropertyOrder({IoCExplorerListResponseMetadata.JSON_PROPERTY_COUNT}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCExplorerListResponseMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public IoCExplorerListResponseMetadata count(Long count) { + this.count = count; + return this; + } + + /** + * Total number of indicators matching the query. + * + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + /** + * 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 IoCExplorerListResponseMetadata + */ + @JsonAnySetter + public IoCExplorerListResponseMetadata 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 IoCExplorerListResponseMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCExplorerListResponseMetadata ioCExplorerListResponseMetadata = + (IoCExplorerListResponseMetadata) o; + return Objects.equals(this.count, ioCExplorerListResponseMetadata.count) + && Objects.equals( + this.additionalProperties, ioCExplorerListResponseMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCExplorerListResponseMetadata {\n"); + sb.append(" count: ").append(toIndentedString(count)).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/IoCExplorerListResponsePaging.java b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponsePaging.java new file mode 100644 index 00000000000..e55cde159ff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCExplorerListResponsePaging.java @@ -0,0 +1,136 @@ +/* + * 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; + +/** Pagination information. */ +@JsonPropertyOrder({IoCExplorerListResponsePaging.JSON_PROPERTY_OFFSET}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCExplorerListResponsePaging { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OFFSET = "offset"; + private Long offset; + + public IoCExplorerListResponsePaging offset(Long offset) { + this.offset = offset; + return this; + } + + /** + * Current pagination offset. + * + * @return offset + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getOffset() { + return offset; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + /** + * 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 IoCExplorerListResponsePaging + */ + @JsonAnySetter + public IoCExplorerListResponsePaging 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 IoCExplorerListResponsePaging object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCExplorerListResponsePaging ioCExplorerListResponsePaging = (IoCExplorerListResponsePaging) o; + return Objects.equals(this.offset, ioCExplorerListResponsePaging.offset) + && Objects.equals( + this.additionalProperties, ioCExplorerListResponsePaging.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(offset, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCExplorerListResponsePaging {\n"); + sb.append(" offset: ").append(toIndentedString(offset)).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/IoCGeoLocation.java b/src/main/java/com/datadog/api/client/v2/model/IoCGeoLocation.java new file mode 100644 index 00000000000..cf027e09be9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCGeoLocation.java @@ -0,0 +1,191 @@ +/* + * 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; + +/** Geographic location information for an IP indicator. */ +@JsonPropertyOrder({ + IoCGeoLocation.JSON_PROPERTY_CITY, + IoCGeoLocation.JSON_PROPERTY_COUNTRY_CODE, + IoCGeoLocation.JSON_PROPERTY_COUNTRY_NAME +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCGeoLocation { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CITY = "city"; + private String city; + + public static final String JSON_PROPERTY_COUNTRY_CODE = "country_code"; + private String countryCode; + + public static final String JSON_PROPERTY_COUNTRY_NAME = "country_name"; + private String countryName; + + public IoCGeoLocation city(String city) { + this.city = city; + return this; + } + + /** + * City name. + * + * @return city + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public IoCGeoLocation countryCode(String countryCode) { + this.countryCode = countryCode; + return this; + } + + /** + * ISO country code. + * + * @return countryCode + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNTRY_CODE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountryCode() { + return countryCode; + } + + public void setCountryCode(String countryCode) { + this.countryCode = countryCode; + } + + public IoCGeoLocation countryName(String countryName) { + this.countryName = countryName; + return this; + } + + /** + * Full country name. + * + * @return countryName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNTRY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getCountryName() { + return countryName; + } + + public void setCountryName(String countryName) { + this.countryName = countryName; + } + + /** + * 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 IoCGeoLocation + */ + @JsonAnySetter + public IoCGeoLocation 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 IoCGeoLocation object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCGeoLocation ioCGeoLocation = (IoCGeoLocation) o; + return Objects.equals(this.city, ioCGeoLocation.city) + && Objects.equals(this.countryCode, ioCGeoLocation.countryCode) + && Objects.equals(this.countryName, ioCGeoLocation.countryName) + && Objects.equals(this.additionalProperties, ioCGeoLocation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(city, countryCode, countryName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCGeoLocation {\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" countryCode: ").append(toIndentedString(countryCode)).append("\n"); + sb.append(" countryName: ").append(toIndentedString(countryName)).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/IoCIndicator.java b/src/main/java/com/datadog/api/client/v2/model/IoCIndicator.java new file mode 100644 index 00000000000..1e9d83fd4ab --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCIndicator.java @@ -0,0 +1,808 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** An indicator of compromise with threat intelligence data. */ +@JsonPropertyOrder({ + IoCIndicator.JSON_PROPERTY_AS_GEO, + IoCIndicator.JSON_PROPERTY_AS_TYPE, + IoCIndicator.JSON_PROPERTY_BENIGN_SOURCES, + IoCIndicator.JSON_PROPERTY_CATEGORIES, + IoCIndicator.JSON_PROPERTY_FIRST_SEEN, + IoCIndicator.JSON_PROPERTY_ID, + IoCIndicator.JSON_PROPERTY_INDICATOR, + IoCIndicator.JSON_PROPERTY_INDICATOR_TYPE, + IoCIndicator.JSON_PROPERTY_LAST_SEEN, + IoCIndicator.JSON_PROPERTY_LOG_MATCHES, + IoCIndicator.JSON_PROPERTY_M_AS_TYPE, + IoCIndicator.JSON_PROPERTY_M_PERSISTENCE, + IoCIndicator.JSON_PROPERTY_M_SIGNAL, + IoCIndicator.JSON_PROPERTY_M_SOURCES, + IoCIndicator.JSON_PROPERTY_MALICIOUS_SOURCES, + IoCIndicator.JSON_PROPERTY_MAX_TRUST_SCORE, + IoCIndicator.JSON_PROPERTY_SCORE, + IoCIndicator.JSON_PROPERTY_SIGNAL_MATCHES, + IoCIndicator.JSON_PROPERTY_SIGNAL_TIER, + IoCIndicator.JSON_PROPERTY_SUSPICIOUS_SOURCES, + IoCIndicator.JSON_PROPERTY_TAGS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCIndicator { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AS_GEO = "as_geo"; + private IoCGeoLocation asGeo; + + public static final String JSON_PROPERTY_AS_TYPE = "as_type"; + private String asType; + + public static final String JSON_PROPERTY_BENIGN_SOURCES = "benign_sources"; + private JsonNullable> benignSources = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_CATEGORIES = "categories"; + private List categories = null; + + public static final String JSON_PROPERTY_FIRST_SEEN = "first_seen"; + private OffsetDateTime firstSeen; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_INDICATOR = "indicator"; + private String indicator; + + public static final String JSON_PROPERTY_INDICATOR_TYPE = "indicator_type"; + private String indicatorType; + + public static final String JSON_PROPERTY_LAST_SEEN = "last_seen"; + private OffsetDateTime lastSeen; + + public static final String JSON_PROPERTY_LOG_MATCHES = "log_matches"; + private Long logMatches; + + public static final String JSON_PROPERTY_M_AS_TYPE = "m_as_type"; + private IoCScoreEffect mAsType; + + public static final String JSON_PROPERTY_M_PERSISTENCE = "m_persistence"; + private IoCScoreEffect mPersistence; + + public static final String JSON_PROPERTY_M_SIGNAL = "m_signal"; + private IoCScoreEffect mSignal; + + public static final String JSON_PROPERTY_M_SOURCES = "m_sources"; + private IoCScoreEffect mSources; + + public static final String JSON_PROPERTY_MALICIOUS_SOURCES = "malicious_sources"; + private JsonNullable> maliciousSources = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_MAX_TRUST_SCORE = "max_trust_score"; + private IoCScoreEffect maxTrustScore; + + public static final String JSON_PROPERTY_SCORE = "score"; + private Double score; + + public static final String JSON_PROPERTY_SIGNAL_MATCHES = "signal_matches"; + private Long signalMatches; + + public static final String JSON_PROPERTY_SIGNAL_TIER = "signal_tier"; + private Long signalTier; + + public static final String JSON_PROPERTY_SUSPICIOUS_SOURCES = "suspicious_sources"; + private JsonNullable> suspiciousSources = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public IoCIndicator asGeo(IoCGeoLocation asGeo) { + this.asGeo = asGeo; + this.unparsed |= asGeo.unparsed; + return this; + } + + /** + * Geographic location information for an IP indicator. + * + * @return asGeo + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AS_GEO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCGeoLocation getAsGeo() { + return asGeo; + } + + public void setAsGeo(IoCGeoLocation asGeo) { + this.asGeo = asGeo; + } + + public IoCIndicator asType(String asType) { + this.asType = asType; + return this; + } + + /** + * Autonomous system type. + * + * @return asType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AS_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAsType() { + return asType; + } + + public void setAsType(String asType) { + this.asType = asType; + } + + public IoCIndicator benignSources(List benignSources) { + this.benignSources = JsonNullable.>of(benignSources); + return this; + } + + public IoCIndicator addBenignSourcesItem(IoCSource benignSourcesItem) { + if (this.benignSources == null || !this.benignSources.isPresent()) { + this.benignSources = JsonNullable.>of(new ArrayList<>()); + } + try { + this.benignSources.get().add(benignSourcesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Threat intelligence sources that flagged this indicator as benign. + * + * @return benignSources + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getBenignSources() { + return benignSources.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BENIGN_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getBenignSources_JsonNullable() { + return benignSources; + } + + @JsonProperty(JSON_PROPERTY_BENIGN_SOURCES) + public void setBenignSources_JsonNullable(JsonNullable> benignSources) { + this.benignSources = benignSources; + } + + public void setBenignSources(List benignSources) { + this.benignSources = JsonNullable.>of(benignSources); + } + + public IoCIndicator categories(List categories) { + this.categories = categories; + return this; + } + + public IoCIndicator addCategoriesItem(String categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList<>(); + } + this.categories.add(categoriesItem); + return this; + } + + /** + * Threat categories associated with the indicator. + * + * @return categories + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCategories() { + return categories; + } + + public void setCategories(List categories) { + this.categories = categories; + } + + public IoCIndicator firstSeen(OffsetDateTime firstSeen) { + this.firstSeen = firstSeen; + return this; + } + + /** + * Timestamp when the indicator was first seen. + * + * @return firstSeen + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_SEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getFirstSeen() { + return firstSeen; + } + + public void setFirstSeen(OffsetDateTime firstSeen) { + this.firstSeen = firstSeen; + } + + public IoCIndicator id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the indicator. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IoCIndicator indicator(String indicator) { + this.indicator = indicator; + return this; + } + + /** + * The indicator value (for example, an IP address or domain). + * + * @return indicator + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDICATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndicator() { + return indicator; + } + + public void setIndicator(String indicator) { + this.indicator = indicator; + } + + public IoCIndicator indicatorType(String indicatorType) { + this.indicatorType = indicatorType; + return this; + } + + /** + * Type of indicator (for example, IP address or domain). + * + * @return indicatorType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDICATOR_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndicatorType() { + return indicatorType; + } + + public void setIndicatorType(String indicatorType) { + this.indicatorType = indicatorType; + } + + public IoCIndicator lastSeen(OffsetDateTime lastSeen) { + this.lastSeen = lastSeen; + return this; + } + + /** + * Timestamp when the indicator was last seen. + * + * @return lastSeen + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_SEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastSeen() { + return lastSeen; + } + + public void setLastSeen(OffsetDateTime lastSeen) { + this.lastSeen = lastSeen; + } + + public IoCIndicator logMatches(Long logMatches) { + this.logMatches = logMatches; + return this; + } + + /** + * Number of logs that matched this indicator. + * + * @return logMatches + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOG_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLogMatches() { + return logMatches; + } + + public void setLogMatches(Long logMatches) { + this.logMatches = logMatches; + } + + public IoCIndicator mAsType(IoCScoreEffect mAsType) { + this.mAsType = mAsType; + this.unparsed |= !mAsType.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return mAsType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_M_AS_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMAsType() { + return mAsType; + } + + public void setMAsType(IoCScoreEffect mAsType) { + if (!mAsType.isValid()) { + this.unparsed = true; + } + this.mAsType = mAsType; + } + + public IoCIndicator mPersistence(IoCScoreEffect mPersistence) { + this.mPersistence = mPersistence; + this.unparsed |= !mPersistence.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return mPersistence + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_M_PERSISTENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMPersistence() { + return mPersistence; + } + + public void setMPersistence(IoCScoreEffect mPersistence) { + if (!mPersistence.isValid()) { + this.unparsed = true; + } + this.mPersistence = mPersistence; + } + + public IoCIndicator mSignal(IoCScoreEffect mSignal) { + this.mSignal = mSignal; + this.unparsed |= !mSignal.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return mSignal + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_M_SIGNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMSignal() { + return mSignal; + } + + public void setMSignal(IoCScoreEffect mSignal) { + if (!mSignal.isValid()) { + this.unparsed = true; + } + this.mSignal = mSignal; + } + + public IoCIndicator mSources(IoCScoreEffect mSources) { + this.mSources = mSources; + this.unparsed |= !mSources.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return mSources + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_M_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMSources() { + return mSources; + } + + public void setMSources(IoCScoreEffect mSources) { + if (!mSources.isValid()) { + this.unparsed = true; + } + this.mSources = mSources; + } + + public IoCIndicator maliciousSources(List maliciousSources) { + this.maliciousSources = JsonNullable.>of(maliciousSources); + return this; + } + + public IoCIndicator addMaliciousSourcesItem(IoCSource maliciousSourcesItem) { + if (this.maliciousSources == null || !this.maliciousSources.isPresent()) { + this.maliciousSources = JsonNullable.>of(new ArrayList<>()); + } + try { + this.maliciousSources.get().add(maliciousSourcesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Threat intelligence sources that flagged this indicator as malicious. + * + * @return maliciousSources + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getMaliciousSources() { + return maliciousSources.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MALICIOUS_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getMaliciousSources_JsonNullable() { + return maliciousSources; + } + + @JsonProperty(JSON_PROPERTY_MALICIOUS_SOURCES) + public void setMaliciousSources_JsonNullable(JsonNullable> maliciousSources) { + this.maliciousSources = maliciousSources; + } + + public void setMaliciousSources(List maliciousSources) { + this.maliciousSources = JsonNullable.>of(maliciousSources); + } + + public IoCIndicator maxTrustScore(IoCScoreEffect maxTrustScore) { + this.maxTrustScore = maxTrustScore; + this.unparsed |= !maxTrustScore.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return maxTrustScore + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_TRUST_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMaxTrustScore() { + return maxTrustScore; + } + + public void setMaxTrustScore(IoCScoreEffect maxTrustScore) { + if (!maxTrustScore.isValid()) { + this.unparsed = true; + } + this.maxTrustScore = maxTrustScore; + } + + public IoCIndicator score(Double score) { + this.score = score; + return this; + } + + /** + * Threat score for the indicator (0-100). + * + * @return score + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getScore() { + return score; + } + + public void setScore(Double score) { + this.score = score; + } + + public IoCIndicator signalMatches(Long signalMatches) { + this.signalMatches = signalMatches; + return this; + } + + /** + * Number of security signals that matched this indicator. + * + * @return signalMatches + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNAL_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSignalMatches() { + return signalMatches; + } + + public void setSignalMatches(Long signalMatches) { + this.signalMatches = signalMatches; + } + + public IoCIndicator signalTier(Long signalTier) { + this.signalTier = signalTier; + return this; + } + + /** + * Signal tier level. + * + * @return signalTier + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNAL_TIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSignalTier() { + return signalTier; + } + + public void setSignalTier(Long signalTier) { + this.signalTier = signalTier; + } + + public IoCIndicator suspiciousSources(List suspiciousSources) { + this.suspiciousSources = JsonNullable.>of(suspiciousSources); + return this; + } + + public IoCIndicator addSuspiciousSourcesItem(IoCSource suspiciousSourcesItem) { + if (this.suspiciousSources == null || !this.suspiciousSources.isPresent()) { + this.suspiciousSources = JsonNullable.>of(new ArrayList<>()); + } + try { + this.suspiciousSources.get().add(suspiciousSourcesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Threat intelligence sources that flagged this indicator as suspicious. + * + * @return suspiciousSources + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getSuspiciousSources() { + return suspiciousSources.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUSPICIOUS_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getSuspiciousSources_JsonNullable() { + return suspiciousSources; + } + + @JsonProperty(JSON_PROPERTY_SUSPICIOUS_SOURCES) + public void setSuspiciousSources_JsonNullable(JsonNullable> suspiciousSources) { + this.suspiciousSources = suspiciousSources; + } + + public void setSuspiciousSources(List suspiciousSources) { + this.suspiciousSources = JsonNullable.>of(suspiciousSources); + } + + public IoCIndicator tags(List tags) { + this.tags = tags; + return this; + } + + public IoCIndicator addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags associated with the indicator. + * + * @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; + } + + /** + * 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 IoCIndicator + */ + @JsonAnySetter + public IoCIndicator 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 IoCIndicator object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCIndicator ioCIndicator = (IoCIndicator) o; + return Objects.equals(this.asGeo, ioCIndicator.asGeo) + && Objects.equals(this.asType, ioCIndicator.asType) + && Objects.equals(this.benignSources, ioCIndicator.benignSources) + && Objects.equals(this.categories, ioCIndicator.categories) + && Objects.equals(this.firstSeen, ioCIndicator.firstSeen) + && Objects.equals(this.id, ioCIndicator.id) + && Objects.equals(this.indicator, ioCIndicator.indicator) + && Objects.equals(this.indicatorType, ioCIndicator.indicatorType) + && Objects.equals(this.lastSeen, ioCIndicator.lastSeen) + && Objects.equals(this.logMatches, ioCIndicator.logMatches) + && Objects.equals(this.mAsType, ioCIndicator.mAsType) + && Objects.equals(this.mPersistence, ioCIndicator.mPersistence) + && Objects.equals(this.mSignal, ioCIndicator.mSignal) + && Objects.equals(this.mSources, ioCIndicator.mSources) + && Objects.equals(this.maliciousSources, ioCIndicator.maliciousSources) + && Objects.equals(this.maxTrustScore, ioCIndicator.maxTrustScore) + && Objects.equals(this.score, ioCIndicator.score) + && Objects.equals(this.signalMatches, ioCIndicator.signalMatches) + && Objects.equals(this.signalTier, ioCIndicator.signalTier) + && Objects.equals(this.suspiciousSources, ioCIndicator.suspiciousSources) + && Objects.equals(this.tags, ioCIndicator.tags) + && Objects.equals(this.additionalProperties, ioCIndicator.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + asGeo, + asType, + benignSources, + categories, + firstSeen, + id, + indicator, + indicatorType, + lastSeen, + logMatches, + mAsType, + mPersistence, + mSignal, + mSources, + maliciousSources, + maxTrustScore, + score, + signalMatches, + signalTier, + suspiciousSources, + tags, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCIndicator {\n"); + sb.append(" asGeo: ").append(toIndentedString(asGeo)).append("\n"); + sb.append(" asType: ").append(toIndentedString(asType)).append("\n"); + sb.append(" benignSources: ").append(toIndentedString(benignSources)).append("\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" firstSeen: ").append(toIndentedString(firstSeen)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" indicator: ").append(toIndentedString(indicator)).append("\n"); + sb.append(" indicatorType: ").append(toIndentedString(indicatorType)).append("\n"); + sb.append(" lastSeen: ").append(toIndentedString(lastSeen)).append("\n"); + sb.append(" logMatches: ").append(toIndentedString(logMatches)).append("\n"); + sb.append(" mAsType: ").append(toIndentedString(mAsType)).append("\n"); + sb.append(" mPersistence: ").append(toIndentedString(mPersistence)).append("\n"); + sb.append(" mSignal: ").append(toIndentedString(mSignal)).append("\n"); + sb.append(" mSources: ").append(toIndentedString(mSources)).append("\n"); + sb.append(" maliciousSources: ").append(toIndentedString(maliciousSources)).append("\n"); + sb.append(" maxTrustScore: ").append(toIndentedString(maxTrustScore)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" signalMatches: ").append(toIndentedString(signalMatches)).append("\n"); + sb.append(" signalTier: ").append(toIndentedString(signalTier)).append("\n"); + sb.append(" suspiciousSources: ").append(toIndentedString(suspiciousSources)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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/IoCIndicatorDetailed.java b/src/main/java/com/datadog/api/client/v2/model/IoCIndicatorDetailed.java new file mode 100644 index 00000000000..6c4ebfbecfc --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCIndicatorDetailed.java @@ -0,0 +1,1148 @@ +/* + * 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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** An indicator of compromise with extended context from your environment. */ +@JsonPropertyOrder({ + IoCIndicatorDetailed.JSON_PROPERTY_ADDITIONAL_DATA, + IoCIndicatorDetailed.JSON_PROPERTY_AS_CIDR_BLOCK, + IoCIndicatorDetailed.JSON_PROPERTY_AS_GEO, + IoCIndicatorDetailed.JSON_PROPERTY_AS_NUMBER, + IoCIndicatorDetailed.JSON_PROPERTY_AS_ORGANIZATION, + IoCIndicatorDetailed.JSON_PROPERTY_AS_TYPE, + IoCIndicatorDetailed.JSON_PROPERTY_BENIGN_SOURCES, + IoCIndicatorDetailed.JSON_PROPERTY_CATEGORIES, + IoCIndicatorDetailed.JSON_PROPERTY_CRITICAL_ASSETS, + IoCIndicatorDetailed.JSON_PROPERTY_FIRST_SEEN, + IoCIndicatorDetailed.JSON_PROPERTY_HOSTS, + IoCIndicatorDetailed.JSON_PROPERTY_ID, + IoCIndicatorDetailed.JSON_PROPERTY_INDICATOR, + IoCIndicatorDetailed.JSON_PROPERTY_INDICATOR_TYPE, + IoCIndicatorDetailed.JSON_PROPERTY_LAST_SEEN, + IoCIndicatorDetailed.JSON_PROPERTY_LOG_MATCHES, + IoCIndicatorDetailed.JSON_PROPERTY_LOG_SOURCES, + IoCIndicatorDetailed.JSON_PROPERTY_M_AS_TYPE, + IoCIndicatorDetailed.JSON_PROPERTY_M_PERSISTENCE, + IoCIndicatorDetailed.JSON_PROPERTY_M_SIGNAL, + IoCIndicatorDetailed.JSON_PROPERTY_M_SOURCES, + IoCIndicatorDetailed.JSON_PROPERTY_MALICIOUS_SOURCES, + IoCIndicatorDetailed.JSON_PROPERTY_MAX_TRUST_SCORE, + IoCIndicatorDetailed.JSON_PROPERTY_SCORE, + IoCIndicatorDetailed.JSON_PROPERTY_SERVICES, + IoCIndicatorDetailed.JSON_PROPERTY_SIGNAL_MATCHES, + IoCIndicatorDetailed.JSON_PROPERTY_SIGNAL_SEVERITY, + IoCIndicatorDetailed.JSON_PROPERTY_SIGNAL_TIER, + IoCIndicatorDetailed.JSON_PROPERTY_SUSPICIOUS_SOURCES, + IoCIndicatorDetailed.JSON_PROPERTY_TAGS, + IoCIndicatorDetailed.JSON_PROPERTY_USERS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCIndicatorDetailed { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ADDITIONAL_DATA = "additional_data"; + private Map additionalData = null; + + public static final String JSON_PROPERTY_AS_CIDR_BLOCK = "as_cidr_block"; + private String asCidrBlock; + + public static final String JSON_PROPERTY_AS_GEO = "as_geo"; + private IoCGeoLocation asGeo; + + public static final String JSON_PROPERTY_AS_NUMBER = "as_number"; + private String asNumber; + + public static final String JSON_PROPERTY_AS_ORGANIZATION = "as_organization"; + private String asOrganization; + + public static final String JSON_PROPERTY_AS_TYPE = "as_type"; + private String asType; + + public static final String JSON_PROPERTY_BENIGN_SOURCES = "benign_sources"; + private JsonNullable> benignSources = JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_CATEGORIES = "categories"; + private List categories = null; + + public static final String JSON_PROPERTY_CRITICAL_ASSETS = "critical_assets"; + private List criticalAssets = null; + + public static final String JSON_PROPERTY_FIRST_SEEN = "first_seen"; + private OffsetDateTime firstSeen; + + public static final String JSON_PROPERTY_HOSTS = "hosts"; + private List hosts = null; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_INDICATOR = "indicator"; + private String indicator; + + public static final String JSON_PROPERTY_INDICATOR_TYPE = "indicator_type"; + private String indicatorType; + + public static final String JSON_PROPERTY_LAST_SEEN = "last_seen"; + private OffsetDateTime lastSeen; + + public static final String JSON_PROPERTY_LOG_MATCHES = "log_matches"; + private Long logMatches; + + public static final String JSON_PROPERTY_LOG_SOURCES = "log_sources"; + private List logSources = null; + + public static final String JSON_PROPERTY_M_AS_TYPE = "m_as_type"; + private IoCScoreEffect mAsType; + + public static final String JSON_PROPERTY_M_PERSISTENCE = "m_persistence"; + private IoCScoreEffect mPersistence; + + public static final String JSON_PROPERTY_M_SIGNAL = "m_signal"; + private IoCScoreEffect mSignal; + + public static final String JSON_PROPERTY_M_SOURCES = "m_sources"; + private IoCScoreEffect mSources; + + public static final String JSON_PROPERTY_MALICIOUS_SOURCES = "malicious_sources"; + private JsonNullable> maliciousSources = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_MAX_TRUST_SCORE = "max_trust_score"; + private IoCScoreEffect maxTrustScore; + + public static final String JSON_PROPERTY_SCORE = "score"; + private Double score; + + public static final String JSON_PROPERTY_SERVICES = "services"; + private List services = null; + + public static final String JSON_PROPERTY_SIGNAL_MATCHES = "signal_matches"; + private Long signalMatches; + + public static final String JSON_PROPERTY_SIGNAL_SEVERITY = "signal_severity"; + private List signalSeverity = null; + + public static final String JSON_PROPERTY_SIGNAL_TIER = "signal_tier"; + private Long signalTier; + + public static final String JSON_PROPERTY_SUSPICIOUS_SOURCES = "suspicious_sources"; + private JsonNullable> suspiciousSources = + JsonNullable.>undefined(); + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_USERS = "users"; + private Map> users = null; + + public IoCIndicatorDetailed additionalData(Map additionalData) { + this.additionalData = additionalData; + return this; + } + + public IoCIndicatorDetailed putAdditionalDataItem(String key, Object additionalDataItem) { + if (this.additionalData == null) { + this.additionalData = new HashMap<>(); + } + this.additionalData.put(key, additionalDataItem); + return this; + } + + /** + * Additional domain-specific context from threat intelligence sources. + * + * @return additionalData + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ADDITIONAL_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map getAdditionalData() { + return additionalData; + } + + public void setAdditionalData(Map additionalData) { + this.additionalData = additionalData; + } + + public IoCIndicatorDetailed asCidrBlock(String asCidrBlock) { + this.asCidrBlock = asCidrBlock; + return this; + } + + /** + * Autonomous system CIDR block. + * + * @return asCidrBlock + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AS_CIDR_BLOCK) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAsCidrBlock() { + return asCidrBlock; + } + + public void setAsCidrBlock(String asCidrBlock) { + this.asCidrBlock = asCidrBlock; + } + + public IoCIndicatorDetailed asGeo(IoCGeoLocation asGeo) { + this.asGeo = asGeo; + this.unparsed |= asGeo.unparsed; + return this; + } + + /** + * Geographic location information for an IP indicator. + * + * @return asGeo + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AS_GEO) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCGeoLocation getAsGeo() { + return asGeo; + } + + public void setAsGeo(IoCGeoLocation asGeo) { + this.asGeo = asGeo; + } + + public IoCIndicatorDetailed asNumber(String asNumber) { + this.asNumber = asNumber; + return this; + } + + /** + * Autonomous system number. + * + * @return asNumber + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AS_NUMBER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAsNumber() { + return asNumber; + } + + public void setAsNumber(String asNumber) { + this.asNumber = asNumber; + } + + public IoCIndicatorDetailed asOrganization(String asOrganization) { + this.asOrganization = asOrganization; + return this; + } + + /** + * Autonomous system organization name. + * + * @return asOrganization + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AS_ORGANIZATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAsOrganization() { + return asOrganization; + } + + public void setAsOrganization(String asOrganization) { + this.asOrganization = asOrganization; + } + + public IoCIndicatorDetailed asType(String asType) { + this.asType = asType; + return this; + } + + /** + * Autonomous system type. + * + * @return asType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_AS_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getAsType() { + return asType; + } + + public void setAsType(String asType) { + this.asType = asType; + } + + public IoCIndicatorDetailed benignSources(List benignSources) { + this.benignSources = JsonNullable.>of(benignSources); + return this; + } + + public IoCIndicatorDetailed addBenignSourcesItem(IoCSource benignSourcesItem) { + if (this.benignSources == null || !this.benignSources.isPresent()) { + this.benignSources = JsonNullable.>of(new ArrayList<>()); + } + try { + this.benignSources.get().add(benignSourcesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Threat intelligence sources that flagged this indicator as benign. + * + * @return benignSources + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getBenignSources() { + return benignSources.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_BENIGN_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getBenignSources_JsonNullable() { + return benignSources; + } + + @JsonProperty(JSON_PROPERTY_BENIGN_SOURCES) + public void setBenignSources_JsonNullable(JsonNullable> benignSources) { + this.benignSources = benignSources; + } + + public void setBenignSources(List benignSources) { + this.benignSources = JsonNullable.>of(benignSources); + } + + public IoCIndicatorDetailed categories(List categories) { + this.categories = categories; + return this; + } + + public IoCIndicatorDetailed addCategoriesItem(String categoriesItem) { + if (this.categories == null) { + this.categories = new ArrayList<>(); + } + this.categories.add(categoriesItem); + return this; + } + + /** + * Threat categories associated with the indicator. + * + * @return categories + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CATEGORIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCategories() { + return categories; + } + + public void setCategories(List categories) { + this.categories = categories; + } + + public IoCIndicatorDetailed criticalAssets(List criticalAssets) { + this.criticalAssets = criticalAssets; + return this; + } + + public IoCIndicatorDetailed addCriticalAssetsItem(String criticalAssetsItem) { + if (this.criticalAssets == null) { + this.criticalAssets = new ArrayList<>(); + } + this.criticalAssets.add(criticalAssetsItem); + return this; + } + + /** + * Critical assets associated with this indicator. + * + * @return criticalAssets + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_CRITICAL_ASSETS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getCriticalAssets() { + return criticalAssets; + } + + public void setCriticalAssets(List criticalAssets) { + this.criticalAssets = criticalAssets; + } + + public IoCIndicatorDetailed firstSeen(OffsetDateTime firstSeen) { + this.firstSeen = firstSeen; + return this; + } + + /** + * Timestamp when the indicator was first seen. + * + * @return firstSeen + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FIRST_SEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getFirstSeen() { + return firstSeen; + } + + public void setFirstSeen(OffsetDateTime firstSeen) { + this.firstSeen = firstSeen; + } + + public IoCIndicatorDetailed hosts(List hosts) { + this.hosts = hosts; + return this; + } + + public IoCIndicatorDetailed addHostsItem(String hostsItem) { + if (this.hosts == null) { + this.hosts = new ArrayList<>(); + } + this.hosts.add(hostsItem); + return this; + } + + /** + * Hosts associated with this indicator. + * + * @return hosts + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_HOSTS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getHosts() { + return hosts; + } + + public void setHosts(List hosts) { + this.hosts = hosts; + } + + public IoCIndicatorDetailed id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the indicator. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public IoCIndicatorDetailed indicator(String indicator) { + this.indicator = indicator; + return this; + } + + /** + * The indicator value (for example, an IP address or domain). + * + * @return indicator + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDICATOR) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndicator() { + return indicator; + } + + public void setIndicator(String indicator) { + this.indicator = indicator; + } + + public IoCIndicatorDetailed indicatorType(String indicatorType) { + this.indicatorType = indicatorType; + return this; + } + + /** + * Type of indicator (for example, IP address or domain). + * + * @return indicatorType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INDICATOR_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getIndicatorType() { + return indicatorType; + } + + public void setIndicatorType(String indicatorType) { + this.indicatorType = indicatorType; + } + + public IoCIndicatorDetailed lastSeen(OffsetDateTime lastSeen) { + this.lastSeen = lastSeen; + return this; + } + + /** + * Timestamp when the indicator was last seen. + * + * @return lastSeen + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LAST_SEEN) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public OffsetDateTime getLastSeen() { + return lastSeen; + } + + public void setLastSeen(OffsetDateTime lastSeen) { + this.lastSeen = lastSeen; + } + + public IoCIndicatorDetailed logMatches(Long logMatches) { + this.logMatches = logMatches; + return this; + } + + /** + * Number of logs that matched this indicator. + * + * @return logMatches + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOG_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getLogMatches() { + return logMatches; + } + + public void setLogMatches(Long logMatches) { + this.logMatches = logMatches; + } + + public IoCIndicatorDetailed logSources(List logSources) { + this.logSources = logSources; + return this; + } + + public IoCIndicatorDetailed addLogSourcesItem(String logSourcesItem) { + if (this.logSources == null) { + this.logSources = new ArrayList<>(); + } + this.logSources.add(logSourcesItem); + return this; + } + + /** + * Log sources where this indicator was observed. + * + * @return logSources + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_LOG_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getLogSources() { + return logSources; + } + + public void setLogSources(List logSources) { + this.logSources = logSources; + } + + public IoCIndicatorDetailed mAsType(IoCScoreEffect mAsType) { + this.mAsType = mAsType; + this.unparsed |= !mAsType.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return mAsType + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_M_AS_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMAsType() { + return mAsType; + } + + public void setMAsType(IoCScoreEffect mAsType) { + if (!mAsType.isValid()) { + this.unparsed = true; + } + this.mAsType = mAsType; + } + + public IoCIndicatorDetailed mPersistence(IoCScoreEffect mPersistence) { + this.mPersistence = mPersistence; + this.unparsed |= !mPersistence.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return mPersistence + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_M_PERSISTENCE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMPersistence() { + return mPersistence; + } + + public void setMPersistence(IoCScoreEffect mPersistence) { + if (!mPersistence.isValid()) { + this.unparsed = true; + } + this.mPersistence = mPersistence; + } + + public IoCIndicatorDetailed mSignal(IoCScoreEffect mSignal) { + this.mSignal = mSignal; + this.unparsed |= !mSignal.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return mSignal + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_M_SIGNAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMSignal() { + return mSignal; + } + + public void setMSignal(IoCScoreEffect mSignal) { + if (!mSignal.isValid()) { + this.unparsed = true; + } + this.mSignal = mSignal; + } + + public IoCIndicatorDetailed mSources(IoCScoreEffect mSources) { + this.mSources = mSources; + this.unparsed |= !mSources.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return mSources + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_M_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMSources() { + return mSources; + } + + public void setMSources(IoCScoreEffect mSources) { + if (!mSources.isValid()) { + this.unparsed = true; + } + this.mSources = mSources; + } + + public IoCIndicatorDetailed maliciousSources(List maliciousSources) { + this.maliciousSources = JsonNullable.>of(maliciousSources); + return this; + } + + public IoCIndicatorDetailed addMaliciousSourcesItem(IoCSource maliciousSourcesItem) { + if (this.maliciousSources == null || !this.maliciousSources.isPresent()) { + this.maliciousSources = JsonNullable.>of(new ArrayList<>()); + } + try { + this.maliciousSources.get().add(maliciousSourcesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Threat intelligence sources that flagged this indicator as malicious. + * + * @return maliciousSources + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getMaliciousSources() { + return maliciousSources.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_MALICIOUS_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getMaliciousSources_JsonNullable() { + return maliciousSources; + } + + @JsonProperty(JSON_PROPERTY_MALICIOUS_SOURCES) + public void setMaliciousSources_JsonNullable(JsonNullable> maliciousSources) { + this.maliciousSources = maliciousSources; + } + + public void setMaliciousSources(List maliciousSources) { + this.maliciousSources = JsonNullable.>of(maliciousSources); + } + + public IoCIndicatorDetailed maxTrustScore(IoCScoreEffect maxTrustScore) { + this.maxTrustScore = maxTrustScore; + this.unparsed |= !maxTrustScore.isValid(); + return this; + } + + /** + * Effect of a scoring factor on the indicator's threat score. + * + * @return maxTrustScore + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MAX_TRUST_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public IoCScoreEffect getMaxTrustScore() { + return maxTrustScore; + } + + public void setMaxTrustScore(IoCScoreEffect maxTrustScore) { + if (!maxTrustScore.isValid()) { + this.unparsed = true; + } + this.maxTrustScore = maxTrustScore; + } + + public IoCIndicatorDetailed score(Double score) { + this.score = score; + return this; + } + + /** + * Threat score for the indicator (0-100). + * + * @return score + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCORE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getScore() { + return score; + } + + public void setScore(Double score) { + this.score = score; + } + + public IoCIndicatorDetailed services(List services) { + this.services = services; + return this; + } + + public IoCIndicatorDetailed addServicesItem(String servicesItem) { + if (this.services == null) { + this.services = new ArrayList<>(); + } + this.services.add(servicesItem); + return this; + } + + /** + * Services where this indicator was observed. + * + * @return services + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SERVICES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getServices() { + return services; + } + + public void setServices(List services) { + this.services = services; + } + + public IoCIndicatorDetailed signalMatches(Long signalMatches) { + this.signalMatches = signalMatches; + return this; + } + + /** + * Number of security signals that matched this indicator. + * + * @return signalMatches + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNAL_MATCHES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSignalMatches() { + return signalMatches; + } + + public void setSignalMatches(Long signalMatches) { + this.signalMatches = signalMatches; + } + + public IoCIndicatorDetailed signalSeverity(List signalSeverity) { + this.signalSeverity = signalSeverity; + for (IoCSignalSeverityCount item : signalSeverity) { + this.unparsed |= item.unparsed; + } + return this; + } + + public IoCIndicatorDetailed addSignalSeverityItem(IoCSignalSeverityCount signalSeverityItem) { + if (this.signalSeverity == null) { + this.signalSeverity = new ArrayList<>(); + } + this.signalSeverity.add(signalSeverityItem); + this.unparsed |= signalSeverityItem.unparsed; + return this; + } + + /** + * Breakdown of security signals by severity. + * + * @return signalSeverity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNAL_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getSignalSeverity() { + return signalSeverity; + } + + public void setSignalSeverity(List signalSeverity) { + this.signalSeverity = signalSeverity; + } + + public IoCIndicatorDetailed signalTier(Long signalTier) { + this.signalTier = signalTier; + return this; + } + + /** + * Signal tier level. + * + * @return signalTier + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SIGNAL_TIER) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getSignalTier() { + return signalTier; + } + + public void setSignalTier(Long signalTier) { + this.signalTier = signalTier; + } + + public IoCIndicatorDetailed suspiciousSources(List suspiciousSources) { + this.suspiciousSources = JsonNullable.>of(suspiciousSources); + return this; + } + + public IoCIndicatorDetailed addSuspiciousSourcesItem(IoCSource suspiciousSourcesItem) { + if (this.suspiciousSources == null || !this.suspiciousSources.isPresent()) { + this.suspiciousSources = JsonNullable.>of(new ArrayList<>()); + } + try { + this.suspiciousSources.get().add(suspiciousSourcesItem); + } catch (java.util.NoSuchElementException e) { + // this can never happen, as we make sure above that the value is present + } + return this; + } + + /** + * Threat intelligence sources that flagged this indicator as suspicious. + * + * @return suspiciousSources + */ + @jakarta.annotation.Nullable + @JsonIgnore + public List getSuspiciousSources() { + return suspiciousSources.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_SUSPICIOUS_SOURCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable> getSuspiciousSources_JsonNullable() { + return suspiciousSources; + } + + @JsonProperty(JSON_PROPERTY_SUSPICIOUS_SOURCES) + public void setSuspiciousSources_JsonNullable(JsonNullable> suspiciousSources) { + this.suspiciousSources = suspiciousSources; + } + + public void setSuspiciousSources(List suspiciousSources) { + this.suspiciousSources = JsonNullable.>of(suspiciousSources); + } + + public IoCIndicatorDetailed tags(List tags) { + this.tags = tags; + return this; + } + + public IoCIndicatorDetailed addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Tags associated with the indicator. + * + * @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 IoCIndicatorDetailed users(Map> users) { + this.users = users; + return this; + } + + public IoCIndicatorDetailed putUsersItem(String key, List usersItem) { + if (this.users == null) { + this.users = new HashMap<>(); + } + this.users.put(key, usersItem); + return this; + } + + /** + * Users associated with this indicator, grouped by category. + * + * @return users + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_USERS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Map> getUsers() { + return users; + } + + public void setUsers(Map> users) { + this.users = users; + } + + /** + * 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 IoCIndicatorDetailed + */ + @JsonAnySetter + public IoCIndicatorDetailed 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 IoCIndicatorDetailed object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCIndicatorDetailed ioCIndicatorDetailed = (IoCIndicatorDetailed) o; + return Objects.equals(this.additionalData, ioCIndicatorDetailed.additionalData) + && Objects.equals(this.asCidrBlock, ioCIndicatorDetailed.asCidrBlock) + && Objects.equals(this.asGeo, ioCIndicatorDetailed.asGeo) + && Objects.equals(this.asNumber, ioCIndicatorDetailed.asNumber) + && Objects.equals(this.asOrganization, ioCIndicatorDetailed.asOrganization) + && Objects.equals(this.asType, ioCIndicatorDetailed.asType) + && Objects.equals(this.benignSources, ioCIndicatorDetailed.benignSources) + && Objects.equals(this.categories, ioCIndicatorDetailed.categories) + && Objects.equals(this.criticalAssets, ioCIndicatorDetailed.criticalAssets) + && Objects.equals(this.firstSeen, ioCIndicatorDetailed.firstSeen) + && Objects.equals(this.hosts, ioCIndicatorDetailed.hosts) + && Objects.equals(this.id, ioCIndicatorDetailed.id) + && Objects.equals(this.indicator, ioCIndicatorDetailed.indicator) + && Objects.equals(this.indicatorType, ioCIndicatorDetailed.indicatorType) + && Objects.equals(this.lastSeen, ioCIndicatorDetailed.lastSeen) + && Objects.equals(this.logMatches, ioCIndicatorDetailed.logMatches) + && Objects.equals(this.logSources, ioCIndicatorDetailed.logSources) + && Objects.equals(this.mAsType, ioCIndicatorDetailed.mAsType) + && Objects.equals(this.mPersistence, ioCIndicatorDetailed.mPersistence) + && Objects.equals(this.mSignal, ioCIndicatorDetailed.mSignal) + && Objects.equals(this.mSources, ioCIndicatorDetailed.mSources) + && Objects.equals(this.maliciousSources, ioCIndicatorDetailed.maliciousSources) + && Objects.equals(this.maxTrustScore, ioCIndicatorDetailed.maxTrustScore) + && Objects.equals(this.score, ioCIndicatorDetailed.score) + && Objects.equals(this.services, ioCIndicatorDetailed.services) + && Objects.equals(this.signalMatches, ioCIndicatorDetailed.signalMatches) + && Objects.equals(this.signalSeverity, ioCIndicatorDetailed.signalSeverity) + && Objects.equals(this.signalTier, ioCIndicatorDetailed.signalTier) + && Objects.equals(this.suspiciousSources, ioCIndicatorDetailed.suspiciousSources) + && Objects.equals(this.tags, ioCIndicatorDetailed.tags) + && Objects.equals(this.users, ioCIndicatorDetailed.users) + && Objects.equals(this.additionalProperties, ioCIndicatorDetailed.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + additionalData, + asCidrBlock, + asGeo, + asNumber, + asOrganization, + asType, + benignSources, + categories, + criticalAssets, + firstSeen, + hosts, + id, + indicator, + indicatorType, + lastSeen, + logMatches, + logSources, + mAsType, + mPersistence, + mSignal, + mSources, + maliciousSources, + maxTrustScore, + score, + services, + signalMatches, + signalSeverity, + signalTier, + suspiciousSources, + tags, + users, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCIndicatorDetailed {\n"); + sb.append(" additionalData: ").append(toIndentedString(additionalData)).append("\n"); + sb.append(" asCidrBlock: ").append(toIndentedString(asCidrBlock)).append("\n"); + sb.append(" asGeo: ").append(toIndentedString(asGeo)).append("\n"); + sb.append(" asNumber: ").append(toIndentedString(asNumber)).append("\n"); + sb.append(" asOrganization: ").append(toIndentedString(asOrganization)).append("\n"); + sb.append(" asType: ").append(toIndentedString(asType)).append("\n"); + sb.append(" benignSources: ").append(toIndentedString(benignSources)).append("\n"); + sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); + sb.append(" criticalAssets: ").append(toIndentedString(criticalAssets)).append("\n"); + sb.append(" firstSeen: ").append(toIndentedString(firstSeen)).append("\n"); + sb.append(" hosts: ").append(toIndentedString(hosts)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" indicator: ").append(toIndentedString(indicator)).append("\n"); + sb.append(" indicatorType: ").append(toIndentedString(indicatorType)).append("\n"); + sb.append(" lastSeen: ").append(toIndentedString(lastSeen)).append("\n"); + sb.append(" logMatches: ").append(toIndentedString(logMatches)).append("\n"); + sb.append(" logSources: ").append(toIndentedString(logSources)).append("\n"); + sb.append(" mAsType: ").append(toIndentedString(mAsType)).append("\n"); + sb.append(" mPersistence: ").append(toIndentedString(mPersistence)).append("\n"); + sb.append(" mSignal: ").append(toIndentedString(mSignal)).append("\n"); + sb.append(" mSources: ").append(toIndentedString(mSources)).append("\n"); + sb.append(" maliciousSources: ").append(toIndentedString(maliciousSources)).append("\n"); + sb.append(" maxTrustScore: ").append(toIndentedString(maxTrustScore)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" services: ").append(toIndentedString(services)).append("\n"); + sb.append(" signalMatches: ").append(toIndentedString(signalMatches)).append("\n"); + sb.append(" signalSeverity: ").append(toIndentedString(signalSeverity)).append("\n"); + sb.append(" signalTier: ").append(toIndentedString(signalTier)).append("\n"); + sb.append(" suspiciousSources: ").append(toIndentedString(suspiciousSources)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); + sb.append(" users: ").append(toIndentedString(users)).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/IoCScoreEffect.java b/src/main/java/com/datadog/api/client/v2/model/IoCScoreEffect.java new file mode 100644 index 00000000000..4d6c5396b7e --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCScoreEffect.java @@ -0,0 +1,56 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** Effect of a scoring factor on the indicator's threat score. */ +@JsonSerialize(using = IoCScoreEffect.IoCScoreEffectSerializer.class) +public class IoCScoreEffect extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("RAISE_SCORE", "LOWER_SCORE", "NO_EFFECT")); + + public static final IoCScoreEffect RAISE_SCORE = new IoCScoreEffect("RAISE_SCORE"); + public static final IoCScoreEffect LOWER_SCORE = new IoCScoreEffect("LOWER_SCORE"); + public static final IoCScoreEffect NO_EFFECT = new IoCScoreEffect("NO_EFFECT"); + + IoCScoreEffect(String value) { + super(value, allowedValues); + } + + public static class IoCScoreEffectSerializer extends StdSerializer { + public IoCScoreEffectSerializer(Class t) { + super(t); + } + + public IoCScoreEffectSerializer() { + this(null); + } + + @Override + public void serialize(IoCScoreEffect value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static IoCScoreEffect fromValue(String value) { + return new IoCScoreEffect(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/IoCSignalSeverityCount.java b/src/main/java/com/datadog/api/client/v2/model/IoCSignalSeverityCount.java new file mode 100644 index 00000000000..8573fc10082 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCSignalSeverityCount.java @@ -0,0 +1,164 @@ +/* + * 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; + +/** Count of security signals by severity level. */ +@JsonPropertyOrder({ + IoCSignalSeverityCount.JSON_PROPERTY_COUNT, + IoCSignalSeverityCount.JSON_PROPERTY_SEVERITY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCSignalSeverityCount { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_SEVERITY = "severity"; + private String severity; + + public IoCSignalSeverityCount count(Long count) { + this.count = count; + return this; + } + + /** + * Number of signals at this severity level. + * + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public IoCSignalSeverityCount severity(String severity) { + this.severity = severity; + return this; + } + + /** + * Severity level (for example, critical, high, medium, low, info). + * + * @return severity + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SEVERITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSeverity() { + return severity; + } + + public void setSeverity(String severity) { + this.severity = severity; + } + + /** + * 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 IoCSignalSeverityCount + */ + @JsonAnySetter + public IoCSignalSeverityCount 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 IoCSignalSeverityCount object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCSignalSeverityCount ioCSignalSeverityCount = (IoCSignalSeverityCount) o; + return Objects.equals(this.count, ioCSignalSeverityCount.count) + && Objects.equals(this.severity, ioCSignalSeverityCount.severity) + && Objects.equals(this.additionalProperties, ioCSignalSeverityCount.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, severity, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCSignalSeverityCount {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" severity: ").append(toIndentedString(severity)).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/IoCSource.java b/src/main/java/com/datadog/api/client/v2/model/IoCSource.java new file mode 100644 index 00000000000..c25d34503f2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/IoCSource.java @@ -0,0 +1,135 @@ +/* + * 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 threat intelligence source that has flagged an indicator. */ +@JsonPropertyOrder({IoCSource.JSON_PROPERTY_NAME}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class IoCSource { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public IoCSource name(String name) { + this.name = name; + return this; + } + + /** + * Name of the threat intelligence source. + * + * @return name + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + /** + * 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 IoCSource + */ + @JsonAnySetter + public IoCSource 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 IoCSource object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IoCSource ioCSource = (IoCSource) o; + return Objects.equals(this.name, ioCSource.name) + && Objects.equals(this.additionalProperties, ioCSource.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IoCSource {\n"); + sb.append(" name: ").append(toIndentedString(name)).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/cassettes/features/v2/Get_an_indicator_of_compromise_returns_Not_Found_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_Not_Found_response.freeze new file mode 100644 index 00000000000..55d3aa91a89 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_Not_Found_response.freeze @@ -0,0 +1 @@ +2026-04-14T18:22:17.027Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_Not_Found_response.json b/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_Not_Found_response.json new file mode 100644 index 00000000000..1a527ae478a --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_Not_Found_response.json @@ -0,0 +1,33 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/siem/ioc-explorer/indicator", + "queryStringParameters": { + "indicator": [ + "this-indicator-does-not-exist.invalid" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"indicator not found\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 404, + "reasonPhrase": "Not Found" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "729cc78d-9a0e-e7c3-573d-0a0a57a4612f" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_OK_response.freeze new file mode 100644 index 00000000000..fc8ed109ad7 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-04-14T18:22:29.733Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_OK_response.json new file mode 100644 index 00000000000..99da3a11737 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Get_an_indicator_of_compromise_returns_OK_response.json @@ -0,0 +1,33 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/siem/ioc-explorer/indicator", + "queryStringParameters": { + "indicator": [ + "masscan/1.3 (https://github.com/robertdavidgraham/masscan)" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"65a31893-cc59-4125-9424-44f7ba083e53\",\"type\":\"get_indicator_response\",\"attributes\":{\"data\":{\"id\":\"masscan/1.3 (https://github.com/robertdavidgraham/masscan)\",\"indicator\":\"masscan/1.3 (https://github.com/robertdavidgraham/masscan)\",\"indicator_type\":\"User Agent\",\"score\":4,\"as_type\":\"hosting\",\"malicious_sources\":null,\"suspicious_sources\":[{\"name\":\"Datadog Threat Research\"}],\"benign_sources\":null,\"categories\":[\"scanner\"],\"tags\":[],\"signal_matches\":0,\"log_matches\":45,\"first_seen\":\"2025-01-08T23:24:45Z\",\"last_seen\":\"2026-04-10T14:36:20Z\",\"signal_tier\":0,\"max_trust_score\":\"RAISE_SCORE\",\"m_sources\":\"NO_EFFECT\",\"m_persistence\":\"RAISE_SCORE\",\"m_signal\":\"NO_EFFECT\",\"m_as_type\":\"NO_EFFECT\",\"log_sources\":[],\"services\":[],\"signal_severity\":[],\"users\":{},\"critical_assets\":[],\"hosts\":[],\"as_number\":\"\",\"as_organization\":\"\",\"as_cidr_block\":\"\"}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "46983f38-5258-9614-d88d-beb54245e244" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_Bad_Request_response.freeze b/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_Bad_Request_response.freeze new file mode 100644 index 00000000000..307d03acb4b --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_Bad_Request_response.freeze @@ -0,0 +1 @@ +2026-04-14T18:22:40.711Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_Bad_Request_response.json b/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_Bad_Request_response.json new file mode 100644 index 00000000000..65f951e35ec --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_Bad_Request_response.json @@ -0,0 +1,33 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/siem/ioc-explorer", + "queryStringParameters": { + "query": [ + "invalid:::query" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"errors\":[{\"title\":\"Generic Error\",\"detail\":\"invalid query: invalid query: syntax error: no viable alternative at input 'invalid::' at line 1 and char position 8\"}]}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 400, + "reasonPhrase": "Bad Request" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "02b5fd49-9f5d-caf4-c0c9-7eb95adecf70" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_OK_response.freeze new file mode 100644 index 00000000000..5814ac627e4 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-04-14T18:22:48.392Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_OK_response.json b/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_OK_response.json new file mode 100644 index 00000000000..b44aac537fb --- /dev/null +++ b/src/test/resources/cassettes/features/v2/List_indicators_of_compromise_returns_OK_response.json @@ -0,0 +1,33 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/security/siem/ioc-explorer", + "queryStringParameters": { + "limit": [ + "1" + ] + }, + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"id\":\"a4e3b616-e180-4b47-a379-43da9c5b300e\",\"type\":\"ioc_explorer_response\",\"attributes\":{\"data\":[{\"id\":\"43.228.157.121\",\"indicator\":\"43.228.157.121\",\"indicator_type\":\"IP Address\",\"score\":8,\"as_type\":\"hosting\",\"malicious_sources\":[{\"name\":\"threatfox\"}],\"suspicious_sources\":[{\"name\":\"tor\"},{\"name\":\"SPUR\"}],\"benign_sources\":null,\"categories\":[\"malware\",\"tor\",\"hosting_proxy\"],\"tags\":[],\"signal_matches\":0,\"log_matches\":14,\"signal_tier\":0,\"max_trust_score\":\"RAISE_SCORE\",\"m_sources\":\"RAISE_SCORE\",\"m_persistence\":\"NO_EFFECT\",\"m_signal\":\"NO_EFFECT\",\"m_as_type\":\"NO_EFFECT\",\"as_geo\":{\"city\":\"Frankfurt am Main\",\"country_code\":\"DE\",\"country_name\":\"Germany\"}}],\"metadata\":{\"count\":25091},\"paging\":{\"offset\":1}}}}", + "headers": { + "Content-Type": [ + "application/vnd.api+json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6fab925a-65ec-0cad-89aa-a6c228f598ee" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature index 1fdee4f141b..ac7b626e0d3 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/security_monitoring.feature @@ -1298,6 +1298,30 @@ Feature: Security Monitoring Then the response status is 200 OK And the response "data[0].attributes.name" is equal to "suppression2 {{ unique_hash }}" + @generated @skip @team:DataDog/k9-cloud-siem + Scenario: Get an indicator of compromise returns "Bad Request" response + Given operation "GetIndicatorOfCompromise" enabled + And new "GetIndicatorOfCompromise" request + And request contains "indicator" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @skip-terraform-config @team:DataDog/k9-cloud-siem + Scenario: Get an indicator of compromise returns "Not Found" response + Given operation "GetIndicatorOfCompromise" enabled + And new "GetIndicatorOfCompromise" request + And request contains "indicator" parameter with value "this-indicator-does-not-exist.invalid" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @skip-terraform-config @team:DataDog/k9-cloud-siem + Scenario: Get an indicator of compromise returns "OK" response + Given operation "GetIndicatorOfCompromise" enabled + And new "GetIndicatorOfCompromise" request + And request contains "indicator" parameter with value "masscan/1.3 (https://github.com/robertdavidgraham/masscan)" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/k9-cloud-siem Scenario: Get content pack states returns "Not Found" response Given operation "GetContentPacksStates" enabled @@ -1573,6 +1597,22 @@ Feature: Security Monitoring When the request is sent Then the response status is 200 OK + @replay-only @skip-terraform-config @team:DataDog/k9-cloud-siem + Scenario: List indicators of compromise returns "Bad Request" response + Given operation "ListIndicatorsOfCompromise" enabled + And new "ListIndicatorsOfCompromise" request + And request contains "query" parameter with value "invalid:::query" + When the request is sent + Then the response status is 400 Bad Request + + @replay-only @skip-terraform-config @team:DataDog/k9-cloud-siem + Scenario: List indicators of compromise returns "OK" response + Given operation "ListIndicatorsOfCompromise" enabled + And new "ListIndicatorsOfCompromise" request + And request contains "limit" parameter with value 1 + When the request is sent + Then the response status is 200 OK + @team:DataDog/k9-cloud-siem Scenario: List resource filters returns "Bad Request" response Given new "GetResourceEvaluationFilters" request 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 02b5c2d4c59..c7ef9624df9 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 @@ -5283,6 +5283,18 @@ "type": "safe" } }, + "ListIndicatorsOfCompromise": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, + "GetIndicatorOfCompromise": { + "tag": "Security Monitoring", + "undo": { + "type": "safe" + } + }, "GetSignalNotificationRules": { "tag": "Security Monitoring", "undo": {