diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 7023d0d7bb9..82c52ea77c7 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -43428,7 +43428,7 @@ paths: operator: OR permissions: - user_access_invite - "/api/v1/user/{user_handle}": + /api/v1/user/{user_handle}: delete: description: |- Delete a user from an organization. diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index f581e14626d..87a9f1ad1be 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -208,6 +208,16 @@ components: required: true schema: type: string + ApplicationSecurityServiceNameParam: + description: |- + The name of the service to retrieve Application Security details for. + Returns all matching services across environments. + example: web-store + in: path + name: service_filter + required: true + schema: + type: string ApplicationSecurityWafCustomRuleIDParam: description: The ID of the custom rule. example: 3b5-v82-ns6 @@ -8067,6 +8077,301 @@ components: required: - data type: object + ApplicationSecurityServiceAttributes: + description: Application Security details describing a service in a given environment. + properties: + agent_versions: + description: The Datadog Agent versions reporting for the service. + example: + - 7.50.0 + items: + description: A Datadog Agent version reporting for the service. + example: 7.50.0 + type: string + type: array + app_type: + description: The application type of the service, such as `web` or `serverless`. + example: web + type: string + asm_threat_compatible: + description: Whether the service is compatible with Application Security Management (Threats). + example: true + type: boolean + backend_waf_event_count: + description: The number of backend WAF events detected for the service. + example: 10 + format: int64 + type: integer + business_logic: + description: The enabled business logic detection rules for the service. + example: + - users.login.success + items: + description: A business logic detection rule enabled for the service. + example: users.login.success + type: string + type: array + color: + deprecated: true + description: "Deprecated: a display color associated with the service in the UI." + example: "" + type: string + env: + description: The environment the service runs in. + example: prod + type: string + event_count: + description: The number of Application Security events detected for the service. + example: 42 + format: int64 + type: integer + event_trend: + deprecated: true + description: "Deprecated: the trend of Application Security events over time." + example: + - 0 + items: + description: A point in the Application Security events trend. + example: 0 + type: integer + type: array + has_appsec_enabled: + description: Whether Application Security Management (Threats) is enabled for the service. + example: true + type: boolean + hits: + deprecated: true + description: "Deprecated: the number of hits for the service." + example: 0 + format: int64 + type: integer + iast_product_activation: + description: Whether Interactive Application Security Testing (IAST) is enabled for the service. + example: false + type: boolean + iast_product_compatibility: + description: The Interactive Application Security Testing (IAST) compatibility status of the service. + example: compatible + type: string + iast_product_compatibility_reasons: + description: The reasons explaining the Interactive Application Security Testing (IAST) compatibility status. + example: + - service_not_compatible + items: + description: A reason explaining the Interactive Application Security Testing (IAST) compatibility status. + example: service_not_compatible + type: string + type: array + languages: + description: The programming languages detected for the service. + example: + - go + items: + description: A programming language detected for the service. + example: go + type: string + type: array + last_ingested_spans: + description: The Unix timestamp, in seconds, of the last ingested span for the service. + example: 1610000000 + format: int64 + type: integer + rc_capabilities: + description: The Remote Configuration capabilities reported by the service. + example: + - ASM_DD_RULES + items: + description: A Remote Configuration capability reported by the service. + example: ASM_DD_RULES + type: string + type: array + recommended_business_logic: + description: The recommended business logic detection rules for the service. + example: + - users.login.success + items: + description: A recommended business logic detection rule for the service. + example: users.login.success + type: string + type: array + risk_product_activation: + description: Whether Software Composition Analysis (SCA) is enabled for the service. + example: false + type: boolean + risk_product_compatibility: + description: The Software Composition Analysis (SCA) compatibility status of the service. + example: compatible + type: string + risk_product_compatibility_reasons: + description: The reasons explaining the Software Composition Analysis (SCA) compatibility status. + example: + - service_not_compatible + items: + description: A reason explaining the Software Composition Analysis (SCA) compatibility status. + example: service_not_compatible + type: string + type: array + rules_version: + description: The WAF rules versions applied to the service. + example: + - 1.13.0 + items: + description: A WAF rules version applied to the service. + example: 1.13.0 + type: string + type: array + service: + description: The name of the service. + example: web-store + type: string + signal_count: + deprecated: true + description: "Deprecated: the number of security signals for the service." + example: 0 + format: int64 + type: integer + signal_trend: + deprecated: true + description: "Deprecated: the trend of security signals over time." + example: + - 0 + items: + description: A point in the security signals trend. + example: 0 + type: integer + type: array + source: + description: The data sources that contributed information about the service. + example: + - services-activity + items: + description: A data source that contributed information about the service. + example: services-activity + type: string + type: array + teams: + description: The teams that own the service. + example: + - security-team + items: + description: A team that owns the service. + example: security-team + type: string + type: array + tracer_versions: + description: The Datadog tracing library versions reporting for the service. + example: + - 1.60.0 + items: + description: A Datadog tracing library version reporting for the service. + example: 1.60.0 + type: string + type: array + vm-activation: + description: The Vulnerability Management activation status of the service. + example: enabled + type: string + vuln_critical_count: + deprecated: true + description: "Deprecated: the number of critical-severity vulnerabilities for the service." + example: 0 + format: int64 + type: integer + vuln_high_count: + deprecated: true + description: "Deprecated: the number of high-severity vulnerabilities for the service." + example: 0 + format: int64 + type: integer + without_filter_services: + description: The total number of services available without applying the service filter. + example: 0 + format: int64 + type: integer + required: + - service + - env + - app_type + - has_appsec_enabled + - asm_threat_compatible + - languages + - teams + - event_count + - backend_waf_event_count + - risk_product_activation + - risk_product_compatibility + - risk_product_compatibility_reasons + - iast_product_activation + - iast_product_compatibility + - iast_product_compatibility_reasons + - vm-activation + - agent_versions + - tracer_versions + - rules_version + - rc_capabilities + - source + - last_ingested_spans + - business_logic + - recommended_business_logic + - without_filter_services + - color + - event_trend + - signal_trend + - signal_count + - hits + - vuln_high_count + - vuln_critical_count + type: object + ApplicationSecurityServiceResource: + description: A JSON:API resource describing a service and its Application Security details. + properties: + attributes: + $ref: "#/components/schemas/ApplicationSecurityServiceAttributes" + id: + description: The unique identifier of the service, formatted as `_`. + example: web-store_prod + type: string + type: + $ref: "#/components/schemas/ApplicationSecurityServiceType" + required: + - id + - type + - attributes + type: object + ApplicationSecurityServiceType: + default: service_env + description: The type of the resource. The value should always be `service_env`. + enum: + - service_env + example: service_env + type: string + x-enum-varnames: + - SERVICE_ENV + ApplicationSecurityServicesMetadata: + description: Metadata returned alongside the list of services. + properties: + num_services_with_appsec: + description: The number of services with Application Security Management (Threats) enabled. + example: 1 + format: int64 + type: integer + required: + - num_services_with_appsec + type: object + ApplicationSecurityServicesResponse: + description: Response object containing the list of services matching the requested name. + properties: + data: + description: The list of services matching the requested name. + items: + $ref: "#/components/schemas/ApplicationSecurityServiceResource" + type: array + meta: + $ref: "#/components/schemas/ApplicationSecurityServicesMetadata" + required: + - data + - meta + type: object ApplicationSecurityWafCustomRuleAction: description: The definition of `ApplicationSecurityWafCustomRuleAction` object. properties: @@ -64579,7 +64884,8 @@ components: OrgConfigGetResponse: description: A response with a single Org Config. properties: - data: {$ref: "#/components/schemas/OrgConfigRead"} + data: + $ref: "#/components/schemas/OrgConfigRead" required: [data] type: object OrgConfigListResponse: @@ -64587,19 +64893,22 @@ components: properties: data: description: An array of Org Configs. - items: {$ref: "#/components/schemas/OrgConfigRead"} + items: + $ref: "#/components/schemas/OrgConfigRead" type: array required: [data] type: object OrgConfigRead: description: A single Org Config. properties: - attributes: {$ref: "#/components/schemas/OrgConfigReadAttributes"} + attributes: + $ref: "#/components/schemas/OrgConfigReadAttributes" id: description: A unique identifier for an Org Config. example: abcd1234 type: string - type: {$ref: "#/components/schemas/OrgConfigType"} + type: + $ref: "#/components/schemas/OrgConfigType" required: [id, type, attributes] type: object OrgConfigReadAttributes: @@ -64636,8 +64945,10 @@ components: OrgConfigWrite: description: An Org Config write operation. properties: - attributes: {$ref: "#/components/schemas/OrgConfigWriteAttributes"} - type: {$ref: "#/components/schemas/OrgConfigType"} + attributes: + $ref: "#/components/schemas/OrgConfigWriteAttributes" + type: + $ref: "#/components/schemas/OrgConfigType" required: [type, attributes] type: object OrgConfigWriteAttributes: @@ -64650,7 +64961,8 @@ components: OrgConfigWriteRequest: description: A request to update an Org Config. properties: - data: {$ref: "#/components/schemas/OrgConfigWrite"} + data: + $ref: "#/components/schemas/OrgConfigWrite" required: [data] type: object OrgConnection: @@ -102508,7 +102820,7 @@ paths: operator: OR permissions: - apps_datastore_manage - "/api/v2/actions-datastores/{datastore_id}": + /api/v2/actions-datastores/{datastore_id}: delete: description: Deletes a datastore by its unique identifier. operationId: DeleteDatastore @@ -102652,7 +102964,7 @@ paths: operator: OR permissions: - apps_datastore_manage - "/api/v2/actions-datastores/{datastore_id}/items": + /api/v2/actions-datastores/{datastore_id}/items: delete: description: Deletes an item from a datastore by its key. operationId: DeleteDatastoreItem @@ -102864,7 +103176,7 @@ paths: operator: OR permissions: - apps_datastore_write - "/api/v2/actions-datastores/{datastore_id}/items/bulk": + /api/v2/actions-datastores/{datastore_id}/items/bulk: delete: description: >- Deletes multiple items from a datastore by their keys in a single operation. @@ -105884,7 +106196,7 @@ paths: - apps_write - connections_resolve - workflows_run - "/api/v2/app-builder/apps/{app_id}": + /api/v2/app-builder/apps/{app_id}: delete: description: Delete a single app. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). operationId: DeleteApp @@ -106086,7 +106398,7 @@ paths: - apps_write - connections_resolve - workflows_run - "/api/v2/app-builder/apps/{app_id}/deployment": + /api/v2/app-builder/apps/{app_id}/deployment: delete: description: Unpublish an app, removing the live version of the app. Unpublishing creates a new instance of a `deployment` object on the app, with a nil `app_version_id` (`00000000-0000-0000-0000-000000000000`). The app can still be updated and published again in the future. This API requires a [registered application key](https://docs.datadoghq.com/api/latest/action-connection/#register-a-new-app-key). Alternatively, you can configure these permissions [in the UI](https://docs.datadoghq.com/account_management/api-app-keys/#actions-api-access). operationId: UnpublishApp @@ -106195,7 +106507,7 @@ paths: operator: OR permissions: - apps_write - "/api/v2/app-builder/apps/{app_id}/favorite": + /api/v2/app-builder/apps/{app_id}/favorite: patch: description: Add or remove an app from the current user's favorites. Favorited apps can be filtered for using the `filter[favorite]` query parameter on the [List Apps](https://docs.datadoghq.com/api/latest/app-builder/#list-apps) endpoint. operationId: UpdateAppFavorite @@ -106251,7 +106563,7 @@ paths: operator: OR permissions: - apps_run - "/api/v2/app-builder/apps/{app_id}/protection-level": + /api/v2/app-builder/apps/{app_id}/protection-level: patch: description: Update the publication protection level of an app. When set to `approval_required`, future publishes must go through an approval workflow before going live. operationId: UpdateProtectionLevel @@ -106325,7 +106637,7 @@ paths: operator: OR permissions: - apps_write - "/api/v2/app-builder/apps/{app_id}/publish-request": + /api/v2/app-builder/apps/{app_id}/publish-request: post: description: Create a publish request to ask for approval to publish an app whose protection level is `approval_required`. Publishing happens automatically once the request is approved by a user with the appropriate permissions. operationId: CreatePublishRequest @@ -106398,7 +106710,7 @@ paths: operator: OR permissions: - apps_write - "/api/v2/app-builder/apps/{app_id}/revert": + /api/v2/app-builder/apps/{app_id}/revert: post: description: Revert an app to a previous version. The version to revert to is selected through the `version` query parameter. The reverted version becomes the new latest version of the app. operationId: RevertApp @@ -106466,7 +106778,7 @@ paths: operator: OR permissions: - apps_write - "/api/v2/app-builder/apps/{app_id}/self-service": + /api/v2/app-builder/apps/{app_id}/self-service: patch: description: Enable or disable self-service for an app. Self-service apps can be discovered and run by users in your organization without explicit access being granted. operationId: UpdateAppSelfService @@ -106522,7 +106834,7 @@ paths: operator: OR permissions: - apps_write - "/api/v2/app-builder/apps/{app_id}/tags": + /api/v2/app-builder/apps/{app_id}/tags: patch: description: Replace the tags on an app. The provided list overwrites the existing tags entirely; tags not present in the request body are removed. operationId: UpdateAppTags @@ -106580,7 +106892,7 @@ paths: operator: OR permissions: - apps_write - "/api/v2/app-builder/apps/{app_id}/version-name": + /api/v2/app-builder/apps/{app_id}/version-name: patch: description: Assign a human-readable name to a specific version of an app. The version is selected through the `version` query parameter. operationId: UpdateAppVersionName @@ -106643,7 +106955,7 @@ paths: operator: OR permissions: - apps_write - "/api/v2/app-builder/apps/{app_id}/versions": + /api/v2/app-builder/apps/{app_id}/versions: get: description: List the versions of an app. This endpoint is paginated. operationId: ListAppVersions @@ -106723,7 +107035,7 @@ paths: permissions: - apps_run - connections_read - "/api/v2/app-builder/blueprint/{blueprint_id}": + /api/v2/app-builder/blueprint/{blueprint_id}: get: description: Retrieve an app blueprint by its ID. operationId: GetBlueprint @@ -106836,7 +107148,7 @@ paths: - apps_write - connections_read - connections_write - "/api/v2/app-builder/blueprints/integration-id/{integration_id}": + /api/v2/app-builder/blueprints/integration-id/{integration_id}: get: description: List app blueprints associated with a specific integration ID. operationId: GetBlueprintsByIntegrationId @@ -106887,7 +107199,7 @@ paths: - apps_write - connections_read - connections_write - "/api/v2/app-builder/blueprints/slugs/{slugs}": + /api/v2/app-builder/blueprints/slugs/{slugs}: get: description: Retrieve app blueprints by their slugs. operationId: GetBlueprintsBySlugs @@ -144742,12 +145054,17 @@ paths: value_type: bool id: abcd1234 type: org_configs - schema: {$ref: "#/components/schemas/OrgConfigListResponse"} + schema: + $ref: "#/components/schemas/OrgConfigListResponse" description: OK - "400": {$ref: "#/components/responses/BadRequestResponse"} - "401": {$ref: "#/components/responses/UnauthorizedResponse"} - "403": {$ref: "#/components/responses/ForbiddenResponse"} - "429": {$ref: "#/components/responses/TooManyRequestsResponse"} + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" summary: List Org Configs tags: [Organizations] "x-permission": @@ -144757,7 +145074,8 @@ paths: get: description: Return the name, description, and value of a specific Org Config. operationId: GetOrgConfig - parameters: [$ref: "#/components/parameters/OrgConfigName"] + parameters: + - $ref: "#/components/parameters/OrgConfigName" responses: "200": content: @@ -144773,13 +145091,19 @@ paths: value_type: bool id: abcd1234 type: org_configs - schema: {$ref: "#/components/schemas/OrgConfigGetResponse"} + schema: + $ref: "#/components/schemas/OrgConfigGetResponse" description: OK - "400": {$ref: "#/components/responses/BadRequestResponse"} - "401": {$ref: "#/components/responses/UnauthorizedResponse"} - "403": {$ref: "#/components/responses/ForbiddenResponse"} - "404": {$ref: "#/components/responses/NotFoundResponse"} - "429": {$ref: "#/components/responses/TooManyRequestsResponse"} + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" summary: Get a specific Org Config value tags: [Organizations] "x-permission": @@ -144788,7 +145112,8 @@ paths: patch: description: Update the value of a specific Org Config. operationId: UpdateOrgConfig - parameters: [$ref: "#/components/parameters/OrgConfigName"] + parameters: + - $ref: "#/components/parameters/OrgConfigName" requestBody: content: application/json: @@ -144799,7 +145124,8 @@ paths: attributes: value: UTC type: org_configs - schema: {$ref: "#/components/schemas/OrgConfigWriteRequest"} + schema: + $ref: "#/components/schemas/OrgConfigWriteRequest" required: true responses: "200": @@ -144816,13 +145142,19 @@ paths: value_type: bool id: abcd1234 type: org_configs - schema: {$ref: "#/components/schemas/OrgConfigGetResponse"} + schema: + $ref: "#/components/schemas/OrgConfigGetResponse" description: OK - "400": {$ref: "#/components/responses/BadRequestResponse"} - "401": {$ref: "#/components/responses/UnauthorizedResponse"} - "403": {$ref: "#/components/responses/ForbiddenResponse"} - "404": {$ref: "#/components/responses/NotFoundResponse"} - "429": {$ref: "#/components/responses/TooManyRequestsResponse"} + "400": + $ref: "#/components/responses/BadRequestResponse" + "401": + $ref: "#/components/responses/UnauthorizedResponse" + "403": + $ref: "#/components/responses/ForbiddenResponse" + "404": + $ref: "#/components/responses/NotFoundResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" summary: Update a specific Org Config tags: [Organizations] "x-permission": @@ -155401,6 +155733,87 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta and it's subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/security/asm/services/{service_filter}: + get: + description: |- + Retrieve Application Security details for services matching the given name. + Returns Application Security activation, compatibility, and product enablement + information for each matching `(service, environment)` pair, along with a count + of services that have Application Security Management (Threats) enabled. + operationId: GetAsmServiceByName + parameters: + - $ref: "#/components/parameters/ApplicationSecurityServiceNameParam" + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + agent_versions: + - 7.50.0 + app_type: web + asm_threat_compatible: true + backend_waf_event_count: 10 + business_logic: [] + color: "" + env: prod + event_count: 42 + event_trend: [] + has_appsec_enabled: true + hits: 0 + iast_product_activation: false + iast_product_compatibility: compatible + iast_product_compatibility_reasons: [] + languages: + - go + last_ingested_spans: 1610000000 + rc_capabilities: + - ASM_DD_RULES + recommended_business_logic: [] + risk_product_activation: false + risk_product_compatibility: compatible + risk_product_compatibility_reasons: [] + rules_version: + - 1.13.0 + service: web-store + signal_count: 0 + signal_trend: [] + source: + - services-activity + teams: + - security-team + tracer_versions: + - 1.60.0 + vm-activation: enabled + vuln_critical_count: 0 + vuln_high_count: 0 + without_filter_services: 0 + id: web-store_prod + type: service_env + meta: + num_services_with_appsec: 1 + schema: + $ref: "#/components/schemas/ApplicationSecurityServicesResponse" + description: OK + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get Application Security details for a service + tags: + - "Application Security" + "x-permission": + operator: OR + permissions: + - apm_service_catalog_read + - appsec_protect_read + - apm_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/security/cloud_workload/policy/download: get: description: |- diff --git a/examples/v2/application-security/GetAsmServiceByName.java b/examples/v2/application-security/GetAsmServiceByName.java new file mode 100644 index 00000000000..1c82c2c30f6 --- /dev/null +++ b/examples/v2/application-security/GetAsmServiceByName.java @@ -0,0 +1,25 @@ +// Get Application Security details for a service returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.ApplicationSecurityApi; +import com.datadog.api.client.v2.model.ApplicationSecurityServicesResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getAsmServiceByName", true); + ApplicationSecurityApi apiInstance = new ApplicationSecurityApi(defaultClient); + + try { + ApplicationSecurityServicesResponse result = apiInstance.getAsmServiceByName("web-store"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ApplicationSecurityApi#getAsmServiceByName"); + 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 c541eda5b33..ad2fe0ef153 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -1138,6 +1138,7 @@ public class ApiClient { put("v2.updateConnection", false); put("v2.getPrunedTraceByID", false); put("v2.getTraceByID", false); + put("v2.getAsmServiceByName", false); put("v2.deleteSourcemaps", false); put("v2.getServiceRepositoryInfo", false); put("v2.getSourcemaps", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/ApplicationSecurityApi.java b/src/main/java/com/datadog/api/client/v2/api/ApplicationSecurityApi.java index 568d1087a3f..51d8b1c08ad 100644 --- a/src/main/java/com/datadog/api/client/v2/api/ApplicationSecurityApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/ApplicationSecurityApi.java @@ -8,6 +8,7 @@ import com.datadog.api.client.v2.model.ApplicationSecurityPolicyListResponse; import com.datadog.api.client.v2.model.ApplicationSecurityPolicyResponse; import com.datadog.api.client.v2.model.ApplicationSecurityPolicyUpdateRequest; +import com.datadog.api.client.v2.model.ApplicationSecurityServicesResponse; import com.datadog.api.client.v2.model.ApplicationSecurityWafCustomRuleCreateRequest; import com.datadog.api.client.v2.model.ApplicationSecurityWafCustomRuleListResponse; import com.datadog.api.client.v2.model.ApplicationSecurityWafCustomRuleResponse; @@ -1345,6 +1346,172 @@ public ApiResponse getApplicationSecurityWafP new GenericType() {}); } + /** + * Get Application Security details for a service. + * + *

See {@link #getAsmServiceByNameWithHttpInfo}. + * + * @param serviceFilter The name of the service to retrieve Application Security details for. + * Returns all matching services across environments. (required) + * @return ApplicationSecurityServicesResponse + * @throws ApiException if fails to make API call + */ + public ApplicationSecurityServicesResponse getAsmServiceByName(String serviceFilter) + throws ApiException { + return getAsmServiceByNameWithHttpInfo(serviceFilter).getData(); + } + + /** + * Get Application Security details for a service. + * + *

See {@link #getAsmServiceByNameWithHttpInfoAsync}. + * + * @param serviceFilter The name of the service to retrieve Application Security details for. + * Returns all matching services across environments. (required) + * @return CompletableFuture<ApplicationSecurityServicesResponse> + */ + public CompletableFuture getAsmServiceByNameAsync( + String serviceFilter) { + return getAsmServiceByNameWithHttpInfoAsync(serviceFilter) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * Retrieve Application Security details for services matching the given name. Returns Application + * Security activation, compatibility, and product enablement information for each matching + * (service, environment) pair, along with a count of services that have Application + * Security Management (Threats) enabled. + * + * @param serviceFilter The name of the service to retrieve Application Security details for. + * Returns all matching services across environments. (required) + * @return ApiResponse<ApplicationSecurityServicesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
403 Not Authorized -
429 Too many requests -
+ */ + public ApiResponse getAsmServiceByNameWithHttpInfo( + String serviceFilter) throws ApiException { + // Check if unstable operation is enabled + String operationId = "getAsmServiceByName"; + 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 'serviceFilter' is set + if (serviceFilter == null) { + throw new ApiException( + 400, "Missing the required parameter 'serviceFilter' when calling getAsmServiceByName"); + } + // create path and map variables + String localVarPath = + "/api/v2/security/asm/services/{service_filter}" + .replaceAll( + "\\{" + "service_filter" + "\\}", apiClient.escapeString(serviceFilter.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.ApplicationSecurityApi.getAsmServiceByName", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + return apiClient.invokeAPI( + "GET", + builder, + localVarHeaderParams, + new String[] {}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Get Application Security details for a service. + * + *

See {@link #getAsmServiceByNameWithHttpInfo}. + * + * @param serviceFilter The name of the service to retrieve Application Security details for. + * Returns all matching services across environments. (required) + * @return CompletableFuture<ApiResponse<ApplicationSecurityServicesResponse>> + */ + public CompletableFuture> + getAsmServiceByNameWithHttpInfoAsync(String serviceFilter) { + // Check if unstable operation is enabled + String operationId = "getAsmServiceByName"; + 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 'serviceFilter' is set + if (serviceFilter == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'serviceFilter' when calling getAsmServiceByName")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/security/asm/services/{service_filter}" + .replaceAll( + "\\{" + "service_filter" + "\\}", apiClient.escapeString(serviceFilter.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.ApplicationSecurityApi.getAsmServiceByName", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth"}); + } 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() {}); + } + /** * List all WAF custom rules. * diff --git a/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServiceAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServiceAttributes.java new file mode 100644 index 00000000000..536797f4364 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServiceAttributes.java @@ -0,0 +1,1205 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Application Security details describing a service in a given environment. */ +@JsonPropertyOrder({ + ApplicationSecurityServiceAttributes.JSON_PROPERTY_AGENT_VERSIONS, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_APP_TYPE, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_ASM_THREAT_COMPATIBLE, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_BACKEND_WAF_EVENT_COUNT, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_BUSINESS_LOGIC, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_COLOR, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_ENV, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_EVENT_COUNT, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_EVENT_TREND, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_HAS_APPSEC_ENABLED, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_HITS, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_IAST_PRODUCT_ACTIVATION, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_IAST_PRODUCT_COMPATIBILITY, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_IAST_PRODUCT_COMPATIBILITY_REASONS, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_LANGUAGES, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_LAST_INGESTED_SPANS, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_RC_CAPABILITIES, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_RECOMMENDED_BUSINESS_LOGIC, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_RISK_PRODUCT_ACTIVATION, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_RISK_PRODUCT_COMPATIBILITY, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_RISK_PRODUCT_COMPATIBILITY_REASONS, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_RULES_VERSION, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_SERVICE, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_SIGNAL_COUNT, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_SIGNAL_TREND, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_SOURCE, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_TEAMS, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_TRACER_VERSIONS, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_VM_ACTIVATION, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_VULN_CRITICAL_COUNT, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_VULN_HIGH_COUNT, + ApplicationSecurityServiceAttributes.JSON_PROPERTY_WITHOUT_FILTER_SERVICES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ApplicationSecurityServiceAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_AGENT_VERSIONS = "agent_versions"; + private List agentVersions = new ArrayList<>(); + + public static final String JSON_PROPERTY_APP_TYPE = "app_type"; + private String appType; + + public static final String JSON_PROPERTY_ASM_THREAT_COMPATIBLE = "asm_threat_compatible"; + private Boolean asmThreatCompatible; + + public static final String JSON_PROPERTY_BACKEND_WAF_EVENT_COUNT = "backend_waf_event_count"; + private Long backendWafEventCount; + + public static final String JSON_PROPERTY_BUSINESS_LOGIC = "business_logic"; + private List businessLogic = new ArrayList<>(); + + public static final String JSON_PROPERTY_COLOR = "color"; + private String color; + + public static final String JSON_PROPERTY_ENV = "env"; + private String env; + + public static final String JSON_PROPERTY_EVENT_COUNT = "event_count"; + private Long eventCount; + + public static final String JSON_PROPERTY_EVENT_TREND = "event_trend"; + private List eventTrend = new ArrayList<>(); + + public static final String JSON_PROPERTY_HAS_APPSEC_ENABLED = "has_appsec_enabled"; + private Boolean hasAppsecEnabled; + + public static final String JSON_PROPERTY_HITS = "hits"; + private Long hits; + + public static final String JSON_PROPERTY_IAST_PRODUCT_ACTIVATION = "iast_product_activation"; + private Boolean iastProductActivation; + + public static final String JSON_PROPERTY_IAST_PRODUCT_COMPATIBILITY = + "iast_product_compatibility"; + private String iastProductCompatibility; + + public static final String JSON_PROPERTY_IAST_PRODUCT_COMPATIBILITY_REASONS = + "iast_product_compatibility_reasons"; + private List iastProductCompatibilityReasons = new ArrayList<>(); + + public static final String JSON_PROPERTY_LANGUAGES = "languages"; + private List languages = new ArrayList<>(); + + public static final String JSON_PROPERTY_LAST_INGESTED_SPANS = "last_ingested_spans"; + private Long lastIngestedSpans; + + public static final String JSON_PROPERTY_RC_CAPABILITIES = "rc_capabilities"; + private List rcCapabilities = new ArrayList<>(); + + public static final String JSON_PROPERTY_RECOMMENDED_BUSINESS_LOGIC = + "recommended_business_logic"; + private List recommendedBusinessLogic = new ArrayList<>(); + + public static final String JSON_PROPERTY_RISK_PRODUCT_ACTIVATION = "risk_product_activation"; + private Boolean riskProductActivation; + + public static final String JSON_PROPERTY_RISK_PRODUCT_COMPATIBILITY = + "risk_product_compatibility"; + private String riskProductCompatibility; + + public static final String JSON_PROPERTY_RISK_PRODUCT_COMPATIBILITY_REASONS = + "risk_product_compatibility_reasons"; + private List riskProductCompatibilityReasons = new ArrayList<>(); + + public static final String JSON_PROPERTY_RULES_VERSION = "rules_version"; + private List rulesVersion = new ArrayList<>(); + + public static final String JSON_PROPERTY_SERVICE = "service"; + private String service; + + public static final String JSON_PROPERTY_SIGNAL_COUNT = "signal_count"; + private Long signalCount; + + public static final String JSON_PROPERTY_SIGNAL_TREND = "signal_trend"; + private List signalTrend = new ArrayList<>(); + + public static final String JSON_PROPERTY_SOURCE = "source"; + private List source = new ArrayList<>(); + + public static final String JSON_PROPERTY_TEAMS = "teams"; + private List teams = new ArrayList<>(); + + public static final String JSON_PROPERTY_TRACER_VERSIONS = "tracer_versions"; + private List tracerVersions = new ArrayList<>(); + + public static final String JSON_PROPERTY_VM_ACTIVATION = "vm-activation"; + private String vmActivation; + + public static final String JSON_PROPERTY_VULN_CRITICAL_COUNT = "vuln_critical_count"; + private Long vulnCriticalCount; + + public static final String JSON_PROPERTY_VULN_HIGH_COUNT = "vuln_high_count"; + private Long vulnHighCount; + + public static final String JSON_PROPERTY_WITHOUT_FILTER_SERVICES = "without_filter_services"; + private Long withoutFilterServices; + + public ApplicationSecurityServiceAttributes() {} + + @JsonCreator + public ApplicationSecurityServiceAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_AGENT_VERSIONS) + List agentVersions, + @JsonProperty(required = true, value = JSON_PROPERTY_APP_TYPE) String appType, + @JsonProperty(required = true, value = JSON_PROPERTY_ASM_THREAT_COMPATIBLE) + Boolean asmThreatCompatible, + @JsonProperty(required = true, value = JSON_PROPERTY_BACKEND_WAF_EVENT_COUNT) + Long backendWafEventCount, + @JsonProperty(required = true, value = JSON_PROPERTY_BUSINESS_LOGIC) + List businessLogic, + @JsonProperty(required = true, value = JSON_PROPERTY_COLOR) String color, + @JsonProperty(required = true, value = JSON_PROPERTY_ENV) String env, + @JsonProperty(required = true, value = JSON_PROPERTY_EVENT_COUNT) Long eventCount, + @JsonProperty(required = true, value = JSON_PROPERTY_EVENT_TREND) List eventTrend, + @JsonProperty(required = true, value = JSON_PROPERTY_HAS_APPSEC_ENABLED) + Boolean hasAppsecEnabled, + @JsonProperty(required = true, value = JSON_PROPERTY_HITS) Long hits, + @JsonProperty(required = true, value = JSON_PROPERTY_IAST_PRODUCT_ACTIVATION) + Boolean iastProductActivation, + @JsonProperty(required = true, value = JSON_PROPERTY_IAST_PRODUCT_COMPATIBILITY) + String iastProductCompatibility, + @JsonProperty(required = true, value = JSON_PROPERTY_IAST_PRODUCT_COMPATIBILITY_REASONS) + List iastProductCompatibilityReasons, + @JsonProperty(required = true, value = JSON_PROPERTY_LANGUAGES) List languages, + @JsonProperty(required = true, value = JSON_PROPERTY_LAST_INGESTED_SPANS) + Long lastIngestedSpans, + @JsonProperty(required = true, value = JSON_PROPERTY_RC_CAPABILITIES) + List rcCapabilities, + @JsonProperty(required = true, value = JSON_PROPERTY_RECOMMENDED_BUSINESS_LOGIC) + List recommendedBusinessLogic, + @JsonProperty(required = true, value = JSON_PROPERTY_RISK_PRODUCT_ACTIVATION) + Boolean riskProductActivation, + @JsonProperty(required = true, value = JSON_PROPERTY_RISK_PRODUCT_COMPATIBILITY) + String riskProductCompatibility, + @JsonProperty(required = true, value = JSON_PROPERTY_RISK_PRODUCT_COMPATIBILITY_REASONS) + List riskProductCompatibilityReasons, + @JsonProperty(required = true, value = JSON_PROPERTY_RULES_VERSION) List rulesVersion, + @JsonProperty(required = true, value = JSON_PROPERTY_SERVICE) String service, + @JsonProperty(required = true, value = JSON_PROPERTY_SIGNAL_COUNT) Long signalCount, + @JsonProperty(required = true, value = JSON_PROPERTY_SIGNAL_TREND) List signalTrend, + @JsonProperty(required = true, value = JSON_PROPERTY_SOURCE) List source, + @JsonProperty(required = true, value = JSON_PROPERTY_TEAMS) List teams, + @JsonProperty(required = true, value = JSON_PROPERTY_TRACER_VERSIONS) + List tracerVersions, + @JsonProperty(required = true, value = JSON_PROPERTY_VM_ACTIVATION) String vmActivation, + @JsonProperty(required = true, value = JSON_PROPERTY_VULN_CRITICAL_COUNT) + Long vulnCriticalCount, + @JsonProperty(required = true, value = JSON_PROPERTY_VULN_HIGH_COUNT) Long vulnHighCount, + @JsonProperty(required = true, value = JSON_PROPERTY_WITHOUT_FILTER_SERVICES) + Long withoutFilterServices) { + this.agentVersions = agentVersions; + this.appType = appType; + this.asmThreatCompatible = asmThreatCompatible; + this.backendWafEventCount = backendWafEventCount; + this.businessLogic = businessLogic; + this.color = color; + this.env = env; + this.eventCount = eventCount; + this.eventTrend = eventTrend; + this.hasAppsecEnabled = hasAppsecEnabled; + this.hits = hits; + this.iastProductActivation = iastProductActivation; + this.iastProductCompatibility = iastProductCompatibility; + this.iastProductCompatibilityReasons = iastProductCompatibilityReasons; + this.languages = languages; + this.lastIngestedSpans = lastIngestedSpans; + this.rcCapabilities = rcCapabilities; + this.recommendedBusinessLogic = recommendedBusinessLogic; + this.riskProductActivation = riskProductActivation; + this.riskProductCompatibility = riskProductCompatibility; + this.riskProductCompatibilityReasons = riskProductCompatibilityReasons; + this.rulesVersion = rulesVersion; + this.service = service; + this.signalCount = signalCount; + this.signalTrend = signalTrend; + this.source = source; + this.teams = teams; + this.tracerVersions = tracerVersions; + this.vmActivation = vmActivation; + this.vulnCriticalCount = vulnCriticalCount; + this.vulnHighCount = vulnHighCount; + this.withoutFilterServices = withoutFilterServices; + } + + public ApplicationSecurityServiceAttributes agentVersions(List agentVersions) { + this.agentVersions = agentVersions; + return this; + } + + public ApplicationSecurityServiceAttributes addAgentVersionsItem(String agentVersionsItem) { + this.agentVersions.add(agentVersionsItem); + return this; + } + + /** + * The Datadog Agent versions reporting for the service. + * + * @return agentVersions + */ + @JsonProperty(JSON_PROPERTY_AGENT_VERSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getAgentVersions() { + return agentVersions; + } + + public void setAgentVersions(List agentVersions) { + this.agentVersions = agentVersions; + } + + public ApplicationSecurityServiceAttributes appType(String appType) { + this.appType = appType; + return this; + } + + /** + * The application type of the service, such as web or serverless. + * + * @return appType + */ + @JsonProperty(JSON_PROPERTY_APP_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getAppType() { + return appType; + } + + public void setAppType(String appType) { + this.appType = appType; + } + + public ApplicationSecurityServiceAttributes asmThreatCompatible(Boolean asmThreatCompatible) { + this.asmThreatCompatible = asmThreatCompatible; + return this; + } + + /** + * Whether the service is compatible with Application Security Management (Threats). + * + * @return asmThreatCompatible + */ + @JsonProperty(JSON_PROPERTY_ASM_THREAT_COMPATIBLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getAsmThreatCompatible() { + return asmThreatCompatible; + } + + public void setAsmThreatCompatible(Boolean asmThreatCompatible) { + this.asmThreatCompatible = asmThreatCompatible; + } + + public ApplicationSecurityServiceAttributes backendWafEventCount(Long backendWafEventCount) { + this.backendWafEventCount = backendWafEventCount; + return this; + } + + /** + * The number of backend WAF events detected for the service. + * + * @return backendWafEventCount + */ + @JsonProperty(JSON_PROPERTY_BACKEND_WAF_EVENT_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getBackendWafEventCount() { + return backendWafEventCount; + } + + public void setBackendWafEventCount(Long backendWafEventCount) { + this.backendWafEventCount = backendWafEventCount; + } + + public ApplicationSecurityServiceAttributes businessLogic(List businessLogic) { + this.businessLogic = businessLogic; + return this; + } + + public ApplicationSecurityServiceAttributes addBusinessLogicItem(String businessLogicItem) { + this.businessLogic.add(businessLogicItem); + return this; + } + + /** + * The enabled business logic detection rules for the service. + * + * @return businessLogic + */ + @JsonProperty(JSON_PROPERTY_BUSINESS_LOGIC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getBusinessLogic() { + return businessLogic; + } + + public void setBusinessLogic(List businessLogic) { + this.businessLogic = businessLogic; + } + + public ApplicationSecurityServiceAttributes color(String color) { + this.color = color; + return this; + } + + /** + * Deprecated: a display color associated with the service in the UI. + * + * @return color + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_COLOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getColor() { + return color; + } + + @Deprecated + public void setColor(String color) { + this.color = color; + } + + public ApplicationSecurityServiceAttributes env(String env) { + this.env = env; + return this; + } + + /** + * The environment the service runs in. + * + * @return env + */ + @JsonProperty(JSON_PROPERTY_ENV) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEnv() { + return env; + } + + public void setEnv(String env) { + this.env = env; + } + + public ApplicationSecurityServiceAttributes eventCount(Long eventCount) { + this.eventCount = eventCount; + return this; + } + + /** + * The number of Application Security events detected for the service. + * + * @return eventCount + */ + @JsonProperty(JSON_PROPERTY_EVENT_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getEventCount() { + return eventCount; + } + + public void setEventCount(Long eventCount) { + this.eventCount = eventCount; + } + + public ApplicationSecurityServiceAttributes eventTrend(List eventTrend) { + this.eventTrend = eventTrend; + return this; + } + + public ApplicationSecurityServiceAttributes addEventTrendItem(Integer eventTrendItem) { + this.eventTrend.add(eventTrendItem); + return this; + } + + /** + * Deprecated: the trend of Application Security events over time. + * + * @return eventTrend + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_EVENT_TREND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getEventTrend() { + return eventTrend; + } + + @Deprecated + public void setEventTrend(List eventTrend) { + this.eventTrend = eventTrend; + } + + public ApplicationSecurityServiceAttributes hasAppsecEnabled(Boolean hasAppsecEnabled) { + this.hasAppsecEnabled = hasAppsecEnabled; + return this; + } + + /** + * Whether Application Security Management (Threats) is enabled for the service. + * + * @return hasAppsecEnabled + */ + @JsonProperty(JSON_PROPERTY_HAS_APPSEC_ENABLED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getHasAppsecEnabled() { + return hasAppsecEnabled; + } + + public void setHasAppsecEnabled(Boolean hasAppsecEnabled) { + this.hasAppsecEnabled = hasAppsecEnabled; + } + + public ApplicationSecurityServiceAttributes hits(Long hits) { + this.hits = hits; + return this; + } + + /** + * Deprecated: the number of hits for the service. + * + * @return hits + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_HITS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getHits() { + return hits; + } + + @Deprecated + public void setHits(Long hits) { + this.hits = hits; + } + + public ApplicationSecurityServiceAttributes iastProductActivation(Boolean iastProductActivation) { + this.iastProductActivation = iastProductActivation; + return this; + } + + /** + * Whether Interactive Application Security Testing (IAST) is enabled for the service. + * + * @return iastProductActivation + */ + @JsonProperty(JSON_PROPERTY_IAST_PRODUCT_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIastProductActivation() { + return iastProductActivation; + } + + public void setIastProductActivation(Boolean iastProductActivation) { + this.iastProductActivation = iastProductActivation; + } + + public ApplicationSecurityServiceAttributes iastProductCompatibility( + String iastProductCompatibility) { + this.iastProductCompatibility = iastProductCompatibility; + return this; + } + + /** + * The Interactive Application Security Testing (IAST) compatibility status of the service. + * + * @return iastProductCompatibility + */ + @JsonProperty(JSON_PROPERTY_IAST_PRODUCT_COMPATIBILITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getIastProductCompatibility() { + return iastProductCompatibility; + } + + public void setIastProductCompatibility(String iastProductCompatibility) { + this.iastProductCompatibility = iastProductCompatibility; + } + + public ApplicationSecurityServiceAttributes iastProductCompatibilityReasons( + List iastProductCompatibilityReasons) { + this.iastProductCompatibilityReasons = iastProductCompatibilityReasons; + return this; + } + + public ApplicationSecurityServiceAttributes addIastProductCompatibilityReasonsItem( + String iastProductCompatibilityReasonsItem) { + this.iastProductCompatibilityReasons.add(iastProductCompatibilityReasonsItem); + return this; + } + + /** + * The reasons explaining the Interactive Application Security Testing (IAST) compatibility + * status. + * + * @return iastProductCompatibilityReasons + */ + @JsonProperty(JSON_PROPERTY_IAST_PRODUCT_COMPATIBILITY_REASONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getIastProductCompatibilityReasons() { + return iastProductCompatibilityReasons; + } + + public void setIastProductCompatibilityReasons(List iastProductCompatibilityReasons) { + this.iastProductCompatibilityReasons = iastProductCompatibilityReasons; + } + + public ApplicationSecurityServiceAttributes languages(List languages) { + this.languages = languages; + return this; + } + + public ApplicationSecurityServiceAttributes addLanguagesItem(String languagesItem) { + this.languages.add(languagesItem); + return this; + } + + /** + * The programming languages detected for the service. + * + * @return languages + */ + @JsonProperty(JSON_PROPERTY_LANGUAGES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getLanguages() { + return languages; + } + + public void setLanguages(List languages) { + this.languages = languages; + } + + public ApplicationSecurityServiceAttributes lastIngestedSpans(Long lastIngestedSpans) { + this.lastIngestedSpans = lastIngestedSpans; + return this; + } + + /** + * The Unix timestamp, in seconds, of the last ingested span for the service. + * + * @return lastIngestedSpans + */ + @JsonProperty(JSON_PROPERTY_LAST_INGESTED_SPANS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getLastIngestedSpans() { + return lastIngestedSpans; + } + + public void setLastIngestedSpans(Long lastIngestedSpans) { + this.lastIngestedSpans = lastIngestedSpans; + } + + public ApplicationSecurityServiceAttributes rcCapabilities(List rcCapabilities) { + this.rcCapabilities = rcCapabilities; + return this; + } + + public ApplicationSecurityServiceAttributes addRcCapabilitiesItem(String rcCapabilitiesItem) { + this.rcCapabilities.add(rcCapabilitiesItem); + return this; + } + + /** + * The Remote Configuration capabilities reported by the service. + * + * @return rcCapabilities + */ + @JsonProperty(JSON_PROPERTY_RC_CAPABILITIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRcCapabilities() { + return rcCapabilities; + } + + public void setRcCapabilities(List rcCapabilities) { + this.rcCapabilities = rcCapabilities; + } + + public ApplicationSecurityServiceAttributes recommendedBusinessLogic( + List recommendedBusinessLogic) { + this.recommendedBusinessLogic = recommendedBusinessLogic; + return this; + } + + public ApplicationSecurityServiceAttributes addRecommendedBusinessLogicItem( + String recommendedBusinessLogicItem) { + this.recommendedBusinessLogic.add(recommendedBusinessLogicItem); + return this; + } + + /** + * The recommended business logic detection rules for the service. + * + * @return recommendedBusinessLogic + */ + @JsonProperty(JSON_PROPERTY_RECOMMENDED_BUSINESS_LOGIC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRecommendedBusinessLogic() { + return recommendedBusinessLogic; + } + + public void setRecommendedBusinessLogic(List recommendedBusinessLogic) { + this.recommendedBusinessLogic = recommendedBusinessLogic; + } + + public ApplicationSecurityServiceAttributes riskProductActivation(Boolean riskProductActivation) { + this.riskProductActivation = riskProductActivation; + return this; + } + + /** + * Whether Software Composition Analysis (SCA) is enabled for the service. + * + * @return riskProductActivation + */ + @JsonProperty(JSON_PROPERTY_RISK_PRODUCT_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getRiskProductActivation() { + return riskProductActivation; + } + + public void setRiskProductActivation(Boolean riskProductActivation) { + this.riskProductActivation = riskProductActivation; + } + + public ApplicationSecurityServiceAttributes riskProductCompatibility( + String riskProductCompatibility) { + this.riskProductCompatibility = riskProductCompatibility; + return this; + } + + /** + * The Software Composition Analysis (SCA) compatibility status of the service. + * + * @return riskProductCompatibility + */ + @JsonProperty(JSON_PROPERTY_RISK_PRODUCT_COMPATIBILITY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getRiskProductCompatibility() { + return riskProductCompatibility; + } + + public void setRiskProductCompatibility(String riskProductCompatibility) { + this.riskProductCompatibility = riskProductCompatibility; + } + + public ApplicationSecurityServiceAttributes riskProductCompatibilityReasons( + List riskProductCompatibilityReasons) { + this.riskProductCompatibilityReasons = riskProductCompatibilityReasons; + return this; + } + + public ApplicationSecurityServiceAttributes addRiskProductCompatibilityReasonsItem( + String riskProductCompatibilityReasonsItem) { + this.riskProductCompatibilityReasons.add(riskProductCompatibilityReasonsItem); + return this; + } + + /** + * The reasons explaining the Software Composition Analysis (SCA) compatibility status. + * + * @return riskProductCompatibilityReasons + */ + @JsonProperty(JSON_PROPERTY_RISK_PRODUCT_COMPATIBILITY_REASONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRiskProductCompatibilityReasons() { + return riskProductCompatibilityReasons; + } + + public void setRiskProductCompatibilityReasons(List riskProductCompatibilityReasons) { + this.riskProductCompatibilityReasons = riskProductCompatibilityReasons; + } + + public ApplicationSecurityServiceAttributes rulesVersion(List rulesVersion) { + this.rulesVersion = rulesVersion; + return this; + } + + public ApplicationSecurityServiceAttributes addRulesVersionItem(String rulesVersionItem) { + this.rulesVersion.add(rulesVersionItem); + return this; + } + + /** + * The WAF rules versions applied to the service. + * + * @return rulesVersion + */ + @JsonProperty(JSON_PROPERTY_RULES_VERSION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getRulesVersion() { + return rulesVersion; + } + + public void setRulesVersion(List rulesVersion) { + this.rulesVersion = rulesVersion; + } + + public ApplicationSecurityServiceAttributes service(String service) { + this.service = service; + return this; + } + + /** + * The name of the service. + * + * @return service + */ + @JsonProperty(JSON_PROPERTY_SERVICE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getService() { + return service; + } + + public void setService(String service) { + this.service = service; + } + + public ApplicationSecurityServiceAttributes signalCount(Long signalCount) { + this.signalCount = signalCount; + return this; + } + + /** + * Deprecated: the number of security signals for the service. + * + * @return signalCount + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_SIGNAL_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getSignalCount() { + return signalCount; + } + + @Deprecated + public void setSignalCount(Long signalCount) { + this.signalCount = signalCount; + } + + public ApplicationSecurityServiceAttributes signalTrend(List signalTrend) { + this.signalTrend = signalTrend; + return this; + } + + public ApplicationSecurityServiceAttributes addSignalTrendItem(Integer signalTrendItem) { + this.signalTrend.add(signalTrendItem); + return this; + } + + /** + * Deprecated: the trend of security signals over time. + * + * @return signalTrend + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_SIGNAL_TREND) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSignalTrend() { + return signalTrend; + } + + @Deprecated + public void setSignalTrend(List signalTrend) { + this.signalTrend = signalTrend; + } + + public ApplicationSecurityServiceAttributes source(List source) { + this.source = source; + return this; + } + + public ApplicationSecurityServiceAttributes addSourceItem(String sourceItem) { + this.source.add(sourceItem); + return this; + } + + /** + * The data sources that contributed information about the service. + * + * @return source + */ + @JsonProperty(JSON_PROPERTY_SOURCE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getSource() { + return source; + } + + public void setSource(List source) { + this.source = source; + } + + public ApplicationSecurityServiceAttributes teams(List teams) { + this.teams = teams; + return this; + } + + public ApplicationSecurityServiceAttributes addTeamsItem(String teamsItem) { + this.teams.add(teamsItem); + return this; + } + + /** + * The teams that own the service. + * + * @return teams + */ + @JsonProperty(JSON_PROPERTY_TEAMS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTeams() { + return teams; + } + + public void setTeams(List teams) { + this.teams = teams; + } + + public ApplicationSecurityServiceAttributes tracerVersions(List tracerVersions) { + this.tracerVersions = tracerVersions; + return this; + } + + public ApplicationSecurityServiceAttributes addTracerVersionsItem(String tracerVersionsItem) { + this.tracerVersions.add(tracerVersionsItem); + return this; + } + + /** + * The Datadog tracing library versions reporting for the service. + * + * @return tracerVersions + */ + @JsonProperty(JSON_PROPERTY_TRACER_VERSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTracerVersions() { + return tracerVersions; + } + + public void setTracerVersions(List tracerVersions) { + this.tracerVersions = tracerVersions; + } + + public ApplicationSecurityServiceAttributes vmActivation(String vmActivation) { + this.vmActivation = vmActivation; + return this; + } + + /** + * The Vulnerability Management activation status of the service. + * + * @return vmActivation + */ + @JsonProperty(JSON_PROPERTY_VM_ACTIVATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getVmActivation() { + return vmActivation; + } + + public void setVmActivation(String vmActivation) { + this.vmActivation = vmActivation; + } + + public ApplicationSecurityServiceAttributes vulnCriticalCount(Long vulnCriticalCount) { + this.vulnCriticalCount = vulnCriticalCount; + return this; + } + + /** + * Deprecated: the number of critical-severity vulnerabilities for the service. + * + * @return vulnCriticalCount + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_VULN_CRITICAL_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVulnCriticalCount() { + return vulnCriticalCount; + } + + @Deprecated + public void setVulnCriticalCount(Long vulnCriticalCount) { + this.vulnCriticalCount = vulnCriticalCount; + } + + public ApplicationSecurityServiceAttributes vulnHighCount(Long vulnHighCount) { + this.vulnHighCount = vulnHighCount; + return this; + } + + /** + * Deprecated: the number of high-severity vulnerabilities for the service. + * + * @return vulnHighCount + * @deprecated + */ + @Deprecated + @JsonProperty(JSON_PROPERTY_VULN_HIGH_COUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getVulnHighCount() { + return vulnHighCount; + } + + @Deprecated + public void setVulnHighCount(Long vulnHighCount) { + this.vulnHighCount = vulnHighCount; + } + + public ApplicationSecurityServiceAttributes withoutFilterServices(Long withoutFilterServices) { + this.withoutFilterServices = withoutFilterServices; + return this; + } + + /** + * The total number of services available without applying the service filter. + * + * @return withoutFilterServices + */ + @JsonProperty(JSON_PROPERTY_WITHOUT_FILTER_SERVICES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getWithoutFilterServices() { + return withoutFilterServices; + } + + public void setWithoutFilterServices(Long withoutFilterServices) { + this.withoutFilterServices = withoutFilterServices; + } + + /** + * 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 ApplicationSecurityServiceAttributes + */ + @JsonAnySetter + public ApplicationSecurityServiceAttributes 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 ApplicationSecurityServiceAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApplicationSecurityServiceAttributes applicationSecurityServiceAttributes = + (ApplicationSecurityServiceAttributes) o; + return Objects.equals(this.agentVersions, applicationSecurityServiceAttributes.agentVersions) + && Objects.equals(this.appType, applicationSecurityServiceAttributes.appType) + && Objects.equals( + this.asmThreatCompatible, applicationSecurityServiceAttributes.asmThreatCompatible) + && Objects.equals( + this.backendWafEventCount, applicationSecurityServiceAttributes.backendWafEventCount) + && Objects.equals(this.businessLogic, applicationSecurityServiceAttributes.businessLogic) + && Objects.equals(this.color, applicationSecurityServiceAttributes.color) + && Objects.equals(this.env, applicationSecurityServiceAttributes.env) + && Objects.equals(this.eventCount, applicationSecurityServiceAttributes.eventCount) + && Objects.equals(this.eventTrend, applicationSecurityServiceAttributes.eventTrend) + && Objects.equals( + this.hasAppsecEnabled, applicationSecurityServiceAttributes.hasAppsecEnabled) + && Objects.equals(this.hits, applicationSecurityServiceAttributes.hits) + && Objects.equals( + this.iastProductActivation, applicationSecurityServiceAttributes.iastProductActivation) + && Objects.equals( + this.iastProductCompatibility, + applicationSecurityServiceAttributes.iastProductCompatibility) + && Objects.equals( + this.iastProductCompatibilityReasons, + applicationSecurityServiceAttributes.iastProductCompatibilityReasons) + && Objects.equals(this.languages, applicationSecurityServiceAttributes.languages) + && Objects.equals( + this.lastIngestedSpans, applicationSecurityServiceAttributes.lastIngestedSpans) + && Objects.equals(this.rcCapabilities, applicationSecurityServiceAttributes.rcCapabilities) + && Objects.equals( + this.recommendedBusinessLogic, + applicationSecurityServiceAttributes.recommendedBusinessLogic) + && Objects.equals( + this.riskProductActivation, applicationSecurityServiceAttributes.riskProductActivation) + && Objects.equals( + this.riskProductCompatibility, + applicationSecurityServiceAttributes.riskProductCompatibility) + && Objects.equals( + this.riskProductCompatibilityReasons, + applicationSecurityServiceAttributes.riskProductCompatibilityReasons) + && Objects.equals(this.rulesVersion, applicationSecurityServiceAttributes.rulesVersion) + && Objects.equals(this.service, applicationSecurityServiceAttributes.service) + && Objects.equals(this.signalCount, applicationSecurityServiceAttributes.signalCount) + && Objects.equals(this.signalTrend, applicationSecurityServiceAttributes.signalTrend) + && Objects.equals(this.source, applicationSecurityServiceAttributes.source) + && Objects.equals(this.teams, applicationSecurityServiceAttributes.teams) + && Objects.equals(this.tracerVersions, applicationSecurityServiceAttributes.tracerVersions) + && Objects.equals(this.vmActivation, applicationSecurityServiceAttributes.vmActivation) + && Objects.equals( + this.vulnCriticalCount, applicationSecurityServiceAttributes.vulnCriticalCount) + && Objects.equals(this.vulnHighCount, applicationSecurityServiceAttributes.vulnHighCount) + && Objects.equals( + this.withoutFilterServices, applicationSecurityServiceAttributes.withoutFilterServices) + && Objects.equals( + this.additionalProperties, applicationSecurityServiceAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + agentVersions, + appType, + asmThreatCompatible, + backendWafEventCount, + businessLogic, + color, + env, + eventCount, + eventTrend, + hasAppsecEnabled, + hits, + iastProductActivation, + iastProductCompatibility, + iastProductCompatibilityReasons, + languages, + lastIngestedSpans, + rcCapabilities, + recommendedBusinessLogic, + riskProductActivation, + riskProductCompatibility, + riskProductCompatibilityReasons, + rulesVersion, + service, + signalCount, + signalTrend, + source, + teams, + tracerVersions, + vmActivation, + vulnCriticalCount, + vulnHighCount, + withoutFilterServices, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApplicationSecurityServiceAttributes {\n"); + sb.append(" agentVersions: ").append(toIndentedString(agentVersions)).append("\n"); + sb.append(" appType: ").append(toIndentedString(appType)).append("\n"); + sb.append(" asmThreatCompatible: ") + .append(toIndentedString(asmThreatCompatible)) + .append("\n"); + sb.append(" backendWafEventCount: ") + .append(toIndentedString(backendWafEventCount)) + .append("\n"); + sb.append(" businessLogic: ").append(toIndentedString(businessLogic)).append("\n"); + sb.append(" color: ").append(toIndentedString(color)).append("\n"); + sb.append(" env: ").append(toIndentedString(env)).append("\n"); + sb.append(" eventCount: ").append(toIndentedString(eventCount)).append("\n"); + sb.append(" eventTrend: ").append(toIndentedString(eventTrend)).append("\n"); + sb.append(" hasAppsecEnabled: ").append(toIndentedString(hasAppsecEnabled)).append("\n"); + sb.append(" hits: ").append(toIndentedString(hits)).append("\n"); + sb.append(" iastProductActivation: ") + .append(toIndentedString(iastProductActivation)) + .append("\n"); + sb.append(" iastProductCompatibility: ") + .append(toIndentedString(iastProductCompatibility)) + .append("\n"); + sb.append(" iastProductCompatibilityReasons: ") + .append(toIndentedString(iastProductCompatibilityReasons)) + .append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" lastIngestedSpans: ").append(toIndentedString(lastIngestedSpans)).append("\n"); + sb.append(" rcCapabilities: ").append(toIndentedString(rcCapabilities)).append("\n"); + sb.append(" recommendedBusinessLogic: ") + .append(toIndentedString(recommendedBusinessLogic)) + .append("\n"); + sb.append(" riskProductActivation: ") + .append(toIndentedString(riskProductActivation)) + .append("\n"); + sb.append(" riskProductCompatibility: ") + .append(toIndentedString(riskProductCompatibility)) + .append("\n"); + sb.append(" riskProductCompatibilityReasons: ") + .append(toIndentedString(riskProductCompatibilityReasons)) + .append("\n"); + sb.append(" rulesVersion: ").append(toIndentedString(rulesVersion)).append("\n"); + sb.append(" service: ").append(toIndentedString(service)).append("\n"); + sb.append(" signalCount: ").append(toIndentedString(signalCount)).append("\n"); + sb.append(" signalTrend: ").append(toIndentedString(signalTrend)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" teams: ").append(toIndentedString(teams)).append("\n"); + sb.append(" tracerVersions: ").append(toIndentedString(tracerVersions)).append("\n"); + sb.append(" vmActivation: ").append(toIndentedString(vmActivation)).append("\n"); + sb.append(" vulnCriticalCount: ").append(toIndentedString(vulnCriticalCount)).append("\n"); + sb.append(" vulnHighCount: ").append(toIndentedString(vulnHighCount)).append("\n"); + sb.append(" withoutFilterServices: ") + .append(toIndentedString(withoutFilterServices)) + .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/ApplicationSecurityServiceResource.java b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServiceResource.java new file mode 100644 index 00000000000..6dd92c13223 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServiceResource.java @@ -0,0 +1,214 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A JSON:API resource describing a service and its Application Security details. */ +@JsonPropertyOrder({ + ApplicationSecurityServiceResource.JSON_PROPERTY_ATTRIBUTES, + ApplicationSecurityServiceResource.JSON_PROPERTY_ID, + ApplicationSecurityServiceResource.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ApplicationSecurityServiceResource { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private ApplicationSecurityServiceAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private ApplicationSecurityServiceType type = ApplicationSecurityServiceType.SERVICE_ENV; + + public ApplicationSecurityServiceResource() {} + + @JsonCreator + public ApplicationSecurityServiceResource( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + ApplicationSecurityServiceAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + ApplicationSecurityServiceType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public ApplicationSecurityServiceResource attributes( + ApplicationSecurityServiceAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Application Security details describing a service in a given environment. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ApplicationSecurityServiceAttributes getAttributes() { + return attributes; + } + + public void setAttributes(ApplicationSecurityServiceAttributes attributes) { + this.attributes = attributes; + } + + public ApplicationSecurityServiceResource id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the service, formatted as <service>_<environment> + * . + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ApplicationSecurityServiceResource type(ApplicationSecurityServiceType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of the resource. The value should always be service_env. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ApplicationSecurityServiceType getType() { + return type; + } + + public void setType(ApplicationSecurityServiceType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ApplicationSecurityServiceResource + */ + @JsonAnySetter + public ApplicationSecurityServiceResource 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 ApplicationSecurityServiceResource object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApplicationSecurityServiceResource applicationSecurityServiceResource = + (ApplicationSecurityServiceResource) o; + return Objects.equals(this.attributes, applicationSecurityServiceResource.attributes) + && Objects.equals(this.id, applicationSecurityServiceResource.id) + && Objects.equals(this.type, applicationSecurityServiceResource.type) + && Objects.equals( + this.additionalProperties, applicationSecurityServiceResource.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApplicationSecurityServiceResource {\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/ApplicationSecurityServiceType.java b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServiceType.java new file mode 100644 index 00000000000..987dffdc6a8 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServiceType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of the resource. The value should always be service_env. */ +@JsonSerialize( + using = ApplicationSecurityServiceType.ApplicationSecurityServiceTypeSerializer.class) +public class ApplicationSecurityServiceType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("service_env")); + + public static final ApplicationSecurityServiceType SERVICE_ENV = + new ApplicationSecurityServiceType("service_env"); + + ApplicationSecurityServiceType(String value) { + super(value, allowedValues); + } + + public static class ApplicationSecurityServiceTypeSerializer + extends StdSerializer { + public ApplicationSecurityServiceTypeSerializer(Class t) { + super(t); + } + + public ApplicationSecurityServiceTypeSerializer() { + this(null); + } + + @Override + public void serialize( + ApplicationSecurityServiceType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static ApplicationSecurityServiceType fromValue(String value) { + return new ApplicationSecurityServiceType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServicesMetadata.java b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServicesMetadata.java new file mode 100644 index 00000000000..873a0f83a4b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServicesMetadata.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata returned alongside the list of services. */ +@JsonPropertyOrder({ApplicationSecurityServicesMetadata.JSON_PROPERTY_NUM_SERVICES_WITH_APPSEC}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ApplicationSecurityServicesMetadata { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_NUM_SERVICES_WITH_APPSEC = "num_services_with_appsec"; + private Long numServicesWithAppsec; + + public ApplicationSecurityServicesMetadata() {} + + @JsonCreator + public ApplicationSecurityServicesMetadata( + @JsonProperty(required = true, value = JSON_PROPERTY_NUM_SERVICES_WITH_APPSEC) + Long numServicesWithAppsec) { + this.numServicesWithAppsec = numServicesWithAppsec; + } + + public ApplicationSecurityServicesMetadata numServicesWithAppsec(Long numServicesWithAppsec) { + this.numServicesWithAppsec = numServicesWithAppsec; + return this; + } + + /** + * The number of services with Application Security Management (Threats) enabled. + * + * @return numServicesWithAppsec + */ + @JsonProperty(JSON_PROPERTY_NUM_SERVICES_WITH_APPSEC) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getNumServicesWithAppsec() { + return numServicesWithAppsec; + } + + public void setNumServicesWithAppsec(Long numServicesWithAppsec) { + this.numServicesWithAppsec = numServicesWithAppsec; + } + + /** + * 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 ApplicationSecurityServicesMetadata + */ + @JsonAnySetter + public ApplicationSecurityServicesMetadata 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 ApplicationSecurityServicesMetadata object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApplicationSecurityServicesMetadata applicationSecurityServicesMetadata = + (ApplicationSecurityServicesMetadata) o; + return Objects.equals( + this.numServicesWithAppsec, applicationSecurityServicesMetadata.numServicesWithAppsec) + && Objects.equals( + this.additionalProperties, applicationSecurityServicesMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(numServicesWithAppsec, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApplicationSecurityServicesMetadata {\n"); + sb.append(" numServicesWithAppsec: ") + .append(toIndentedString(numServicesWithAppsec)) + .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/ApplicationSecurityServicesResponse.java b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServicesResponse.java new file mode 100644 index 00000000000..cad2054af89 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ApplicationSecurityServicesResponse.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.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response object containing the list of services matching the requested name. */ +@JsonPropertyOrder({ + ApplicationSecurityServicesResponse.JSON_PROPERTY_DATA, + ApplicationSecurityServicesResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ApplicationSecurityServicesResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_META = "meta"; + private ApplicationSecurityServicesMetadata meta; + + public ApplicationSecurityServicesResponse() {} + + @JsonCreator + public ApplicationSecurityServicesResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data, + @JsonProperty(required = true, value = JSON_PROPERTY_META) + ApplicationSecurityServicesMetadata meta) { + this.data = data; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public ApplicationSecurityServicesResponse data(List data) { + this.data = data; + for (ApplicationSecurityServiceResource item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ApplicationSecurityServicesResponse addDataItem( + ApplicationSecurityServiceResource dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * The list of services matching the requested name. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ApplicationSecurityServicesResponse meta(ApplicationSecurityServicesMetadata meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata returned alongside the list of services. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ApplicationSecurityServicesMetadata getMeta() { + return meta; + } + + public void setMeta(ApplicationSecurityServicesMetadata meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ApplicationSecurityServicesResponse + */ + @JsonAnySetter + public ApplicationSecurityServicesResponse 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 ApplicationSecurityServicesResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApplicationSecurityServicesResponse applicationSecurityServicesResponse = + (ApplicationSecurityServicesResponse) o; + return Objects.equals(this.data, applicationSecurityServicesResponse.data) + && Objects.equals(this.meta, applicationSecurityServicesResponse.meta) + && Objects.equals( + this.additionalProperties, applicationSecurityServicesResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApplicationSecurityServicesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/application_security.feature b/src/test/resources/com/datadog/api/client/v2/api/application_security.feature index 4dbda1c4694..710a6064141 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/application_security.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/application_security.feature @@ -148,6 +148,14 @@ Feature: Application Security When the request is sent Then the response status is 204 OK + @generated @skip @team:DataDog/asm-backend + Scenario: Get Application Security details for a service returns "OK" response + Given operation "GetAsmServiceByName" enabled + And new "GetAsmServiceByName" request + And request contains "service_filter" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @team:DataDog/asm-backend Scenario: Get a WAF Policy returns "OK" response Given there is a valid "policy" in the system 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 f582e0e3de8..d386bb6c087 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 @@ -6432,6 +6432,12 @@ "type": "safe" } }, + "GetAsmServiceByName": { + "tag": "Application Security", + "undo": { + "type": "safe" + } + }, "DownloadCloudWorkloadPolicyFile": { "tag": "CSM Threats", "undo": {