diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index e3cf794bc7f..3ad27aedcaa 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -29047,6 +29047,64 @@ components: $ref: "#/components/schemas/GetInterfacesData" type: array type: object + GetInvestigationResponse: + description: Response for a single Bits AI investigation. + properties: + data: + $ref: "#/components/schemas/GetInvestigationResponseData" + links: + $ref: "#/components/schemas/GetInvestigationResponseLinks" + required: + - data + - links + type: object + GetInvestigationResponseData: + description: Data for the get investigation response. + properties: + attributes: + $ref: "#/components/schemas/GetInvestigationResponseDataAttributes" + id: + description: The unique identifier of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + type: + $ref: "#/components/schemas/InvestigationType" + required: + - id + - type + - attributes + type: object + GetInvestigationResponseDataAttributes: + description: Attributes of the investigation. + properties: + conclusions: + description: The conclusions drawn from the investigation. + items: + $ref: "#/components/schemas/InvestigationConclusion" + type: array + status: + description: The current status of the investigation. + example: "conclusive" + type: string + title: + description: The title of the investigation. + example: "Monitor alert investigation for web-server-01" + type: string + required: + - title + - status + - conclusions + type: object + GetInvestigationResponseLinks: + description: Links related to the investigation. + properties: + self: + description: The URL to the investigation in the Datadog app. + example: "https://app.datadoghq.com/bits-ai/investigations/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + required: + - self + type: object GetIssueIncludeQueryParameterItem: description: Relationship object that should be included in the response. enum: @@ -34510,6 +34568,34 @@ components: - DOWN - WARNING - "OFF" + InvestigationConclusion: + description: A full explanation of the finding, including root cause analysis and supporting evidence. + properties: + description: + description: A full explanation of the finding, including root cause analysis and supporting evidence. + example: "The investigation found that a memory leak in payments-service caused CPU usage to spike above 95% starting at 14:32 UTC." + type: string + summary: + description: A summary of the finding, including affected components and timeframe. + example: "CPU usage exceeded 95% for over 10 minutes on web-server-01." + type: string + title: + description: The title of the conclusion. + example: "High CPU usage detected on web-server-01" + type: string + required: + - title + - summary + - description + type: object + InvestigationType: + description: The resource type for investigations. + enum: + - investigation + example: investigation + type: string + x-enum-varnames: + - INVESTIGATION Issue: description: The issue matching the request. properties: @@ -38356,6 +38442,113 @@ components: description: The type of the resource. The value should always be tags. type: string type: object + ListInvestigationsResponse: + description: Response for listing investigations. + properties: + data: + description: List of investigations. + items: + $ref: "#/components/schemas/ListInvestigationsResponseData" + type: array + links: + $ref: "#/components/schemas/ListInvestigationsResponseLinks" + meta: + $ref: "#/components/schemas/ListInvestigationsResponseMeta" + required: + - data + - meta + - links + type: object + ListInvestigationsResponseData: + description: Data for an investigation list item. + properties: + attributes: + $ref: "#/components/schemas/ListInvestigationsResponseDataAttributes" + id: + description: The unique identifier of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + type: + $ref: "#/components/schemas/InvestigationType" + required: + - id + - type + - attributes + type: object + ListInvestigationsResponseDataAttributes: + description: Attributes of an investigation list item. + properties: + status: + description: The current status of the investigation. + example: "conclusive" + type: string + title: + description: The title of the investigation. + example: "Monitor alert investigation for web-server-01" + type: string + required: + - status + - title + type: object + ListInvestigationsResponseLinks: + description: Pagination links for the list investigations response. + properties: + first: + description: Link to the first page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + type: string + last: + description: Link to the last page. + nullable: true + type: string + next: + description: Link to the next page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=10&page[limit]=10" + type: string + prev: + description: Link to the previous page. + nullable: true + type: string + self: + description: Link to the current page. + example: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + type: string + required: + - first + - next + - self + type: object + ListInvestigationsResponseMeta: + description: Metadata for the list investigations response. + properties: + page: + $ref: "#/components/schemas/ListInvestigationsResponseMetaPage" + required: + - page + type: object + ListInvestigationsResponseMetaPage: + description: Pagination metadata. + properties: + limit: + description: Maximum number of results per page. + example: 10 + format: int64 + type: integer + offset: + description: Offset of the current page. + example: 0 + format: int64 + type: integer + total: + description: Total number of investigations. + example: 50 + format: int64 + type: integer + required: + - total + - limit + - offset + type: object ListKindCatalogResponse: description: List kind response. properties: @@ -41727,6 +41920,28 @@ components: maxLength: 255 type: string type: object + MonitorAlertTriggerAttributes: + description: Attributes for a monitor alert trigger. + properties: + event_id: + description: The event ID associated with the monitor alert. + example: "1234567890123456789" + type: string + event_ts: + description: The timestamp of the event in Unix milliseconds. + example: 1700000000000 + format: int64 + type: integer + monitor_id: + description: The monitor ID that triggered the alert. + example: 12345678 + format: int64 + type: integer + required: + - monitor_id + - event_id + - event_ts + type: object MonitorConfigPolicyAttributeCreateRequest: description: Policy and policy type for a monitor configuration policy. properties: @@ -70781,286 +70996,6 @@ components: type: string x-enum-varnames: - TEST_OPTIMIZATION_DELETE_SERVICE_SETTINGS_REQUEST - TestOptimizationFlakyTestsManagementPoliciesAttemptToFix: - description: Configuration for the attempt-to-fix Flaky Tests Management policy. - properties: - retries: - description: Number of retries when attempting to fix a flaky test. Must be greater than 0. - example: 3 - format: int64 - type: integer - type: object - TestOptimizationFlakyTestsManagementPoliciesAttributes: - description: Attributes of the Flaky Tests Management policies for a repository. - properties: - attempt_to_fix: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesAttemptToFix" - disabled: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesDisabled" - quarantined: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesQuarantined" - repository_id: - description: The repository identifier. - example: github.com/datadog/shopist - type: string - type: object - TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule: - description: Automatic disable triggering rule based on a time window and test status. - properties: - enabled: - description: Whether this auto-disable rule is enabled. - example: false - type: boolean - status: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesDisabledStatus" - window_seconds: - description: Time window in seconds over which flakiness is evaluated. Must be greater than 0. - example: 3600 - format: int64 - type: integer - type: object - TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule: - description: Automatic quarantine triggering rule based on a time window. - properties: - enabled: - description: Whether this auto-quarantine rule is enabled. - example: true - type: boolean - window_seconds: - description: Time window in seconds over which flakiness is evaluated. Must be greater than 0. - example: 3600 - format: int64 - type: integer - type: object - TestOptimizationFlakyTestsManagementPoliciesBranchRule: - description: Branch filtering rule for a Flaky Tests Management policy. - properties: - branches: - description: List of branches to which the policy applies. - example: - - main - items: - description: A branch name. - type: string - type: array - enabled: - description: Whether this branch rule is enabled. - example: true - type: boolean - excluded_branches: - description: List of branches excluded from the policy. - example: [] - items: - description: A branch name. - type: string - type: array - excluded_test_services: - description: List of test services excluded from the policy. - example: [] - items: - description: A test service name. - type: string - type: array - type: object - TestOptimizationFlakyTestsManagementPoliciesData: - description: Data object for Flaky Tests Management policies response. - properties: - attributes: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesAttributes" - id: - description: The repository identifier used as the resource ID. - example: github.com/datadog/shopist - type: string - type: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesType" - type: object - TestOptimizationFlakyTestsManagementPoliciesDisabled: - description: Configuration for the disabled Flaky Tests Management policy. - properties: - auto_disable_rule: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule" - branch_rule: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesBranchRule" - enabled: - description: Whether the disabled policy is enabled. - example: false - type: boolean - failure_rate_rule: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule" - type: object - TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule: - description: Failure-rate-based rule for the disabled policy. - properties: - branches: - description: List of branches to which this rule applies. - example: [] - items: - description: A branch name. - type: string - type: array - enabled: - description: Whether this failure rate rule is enabled. - example: false - type: boolean - min_runs: - description: Minimum number of runs required before the rule is evaluated. Must be greater than or equal to 0. - example: 10 - format: int64 - type: integer - status: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesDisabledStatus" - threshold: - description: Failure rate threshold (0.0–1.0) above which the rule triggers. - example: 0.5 - format: double - type: number - type: object - TestOptimizationFlakyTestsManagementPoliciesDisabledStatus: - description: |- - Test status that the disable policy applies to. - Must be either `active` or `quarantined`. - enum: - - active - - quarantined - example: active - type: string - x-enum-varnames: - - ACTIVE - - QUARANTINED - TestOptimizationFlakyTestsManagementPoliciesGetRequest: - description: Request object for getting Flaky Tests Management policies. - properties: - data: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesGetRequestData" - required: - - data - type: object - TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes: - description: Attributes for requesting Flaky Tests Management policies. - properties: - repository_id: - description: The repository identifier. - example: github.com/datadog/shopist - minLength: 1 - type: string - required: - - repository_id - type: object - TestOptimizationFlakyTestsManagementPoliciesGetRequestData: - description: Data object for get Flaky Tests Management policies request. - properties: - attributes: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes" - type: - $ref: "#/components/schemas/TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType" - required: - - type - - attributes - type: object - TestOptimizationFlakyTestsManagementPoliciesQuarantined: - description: Configuration for the quarantined Flaky Tests Management policy. - properties: - auto_quarantine_rule: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule" - branch_rule: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesBranchRule" - enabled: - description: Whether the quarantined policy is enabled. - example: true - type: boolean - failure_rate_rule: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule" - type: object - TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule: - description: Failure-rate-based rule for the quarantined policy. - properties: - branches: - description: List of branches to which this rule applies. - example: - - main - items: - description: A branch name. - type: string - type: array - enabled: - description: Whether this failure rate rule is enabled. - example: true - type: boolean - min_runs: - description: Minimum number of runs required before the rule is evaluated. Must be greater than or equal to 0. - example: 10 - format: int64 - type: integer - threshold: - description: Failure rate threshold (0.0–1.0) above which the rule triggers. - example: 0.5 - format: double - type: number - type: object - TestOptimizationFlakyTestsManagementPoliciesResponse: - description: Response object containing Flaky Tests Management policies for a repository. - properties: - data: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesData" - type: object - TestOptimizationFlakyTestsManagementPoliciesType: - description: |- - JSON:API type for Flaky Tests Management policies response. - The value must always be `test_optimization_flaky_tests_management_policies`. - enum: - - test_optimization_flaky_tests_management_policies - example: test_optimization_flaky_tests_management_policies - type: string - x-enum-varnames: - - TEST_OPTIMIZATION_FLAKY_TESTS_MANAGEMENT_POLICIES - TestOptimizationFlakyTestsManagementPoliciesUpdateRequest: - description: Request object for updating Flaky Tests Management policies. - properties: - data: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData" - required: - - data - type: object - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes: - description: |- - Attributes for updating Flaky Tests Management policies. - Only provided policy blocks are updated; omitted blocks are left unchanged. - properties: - attempt_to_fix: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesAttemptToFix" - disabled: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesDisabled" - quarantined: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesQuarantined" - repository_id: - description: The repository identifier. - example: github.com/datadog/shopist - minLength: 1 - type: string - required: - - repository_id - type: object - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData: - description: Data object for update Flaky Tests Management policies request. - properties: - attributes: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes" - type: - $ref: "#/components/schemas/TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType" - required: - - type - - attributes - type: object - TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType: - description: |- - JSON:API type for get Flaky Tests Management policies request. - The value must always be `test_optimization_get_flaky_tests_management_policies_request`. - enum: - - test_optimization_get_flaky_tests_management_policies_request - example: test_optimization_get_flaky_tests_management_policies_request - type: string - x-enum-varnames: - - TEST_OPTIMIZATION_GET_FLAKY_TESTS_MANAGEMENT_POLICIES_REQUEST TestOptimizationGetServiceSettingsRequest: description: Request object for getting Test Optimization service settings. properties: @@ -71179,16 +71114,6 @@ components: type: string x-enum-varnames: - TEST_OPTIMIZATION_SERVICE_SETTINGS - TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType: - description: |- - JSON:API type for update Flaky Tests Management policies request. - The value must always be `test_optimization_update_flaky_tests_management_policies_request`. - enum: - - test_optimization_update_flaky_tests_management_policies_request - example: test_optimization_update_flaky_tests_management_policies_request - type: string - x-enum-varnames: - - TEST_OPTIMIZATION_UPDATE_FLAKY_TESTS_MANAGEMENT_POLICIES_REQUEST TestOptimizationUpdateServiceSettingsRequest: description: Request object for updating Test Optimization service settings. properties: @@ -71736,6 +71661,94 @@ components: - $ref: "#/components/schemas/SlackTriggerWrapper" - $ref: "#/components/schemas/SoftwareCatalogTriggerWrapper" - $ref: "#/components/schemas/WorkflowTriggerWrapper" + TriggerAttributes: + description: The trigger definition for starting an investigation. + properties: + monitor_alert_trigger: + $ref: "#/components/schemas/MonitorAlertTriggerAttributes" + type: + $ref: "#/components/schemas/TriggerType" + required: + - type + - monitor_alert_trigger + type: object + TriggerInvestigationRequest: + description: Request to trigger a new investigation. + properties: + data: + $ref: "#/components/schemas/TriggerInvestigationRequestData" + required: + - data + type: object + TriggerInvestigationRequestData: + description: Data for the trigger investigation request. + properties: + attributes: + $ref: "#/components/schemas/TriggerInvestigationRequestDataAttributes" + type: + $ref: "#/components/schemas/TriggerInvestigationRequestType" + required: + - type + - attributes + type: object + TriggerInvestigationRequestDataAttributes: + description: Attributes for the trigger investigation request. + properties: + trigger: + $ref: "#/components/schemas/TriggerAttributes" + required: + - trigger + type: object + TriggerInvestigationRequestType: + description: The resource type for trigger investigation requests. + enum: + - trigger_investigation_request + example: trigger_investigation_request + type: string + x-enum-varnames: + - TRIGGER_INVESTIGATION_REQUEST + TriggerInvestigationResponse: + description: Response after triggering an investigation. + properties: + data: + $ref: "#/components/schemas/TriggerInvestigationResponseData" + required: + - data + type: object + TriggerInvestigationResponseData: + description: Data for the trigger investigation response. + properties: + attributes: + $ref: "#/components/schemas/TriggerInvestigationResponseDataAttributes" + id: + description: Unique identifier for the trigger response. + example: "f5e6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" + type: string + type: + $ref: "#/components/schemas/TriggerInvestigationResponseType" + required: + - id + - type + - attributes + type: object + TriggerInvestigationResponseDataAttributes: + description: Attributes for the trigger investigation response. + properties: + investigation_id: + description: The ID of the investigation that was created. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: string + required: + - investigation_id + type: object + TriggerInvestigationResponseType: + description: The resource type for trigger investigation responses. + enum: + - trigger_investigation_response + example: trigger_investigation_response + type: string + x-enum-varnames: + - TRIGGER_INVESTIGATION_RESPONSE TriggerRateLimit: description: Defines a rate limit for a trigger. properties: @@ -71759,6 +71772,14 @@ components: x-enum-varnames: - SECURITY_FINDINGS - SECURITY_SIGNALS + TriggerType: + description: The type of trigger for the investigation. + enum: + - monitor_alert_trigger + example: monitor_alert_trigger + type: string + x-enum-varnames: + - MONITOR_ALERT_TRIGGER UCConfigPair: description: The definition of `UCConfigPair` object. example: @@ -75636,6 +75657,8 @@ components: apm_service_catalog_write: Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog. appsec_vm_read: View infrastructure, application code, and library vulnerability findings. billing_read: View your organization's billing information. + bits_investigations_read: View Bits AI investigations. + bits_investigations_write: Create and manage Bits AI investigations. cases_read: View Cases. cases_write: Create and update cases. ci_visibility_pipelines_write: Create CI Visibility pipeline spans using the API. @@ -79726,6 +79749,213 @@ paths: operator: OR permissions: - user_access_manage + /api/v2/bits-ai/investigations: + get: + description: List all Bits AI investigations for the organization. + operationId: ListInvestigations + parameters: + - description: Offset for pagination. + example: 0 + in: query + name: page[offset] + required: false + schema: + format: int64 + type: integer + - description: Maximum number of investigations to return. + example: 25 + in: query + name: page[limit] + required: false + schema: + default: 25 + format: int64 + maximum: 100 + type: integer + - description: Filter investigations by monitor ID. + example: 12345678 + in: query + name: filter[monitor_id] + required: false + schema: + format: int64 + type: integer + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + status: "conclusive" + title: "Monitor alert investigation for web-server-01" + id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: investigation + links: + first: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + next: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=10&page[limit]=10" + self: "https://api.datadoghq.com/api/v2/bits-ai/investigations?page[offset]=0&page[limit]=10" + meta: + page: + limit: 10 + offset: 0 + total: 50 + schema: + $ref: "#/components/schemas/ListInvestigationsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_read + summary: List Bits AI investigations + tags: + - Bits AI + x-pagination: + limitParam: page[limit] + pageOffsetParam: page[offset] + resultsPath: data + "x-permission": + operator: OR + permissions: + - bits_investigations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + post: + description: Trigger a new Bits AI investigation based on a monitor alert. + operationId: TriggerInvestigation + requestBody: + content: + application/json: + examples: + default: + value: + data: + attributes: + trigger: + monitor_alert_trigger: + event_id: "1234567890123456789" + event_ts: 1700000000000 + monitor_id: 12345678 + type: monitor_alert_trigger + type: trigger_investigation_request + schema: + $ref: "#/components/schemas/TriggerInvestigationRequest" + description: Trigger investigation request body. + required: true + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + investigation_id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + id: "f5e6a7b8-c9d0-1e2f-3a4b-5c6d7e8f9a0b" + type: trigger_investigation_response + schema: + $ref: "#/components/schemas/TriggerInvestigationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_write + summary: Trigger a Bits AI investigation + tags: + - Bits AI + x-codegen-request-body-name: body + "x-permission": + operator: OR + permissions: + - bits_investigations_write + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/bits-ai/investigations/{id}: + get: + description: Get a specific Bits AI investigation by ID. + operationId: GetInvestigation + parameters: + - description: The ID of the investigation. + example: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + in: path + name: id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + conclusions: + - description: "The investigation found that a memory leak in payments-service caused CPU usage to spike above 95% starting at 14:32 UTC." + summary: "CPU usage exceeded 95% for over 10 minutes on web-server-01." + title: "High CPU usage detected on web-server-01" + status: "conclusive" + title: "Monitor alert investigation for web-server-01" + id: "a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + type: investigation + links: + self: "https://app.datadoghq.com/bits-ai/investigations/a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d" + schema: + $ref: "#/components/schemas/GetInvestigationResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - bits_investigations_read + summary: Get a Bits AI investigation + tags: + - Bits AI + "x-permission": + operator: OR + permissions: + - bits_investigations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/cases: get: description: >- @@ -81947,88 +82177,6 @@ paths: operator: OR permissions: - ci_visibility_read - /api/v2/ci/test-optimization/settings/policies: - patch: - description: |- - Partially update Flaky Tests Management repository-level policies for the given repository. - Only provided policy blocks are updated; omitted blocks are left unchanged. - operationId: UpdateFlakyTestsManagementPolicies - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesUpdateRequest" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - test_optimization_settings_write - summary: Update Flaky Tests Management policies - tags: ["Test Optimization"] - x-codegen-request-body-name: body - x-permission: - operator: OR - permissions: - - test_optimization_settings_write - x-unstable: |- - **Note**: This endpoint is in preview and may be subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). - post: - description: |- - Retrieve Flaky Tests Management repository-level policies for the given repository. - operationId: GetFlakyTestsManagementPolicies - requestBody: - content: - application/json: - schema: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesGetRequest" - required: true - responses: - "200": - content: - application/json: - schema: - $ref: "#/components/schemas/TestOptimizationFlakyTestsManagementPoliciesResponse" - description: OK - "400": - $ref: "#/components/responses/BadRequestResponse" - "403": - $ref: "#/components/responses/NotAuthorizedResponse" - "404": - $ref: "#/components/responses/NotFoundResponse" - "429": - $ref: "#/components/responses/TooManyRequestsResponse" - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: - - test_optimization_read - summary: Get Flaky Tests Management policies - tags: ["Test Optimization"] - x-codegen-request-body-name: body - x-permission: - operator: OR - permissions: - - test_optimization_read - x-unstable: |- - **Note**: This endpoint is in preview and may be subject to change. - If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/ci/test-optimization/settings/service: delete: description: |- @@ -116827,6 +116975,9 @@ tags: is used to automatically map groups of users to roles in Datadog using attributes sent from Identity Providers. Use these endpoints to manage your AuthN Mappings. name: AuthN Mappings + - description: |- + Use the Bits AI endpoints to retrieve AI-powered investigations. + name: Bits AI - description: |- Search or aggregate your CI Visibility pipeline events and send them to your Datadog site over HTTP. See the [CI Pipeline Visibility in Datadog page](https://docs.datadoghq.com/continuous_integration/pipelines/) for more information. name: CI Visibility Pipelines diff --git a/examples/v2/bits-ai/GetInvestigation.java b/examples/v2/bits-ai/GetInvestigation.java new file mode 100644 index 00000000000..0ce9cbf637d --- /dev/null +++ b/examples/v2/bits-ai/GetInvestigation.java @@ -0,0 +1,26 @@ +// Get a Bits AI investigation returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.BitsAiApi; +import com.datadog.api.client.v2.model.GetInvestigationResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.getInvestigation", true); + BitsAiApi apiInstance = new BitsAiApi(defaultClient); + + try { + GetInvestigationResponse result = + apiInstance.getInvestigation("a1b2c3d4-5e6f-7a8b-9c0d-1e2f3a4b5c6d"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BitsAiApi#getInvestigation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/bits-ai/ListInvestigations.java b/examples/v2/bits-ai/ListInvestigations.java new file mode 100644 index 00000000000..4c9dd713a29 --- /dev/null +++ b/examples/v2/bits-ai/ListInvestigations.java @@ -0,0 +1,25 @@ +// List Bits AI investigations returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.BitsAiApi; +import com.datadog.api.client.v2.model.ListInvestigationsResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listInvestigations", true); + BitsAiApi apiInstance = new BitsAiApi(defaultClient); + + try { + ListInvestigationsResponse result = apiInstance.listInvestigations(); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BitsAiApi#listInvestigations"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/bits-ai/ListInvestigations_130750454.java b/examples/v2/bits-ai/ListInvestigations_130750454.java new file mode 100644 index 00000000000..f4a98b8a4e5 --- /dev/null +++ b/examples/v2/bits-ai/ListInvestigations_130750454.java @@ -0,0 +1,27 @@ +// List Bits AI investigations returns "OK" response with pagination + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.v2.api.BitsAiApi; +import com.datadog.api.client.v2.model.ListInvestigationsResponseData; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.listInvestigations", true); + BitsAiApi apiInstance = new BitsAiApi(defaultClient); + + try { + PaginationIterable iterable = + apiInstance.listInvestigationsWithPagination(); + + for (ListInvestigationsResponseData item : iterable) { + System.out.println(item); + } + } catch (RuntimeException e) { + System.err.println("Exception when calling BitsAiApi#listInvestigationsWithPagination"); + System.err.println("Reason: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/bits-ai/TriggerInvestigation.java b/examples/v2/bits-ai/TriggerInvestigation.java new file mode 100644 index 00000000000..fc5ea035d8a --- /dev/null +++ b/examples/v2/bits-ai/TriggerInvestigation.java @@ -0,0 +1,48 @@ +// Trigger a Bits AI investigation returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.BitsAiApi; +import com.datadog.api.client.v2.model.MonitorAlertTriggerAttributes; +import com.datadog.api.client.v2.model.TriggerAttributes; +import com.datadog.api.client.v2.model.TriggerInvestigationRequest; +import com.datadog.api.client.v2.model.TriggerInvestigationRequestData; +import com.datadog.api.client.v2.model.TriggerInvestigationRequestDataAttributes; +import com.datadog.api.client.v2.model.TriggerInvestigationRequestType; +import com.datadog.api.client.v2.model.TriggerInvestigationResponse; +import com.datadog.api.client.v2.model.TriggerType; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + defaultClient.setUnstableOperationEnabled("v2.triggerInvestigation", true); + BitsAiApi apiInstance = new BitsAiApi(defaultClient); + + TriggerInvestigationRequest body = + new TriggerInvestigationRequest() + .data( + new TriggerInvestigationRequestData() + .attributes( + new TriggerInvestigationRequestDataAttributes() + .trigger( + new TriggerAttributes() + .monitorAlertTrigger( + new MonitorAlertTriggerAttributes() + .eventId("1234567890123456789") + .eventTs(1700000000000L) + .monitorId(12345678L)) + .type(TriggerType.MONITOR_ALERT_TRIGGER))) + .type(TriggerInvestigationRequestType.TRIGGER_INVESTIGATION_REQUEST)); + + try { + TriggerInvestigationResponse result = apiInstance.triggerInvestigation(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling BitsAiApi#triggerInvestigation"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} diff --git a/examples/v2/test-optimization/GetFlakyTestsManagementPolicies.java b/examples/v2/test-optimization/GetFlakyTestsManagementPolicies.java deleted file mode 100644 index 61b0ef3a97d..00000000000 --- a/examples/v2/test-optimization/GetFlakyTestsManagementPolicies.java +++ /dev/null @@ -1,42 +0,0 @@ -// Get Flaky Tests Management policies returns "OK" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.TestOptimizationApi; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesGetRequest; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesGetRequestData; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesResponse; -import com.datadog.api.client.v2.model.TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.getFlakyTestsManagementPolicies", true); - TestOptimizationApi apiInstance = new TestOptimizationApi(defaultClient); - - TestOptimizationFlakyTestsManagementPoliciesGetRequest body = - new TestOptimizationFlakyTestsManagementPoliciesGetRequest() - .data( - new TestOptimizationFlakyTestsManagementPoliciesGetRequestData() - .attributes( - new TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes() - .repositoryId("github.com/datadog/shopist")) - .type( - TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType - .TEST_OPTIMIZATION_GET_FLAKY_TESTS_MANAGEMENT_POLICIES_REQUEST)); - - try { - TestOptimizationFlakyTestsManagementPoliciesResponse result = - apiInstance.getFlakyTestsManagementPolicies(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println( - "Exception when calling TestOptimizationApi#getFlakyTestsManagementPolicies"); - System.err.println("Status code: " + e.getCode()); - System.err.println("Reason: " + e.getResponseBody()); - System.err.println("Response headers: " + e.getResponseHeaders()); - e.printStackTrace(); - } - } -} diff --git a/examples/v2/test-optimization/UpdateFlakyTestsManagementPolicies.java b/examples/v2/test-optimization/UpdateFlakyTestsManagementPolicies.java deleted file mode 100644 index 7cd0d0933f2..00000000000 --- a/examples/v2/test-optimization/UpdateFlakyTestsManagementPolicies.java +++ /dev/null @@ -1,94 +0,0 @@ -// Update Flaky Tests Management policies returns "OK" response - -import com.datadog.api.client.ApiClient; -import com.datadog.api.client.ApiException; -import com.datadog.api.client.v2.api.TestOptimizationApi; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesAttemptToFix; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesBranchRule; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesDisabled; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesDisabledStatus; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesQuarantined; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesResponse; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesUpdateRequest; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData; -import com.datadog.api.client.v2.model.TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType; -import java.util.Collections; - -public class Example { - public static void main(String[] args) { - ApiClient defaultClient = ApiClient.getDefaultApiClient(); - defaultClient.setUnstableOperationEnabled("v2.updateFlakyTestsManagementPolicies", true); - TestOptimizationApi apiInstance = new TestOptimizationApi(defaultClient); - - TestOptimizationFlakyTestsManagementPoliciesUpdateRequest body = - new TestOptimizationFlakyTestsManagementPoliciesUpdateRequest() - .data( - new TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData() - .attributes( - new TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes() - .attemptToFix( - new TestOptimizationFlakyTestsManagementPoliciesAttemptToFix() - .retries(3L)) - .disabled( - new TestOptimizationFlakyTestsManagementPoliciesDisabled() - .autoDisableRule( - new TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule() - .enabled(false) - .status( - TestOptimizationFlakyTestsManagementPoliciesDisabledStatus - .ACTIVE) - .windowSeconds(3600L)) - .branchRule( - new TestOptimizationFlakyTestsManagementPoliciesBranchRule() - .branches(Collections.singletonList("main")) - .enabled(true)) - .enabled(false) - .failureRateRule( - new TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule() - .enabled(false) - .minRuns(10L) - .status( - TestOptimizationFlakyTestsManagementPoliciesDisabledStatus - .ACTIVE) - .threshold(0.5))) - .quarantined( - new TestOptimizationFlakyTestsManagementPoliciesQuarantined() - .autoQuarantineRule( - new TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule() - .enabled(true) - .windowSeconds(3600L)) - .branchRule( - new TestOptimizationFlakyTestsManagementPoliciesBranchRule() - .branches(Collections.singletonList("main")) - .enabled(true)) - .enabled(true) - .failureRateRule( - new TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule() - .branches(Collections.singletonList("main")) - .enabled(true) - .minRuns(10L) - .threshold(0.5))) - .repositoryId("github.com/datadog/shopist")) - .type( - TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType - .TEST_OPTIMIZATION_UPDATE_FLAKY_TESTS_MANAGEMENT_POLICIES_REQUEST)); - - try { - TestOptimizationFlakyTestsManagementPoliciesResponse result = - apiInstance.updateFlakyTestsManagementPolicies(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println( - "Exception when calling TestOptimizationApi#updateFlakyTestsManagementPolicies"); - 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 6993c8dd608..6906e0883f6 100644 --- a/src/main/java/com/datadog/api/client/ApiClient.java +++ b/src/main/java/com/datadog/api/client/ApiClient.java @@ -769,6 +769,9 @@ public class ApiClient { put("v2.getOpenAPI", false); put("v2.listAPIs", false); put("v2.updateOpenAPI", false); + put("v2.getInvestigation", false); + put("v2.listInvestigations", false); + put("v2.triggerInvestigation", false); put("v2.createCaseJiraIssue", false); put("v2.createCaseNotebook", false); put("v2.createCaseServiceNowTicket", false); @@ -783,11 +786,9 @@ public class ApiClient { put("v2.updateChangeRequest", false); put("v2.updateChangeRequestDecision", false); put("v2.deleteTestOptimizationServiceSettings", false); - put("v2.getFlakyTestsManagementPolicies", false); put("v2.getTestOptimizationServiceSettings", false); put("v2.searchFlakyTests", false); put("v2.updateFlakyTests", false); - put("v2.updateFlakyTestsManagementPolicies", false); put("v2.updateTestOptimizationServiceSettings", false); put("v2.createAWSCloudAuthPersonaMapping", false); put("v2.deleteAWSCloudAuthPersonaMapping", false); diff --git a/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java b/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java new file mode 100644 index 00000000000..12af8e44f39 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/api/BitsAiApi.java @@ -0,0 +1,628 @@ +package com.datadog.api.client.v2.api; + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.ApiResponse; +import com.datadog.api.client.PaginationIterable; +import com.datadog.api.client.Pair; +import com.datadog.api.client.v2.model.GetInvestigationResponse; +import com.datadog.api.client.v2.model.ListInvestigationsResponse; +import com.datadog.api.client.v2.model.ListInvestigationsResponseData; +import com.datadog.api.client.v2.model.TriggerInvestigationRequest; +import com.datadog.api.client.v2.model.TriggerInvestigationResponse; +import jakarta.ws.rs.client.Invocation; +import jakarta.ws.rs.core.GenericType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CompletableFuture; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class BitsAiApi { + private ApiClient apiClient; + + public BitsAiApi() { + this(ApiClient.getDefaultApiClient()); + } + + public BitsAiApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API client. + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API client. + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get a Bits AI investigation. + * + *

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

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

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

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

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

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

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

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

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

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

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

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

See {@link #triggerInvestigationWithHttpInfo}. + * + * @param body Trigger investigation request body. (required) + * @return CompletableFuture<ApiResponse<TriggerInvestigationResponse>> + */ + public CompletableFuture> + triggerInvestigationWithHttpInfoAsync(TriggerInvestigationRequest body) { + // Check if unstable operation is enabled + String operationId = "triggerInvestigation"; + if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); + return result; + } + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, "Missing the required parameter 'body' when calling triggerInvestigation")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/bits-ai/investigations"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.BitsAiApi.triggerInvestigation", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + } catch (ApiException ex) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally(ex); + return result; + } + return apiClient.invokeAPIAsync( + "POST", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java b/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java index d0234d87de2..6a2f070b14f 100644 --- a/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/TestOptimizationApi.java @@ -12,9 +12,6 @@ import com.datadog.api.client.v2.model.FlakyTestsSearchRequestData; import com.datadog.api.client.v2.model.FlakyTestsSearchResponse; import com.datadog.api.client.v2.model.TestOptimizationDeleteServiceSettingsRequest; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesGetRequest; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesResponse; -import com.datadog.api.client.v2.model.TestOptimizationFlakyTestsManagementPoliciesUpdateRequest; import com.datadog.api.client.v2.model.TestOptimizationGetServiceSettingsRequest; import com.datadog.api.client.v2.model.TestOptimizationServiceSettingsResponse; import com.datadog.api.client.v2.model.TestOptimizationUpdateServiceSettingsRequest; @@ -215,167 +212,6 @@ public ApiResponse deleteTestOptimizationServiceSettingsWithHttpInfo( null); } - /** - * Get Flaky Tests Management policies. - * - *

See {@link #getFlakyTestsManagementPoliciesWithHttpInfo}. - * - * @param body (required) - * @return TestOptimizationFlakyTestsManagementPoliciesResponse - * @throws ApiException if fails to make API call - */ - public TestOptimizationFlakyTestsManagementPoliciesResponse getFlakyTestsManagementPolicies( - TestOptimizationFlakyTestsManagementPoliciesGetRequest body) throws ApiException { - return getFlakyTestsManagementPoliciesWithHttpInfo(body).getData(); - } - - /** - * Get Flaky Tests Management policies. - * - *

See {@link #getFlakyTestsManagementPoliciesWithHttpInfoAsync}. - * - * @param body (required) - * @return CompletableFuture<TestOptimizationFlakyTestsManagementPoliciesResponse> - */ - public CompletableFuture - getFlakyTestsManagementPoliciesAsync( - TestOptimizationFlakyTestsManagementPoliciesGetRequest body) { - return getFlakyTestsManagementPoliciesWithHttpInfoAsync(body) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Retrieve Flaky Tests Management repository-level policies for the given repository. - * - * @param body (required) - * @return ApiResponse<TestOptimizationFlakyTestsManagementPoliciesResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
- */ - public ApiResponse - getFlakyTestsManagementPoliciesWithHttpInfo( - TestOptimizationFlakyTestsManagementPoliciesGetRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "getFlakyTestsManagementPolicies"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException( - 400, - "Missing the required parameter 'body' when calling getFlakyTestsManagementPolicies"); - } - // create path and map variables - String localVarPath = "/api/v2/ci/test-optimization/settings/policies"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.TestOptimizationApi.getFlakyTestsManagementPolicies", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - return apiClient.invokeAPI( - "POST", - builder, - localVarHeaderParams, - new String[] {"application/json"}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Get Flaky Tests Management policies. - * - *

See {@link #getFlakyTestsManagementPoliciesWithHttpInfo}. - * - * @param body (required) - * @return - * CompletableFuture<ApiResponse<TestOptimizationFlakyTestsManagementPoliciesResponse>> - */ - public CompletableFuture> - getFlakyTestsManagementPoliciesWithHttpInfoAsync( - TestOptimizationFlakyTestsManagementPoliciesGetRequest body) { - // Check if unstable operation is enabled - String operationId = "getFlakyTestsManagementPolicies"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " getFlakyTestsManagementPolicies")); - return result; - } - // create path and map variables - String localVarPath = "/api/v2/ci/test-optimization/settings/policies"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.TestOptimizationApi.getFlakyTestsManagementPolicies", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; - } - return apiClient.invokeAPIAsync( - "POST", - builder, - localVarHeaderParams, - new String[] {"application/json"}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - /** * Get Test Optimization service settings. * @@ -945,168 +781,6 @@ public CompletableFuture> updateFlakyTests new GenericType() {}); } - /** - * Update Flaky Tests Management policies. - * - *

See {@link #updateFlakyTestsManagementPoliciesWithHttpInfo}. - * - * @param body (required) - * @return TestOptimizationFlakyTestsManagementPoliciesResponse - * @throws ApiException if fails to make API call - */ - public TestOptimizationFlakyTestsManagementPoliciesResponse updateFlakyTestsManagementPolicies( - TestOptimizationFlakyTestsManagementPoliciesUpdateRequest body) throws ApiException { - return updateFlakyTestsManagementPoliciesWithHttpInfo(body).getData(); - } - - /** - * Update Flaky Tests Management policies. - * - *

See {@link #updateFlakyTestsManagementPoliciesWithHttpInfoAsync}. - * - * @param body (required) - * @return CompletableFuture<TestOptimizationFlakyTestsManagementPoliciesResponse> - */ - public CompletableFuture - updateFlakyTestsManagementPoliciesAsync( - TestOptimizationFlakyTestsManagementPoliciesUpdateRequest body) { - return updateFlakyTestsManagementPoliciesWithHttpInfoAsync(body) - .thenApply( - response -> { - return response.getData(); - }); - } - - /** - * Partially update Flaky Tests Management repository-level policies for the given repository. - * Only provided policy blocks are updated; omitted blocks are left unchanged. - * - * @param body (required) - * @return ApiResponse<TestOptimizationFlakyTestsManagementPoliciesResponse> - * @throws ApiException if fails to make API call - * @http.response.details - * - * - * - * - * - * - * - * - *
Response details
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Not Authorized -
404 Not Found -
429 Too many requests -
- */ - public ApiResponse - updateFlakyTestsManagementPoliciesWithHttpInfo( - TestOptimizationFlakyTestsManagementPoliciesUpdateRequest body) throws ApiException { - // Check if unstable operation is enabled - String operationId = "updateFlakyTestsManagementPolicies"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); - } - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException( - 400, - "Missing the required parameter 'body' when calling updateFlakyTestsManagementPolicies"); - } - // create path and map variables - String localVarPath = "/api/v2/ci/test-optimization/settings/policies"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder = - apiClient.createBuilder( - "v2.TestOptimizationApi.updateFlakyTestsManagementPolicies", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - return apiClient.invokeAPI( - "PATCH", - builder, - localVarHeaderParams, - new String[] {"application/json"}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - - /** - * Update Flaky Tests Management policies. - * - *

See {@link #updateFlakyTestsManagementPoliciesWithHttpInfo}. - * - * @param body (required) - * @return - * CompletableFuture<ApiResponse<TestOptimizationFlakyTestsManagementPoliciesResponse>> - */ - public CompletableFuture> - updateFlakyTestsManagementPoliciesWithHttpInfoAsync( - TestOptimizationFlakyTestsManagementPoliciesUpdateRequest body) { - // Check if unstable operation is enabled - String operationId = "updateFlakyTestsManagementPolicies"; - if (apiClient.isUnstableOperationEnabled("v2." + operationId)) { - apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); - } else { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId))); - return result; - } - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally( - new ApiException( - 400, - "Missing the required parameter 'body' when calling" - + " updateFlakyTestsManagementPolicies")); - return result; - } - // create path and map variables - String localVarPath = "/api/v2/ci/test-optimization/settings/policies"; - - Map localVarHeaderParams = new HashMap(); - - Invocation.Builder builder; - try { - builder = - apiClient.createBuilder( - "v2.TestOptimizationApi.updateFlakyTestsManagementPolicies", - localVarPath, - new ArrayList(), - localVarHeaderParams, - new HashMap(), - new String[] {"application/json"}, - new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); - } catch (ApiException ex) { - CompletableFuture> result = - new CompletableFuture<>(); - result.completeExceptionally(ex); - return result; - } - return apiClient.invokeAPIAsync( - "PATCH", - builder, - localVarHeaderParams, - new String[] {"application/json"}, - localVarPostBody, - new HashMap(), - false, - new GenericType() {}); - } - /** * Update Test Optimization service settings. * diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesUpdateRequest.java b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponse.java similarity index 62% rename from src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesUpdateRequest.java rename to src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponse.java index d712dfb5eec..3867e55078a 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesUpdateRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponse.java @@ -17,47 +17,76 @@ import java.util.Map; import java.util.Objects; -/** Request object for updating Flaky Tests Management policies. */ -@JsonPropertyOrder({TestOptimizationFlakyTestsManagementPoliciesUpdateRequest.JSON_PROPERTY_DATA}) +/** Response for a single Bits AI investigation. */ +@JsonPropertyOrder({ + GetInvestigationResponse.JSON_PROPERTY_DATA, + GetInvestigationResponse.JSON_PROPERTY_LINKS +}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesUpdateRequest { +public class GetInvestigationResponse { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData data; + private GetInvestigationResponseData data; - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequest() {} + public static final String JSON_PROPERTY_LINKS = "links"; + private GetInvestigationResponseLinks links; + + public GetInvestigationResponse() {} @JsonCreator - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequest( - @JsonProperty(required = true, value = JSON_PROPERTY_DATA) - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData data) { + public GetInvestigationResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) GetInvestigationResponseData data, + @JsonProperty(required = true, value = JSON_PROPERTY_LINKS) + GetInvestigationResponseLinks links) { this.data = data; this.unparsed |= data.unparsed; + this.links = links; + this.unparsed |= links.unparsed; } - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequest data( - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData data) { + public GetInvestigationResponse data(GetInvestigationResponseData data) { this.data = data; this.unparsed |= data.unparsed; return this; } /** - * Data object for update Flaky Tests Management policies request. + * Data for the get investigation response. * * @return data */ @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData getData() { + public GetInvestigationResponseData getData() { return data; } - public void setData(TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData data) { + public void setData(GetInvestigationResponseData data) { this.data = data; } + public GetInvestigationResponse links(GetInvestigationResponseLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Links related to the investigation. + * + * @return links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetInvestigationResponseLinks getLinks() { + return links; + } + + public void setLinks(GetInvestigationResponseLinks links) { + this.links = links; + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -70,11 +99,10 @@ public void setData(TestOptimizationFlakyTestsManagementPoliciesUpdateRequestDat * * @param key The arbitrary key to set * @param value The associated value - * @return TestOptimizationFlakyTestsManagementPoliciesUpdateRequest + * @return GetInvestigationResponse */ @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequest putAdditionalProperty( - String key, Object value) { + public GetInvestigationResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -105,10 +133,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** - * Return true if this TestOptimizationFlakyTestsManagementPoliciesUpdateRequest object is equal - * to o. - */ + /** Return true if this GetInvestigationResponse object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -117,25 +142,23 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TestOptimizationFlakyTestsManagementPoliciesUpdateRequest - testOptimizationFlakyTestsManagementPoliciesUpdateRequest = - (TestOptimizationFlakyTestsManagementPoliciesUpdateRequest) o; - return Objects.equals(this.data, testOptimizationFlakyTestsManagementPoliciesUpdateRequest.data) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesUpdateRequest.additionalProperties); + GetInvestigationResponse getInvestigationResponse = (GetInvestigationResponse) o; + return Objects.equals(this.data, getInvestigationResponse.data) + && Objects.equals(this.links, getInvestigationResponse.links) + && Objects.equals(this.additionalProperties, getInvestigationResponse.additionalProperties); } @Override public int hashCode() { - return Objects.hash(data, additionalProperties); + return Objects.hash(data, links, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesUpdateRequest {\n"); + sb.append("class GetInvestigationResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesData.java b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseData.java similarity index 60% rename from src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesData.java rename to src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseData.java index df5eb9fe6b9..5b306309a57 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesData.java +++ b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseData.java @@ -8,6 +8,7 @@ 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; @@ -16,61 +17,74 @@ import java.util.Map; import java.util.Objects; -/** Data object for Flaky Tests Management policies response. */ +/** Data for the get investigation response. */ @JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesData.JSON_PROPERTY_ATTRIBUTES, - TestOptimizationFlakyTestsManagementPoliciesData.JSON_PROPERTY_ID, - TestOptimizationFlakyTestsManagementPoliciesData.JSON_PROPERTY_TYPE + GetInvestigationResponseData.JSON_PROPERTY_ATTRIBUTES, + GetInvestigationResponseData.JSON_PROPERTY_ID, + GetInvestigationResponseData.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesData { +public class GetInvestigationResponseData { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private TestOptimizationFlakyTestsManagementPoliciesAttributes attributes; + private GetInvestigationResponseDataAttributes attributes; public static final String JSON_PROPERTY_ID = "id"; private String id; public static final String JSON_PROPERTY_TYPE = "type"; - private TestOptimizationFlakyTestsManagementPoliciesType type; + private InvestigationType type; - public TestOptimizationFlakyTestsManagementPoliciesData attributes( - TestOptimizationFlakyTestsManagementPoliciesAttributes attributes) { + public GetInvestigationResponseData() {} + + @JsonCreator + public GetInvestigationResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + GetInvestigationResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InvestigationType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public GetInvestigationResponseData attributes( + GetInvestigationResponseDataAttributes attributes) { this.attributes = attributes; this.unparsed |= attributes.unparsed; return this; } /** - * Attributes of the Flaky Tests Management policies for a repository. + * Attributes of the investigation. * * @return attributes */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ATTRIBUTES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesAttributes getAttributes() { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public GetInvestigationResponseDataAttributes getAttributes() { return attributes; } - public void setAttributes(TestOptimizationFlakyTestsManagementPoliciesAttributes attributes) { + public void setAttributes(GetInvestigationResponseDataAttributes attributes) { this.attributes = attributes; } - public TestOptimizationFlakyTestsManagementPoliciesData id(String id) { + public GetInvestigationResponseData id(String id) { this.id = id; return this; } /** - * The repository identifier used as the resource ID. + * The unique identifier of the investigation. * * @return id */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getId() { return id; } @@ -79,27 +93,24 @@ public void setId(String id) { this.id = id; } - public TestOptimizationFlakyTestsManagementPoliciesData type( - TestOptimizationFlakyTestsManagementPoliciesType type) { + public GetInvestigationResponseData type(InvestigationType type) { this.type = type; this.unparsed |= !type.isValid(); return this; } /** - * JSON:API type for Flaky Tests Management policies response. The value must always be - * test_optimization_flaky_tests_management_policies. + * The resource type for investigations. * * @return type */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_TYPE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesType getType() { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public InvestigationType getType() { return type; } - public void setType(TestOptimizationFlakyTestsManagementPoliciesType type) { + public void setType(InvestigationType type) { if (!type.isValid()) { this.unparsed = true; } @@ -118,11 +129,10 @@ public void setType(TestOptimizationFlakyTestsManagementPoliciesType type) { * * @param key The arbitrary key to set * @param value The associated value - * @return TestOptimizationFlakyTestsManagementPoliciesData + * @return GetInvestigationResponseData */ @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesData putAdditionalProperty( - String key, Object value) { + public GetInvestigationResponseData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -153,7 +163,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** Return true if this TestOptimizationFlakyTestsManagementPoliciesData object is equal to o. */ + /** Return true if this GetInvestigationResponseData object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -162,16 +172,12 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TestOptimizationFlakyTestsManagementPoliciesData - testOptimizationFlakyTestsManagementPoliciesData = - (TestOptimizationFlakyTestsManagementPoliciesData) o; - return Objects.equals( - this.attributes, testOptimizationFlakyTestsManagementPoliciesData.attributes) - && Objects.equals(this.id, testOptimizationFlakyTestsManagementPoliciesData.id) - && Objects.equals(this.type, testOptimizationFlakyTestsManagementPoliciesData.type) + GetInvestigationResponseData getInvestigationResponseData = (GetInvestigationResponseData) o; + return Objects.equals(this.attributes, getInvestigationResponseData.attributes) + && Objects.equals(this.id, getInvestigationResponseData.id) + && Objects.equals(this.type, getInvestigationResponseData.type) && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesData.additionalProperties); + this.additionalProperties, getInvestigationResponseData.additionalProperties); } @Override @@ -182,7 +188,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesData {\n"); + sb.append("class GetInvestigationResponseData {\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseDataAttributes.java new file mode 100644 index 00000000000..02133586a36 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseDataAttributes.java @@ -0,0 +1,217 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Attributes of the investigation. */ +@JsonPropertyOrder({ + GetInvestigationResponseDataAttributes.JSON_PROPERTY_CONCLUSIONS, + GetInvestigationResponseDataAttributes.JSON_PROPERTY_STATUS, + GetInvestigationResponseDataAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class GetInvestigationResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONCLUSIONS = "conclusions"; + private List conclusions = new ArrayList<>(); + + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public GetInvestigationResponseDataAttributes() {} + + @JsonCreator + public GetInvestigationResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_CONCLUSIONS) + List conclusions, + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.conclusions = conclusions; + this.status = status; + this.title = title; + } + + public GetInvestigationResponseDataAttributes conclusions( + List conclusions) { + this.conclusions = conclusions; + for (InvestigationConclusion item : conclusions) { + this.unparsed |= item.unparsed; + } + return this; + } + + public GetInvestigationResponseDataAttributes addConclusionsItem( + InvestigationConclusion conclusionsItem) { + this.conclusions.add(conclusionsItem); + this.unparsed |= conclusionsItem.unparsed; + return this; + } + + /** + * The conclusions drawn from the investigation. + * + * @return conclusions + */ + @JsonProperty(JSON_PROPERTY_CONCLUSIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getConclusions() { + return conclusions; + } + + public void setConclusions(List conclusions) { + this.conclusions = conclusions; + } + + public GetInvestigationResponseDataAttributes status(String status) { + this.status = status; + return this; + } + + /** + * The current status of the investigation. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public GetInvestigationResponseDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the investigation. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return GetInvestigationResponseDataAttributes + */ + @JsonAnySetter + public GetInvestigationResponseDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this GetInvestigationResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInvestigationResponseDataAttributes getInvestigationResponseDataAttributes = + (GetInvestigationResponseDataAttributes) o; + return Objects.equals(this.conclusions, getInvestigationResponseDataAttributes.conclusions) + && Objects.equals(this.status, getInvestigationResponseDataAttributes.status) + && Objects.equals(this.title, getInvestigationResponseDataAttributes.title) + && Objects.equals( + this.additionalProperties, getInvestigationResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(conclusions, status, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvestigationResponseDataAttributes {\n"); + sb.append(" conclusions: ").append(toIndentedString(conclusions)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAttemptToFix.java b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseLinks.java similarity index 62% rename from src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAttemptToFix.java rename to src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseLinks.java index a2ea17982d3..c2cb621880e 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAttemptToFix.java +++ b/src/main/java/com/datadog/api/client/v2/model/GetInvestigationResponseLinks.java @@ -8,6 +8,7 @@ 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; @@ -16,34 +17,41 @@ import java.util.Map; import java.util.Objects; -/** Configuration for the attempt-to-fix Flaky Tests Management policy. */ -@JsonPropertyOrder({TestOptimizationFlakyTestsManagementPoliciesAttemptToFix.JSON_PROPERTY_RETRIES}) +/** Links related to the investigation. */ +@JsonPropertyOrder({GetInvestigationResponseLinks.JSON_PROPERTY_SELF}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesAttemptToFix { +public class GetInvestigationResponseLinks { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_RETRIES = "retries"; - private Long retries; + public static final String JSON_PROPERTY_SELF = "self"; + private String self; - public TestOptimizationFlakyTestsManagementPoliciesAttemptToFix retries(Long retries) { - this.retries = retries; + public GetInvestigationResponseLinks() {} + + @JsonCreator + public GetInvestigationResponseLinks( + @JsonProperty(required = true, value = JSON_PROPERTY_SELF) String self) { + this.self = self; + } + + public GetInvestigationResponseLinks self(String self) { + this.self = self; return this; } /** - * Number of retries when attempting to fix a flaky test. Must be greater than 0. + * The URL to the investigation in the Datadog app. * - * @return retries + * @return self */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_RETRIES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getRetries() { - return retries; + @JsonProperty(JSON_PROPERTY_SELF) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSelf() { + return self; } - public void setRetries(Long retries) { - this.retries = retries; + public void setSelf(String self) { + this.self = self; } /** @@ -58,11 +66,10 @@ public void setRetries(Long retries) { * * @param key The arbitrary key to set * @param value The associated value - * @return TestOptimizationFlakyTestsManagementPoliciesAttemptToFix + * @return GetInvestigationResponseLinks */ @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesAttemptToFix putAdditionalProperty( - String key, Object value) { + public GetInvestigationResponseLinks putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -93,10 +100,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** - * Return true if this TestOptimizationFlakyTestsManagementPoliciesAttemptToFix object is equal to - * o. - */ + /** Return true if this GetInvestigationResponseLinks object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -105,26 +109,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TestOptimizationFlakyTestsManagementPoliciesAttemptToFix - testOptimizationFlakyTestsManagementPoliciesAttemptToFix = - (TestOptimizationFlakyTestsManagementPoliciesAttemptToFix) o; - return Objects.equals( - this.retries, testOptimizationFlakyTestsManagementPoliciesAttemptToFix.retries) + GetInvestigationResponseLinks getInvestigationResponseLinks = (GetInvestigationResponseLinks) o; + return Objects.equals(this.self, getInvestigationResponseLinks.self) && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesAttemptToFix.additionalProperties); + this.additionalProperties, getInvestigationResponseLinks.additionalProperties); } @Override public int hashCode() { - return Objects.hash(retries, additionalProperties); + return Objects.hash(self, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesAttemptToFix {\n"); - sb.append(" retries: ").append(toIndentedString(retries)).append("\n"); + sb.append("class GetInvestigationResponseLinks {\n"); + sb.append(" self: ").append(toIndentedString(self)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/InvestigationConclusion.java b/src/main/java/com/datadog/api/client/v2/model/InvestigationConclusion.java new file mode 100644 index 00000000000..2b647b8dc79 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InvestigationConclusion.java @@ -0,0 +1,201 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** A full explanation of the finding, including root cause analysis and supporting evidence. */ +@JsonPropertyOrder({ + InvestigationConclusion.JSON_PROPERTY_DESCRIPTION, + InvestigationConclusion.JSON_PROPERTY_SUMMARY, + InvestigationConclusion.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class InvestigationConclusion { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESCRIPTION = "description"; + private String description; + + public static final String JSON_PROPERTY_SUMMARY = "summary"; + private String summary; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public InvestigationConclusion() {} + + @JsonCreator + public InvestigationConclusion( + @JsonProperty(required = true, value = JSON_PROPERTY_DESCRIPTION) String description, + @JsonProperty(required = true, value = JSON_PROPERTY_SUMMARY) String summary, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.description = description; + this.summary = summary; + this.title = title; + } + + public InvestigationConclusion description(String description) { + this.description = description; + return this; + } + + /** + * A full explanation of the finding, including root cause analysis and supporting evidence. + * + * @return description + */ + @JsonProperty(JSON_PROPERTY_DESCRIPTION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public InvestigationConclusion summary(String summary) { + this.summary = summary; + return this; + } + + /** + * A summary of the finding, including affected components and timeframe. + * + * @return summary + */ + @JsonProperty(JSON_PROPERTY_SUMMARY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public InvestigationConclusion title(String title) { + this.title = title; + return this; + } + + /** + * The title of the conclusion. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return InvestigationConclusion + */ + @JsonAnySetter + public InvestigationConclusion putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this InvestigationConclusion object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvestigationConclusion investigationConclusion = (InvestigationConclusion) o; + return Objects.equals(this.description, investigationConclusion.description) + && Objects.equals(this.summary, investigationConclusion.summary) + && Objects.equals(this.title, investigationConclusion.title) + && Objects.equals(this.additionalProperties, investigationConclusion.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(description, summary, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvestigationConclusion {\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/InvestigationType.java b/src/main/java/com/datadog/api/client/v2/model/InvestigationType.java new file mode 100644 index 00000000000..dc92118e017 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/InvestigationType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type for investigations. */ +@JsonSerialize(using = InvestigationType.InvestigationTypeSerializer.class) +public class InvestigationType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("investigation")); + + public static final InvestigationType INVESTIGATION = new InvestigationType("investigation"); + + InvestigationType(String value) { + super(value, allowedValues); + } + + public static class InvestigationTypeSerializer extends StdSerializer { + public InvestigationTypeSerializer(Class t) { + super(t); + } + + public InvestigationTypeSerializer() { + this(null); + } + + @Override + public void serialize(InvestigationType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static InvestigationType fromValue(String value) { + return new InvestigationType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponse.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponse.java new file mode 100644 index 00000000000..24f94793b54 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponse.java @@ -0,0 +1,220 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** Response for listing investigations. */ +@JsonPropertyOrder({ + ListInvestigationsResponse.JSON_PROPERTY_DATA, + ListInvestigationsResponse.JSON_PROPERTY_LINKS, + ListInvestigationsResponse.JSON_PROPERTY_META +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = new ArrayList<>(); + + public static final String JSON_PROPERTY_LINKS = "links"; + private ListInvestigationsResponseLinks links; + + public static final String JSON_PROPERTY_META = "meta"; + private ListInvestigationsResponseMeta meta; + + public ListInvestigationsResponse() {} + + @JsonCreator + public ListInvestigationsResponse( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + List data, + @JsonProperty(required = true, value = JSON_PROPERTY_LINKS) + ListInvestigationsResponseLinks links, + @JsonProperty(required = true, value = JSON_PROPERTY_META) + ListInvestigationsResponseMeta meta) { + this.data = data; + this.links = links; + this.unparsed |= links.unparsed; + this.meta = meta; + this.unparsed |= meta.unparsed; + } + + public ListInvestigationsResponse data(List data) { + this.data = data; + for (ListInvestigationsResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public ListInvestigationsResponse addDataItem(ListInvestigationsResponseData dataItem) { + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * List of investigations. + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public ListInvestigationsResponse links(ListInvestigationsResponseLinks links) { + this.links = links; + this.unparsed |= links.unparsed; + return this; + } + + /** + * Pagination links for the list investigations response. + * + * @return links + */ + @JsonProperty(JSON_PROPERTY_LINKS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListInvestigationsResponseLinks getLinks() { + return links; + } + + public void setLinks(ListInvestigationsResponseLinks links) { + this.links = links; + } + + public ListInvestigationsResponse meta(ListInvestigationsResponseMeta meta) { + this.meta = meta; + this.unparsed |= meta.unparsed; + return this; + } + + /** + * Metadata for the list investigations response. + * + * @return meta + */ + @JsonProperty(JSON_PROPERTY_META) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListInvestigationsResponseMeta getMeta() { + return meta; + } + + public void setMeta(ListInvestigationsResponseMeta meta) { + this.meta = meta; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListInvestigationsResponse + */ + @JsonAnySetter + public ListInvestigationsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListInvestigationsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponse listInvestigationsResponse = (ListInvestigationsResponse) o; + return Objects.equals(this.data, listInvestigationsResponse.data) + && Objects.equals(this.links, listInvestigationsResponse.links) + && Objects.equals(this.meta, listInvestigationsResponse.meta) + && Objects.equals( + this.additionalProperties, listInvestigationsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, links, meta, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" links: ").append(toIndentedString(links)).append("\n"); + sb.append(" meta: ").append(toIndentedString(meta)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseData.java similarity index 58% rename from src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData.java rename to src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseData.java index 07f1ee45dcc..4f8b9574669 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseData.java @@ -17,79 +17,100 @@ import java.util.Map; import java.util.Objects; -/** Data object for update Flaky Tests Management policies request. */ +/** Data for an investigation list item. */ @JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData.JSON_PROPERTY_ATTRIBUTES, - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData.JSON_PROPERTY_TYPE + ListInvestigationsResponseData.JSON_PROPERTY_ATTRIBUTES, + ListInvestigationsResponseData.JSON_PROPERTY_ID, + ListInvestigationsResponseData.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData { +public class ListInvestigationsResponseData { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes attributes; + private ListInvestigationsResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; public static final String JSON_PROPERTY_TYPE = "type"; - private TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType type; + private InvestigationType type; - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData() {} + public ListInvestigationsResponseData() {} @JsonCreator - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData( + public ListInvestigationsResponseData( @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes attributes, - @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) - TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType type) { + ListInvestigationsResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) InvestigationType type) { this.attributes = attributes; this.unparsed |= attributes.unparsed; + this.id = id; this.type = type; this.unparsed |= !type.isValid(); } - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData attributes( - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes attributes) { + public ListInvestigationsResponseData attributes( + ListInvestigationsResponseDataAttributes attributes) { this.attributes = attributes; this.unparsed |= attributes.unparsed; return this; } /** - * Attributes for updating Flaky Tests Management policies. Only provided policy blocks are - * updated; omitted blocks are left unchanged. + * Attributes of an investigation list item. * * @return attributes */ @JsonProperty(JSON_PROPERTY_ATTRIBUTES) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes getAttributes() { + public ListInvestigationsResponseDataAttributes getAttributes() { return attributes; } - public void setAttributes( - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes attributes) { + public void setAttributes(ListInvestigationsResponseDataAttributes attributes) { this.attributes = attributes; } - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData type( - TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType type) { + public ListInvestigationsResponseData id(String id) { + this.id = id; + return this; + } + + /** + * The unique identifier of the investigation. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public ListInvestigationsResponseData type(InvestigationType type) { this.type = type; this.unparsed |= !type.isValid(); return this; } /** - * JSON:API type for update Flaky Tests Management policies request. The value must always be - * test_optimization_update_flaky_tests_management_policies_request. + * The resource type for investigations. * * @return type */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType getType() { + public InvestigationType getType() { return type; } - public void setType(TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType type) { + public void setType(InvestigationType type) { if (!type.isValid()) { this.unparsed = true; } @@ -108,11 +129,10 @@ public void setType(TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDat * * @param key The arbitrary key to set * @param value The associated value - * @return TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData + * @return ListInvestigationsResponseData */ @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData putAdditionalProperty( - String key, Object value) { + public ListInvestigationsResponseData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -143,10 +163,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** - * Return true if this TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData object is - * equal to o. - */ + /** Return true if this ListInvestigationsResponseData object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -155,29 +172,26 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData - testOptimizationFlakyTestsManagementPoliciesUpdateRequestData = - (TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData) o; - return Objects.equals( - this.attributes, - testOptimizationFlakyTestsManagementPoliciesUpdateRequestData.attributes) - && Objects.equals( - this.type, testOptimizationFlakyTestsManagementPoliciesUpdateRequestData.type) + ListInvestigationsResponseData listInvestigationsResponseData = + (ListInvestigationsResponseData) o; + return Objects.equals(this.attributes, listInvestigationsResponseData.attributes) + && Objects.equals(this.id, listInvestigationsResponseData.id) + && Objects.equals(this.type, listInvestigationsResponseData.type) && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesUpdateRequestData.additionalProperties); + this.additionalProperties, listInvestigationsResponseData.additionalProperties); } @Override public int hashCode() { - return Objects.hash(attributes, type, additionalProperties); + return Objects.hash(attributes, id, type, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesUpdateRequestData {\n"); + sb.append("class ListInvestigationsResponseData {\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseDataAttributes.java new file mode 100644 index 00000000000..ef3e1b048a5 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseDataAttributes.java @@ -0,0 +1,176 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes of an investigation list item. */ +@JsonPropertyOrder({ + ListInvestigationsResponseDataAttributes.JSON_PROPERTY_STATUS, + ListInvestigationsResponseDataAttributes.JSON_PROPERTY_TITLE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_STATUS = "status"; + private String status; + + public static final String JSON_PROPERTY_TITLE = "title"; + private String title; + + public ListInvestigationsResponseDataAttributes() {} + + @JsonCreator + public ListInvestigationsResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_STATUS) String status, + @JsonProperty(required = true, value = JSON_PROPERTY_TITLE) String title) { + this.status = status; + this.title = title; + } + + public ListInvestigationsResponseDataAttributes status(String status) { + this.status = status; + return this; + } + + /** + * The current status of the investigation. + * + * @return status + */ + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getStatus() { + return status; + } + + public void setStatus(String status) { + this.status = status; + } + + public ListInvestigationsResponseDataAttributes title(String title) { + this.title = title; + return this; + } + + /** + * The title of the investigation. + * + * @return title + */ + @JsonProperty(JSON_PROPERTY_TITLE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListInvestigationsResponseDataAttributes + */ + @JsonAnySetter + public ListInvestigationsResponseDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListInvestigationsResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponseDataAttributes listInvestigationsResponseDataAttributes = + (ListInvestigationsResponseDataAttributes) o; + return Objects.equals(this.status, listInvestigationsResponseDataAttributes.status) + && Objects.equals(this.title, listInvestigationsResponseDataAttributes.title) + && Objects.equals( + this.additionalProperties, + listInvestigationsResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(status, title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponseDataAttributes {\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseLinks.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseLinks.java new file mode 100644 index 00000000000..807088bff23 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseLinks.java @@ -0,0 +1,278 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.openapitools.jackson.nullable.JsonNullable; + +/** Pagination links for the list investigations response. */ +@JsonPropertyOrder({ + ListInvestigationsResponseLinks.JSON_PROPERTY_FIRST, + ListInvestigationsResponseLinks.JSON_PROPERTY_LAST, + ListInvestigationsResponseLinks.JSON_PROPERTY_NEXT, + ListInvestigationsResponseLinks.JSON_PROPERTY_PREV, + ListInvestigationsResponseLinks.JSON_PROPERTY_SELF +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponseLinks { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FIRST = "first"; + private String first; + + public static final String JSON_PROPERTY_LAST = "last"; + private JsonNullable last = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_NEXT = "next"; + private String next; + + public static final String JSON_PROPERTY_PREV = "prev"; + private JsonNullable prev = JsonNullable.undefined(); + + public static final String JSON_PROPERTY_SELF = "self"; + private String self; + + public ListInvestigationsResponseLinks() {} + + @JsonCreator + public ListInvestigationsResponseLinks( + @JsonProperty(required = true, value = JSON_PROPERTY_FIRST) String first, + @JsonProperty(required = true, value = JSON_PROPERTY_NEXT) String next, + @JsonProperty(required = true, value = JSON_PROPERTY_SELF) String self) { + this.first = first; + this.next = next; + this.self = self; + } + + public ListInvestigationsResponseLinks first(String first) { + this.first = first; + return this; + } + + /** + * Link to the first page. + * + * @return first + */ + @JsonProperty(JSON_PROPERTY_FIRST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFirst() { + return first; + } + + public void setFirst(String first) { + this.first = first; + } + + public ListInvestigationsResponseLinks last(String last) { + this.last = JsonNullable.of(last); + return this; + } + + /** + * Link to the last page. + * + * @return last + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getLast() { + return last.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_LAST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getLast_JsonNullable() { + return last; + } + + @JsonProperty(JSON_PROPERTY_LAST) + public void setLast_JsonNullable(JsonNullable last) { + this.last = last; + } + + public void setLast(String last) { + this.last = JsonNullable.of(last); + } + + public ListInvestigationsResponseLinks next(String next) { + this.next = next; + return this; + } + + /** + * Link to the next page. + * + * @return next + */ + @JsonProperty(JSON_PROPERTY_NEXT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getNext() { + return next; + } + + public void setNext(String next) { + this.next = next; + } + + public ListInvestigationsResponseLinks prev(String prev) { + this.prev = JsonNullable.of(prev); + return this; + } + + /** + * Link to the previous page. + * + * @return prev + */ + @jakarta.annotation.Nullable + @JsonIgnore + public String getPrev() { + return prev.orElse(null); + } + + @JsonProperty(JSON_PROPERTY_PREV) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public JsonNullable getPrev_JsonNullable() { + return prev; + } + + @JsonProperty(JSON_PROPERTY_PREV) + public void setPrev_JsonNullable(JsonNullable prev) { + this.prev = prev; + } + + public void setPrev(String prev) { + this.prev = JsonNullable.of(prev); + } + + public ListInvestigationsResponseLinks self(String self) { + this.self = self; + return this; + } + + /** + * Link to the current page. + * + * @return self + */ + @JsonProperty(JSON_PROPERTY_SELF) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getSelf() { + return self; + } + + public void setSelf(String self) { + this.self = self; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListInvestigationsResponseLinks + */ + @JsonAnySetter + public ListInvestigationsResponseLinks putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListInvestigationsResponseLinks object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponseLinks listInvestigationsResponseLinks = + (ListInvestigationsResponseLinks) o; + return Objects.equals(this.first, listInvestigationsResponseLinks.first) + && Objects.equals(this.last, listInvestigationsResponseLinks.last) + && Objects.equals(this.next, listInvestigationsResponseLinks.next) + && Objects.equals(this.prev, listInvestigationsResponseLinks.prev) + && Objects.equals(this.self, listInvestigationsResponseLinks.self) + && Objects.equals( + this.additionalProperties, listInvestigationsResponseLinks.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(first, last, next, prev, self, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponseLinks {\n"); + sb.append(" first: ").append(toIndentedString(first)).append("\n"); + sb.append(" last: ").append(toIndentedString(last)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" prev: ").append(toIndentedString(prev)).append("\n"); + sb.append(" self: ").append(toIndentedString(self)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMeta.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMeta.java new file mode 100644 index 00000000000..1a2a8d30c2d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMeta.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Metadata for the list investigations response. */ +@JsonPropertyOrder({ListInvestigationsResponseMeta.JSON_PROPERTY_PAGE}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponseMeta { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_PAGE = "page"; + private ListInvestigationsResponseMetaPage page; + + public ListInvestigationsResponseMeta() {} + + @JsonCreator + public ListInvestigationsResponseMeta( + @JsonProperty(required = true, value = JSON_PROPERTY_PAGE) + ListInvestigationsResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + } + + public ListInvestigationsResponseMeta page(ListInvestigationsResponseMetaPage page) { + this.page = page; + this.unparsed |= page.unparsed; + return this; + } + + /** + * Pagination metadata. + * + * @return page + */ + @JsonProperty(JSON_PROPERTY_PAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public ListInvestigationsResponseMetaPage getPage() { + return page; + } + + public void setPage(ListInvestigationsResponseMetaPage page) { + this.page = page; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListInvestigationsResponseMeta + */ + @JsonAnySetter + public ListInvestigationsResponseMeta putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListInvestigationsResponseMeta object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponseMeta listInvestigationsResponseMeta = + (ListInvestigationsResponseMeta) o; + return Objects.equals(this.page, listInvestigationsResponseMeta.page) + && Objects.equals( + this.additionalProperties, listInvestigationsResponseMeta.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(page, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponseMeta {\n"); + sb.append(" page: ").append(toIndentedString(page)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMetaPage.java b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMetaPage.java new file mode 100644 index 00000000000..6cd4b0f52fe --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/ListInvestigationsResponseMetaPage.java @@ -0,0 +1,203 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Pagination metadata. */ +@JsonPropertyOrder({ + ListInvestigationsResponseMetaPage.JSON_PROPERTY_LIMIT, + ListInvestigationsResponseMetaPage.JSON_PROPERTY_OFFSET, + ListInvestigationsResponseMetaPage.JSON_PROPERTY_TOTAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class ListInvestigationsResponseMetaPage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_LIMIT = "limit"; + private Long limit; + + public static final String JSON_PROPERTY_OFFSET = "offset"; + private Long offset; + + public static final String JSON_PROPERTY_TOTAL = "total"; + private Long total; + + public ListInvestigationsResponseMetaPage() {} + + @JsonCreator + public ListInvestigationsResponseMetaPage( + @JsonProperty(required = true, value = JSON_PROPERTY_LIMIT) Long limit, + @JsonProperty(required = true, value = JSON_PROPERTY_OFFSET) Long offset, + @JsonProperty(required = true, value = JSON_PROPERTY_TOTAL) Long total) { + this.limit = limit; + this.offset = offset; + this.total = total; + } + + public ListInvestigationsResponseMetaPage limit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Maximum number of results per page. + * + * @return limit + */ + @JsonProperty(JSON_PROPERTY_LIMIT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getLimit() { + return limit; + } + + public void setLimit(Long limit) { + this.limit = limit; + } + + public ListInvestigationsResponseMetaPage offset(Long offset) { + this.offset = offset; + return this; + } + + /** + * Offset of the current page. + * + * @return offset + */ + @JsonProperty(JSON_PROPERTY_OFFSET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getOffset() { + return offset; + } + + public void setOffset(Long offset) { + this.offset = offset; + } + + public ListInvestigationsResponseMetaPage total(Long total) { + this.total = total; + return this; + } + + /** + * Total number of investigations. + * + * @return total + */ + @JsonProperty(JSON_PROPERTY_TOTAL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTotal() { + return total; + } + + public void setTotal(Long total) { + this.total = total; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return ListInvestigationsResponseMetaPage + */ + @JsonAnySetter + public ListInvestigationsResponseMetaPage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this ListInvestigationsResponseMetaPage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ListInvestigationsResponseMetaPage listInvestigationsResponseMetaPage = + (ListInvestigationsResponseMetaPage) o; + return Objects.equals(this.limit, listInvestigationsResponseMetaPage.limit) + && Objects.equals(this.offset, listInvestigationsResponseMetaPage.offset) + && Objects.equals(this.total, listInvestigationsResponseMetaPage.total) + && Objects.equals( + this.additionalProperties, listInvestigationsResponseMetaPage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(limit, offset, total, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ListInvestigationsResponseMetaPage {\n"); + sb.append(" limit: ").append(toIndentedString(limit)).append("\n"); + sb.append(" offset: ").append(toIndentedString(offset)).append("\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTriggerAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTriggerAttributes.java new file mode 100644 index 00000000000..7696311016d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MonitorAlertTriggerAttributes.java @@ -0,0 +1,202 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for a monitor alert trigger. */ +@JsonPropertyOrder({ + MonitorAlertTriggerAttributes.JSON_PROPERTY_EVENT_ID, + MonitorAlertTriggerAttributes.JSON_PROPERTY_EVENT_TS, + MonitorAlertTriggerAttributes.JSON_PROPERTY_MONITOR_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MonitorAlertTriggerAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_EVENT_ID = "event_id"; + private String eventId; + + public static final String JSON_PROPERTY_EVENT_TS = "event_ts"; + private Long eventTs; + + public static final String JSON_PROPERTY_MONITOR_ID = "monitor_id"; + private Long monitorId; + + public MonitorAlertTriggerAttributes() {} + + @JsonCreator + public MonitorAlertTriggerAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_EVENT_ID) String eventId, + @JsonProperty(required = true, value = JSON_PROPERTY_EVENT_TS) Long eventTs, + @JsonProperty(required = true, value = JSON_PROPERTY_MONITOR_ID) Long monitorId) { + this.eventId = eventId; + this.eventTs = eventTs; + this.monitorId = monitorId; + } + + public MonitorAlertTriggerAttributes eventId(String eventId) { + this.eventId = eventId; + return this; + } + + /** + * The event ID associated with the monitor alert. + * + * @return eventId + */ + @JsonProperty(JSON_PROPERTY_EVENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getEventId() { + return eventId; + } + + public void setEventId(String eventId) { + this.eventId = eventId; + } + + public MonitorAlertTriggerAttributes eventTs(Long eventTs) { + this.eventTs = eventTs; + return this; + } + + /** + * The timestamp of the event in Unix milliseconds. + * + * @return eventTs + */ + @JsonProperty(JSON_PROPERTY_EVENT_TS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getEventTs() { + return eventTs; + } + + public void setEventTs(Long eventTs) { + this.eventTs = eventTs; + } + + public MonitorAlertTriggerAttributes monitorId(Long monitorId) { + this.monitorId = monitorId; + return this; + } + + /** + * The monitor ID that triggered the alert. + * + * @return monitorId + */ + @JsonProperty(JSON_PROPERTY_MONITOR_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMonitorId() { + return monitorId; + } + + public void setMonitorId(Long monitorId) { + this.monitorId = monitorId; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MonitorAlertTriggerAttributes + */ + @JsonAnySetter + public MonitorAlertTriggerAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MonitorAlertTriggerAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MonitorAlertTriggerAttributes monitorAlertTriggerAttributes = (MonitorAlertTriggerAttributes) o; + return Objects.equals(this.eventId, monitorAlertTriggerAttributes.eventId) + && Objects.equals(this.eventTs, monitorAlertTriggerAttributes.eventTs) + && Objects.equals(this.monitorId, monitorAlertTriggerAttributes.monitorId) + && Objects.equals( + this.additionalProperties, monitorAlertTriggerAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(eventId, eventTs, monitorId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MonitorAlertTriggerAttributes {\n"); + sb.append(" eventId: ").append(toIndentedString(eventId)).append("\n"); + sb.append(" eventTs: ").append(toIndentedString(eventTs)).append("\n"); + sb.append(" monitorId: ").append(toIndentedString(monitorId)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAttributes.java deleted file mode 100644 index 992d16d1f9b..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAttributes.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Attributes of the Flaky Tests Management policies for a repository. */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesAttributes.JSON_PROPERTY_ATTEMPT_TO_FIX, - TestOptimizationFlakyTestsManagementPoliciesAttributes.JSON_PROPERTY_DISABLED, - TestOptimizationFlakyTestsManagementPoliciesAttributes.JSON_PROPERTY_QUARANTINED, - TestOptimizationFlakyTestsManagementPoliciesAttributes.JSON_PROPERTY_REPOSITORY_ID -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesAttributes { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ATTEMPT_TO_FIX = "attempt_to_fix"; - private TestOptimizationFlakyTestsManagementPoliciesAttemptToFix attemptToFix; - - public static final String JSON_PROPERTY_DISABLED = "disabled"; - private TestOptimizationFlakyTestsManagementPoliciesDisabled disabled; - - public static final String JSON_PROPERTY_QUARANTINED = "quarantined"; - private TestOptimizationFlakyTestsManagementPoliciesQuarantined quarantined; - - public static final String JSON_PROPERTY_REPOSITORY_ID = "repository_id"; - private String repositoryId; - - public TestOptimizationFlakyTestsManagementPoliciesAttributes attemptToFix( - TestOptimizationFlakyTestsManagementPoliciesAttemptToFix attemptToFix) { - this.attemptToFix = attemptToFix; - this.unparsed |= attemptToFix.unparsed; - return this; - } - - /** - * Configuration for the attempt-to-fix Flaky Tests Management policy. - * - * @return attemptToFix - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTEMPT_TO_FIX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesAttemptToFix getAttemptToFix() { - return attemptToFix; - } - - public void setAttemptToFix( - TestOptimizationFlakyTestsManagementPoliciesAttemptToFix attemptToFix) { - this.attemptToFix = attemptToFix; - } - - public TestOptimizationFlakyTestsManagementPoliciesAttributes disabled( - TestOptimizationFlakyTestsManagementPoliciesDisabled disabled) { - this.disabled = disabled; - this.unparsed |= disabled.unparsed; - return this; - } - - /** - * Configuration for the disabled Flaky Tests Management policy. - * - * @return disabled - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DISABLED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesDisabled getDisabled() { - return disabled; - } - - public void setDisabled(TestOptimizationFlakyTestsManagementPoliciesDisabled disabled) { - this.disabled = disabled; - } - - public TestOptimizationFlakyTestsManagementPoliciesAttributes quarantined( - TestOptimizationFlakyTestsManagementPoliciesQuarantined quarantined) { - this.quarantined = quarantined; - this.unparsed |= quarantined.unparsed; - return this; - } - - /** - * Configuration for the quarantined Flaky Tests Management policy. - * - * @return quarantined - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_QUARANTINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesQuarantined getQuarantined() { - return quarantined; - } - - public void setQuarantined(TestOptimizationFlakyTestsManagementPoliciesQuarantined quarantined) { - this.quarantined = quarantined; - } - - public TestOptimizationFlakyTestsManagementPoliciesAttributes repositoryId(String repositoryId) { - this.repositoryId = repositoryId; - return this; - } - - /** - * The repository identifier. - * - * @return repositoryId - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_REPOSITORY_ID) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRepositoryId() { - return repositoryId; - } - - public void setRepositoryId(String repositoryId) { - this.repositoryId = repositoryId; - } - - /** - * 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 TestOptimizationFlakyTestsManagementPoliciesAttributes - */ - @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesAttributes 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 TestOptimizationFlakyTestsManagementPoliciesAttributes object is equal to - * o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestOptimizationFlakyTestsManagementPoliciesAttributes - testOptimizationFlakyTestsManagementPoliciesAttributes = - (TestOptimizationFlakyTestsManagementPoliciesAttributes) o; - return Objects.equals( - this.attemptToFix, testOptimizationFlakyTestsManagementPoliciesAttributes.attemptToFix) - && Objects.equals( - this.disabled, testOptimizationFlakyTestsManagementPoliciesAttributes.disabled) - && Objects.equals( - this.quarantined, testOptimizationFlakyTestsManagementPoliciesAttributes.quarantined) - && Objects.equals( - this.repositoryId, testOptimizationFlakyTestsManagementPoliciesAttributes.repositoryId) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesAttributes.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(attemptToFix, disabled, quarantined, repositoryId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesAttributes {\n"); - sb.append(" attemptToFix: ").append(toIndentedString(attemptToFix)).append("\n"); - sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n"); - sb.append(" quarantined: ").append(toIndentedString(quarantined)).append("\n"); - sb.append(" repositoryId: ").append(toIndentedString(repositoryId)).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/TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule.java deleted file mode 100644 index 912790371ca..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule.java +++ /dev/null @@ -1,210 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Automatic disable triggering rule based on a time window and test status. */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule.JSON_PROPERTY_ENABLED, - TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule.JSON_PROPERTY_STATUS, - TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule.JSON_PROPERTY_WINDOW_SECONDS -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ENABLED = "enabled"; - private Boolean enabled; - - public static final String JSON_PROPERTY_STATUS = "status"; - private TestOptimizationFlakyTestsManagementPoliciesDisabledStatus status; - - public static final String JSON_PROPERTY_WINDOW_SECONDS = "window_seconds"; - private Long windowSeconds; - - public TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule enabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Whether this auto-disable rule is enabled. - * - * @return enabled - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENABLED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule status( - TestOptimizationFlakyTestsManagementPoliciesDisabledStatus status) { - this.status = status; - this.unparsed |= !status.isValid(); - return this; - } - - /** - * Test status that the disable policy applies to. Must be either active or - * quarantined. - * - * @return status - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesDisabledStatus getStatus() { - return status; - } - - public void setStatus(TestOptimizationFlakyTestsManagementPoliciesDisabledStatus status) { - if (!status.isValid()) { - this.unparsed = true; - } - this.status = status; - } - - public TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule windowSeconds( - Long windowSeconds) { - this.windowSeconds = windowSeconds; - return this; - } - - /** - * Time window in seconds over which flakiness is evaluated. Must be greater than 0. - * - * @return windowSeconds - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WINDOW_SECONDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getWindowSeconds() { - return windowSeconds; - } - - public void setWindowSeconds(Long windowSeconds) { - this.windowSeconds = windowSeconds; - } - - /** - * 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 TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule - */ - @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule 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 TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule object is equal - * to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule - testOptimizationFlakyTestsManagementPoliciesAutoDisableRule = - (TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule) o; - return Objects.equals( - this.enabled, testOptimizationFlakyTestsManagementPoliciesAutoDisableRule.enabled) - && Objects.equals( - this.status, testOptimizationFlakyTestsManagementPoliciesAutoDisableRule.status) - && Objects.equals( - this.windowSeconds, - testOptimizationFlakyTestsManagementPoliciesAutoDisableRule.windowSeconds) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesAutoDisableRule.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(enabled, status, windowSeconds, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" windowSeconds: ").append(toIndentedString(windowSeconds)).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/TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule.java deleted file mode 100644 index fb8c7aaa9a5..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule.java +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Automatic quarantine triggering rule based on a time window. */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule.JSON_PROPERTY_ENABLED, - TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule.JSON_PROPERTY_WINDOW_SECONDS -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ENABLED = "enabled"; - private Boolean enabled; - - public static final String JSON_PROPERTY_WINDOW_SECONDS = "window_seconds"; - private Long windowSeconds; - - public TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule enabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Whether this auto-quarantine rule is enabled. - * - * @return enabled - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENABLED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule windowSeconds( - Long windowSeconds) { - this.windowSeconds = windowSeconds; - return this; - } - - /** - * Time window in seconds over which flakiness is evaluated. Must be greater than 0. - * - * @return windowSeconds - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_WINDOW_SECONDS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getWindowSeconds() { - return windowSeconds; - } - - public void setWindowSeconds(Long windowSeconds) { - this.windowSeconds = windowSeconds; - } - - /** - * 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 TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule - */ - @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule 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 TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule object is - * equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule - testOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule = - (TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule) o; - return Objects.equals( - this.enabled, testOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule.enabled) - && Objects.equals( - this.windowSeconds, - testOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule.windowSeconds) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(enabled, windowSeconds, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule {\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" windowSeconds: ").append(toIndentedString(windowSeconds)).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/TestOptimizationFlakyTestsManagementPoliciesBranchRule.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesBranchRule.java deleted file mode 100644 index e10eedf4994..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesBranchRule.java +++ /dev/null @@ -1,266 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Branch filtering rule for a Flaky Tests Management policy. */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesBranchRule.JSON_PROPERTY_BRANCHES, - TestOptimizationFlakyTestsManagementPoliciesBranchRule.JSON_PROPERTY_ENABLED, - TestOptimizationFlakyTestsManagementPoliciesBranchRule.JSON_PROPERTY_EXCLUDED_BRANCHES, - TestOptimizationFlakyTestsManagementPoliciesBranchRule.JSON_PROPERTY_EXCLUDED_TEST_SERVICES -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesBranchRule { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_BRANCHES = "branches"; - private List branches = null; - - public static final String JSON_PROPERTY_ENABLED = "enabled"; - private Boolean enabled; - - public static final String JSON_PROPERTY_EXCLUDED_BRANCHES = "excluded_branches"; - private List excludedBranches = null; - - public static final String JSON_PROPERTY_EXCLUDED_TEST_SERVICES = "excluded_test_services"; - private List excludedTestServices = null; - - public TestOptimizationFlakyTestsManagementPoliciesBranchRule branches(List branches) { - this.branches = branches; - return this; - } - - public TestOptimizationFlakyTestsManagementPoliciesBranchRule addBranchesItem( - String branchesItem) { - if (this.branches == null) { - this.branches = new ArrayList<>(); - } - this.branches.add(branchesItem); - return this; - } - - /** - * List of branches to which the policy applies. - * - * @return branches - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BRANCHES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getBranches() { - return branches; - } - - public void setBranches(List branches) { - this.branches = branches; - } - - public TestOptimizationFlakyTestsManagementPoliciesBranchRule enabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Whether this branch rule is enabled. - * - * @return enabled - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENABLED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public TestOptimizationFlakyTestsManagementPoliciesBranchRule excludedBranches( - List excludedBranches) { - this.excludedBranches = excludedBranches; - return this; - } - - public TestOptimizationFlakyTestsManagementPoliciesBranchRule addExcludedBranchesItem( - String excludedBranchesItem) { - if (this.excludedBranches == null) { - this.excludedBranches = new ArrayList<>(); - } - this.excludedBranches.add(excludedBranchesItem); - return this; - } - - /** - * List of branches excluded from the policy. - * - * @return excludedBranches - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EXCLUDED_BRANCHES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getExcludedBranches() { - return excludedBranches; - } - - public void setExcludedBranches(List excludedBranches) { - this.excludedBranches = excludedBranches; - } - - public TestOptimizationFlakyTestsManagementPoliciesBranchRule excludedTestServices( - List excludedTestServices) { - this.excludedTestServices = excludedTestServices; - return this; - } - - public TestOptimizationFlakyTestsManagementPoliciesBranchRule addExcludedTestServicesItem( - String excludedTestServicesItem) { - if (this.excludedTestServices == null) { - this.excludedTestServices = new ArrayList<>(); - } - this.excludedTestServices.add(excludedTestServicesItem); - return this; - } - - /** - * List of test services excluded from the policy. - * - * @return excludedTestServices - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_EXCLUDED_TEST_SERVICES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getExcludedTestServices() { - return excludedTestServices; - } - - public void setExcludedTestServices(List excludedTestServices) { - this.excludedTestServices = excludedTestServices; - } - - /** - * 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 TestOptimizationFlakyTestsManagementPoliciesBranchRule - */ - @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesBranchRule 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 TestOptimizationFlakyTestsManagementPoliciesBranchRule object is equal to - * o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestOptimizationFlakyTestsManagementPoliciesBranchRule - testOptimizationFlakyTestsManagementPoliciesBranchRule = - (TestOptimizationFlakyTestsManagementPoliciesBranchRule) o; - return Objects.equals( - this.branches, testOptimizationFlakyTestsManagementPoliciesBranchRule.branches) - && Objects.equals( - this.enabled, testOptimizationFlakyTestsManagementPoliciesBranchRule.enabled) - && Objects.equals( - this.excludedBranches, - testOptimizationFlakyTestsManagementPoliciesBranchRule.excludedBranches) - && Objects.equals( - this.excludedTestServices, - testOptimizationFlakyTestsManagementPoliciesBranchRule.excludedTestServices) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesBranchRule.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - branches, enabled, excludedBranches, excludedTestServices, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesBranchRule {\n"); - sb.append(" branches: ").append(toIndentedString(branches)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" excludedBranches: ").append(toIndentedString(excludedBranches)).append("\n"); - sb.append(" excludedTestServices: ") - .append(toIndentedString(excludedTestServices)) - .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/TestOptimizationFlakyTestsManagementPoliciesDisabled.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesDisabled.java deleted file mode 100644 index e37f5031f26..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesDisabled.java +++ /dev/null @@ -1,240 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Configuration for the disabled Flaky Tests Management policy. */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesDisabled.JSON_PROPERTY_AUTO_DISABLE_RULE, - TestOptimizationFlakyTestsManagementPoliciesDisabled.JSON_PROPERTY_BRANCH_RULE, - TestOptimizationFlakyTestsManagementPoliciesDisabled.JSON_PROPERTY_ENABLED, - TestOptimizationFlakyTestsManagementPoliciesDisabled.JSON_PROPERTY_FAILURE_RATE_RULE -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesDisabled { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_AUTO_DISABLE_RULE = "auto_disable_rule"; - private TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule autoDisableRule; - - public static final String JSON_PROPERTY_BRANCH_RULE = "branch_rule"; - private TestOptimizationFlakyTestsManagementPoliciesBranchRule branchRule; - - public static final String JSON_PROPERTY_ENABLED = "enabled"; - private Boolean enabled; - - public static final String JSON_PROPERTY_FAILURE_RATE_RULE = "failure_rate_rule"; - private TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule failureRateRule; - - public TestOptimizationFlakyTestsManagementPoliciesDisabled autoDisableRule( - TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule autoDisableRule) { - this.autoDisableRule = autoDisableRule; - this.unparsed |= autoDisableRule.unparsed; - return this; - } - - /** - * Automatic disable triggering rule based on a time window and test status. - * - * @return autoDisableRule - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_AUTO_DISABLE_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule getAutoDisableRule() { - return autoDisableRule; - } - - public void setAutoDisableRule( - TestOptimizationFlakyTestsManagementPoliciesAutoDisableRule autoDisableRule) { - this.autoDisableRule = autoDisableRule; - } - - public TestOptimizationFlakyTestsManagementPoliciesDisabled branchRule( - TestOptimizationFlakyTestsManagementPoliciesBranchRule branchRule) { - this.branchRule = branchRule; - this.unparsed |= branchRule.unparsed; - return this; - } - - /** - * Branch filtering rule for a Flaky Tests Management policy. - * - * @return branchRule - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BRANCH_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesBranchRule getBranchRule() { - return branchRule; - } - - public void setBranchRule(TestOptimizationFlakyTestsManagementPoliciesBranchRule branchRule) { - this.branchRule = branchRule; - } - - public TestOptimizationFlakyTestsManagementPoliciesDisabled enabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Whether the disabled policy is enabled. - * - * @return enabled - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENABLED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public TestOptimizationFlakyTestsManagementPoliciesDisabled failureRateRule( - TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule failureRateRule) { - this.failureRateRule = failureRateRule; - this.unparsed |= failureRateRule.unparsed; - return this; - } - - /** - * Failure-rate-based rule for the disabled policy. - * - * @return failureRateRule - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FAILURE_RATE_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule getFailureRateRule() { - return failureRateRule; - } - - public void setFailureRateRule( - TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule failureRateRule) { - this.failureRateRule = failureRateRule; - } - - /** - * 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 TestOptimizationFlakyTestsManagementPoliciesDisabled - */ - @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesDisabled 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 TestOptimizationFlakyTestsManagementPoliciesDisabled object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestOptimizationFlakyTestsManagementPoliciesDisabled - testOptimizationFlakyTestsManagementPoliciesDisabled = - (TestOptimizationFlakyTestsManagementPoliciesDisabled) o; - return Objects.equals( - this.autoDisableRule, - testOptimizationFlakyTestsManagementPoliciesDisabled.autoDisableRule) - && Objects.equals( - this.branchRule, testOptimizationFlakyTestsManagementPoliciesDisabled.branchRule) - && Objects.equals( - this.enabled, testOptimizationFlakyTestsManagementPoliciesDisabled.enabled) - && Objects.equals( - this.failureRateRule, - testOptimizationFlakyTestsManagementPoliciesDisabled.failureRateRule) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesDisabled.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - autoDisableRule, branchRule, enabled, failureRateRule, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesDisabled {\n"); - sb.append(" autoDisableRule: ").append(toIndentedString(autoDisableRule)).append("\n"); - sb.append(" branchRule: ").append(toIndentedString(branchRule)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" failureRateRule: ").append(toIndentedString(failureRateRule)).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/TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.java deleted file mode 100644 index bb28673d53c..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.java +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Failure-rate-based rule for the disabled policy. */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.JSON_PROPERTY_BRANCHES, - TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.JSON_PROPERTY_ENABLED, - TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.JSON_PROPERTY_MIN_RUNS, - TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.JSON_PROPERTY_STATUS, - TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.JSON_PROPERTY_THRESHOLD -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_BRANCHES = "branches"; - private List branches = null; - - public static final String JSON_PROPERTY_ENABLED = "enabled"; - private Boolean enabled; - - public static final String JSON_PROPERTY_MIN_RUNS = "min_runs"; - private Long minRuns; - - public static final String JSON_PROPERTY_STATUS = "status"; - private TestOptimizationFlakyTestsManagementPoliciesDisabledStatus status; - - public static final String JSON_PROPERTY_THRESHOLD = "threshold"; - private Double threshold; - - public TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule branches( - List branches) { - this.branches = branches; - return this; - } - - public TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule addBranchesItem( - String branchesItem) { - if (this.branches == null) { - this.branches = new ArrayList<>(); - } - this.branches.add(branchesItem); - return this; - } - - /** - * List of branches to which this rule applies. - * - * @return branches - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BRANCHES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getBranches() { - return branches; - } - - public void setBranches(List branches) { - this.branches = branches; - } - - public TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule enabled( - Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Whether this failure rate rule is enabled. - * - * @return enabled - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENABLED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule minRuns(Long minRuns) { - this.minRuns = minRuns; - return this; - } - - /** - * Minimum number of runs required before the rule is evaluated. Must be greater than or equal to - * 0. - * - * @return minRuns - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MIN_RUNS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getMinRuns() { - return minRuns; - } - - public void setMinRuns(Long minRuns) { - this.minRuns = minRuns; - } - - public TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule status( - TestOptimizationFlakyTestsManagementPoliciesDisabledStatus status) { - this.status = status; - this.unparsed |= !status.isValid(); - return this; - } - - /** - * Test status that the disable policy applies to. Must be either active or - * quarantined. - * - * @return status - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_STATUS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesDisabledStatus getStatus() { - return status; - } - - public void setStatus(TestOptimizationFlakyTestsManagementPoliciesDisabledStatus status) { - if (!status.isValid()) { - this.unparsed = true; - } - this.status = status; - } - - public TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule threshold( - Double threshold) { - this.threshold = threshold; - return this; - } - - /** - * Failure rate threshold (0.0–1.0) above which the rule triggers. - * - * @return threshold - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_THRESHOLD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getThreshold() { - return threshold; - } - - public void setThreshold(Double threshold) { - this.threshold = threshold; - } - - /** - * 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 TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule - */ - @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule 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 TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule object - * is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule - testOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule = - (TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule) o; - return Objects.equals( - this.branches, - testOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.branches) - && Objects.equals( - this.enabled, - testOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.enabled) - && Objects.equals( - this.minRuns, - testOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.minRuns) - && Objects.equals( - this.status, testOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.status) - && Objects.equals( - this.threshold, - testOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule.threshold) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule - .additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(branches, enabled, minRuns, status, threshold, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesDisabledFailureRateRule {\n"); - sb.append(" branches: ").append(toIndentedString(branches)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" minRuns: ").append(toIndentedString(minRuns)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" threshold: ").append(toIndentedString(threshold)).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/TestOptimizationFlakyTestsManagementPoliciesDisabledStatus.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesDisabledStatus.java deleted file mode 100644 index 83746327c59..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesDisabledStatus.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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; - -/** - * Test status that the disable policy applies to. Must be either active or - * quarantined. - */ -@JsonSerialize( - using = - TestOptimizationFlakyTestsManagementPoliciesDisabledStatus - .TestOptimizationFlakyTestsManagementPoliciesDisabledStatusSerializer.class) -public class TestOptimizationFlakyTestsManagementPoliciesDisabledStatus extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("active", "quarantined")); - - public static final TestOptimizationFlakyTestsManagementPoliciesDisabledStatus ACTIVE = - new TestOptimizationFlakyTestsManagementPoliciesDisabledStatus("active"); - public static final TestOptimizationFlakyTestsManagementPoliciesDisabledStatus QUARANTINED = - new TestOptimizationFlakyTestsManagementPoliciesDisabledStatus("quarantined"); - - TestOptimizationFlakyTestsManagementPoliciesDisabledStatus(String value) { - super(value, allowedValues); - } - - public static class TestOptimizationFlakyTestsManagementPoliciesDisabledStatusSerializer - extends StdSerializer { - public TestOptimizationFlakyTestsManagementPoliciesDisabledStatusSerializer( - Class t) { - super(t); - } - - public TestOptimizationFlakyTestsManagementPoliciesDisabledStatusSerializer() { - this(null); - } - - @Override - public void serialize( - TestOptimizationFlakyTestsManagementPoliciesDisabledStatus value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static TestOptimizationFlakyTestsManagementPoliciesDisabledStatus fromValue(String value) { - return new TestOptimizationFlakyTestsManagementPoliciesDisabledStatus(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesQuarantined.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesQuarantined.java deleted file mode 100644 index 6089ad4f9aa..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesQuarantined.java +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** Configuration for the quarantined Flaky Tests Management policy. */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesQuarantined.JSON_PROPERTY_AUTO_QUARANTINE_RULE, - TestOptimizationFlakyTestsManagementPoliciesQuarantined.JSON_PROPERTY_BRANCH_RULE, - TestOptimizationFlakyTestsManagementPoliciesQuarantined.JSON_PROPERTY_ENABLED, - TestOptimizationFlakyTestsManagementPoliciesQuarantined.JSON_PROPERTY_FAILURE_RATE_RULE -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesQuarantined { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_AUTO_QUARANTINE_RULE = "auto_quarantine_rule"; - private TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule autoQuarantineRule; - - public static final String JSON_PROPERTY_BRANCH_RULE = "branch_rule"; - private TestOptimizationFlakyTestsManagementPoliciesBranchRule branchRule; - - public static final String JSON_PROPERTY_ENABLED = "enabled"; - private Boolean enabled; - - public static final String JSON_PROPERTY_FAILURE_RATE_RULE = "failure_rate_rule"; - private TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule failureRateRule; - - public TestOptimizationFlakyTestsManagementPoliciesQuarantined autoQuarantineRule( - TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule autoQuarantineRule) { - this.autoQuarantineRule = autoQuarantineRule; - this.unparsed |= autoQuarantineRule.unparsed; - return this; - } - - /** - * Automatic quarantine triggering rule based on a time window. - * - * @return autoQuarantineRule - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_AUTO_QUARANTINE_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule getAutoQuarantineRule() { - return autoQuarantineRule; - } - - public void setAutoQuarantineRule( - TestOptimizationFlakyTestsManagementPoliciesAutoQuarantineRule autoQuarantineRule) { - this.autoQuarantineRule = autoQuarantineRule; - } - - public TestOptimizationFlakyTestsManagementPoliciesQuarantined branchRule( - TestOptimizationFlakyTestsManagementPoliciesBranchRule branchRule) { - this.branchRule = branchRule; - this.unparsed |= branchRule.unparsed; - return this; - } - - /** - * Branch filtering rule for a Flaky Tests Management policy. - * - * @return branchRule - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BRANCH_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesBranchRule getBranchRule() { - return branchRule; - } - - public void setBranchRule(TestOptimizationFlakyTestsManagementPoliciesBranchRule branchRule) { - this.branchRule = branchRule; - } - - public TestOptimizationFlakyTestsManagementPoliciesQuarantined enabled(Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Whether the quarantined policy is enabled. - * - * @return enabled - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENABLED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public TestOptimizationFlakyTestsManagementPoliciesQuarantined failureRateRule( - TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule failureRateRule) { - this.failureRateRule = failureRateRule; - this.unparsed |= failureRateRule.unparsed; - return this; - } - - /** - * Failure-rate-based rule for the quarantined policy. - * - * @return failureRateRule - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_FAILURE_RATE_RULE) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule - getFailureRateRule() { - return failureRateRule; - } - - public void setFailureRateRule( - TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule failureRateRule) { - this.failureRateRule = failureRateRule; - } - - /** - * 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 TestOptimizationFlakyTestsManagementPoliciesQuarantined - */ - @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesQuarantined 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 TestOptimizationFlakyTestsManagementPoliciesQuarantined object is equal to - * o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestOptimizationFlakyTestsManagementPoliciesQuarantined - testOptimizationFlakyTestsManagementPoliciesQuarantined = - (TestOptimizationFlakyTestsManagementPoliciesQuarantined) o; - return Objects.equals( - this.autoQuarantineRule, - testOptimizationFlakyTestsManagementPoliciesQuarantined.autoQuarantineRule) - && Objects.equals( - this.branchRule, testOptimizationFlakyTestsManagementPoliciesQuarantined.branchRule) - && Objects.equals( - this.enabled, testOptimizationFlakyTestsManagementPoliciesQuarantined.enabled) - && Objects.equals( - this.failureRateRule, - testOptimizationFlakyTestsManagementPoliciesQuarantined.failureRateRule) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesQuarantined.additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash( - autoQuarantineRule, branchRule, enabled, failureRateRule, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesQuarantined {\n"); - sb.append(" autoQuarantineRule: ").append(toIndentedString(autoQuarantineRule)).append("\n"); - sb.append(" branchRule: ").append(toIndentedString(branchRule)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" failureRateRule: ").append(toIndentedString(failureRateRule)).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/TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.java deleted file mode 100644 index 87ea28064d7..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; - -/** Failure-rate-based rule for the quarantined policy. */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.JSON_PROPERTY_BRANCHES, - TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.JSON_PROPERTY_ENABLED, - TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.JSON_PROPERTY_MIN_RUNS, - TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.JSON_PROPERTY_THRESHOLD -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_BRANCHES = "branches"; - private List branches = null; - - public static final String JSON_PROPERTY_ENABLED = "enabled"; - private Boolean enabled; - - public static final String JSON_PROPERTY_MIN_RUNS = "min_runs"; - private Long minRuns; - - public static final String JSON_PROPERTY_THRESHOLD = "threshold"; - private Double threshold; - - public TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule branches( - List branches) { - this.branches = branches; - return this; - } - - public TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule addBranchesItem( - String branchesItem) { - if (this.branches == null) { - this.branches = new ArrayList<>(); - } - this.branches.add(branchesItem); - return this; - } - - /** - * List of branches to which this rule applies. - * - * @return branches - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_BRANCHES) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getBranches() { - return branches; - } - - public void setBranches(List branches) { - this.branches = branches; - } - - public TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule enabled( - Boolean enabled) { - this.enabled = enabled; - return this; - } - - /** - * Whether this failure rate rule is enabled. - * - * @return enabled - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ENABLED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEnabled() { - return enabled; - } - - public void setEnabled(Boolean enabled) { - this.enabled = enabled; - } - - public TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule minRuns( - Long minRuns) { - this.minRuns = minRuns; - return this; - } - - /** - * Minimum number of runs required before the rule is evaluated. Must be greater than or equal to - * 0. - * - * @return minRuns - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_MIN_RUNS) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getMinRuns() { - return minRuns; - } - - public void setMinRuns(Long minRuns) { - this.minRuns = minRuns; - } - - public TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule threshold( - Double threshold) { - this.threshold = threshold; - return this; - } - - /** - * Failure rate threshold (0.0–1.0) above which the rule triggers. - * - * @return threshold - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_THRESHOLD) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getThreshold() { - return threshold; - } - - public void setThreshold(Double threshold) { - this.threshold = threshold; - } - - /** - * 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 TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule - */ - @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule - 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 TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule - * object is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule - testOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule = - (TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule) o; - return Objects.equals( - this.branches, - testOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.branches) - && Objects.equals( - this.enabled, - testOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.enabled) - && Objects.equals( - this.minRuns, - testOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.minRuns) - && Objects.equals( - this.threshold, - testOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule.threshold) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule - .additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(branches, enabled, minRuns, threshold, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesQuarantinedFailureRateRule {\n"); - sb.append(" branches: ").append(toIndentedString(branches)).append("\n"); - sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); - sb.append(" minRuns: ").append(toIndentedString(minRuns)).append("\n"); - sb.append(" threshold: ").append(toIndentedString(threshold)).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/TestOptimizationFlakyTestsManagementPoliciesType.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesType.java deleted file mode 100644 index e835777328b..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesType.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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; - -/** - * JSON:API type for Flaky Tests Management policies response. The value must always be - * test_optimization_flaky_tests_management_policies. - */ -@JsonSerialize( - using = - TestOptimizationFlakyTestsManagementPoliciesType - .TestOptimizationFlakyTestsManagementPoliciesTypeSerializer.class) -public class TestOptimizationFlakyTestsManagementPoliciesType extends ModelEnum { - - private static final Set allowedValues = - new HashSet(Arrays.asList("test_optimization_flaky_tests_management_policies")); - - public static final TestOptimizationFlakyTestsManagementPoliciesType - TEST_OPTIMIZATION_FLAKY_TESTS_MANAGEMENT_POLICIES = - new TestOptimizationFlakyTestsManagementPoliciesType( - "test_optimization_flaky_tests_management_policies"); - - TestOptimizationFlakyTestsManagementPoliciesType(String value) { - super(value, allowedValues); - } - - public static class TestOptimizationFlakyTestsManagementPoliciesTypeSerializer - extends StdSerializer { - public TestOptimizationFlakyTestsManagementPoliciesTypeSerializer( - Class t) { - super(t); - } - - public TestOptimizationFlakyTestsManagementPoliciesTypeSerializer() { - this(null); - } - - @Override - public void serialize( - TestOptimizationFlakyTestsManagementPoliciesType value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static TestOptimizationFlakyTestsManagementPoliciesType fromValue(String value) { - return new TestOptimizationFlakyTestsManagementPoliciesType(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.java deleted file mode 100644 index e9642147c79..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. - * This product includes software developed at Datadog (https://www.datadoghq.com/). - * Copyright 2019-Present Datadog, Inc. - */ - -package com.datadog.api.client.v2.model; - -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; - -/** - * Attributes for updating Flaky Tests Management policies. Only provided policy blocks are updated; - * omitted blocks are left unchanged. - */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.JSON_PROPERTY_ATTEMPT_TO_FIX, - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.JSON_PROPERTY_DISABLED, - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.JSON_PROPERTY_QUARANTINED, - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.JSON_PROPERTY_REPOSITORY_ID -}) -@jakarta.annotation.Generated( - value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes { - @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_ATTEMPT_TO_FIX = "attempt_to_fix"; - private TestOptimizationFlakyTestsManagementPoliciesAttemptToFix attemptToFix; - - public static final String JSON_PROPERTY_DISABLED = "disabled"; - private TestOptimizationFlakyTestsManagementPoliciesDisabled disabled; - - public static final String JSON_PROPERTY_QUARANTINED = "quarantined"; - private TestOptimizationFlakyTestsManagementPoliciesQuarantined quarantined; - - public static final String JSON_PROPERTY_REPOSITORY_ID = "repository_id"; - private String repositoryId; - - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes() {} - - @JsonCreator - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes( - @JsonProperty(required = true, value = JSON_PROPERTY_REPOSITORY_ID) String repositoryId) { - this.repositoryId = repositoryId; - } - - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes attemptToFix( - TestOptimizationFlakyTestsManagementPoliciesAttemptToFix attemptToFix) { - this.attemptToFix = attemptToFix; - this.unparsed |= attemptToFix.unparsed; - return this; - } - - /** - * Configuration for the attempt-to-fix Flaky Tests Management policy. - * - * @return attemptToFix - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_ATTEMPT_TO_FIX) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesAttemptToFix getAttemptToFix() { - return attemptToFix; - } - - public void setAttemptToFix( - TestOptimizationFlakyTestsManagementPoliciesAttemptToFix attemptToFix) { - this.attemptToFix = attemptToFix; - } - - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes disabled( - TestOptimizationFlakyTestsManagementPoliciesDisabled disabled) { - this.disabled = disabled; - this.unparsed |= disabled.unparsed; - return this; - } - - /** - * Configuration for the disabled Flaky Tests Management policy. - * - * @return disabled - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_DISABLED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesDisabled getDisabled() { - return disabled; - } - - public void setDisabled(TestOptimizationFlakyTestsManagementPoliciesDisabled disabled) { - this.disabled = disabled; - } - - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes quarantined( - TestOptimizationFlakyTestsManagementPoliciesQuarantined quarantined) { - this.quarantined = quarantined; - this.unparsed |= quarantined.unparsed; - return this; - } - - /** - * Configuration for the quarantined Flaky Tests Management policy. - * - * @return quarantined - */ - @jakarta.annotation.Nullable - @JsonProperty(JSON_PROPERTY_QUARANTINED) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesQuarantined getQuarantined() { - return quarantined; - } - - public void setQuarantined(TestOptimizationFlakyTestsManagementPoliciesQuarantined quarantined) { - this.quarantined = quarantined; - } - - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes repositoryId( - String repositoryId) { - this.repositoryId = repositoryId; - return this; - } - - /** - * The repository identifier. - * - * @return repositoryId - */ - @JsonProperty(JSON_PROPERTY_REPOSITORY_ID) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRepositoryId() { - return repositoryId; - } - - public void setRepositoryId(String repositoryId) { - this.repositoryId = repositoryId; - } - - /** - * 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 TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes - */ - @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes 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 TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes object - * is equal to o. - */ - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes - testOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes = - (TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes) o; - return Objects.equals( - this.attemptToFix, - testOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.attemptToFix) - && Objects.equals( - this.disabled, - testOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.disabled) - && Objects.equals( - this.quarantined, - testOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.quarantined) - && Objects.equals( - this.repositoryId, - testOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes.repositoryId) - && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes - .additionalProperties); - } - - @Override - public int hashCode() { - return Objects.hash(attemptToFix, disabled, quarantined, repositoryId, additionalProperties); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesUpdateRequestAttributes {\n"); - sb.append(" attemptToFix: ").append(toIndentedString(attemptToFix)).append("\n"); - sb.append(" disabled: ").append(toIndentedString(disabled)).append("\n"); - sb.append(" quarantined: ").append(toIndentedString(quarantined)).append("\n"); - sb.append(" repositoryId: ").append(toIndentedString(repositoryId)).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/TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType.java deleted file mode 100644 index 5edbf8f0ef4..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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; - -/** - * JSON:API type for get Flaky Tests Management policies request. The value must always be - * test_optimization_get_flaky_tests_management_policies_request. - */ -@JsonSerialize( - using = - TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType - .TestOptimizationGetFlakyTestsManagementPoliciesRequestDataTypeSerializer.class) -public class TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType - extends ModelEnum { - - private static final Set allowedValues = - new HashSet( - Arrays.asList("test_optimization_get_flaky_tests_management_policies_request")); - - public static final TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType - TEST_OPTIMIZATION_GET_FLAKY_TESTS_MANAGEMENT_POLICIES_REQUEST = - new TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType( - "test_optimization_get_flaky_tests_management_policies_request"); - - TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType(String value) { - super(value, allowedValues); - } - - public static class TestOptimizationGetFlakyTestsManagementPoliciesRequestDataTypeSerializer - extends StdSerializer { - public TestOptimizationGetFlakyTestsManagementPoliciesRequestDataTypeSerializer( - Class t) { - super(t); - } - - public TestOptimizationGetFlakyTestsManagementPoliciesRequestDataTypeSerializer() { - this(null); - } - - @Override - public void serialize( - TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType fromValue( - String value) { - return new TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType.java b/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType.java deleted file mode 100644 index be9ee7c1898..00000000000 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType.java +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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; - -/** - * JSON:API type for update Flaky Tests Management policies request. The value must always be - * test_optimization_update_flaky_tests_management_policies_request. - */ -@JsonSerialize( - using = - TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType - .TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataTypeSerializer.class) -public class TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType - extends ModelEnum { - - private static final Set allowedValues = - new HashSet( - Arrays.asList("test_optimization_update_flaky_tests_management_policies_request")); - - public static final TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType - TEST_OPTIMIZATION_UPDATE_FLAKY_TESTS_MANAGEMENT_POLICIES_REQUEST = - new TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType( - "test_optimization_update_flaky_tests_management_policies_request"); - - TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType(String value) { - super(value, allowedValues); - } - - public static class TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataTypeSerializer - extends StdSerializer { - public TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataTypeSerializer( - Class t) { - super(t); - } - - public TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataTypeSerializer() { - this(null); - } - - @Override - public void serialize( - TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType value, - JsonGenerator jgen, - SerializerProvider provider) - throws IOException, JsonProcessingException { - jgen.writeObject(value.value); - } - } - - @JsonCreator - public static TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType fromValue( - String value) { - return new TestOptimizationUpdateFlakyTestsManagementPoliciesRequestDataType(value); - } -} diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java new file mode 100644 index 00000000000..26d635731a9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerAttributes.java @@ -0,0 +1,183 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** The trigger definition for starting an investigation. */ +@JsonPropertyOrder({ + TriggerAttributes.JSON_PROPERTY_MONITOR_ALERT_TRIGGER, + TriggerAttributes.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MONITOR_ALERT_TRIGGER = "monitor_alert_trigger"; + private MonitorAlertTriggerAttributes monitorAlertTrigger; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TriggerType type; + + public TriggerAttributes() {} + + @JsonCreator + public TriggerAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_MONITOR_ALERT_TRIGGER) + MonitorAlertTriggerAttributes monitorAlertTrigger, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) TriggerType type) { + this.monitorAlertTrigger = monitorAlertTrigger; + this.unparsed |= monitorAlertTrigger.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TriggerAttributes monitorAlertTrigger(MonitorAlertTriggerAttributes monitorAlertTrigger) { + this.monitorAlertTrigger = monitorAlertTrigger; + this.unparsed |= monitorAlertTrigger.unparsed; + return this; + } + + /** + * Attributes for a monitor alert trigger. + * + * @return monitorAlertTrigger + */ + @JsonProperty(JSON_PROPERTY_MONITOR_ALERT_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public MonitorAlertTriggerAttributes getMonitorAlertTrigger() { + return monitorAlertTrigger; + } + + public void setMonitorAlertTrigger(MonitorAlertTriggerAttributes monitorAlertTrigger) { + this.monitorAlertTrigger = monitorAlertTrigger; + } + + public TriggerAttributes type(TriggerType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The type of trigger for the investigation. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerType getType() { + return type; + } + + public void setType(TriggerType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TriggerAttributes + */ + @JsonAnySetter + public TriggerAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TriggerAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerAttributes triggerAttributes = (TriggerAttributes) o; + return Objects.equals(this.monitorAlertTrigger, triggerAttributes.monitorAlertTrigger) + && Objects.equals(this.type, triggerAttributes.type) + && Objects.equals(this.additionalProperties, triggerAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(monitorAlertTrigger, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerAttributes {\n"); + sb.append(" monitorAlertTrigger: ") + .append(toIndentedString(monitorAlertTrigger)) + .append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesResponse.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequest.java similarity index 68% rename from src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesResponse.java rename to src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequest.java index 4b3956fc121..ffa584c06a3 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesResponse.java +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequest.java @@ -8,6 +8,7 @@ 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; @@ -16,35 +17,43 @@ import java.util.Map; import java.util.Objects; -/** Response object containing Flaky Tests Management policies for a repository. */ -@JsonPropertyOrder({TestOptimizationFlakyTestsManagementPoliciesResponse.JSON_PROPERTY_DATA}) +/** Request to trigger a new investigation. */ +@JsonPropertyOrder({TriggerInvestigationRequest.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesResponse { +public class TriggerInvestigationRequest { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private TestOptimizationFlakyTestsManagementPoliciesData data; + private TriggerInvestigationRequestData data; - public TestOptimizationFlakyTestsManagementPoliciesResponse data( - TestOptimizationFlakyTestsManagementPoliciesData data) { + public TriggerInvestigationRequest() {} + + @JsonCreator + public TriggerInvestigationRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) + TriggerInvestigationRequestData data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public TriggerInvestigationRequest data(TriggerInvestigationRequestData data) { this.data = data; this.unparsed |= data.unparsed; return this; } /** - * Data object for Flaky Tests Management policies response. + * Data for the trigger investigation request. * * @return data */ - @jakarta.annotation.Nullable @JsonProperty(JSON_PROPERTY_DATA) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TestOptimizationFlakyTestsManagementPoliciesData getData() { + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerInvestigationRequestData getData() { return data; } - public void setData(TestOptimizationFlakyTestsManagementPoliciesData data) { + public void setData(TriggerInvestigationRequestData data) { this.data = data; } @@ -60,11 +69,10 @@ public void setData(TestOptimizationFlakyTestsManagementPoliciesData data) { * * @param key The arbitrary key to set * @param value The associated value - * @return TestOptimizationFlakyTestsManagementPoliciesResponse + * @return TriggerInvestigationRequest */ @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesResponse putAdditionalProperty( - String key, Object value) { + public TriggerInvestigationRequest putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -95,9 +103,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** - * Return true if this TestOptimizationFlakyTestsManagementPoliciesResponse object is equal to o. - */ + /** Return true if this TriggerInvestigationRequest object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -106,13 +112,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TestOptimizationFlakyTestsManagementPoliciesResponse - testOptimizationFlakyTestsManagementPoliciesResponse = - (TestOptimizationFlakyTestsManagementPoliciesResponse) o; - return Objects.equals(this.data, testOptimizationFlakyTestsManagementPoliciesResponse.data) + TriggerInvestigationRequest triggerInvestigationRequest = (TriggerInvestigationRequest) o; + return Objects.equals(this.data, triggerInvestigationRequest.data) && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesResponse.additionalProperties); + this.additionalProperties, triggerInvestigationRequest.additionalProperties); } @Override @@ -123,7 +126,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesResponse {\n"); + sb.append("class TriggerInvestigationRequest {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesGetRequestData.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestData.java similarity index 61% rename from src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesGetRequestData.java rename to src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestData.java index b50cd2e6be6..37047aa49e8 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesGetRequestData.java +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestData.java @@ -17,78 +17,75 @@ import java.util.Map; import java.util.Objects; -/** Data object for get Flaky Tests Management policies request. */ +/** Data for the trigger investigation request. */ @JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesGetRequestData.JSON_PROPERTY_ATTRIBUTES, - TestOptimizationFlakyTestsManagementPoliciesGetRequestData.JSON_PROPERTY_TYPE + TriggerInvestigationRequestData.JSON_PROPERTY_ATTRIBUTES, + TriggerInvestigationRequestData.JSON_PROPERTY_TYPE }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesGetRequestData { +public class TriggerInvestigationRequestData { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; - private TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes attributes; + private TriggerInvestigationRequestDataAttributes attributes; public static final String JSON_PROPERTY_TYPE = "type"; - private TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType type; + private TriggerInvestigationRequestType type; - public TestOptimizationFlakyTestsManagementPoliciesGetRequestData() {} + public TriggerInvestigationRequestData() {} @JsonCreator - public TestOptimizationFlakyTestsManagementPoliciesGetRequestData( + public TriggerInvestigationRequestData( @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) - TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes attributes, + TriggerInvestigationRequestDataAttributes attributes, @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) - TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType type) { + TriggerInvestigationRequestType type) { this.attributes = attributes; this.unparsed |= attributes.unparsed; this.type = type; this.unparsed |= !type.isValid(); } - public TestOptimizationFlakyTestsManagementPoliciesGetRequestData attributes( - TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes attributes) { + public TriggerInvestigationRequestData attributes( + TriggerInvestigationRequestDataAttributes attributes) { this.attributes = attributes; this.unparsed |= attributes.unparsed; return this; } /** - * Attributes for requesting Flaky Tests Management policies. + * Attributes for the trigger investigation request. * * @return attributes */ @JsonProperty(JSON_PROPERTY_ATTRIBUTES) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes getAttributes() { + public TriggerInvestigationRequestDataAttributes getAttributes() { return attributes; } - public void setAttributes( - TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes attributes) { + public void setAttributes(TriggerInvestigationRequestDataAttributes attributes) { this.attributes = attributes; } - public TestOptimizationFlakyTestsManagementPoliciesGetRequestData type( - TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType type) { + public TriggerInvestigationRequestData type(TriggerInvestigationRequestType type) { this.type = type; this.unparsed |= !type.isValid(); return this; } /** - * JSON:API type for get Flaky Tests Management policies request. The value must always be - * test_optimization_get_flaky_tests_management_policies_request. + * The resource type for trigger investigation requests. * * @return type */ @JsonProperty(JSON_PROPERTY_TYPE) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType getType() { + public TriggerInvestigationRequestType getType() { return type; } - public void setType(TestOptimizationGetFlakyTestsManagementPoliciesRequestDataType type) { + public void setType(TriggerInvestigationRequestType type) { if (!type.isValid()) { this.unparsed = true; } @@ -107,11 +104,10 @@ public void setType(TestOptimizationGetFlakyTestsManagementPoliciesRequestDataTy * * @param key The arbitrary key to set * @param value The associated value - * @return TestOptimizationFlakyTestsManagementPoliciesGetRequestData + * @return TriggerInvestigationRequestData */ @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesGetRequestData putAdditionalProperty( - String key, Object value) { + public TriggerInvestigationRequestData putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -142,10 +138,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** - * Return true if this TestOptimizationFlakyTestsManagementPoliciesGetRequestData object is equal - * to o. - */ + /** Return true if this TriggerInvestigationRequestData object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -154,16 +147,12 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TestOptimizationFlakyTestsManagementPoliciesGetRequestData - testOptimizationFlakyTestsManagementPoliciesGetRequestData = - (TestOptimizationFlakyTestsManagementPoliciesGetRequestData) o; - return Objects.equals( - this.attributes, testOptimizationFlakyTestsManagementPoliciesGetRequestData.attributes) - && Objects.equals( - this.type, testOptimizationFlakyTestsManagementPoliciesGetRequestData.type) + TriggerInvestigationRequestData triggerInvestigationRequestData = + (TriggerInvestigationRequestData) o; + return Objects.equals(this.attributes, triggerInvestigationRequestData.attributes) + && Objects.equals(this.type, triggerInvestigationRequestData.type) && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesGetRequestData.additionalProperties); + this.additionalProperties, triggerInvestigationRequestData.additionalProperties); } @Override @@ -174,7 +163,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesGetRequestData {\n"); + sb.append("class TriggerInvestigationRequestData {\n"); sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" additionalProperties: ") diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestDataAttributes.java new file mode 100644 index 00000000000..8916a0aa9cd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestDataAttributes.java @@ -0,0 +1,148 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Attributes for the trigger investigation request. */ +@JsonPropertyOrder({TriggerInvestigationRequestDataAttributes.JSON_PROPERTY_TRIGGER}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerInvestigationRequestDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TRIGGER = "trigger"; + private TriggerAttributes trigger; + + public TriggerInvestigationRequestDataAttributes() {} + + @JsonCreator + public TriggerInvestigationRequestDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_TRIGGER) TriggerAttributes trigger) { + this.trigger = trigger; + this.unparsed |= trigger.unparsed; + } + + public TriggerInvestigationRequestDataAttributes trigger(TriggerAttributes trigger) { + this.trigger = trigger; + this.unparsed |= trigger.unparsed; + return this; + } + + /** + * The trigger definition for starting an investigation. + * + * @return trigger + */ + @JsonProperty(JSON_PROPERTY_TRIGGER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerAttributes getTrigger() { + return trigger; + } + + public void setTrigger(TriggerAttributes trigger) { + this.trigger = trigger; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TriggerInvestigationRequestDataAttributes + */ + @JsonAnySetter + public TriggerInvestigationRequestDataAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TriggerInvestigationRequestDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerInvestigationRequestDataAttributes triggerInvestigationRequestDataAttributes = + (TriggerInvestigationRequestDataAttributes) o; + return Objects.equals(this.trigger, triggerInvestigationRequestDataAttributes.trigger) + && Objects.equals( + this.additionalProperties, + triggerInvestigationRequestDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(trigger, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerInvestigationRequestDataAttributes {\n"); + sb.append(" trigger: ").append(toIndentedString(trigger)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestType.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestType.java new file mode 100644 index 00000000000..2ed674d9139 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationRequestType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type for trigger investigation requests. */ +@JsonSerialize( + using = TriggerInvestigationRequestType.TriggerInvestigationRequestTypeSerializer.class) +public class TriggerInvestigationRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("trigger_investigation_request")); + + public static final TriggerInvestigationRequestType TRIGGER_INVESTIGATION_REQUEST = + new TriggerInvestigationRequestType("trigger_investigation_request"); + + TriggerInvestigationRequestType(String value) { + super(value, allowedValues); + } + + public static class TriggerInvestigationRequestTypeSerializer + extends StdSerializer { + public TriggerInvestigationRequestTypeSerializer(Class t) { + super(t); + } + + public TriggerInvestigationRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TriggerInvestigationRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TriggerInvestigationRequestType fromValue(String value) { + return new TriggerInvestigationRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesGetRequest.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponse.java similarity index 67% rename from src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesGetRequest.java rename to src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponse.java index 423353b2e2f..5d3de60086d 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesGetRequest.java +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponse.java @@ -17,44 +17,43 @@ import java.util.Map; import java.util.Objects; -/** Request object for getting Flaky Tests Management policies. */ -@JsonPropertyOrder({TestOptimizationFlakyTestsManagementPoliciesGetRequest.JSON_PROPERTY_DATA}) +/** Response after triggering an investigation. */ +@JsonPropertyOrder({TriggerInvestigationResponse.JSON_PROPERTY_DATA}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesGetRequest { +public class TriggerInvestigationResponse { @JsonIgnore public boolean unparsed = false; public static final String JSON_PROPERTY_DATA = "data"; - private TestOptimizationFlakyTestsManagementPoliciesGetRequestData data; + private TriggerInvestigationResponseData data; - public TestOptimizationFlakyTestsManagementPoliciesGetRequest() {} + public TriggerInvestigationResponse() {} @JsonCreator - public TestOptimizationFlakyTestsManagementPoliciesGetRequest( + public TriggerInvestigationResponse( @JsonProperty(required = true, value = JSON_PROPERTY_DATA) - TestOptimizationFlakyTestsManagementPoliciesGetRequestData data) { + TriggerInvestigationResponseData data) { this.data = data; this.unparsed |= data.unparsed; } - public TestOptimizationFlakyTestsManagementPoliciesGetRequest data( - TestOptimizationFlakyTestsManagementPoliciesGetRequestData data) { + public TriggerInvestigationResponse data(TriggerInvestigationResponseData data) { this.data = data; this.unparsed |= data.unparsed; return this; } /** - * Data object for get Flaky Tests Management policies request. + * Data for the trigger investigation response. * * @return data */ @JsonProperty(JSON_PROPERTY_DATA) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public TestOptimizationFlakyTestsManagementPoliciesGetRequestData getData() { + public TriggerInvestigationResponseData getData() { return data; } - public void setData(TestOptimizationFlakyTestsManagementPoliciesGetRequestData data) { + public void setData(TriggerInvestigationResponseData data) { this.data = data; } @@ -70,11 +69,10 @@ public void setData(TestOptimizationFlakyTestsManagementPoliciesGetRequestData d * * @param key The arbitrary key to set * @param value The associated value - * @return TestOptimizationFlakyTestsManagementPoliciesGetRequest + * @return TriggerInvestigationResponse */ @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesGetRequest putAdditionalProperty( - String key, Object value) { + public TriggerInvestigationResponse putAdditionalProperty(String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); } @@ -105,10 +103,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** - * Return true if this TestOptimizationFlakyTestsManagementPoliciesGetRequest object is equal to - * o. - */ + /** Return true if this TriggerInvestigationResponse object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -117,13 +112,10 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TestOptimizationFlakyTestsManagementPoliciesGetRequest - testOptimizationFlakyTestsManagementPoliciesGetRequest = - (TestOptimizationFlakyTestsManagementPoliciesGetRequest) o; - return Objects.equals(this.data, testOptimizationFlakyTestsManagementPoliciesGetRequest.data) + TriggerInvestigationResponse triggerInvestigationResponse = (TriggerInvestigationResponse) o; + return Objects.equals(this.data, triggerInvestigationResponse.data) && Objects.equals( - this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesGetRequest.additionalProperties); + this.additionalProperties, triggerInvestigationResponse.additionalProperties); } @Override @@ -134,7 +126,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesGetRequest {\n"); + sb.append("class TriggerInvestigationResponse {\n"); sb.append(" data: ").append(toIndentedString(data)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseData.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseData.java new file mode 100644 index 00000000000..6b5ca0ef6a4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseData.java @@ -0,0 +1,213 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Data for the trigger investigation response. */ +@JsonPropertyOrder({ + TriggerInvestigationResponseData.JSON_PROPERTY_ATTRIBUTES, + TriggerInvestigationResponseData.JSON_PROPERTY_ID, + TriggerInvestigationResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class TriggerInvestigationResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private TriggerInvestigationResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private TriggerInvestigationResponseType type; + + public TriggerInvestigationResponseData() {} + + @JsonCreator + public TriggerInvestigationResponseData( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + TriggerInvestigationResponseDataAttributes attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_ID) String id, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + TriggerInvestigationResponseType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.id = id; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public TriggerInvestigationResponseData attributes( + TriggerInvestigationResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Attributes for the trigger investigation response. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerInvestigationResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(TriggerInvestigationResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public TriggerInvestigationResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the trigger response. + * + * @return id + */ + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public TriggerInvestigationResponseData type(TriggerInvestigationResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * The resource type for trigger investigation responses. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public TriggerInvestigationResponseType getType() { + return type; + } + + public void setType(TriggerInvestigationResponseType type) { + if (!type.isValid()) { + this.unparsed = true; + } + this.type = type; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return TriggerInvestigationResponseData + */ + @JsonAnySetter + public TriggerInvestigationResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this TriggerInvestigationResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TriggerInvestigationResponseData triggerInvestigationResponseData = + (TriggerInvestigationResponseData) o; + return Objects.equals(this.attributes, triggerInvestigationResponseData.attributes) + && Objects.equals(this.id, triggerInvestigationResponseData.id) + && Objects.equals(this.type, triggerInvestigationResponseData.type) + && Objects.equals( + this.additionalProperties, triggerInvestigationResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TriggerInvestigationResponseData {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseDataAttributes.java similarity index 60% rename from src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes.java rename to src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseDataAttributes.java index c28c2481953..1503fd60036 100644 --- a/src/main/java/com/datadog/api/client/v2/model/TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseDataAttributes.java @@ -17,44 +17,42 @@ import java.util.Map; import java.util.Objects; -/** Attributes for requesting Flaky Tests Management policies. */ -@JsonPropertyOrder({ - TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes.JSON_PROPERTY_REPOSITORY_ID -}) +/** Attributes for the trigger investigation response. */ +@JsonPropertyOrder({TriggerInvestigationResponseDataAttributes.JSON_PROPERTY_INVESTIGATION_ID}) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") -public class TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes { +public class TriggerInvestigationResponseDataAttributes { @JsonIgnore public boolean unparsed = false; - public static final String JSON_PROPERTY_REPOSITORY_ID = "repository_id"; - private String repositoryId; + public static final String JSON_PROPERTY_INVESTIGATION_ID = "investigation_id"; + private String investigationId; - public TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes() {} + public TriggerInvestigationResponseDataAttributes() {} @JsonCreator - public TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes( - @JsonProperty(required = true, value = JSON_PROPERTY_REPOSITORY_ID) String repositoryId) { - this.repositoryId = repositoryId; + public TriggerInvestigationResponseDataAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_INVESTIGATION_ID) + String investigationId) { + this.investigationId = investigationId; } - public TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes repositoryId( - String repositoryId) { - this.repositoryId = repositoryId; + public TriggerInvestigationResponseDataAttributes investigationId(String investigationId) { + this.investigationId = investigationId; return this; } /** - * The repository identifier. + * The ID of the investigation that was created. * - * @return repositoryId + * @return investigationId */ - @JsonProperty(JSON_PROPERTY_REPOSITORY_ID) + @JsonProperty(JSON_PROPERTY_INVESTIGATION_ID) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRepositoryId() { - return repositoryId; + public String getInvestigationId() { + return investigationId; } - public void setRepositoryId(String repositoryId) { - this.repositoryId = repositoryId; + public void setInvestigationId(String investigationId) { + this.investigationId = investigationId; } /** @@ -69,10 +67,10 @@ public void setRepositoryId(String repositoryId) { * * @param key The arbitrary key to set * @param value The associated value - * @return TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes + * @return TriggerInvestigationResponseDataAttributes */ @JsonAnySetter - public TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes putAdditionalProperty( + public TriggerInvestigationResponseDataAttributes putAdditionalProperty( String key, Object value) { if (this.additionalProperties == null) { this.additionalProperties = new HashMap(); @@ -104,10 +102,7 @@ public Object getAdditionalProperty(String key) { return this.additionalProperties.get(key); } - /** - * Return true if this TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes object is - * equal to o. - */ + /** Return true if this TriggerInvestigationResponseDataAttributes object is equal to o. */ @Override public boolean equals(Object o) { if (this == o) { @@ -116,27 +111,25 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes - testOptimizationFlakyTestsManagementPoliciesGetRequestAttributes = - (TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes) o; + TriggerInvestigationResponseDataAttributes triggerInvestigationResponseDataAttributes = + (TriggerInvestigationResponseDataAttributes) o; return Objects.equals( - this.repositoryId, - testOptimizationFlakyTestsManagementPoliciesGetRequestAttributes.repositoryId) + this.investigationId, triggerInvestigationResponseDataAttributes.investigationId) && Objects.equals( this.additionalProperties, - testOptimizationFlakyTestsManagementPoliciesGetRequestAttributes.additionalProperties); + triggerInvestigationResponseDataAttributes.additionalProperties); } @Override public int hashCode() { - return Objects.hash(repositoryId, additionalProperties); + return Objects.hash(investigationId, additionalProperties); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class TestOptimizationFlakyTestsManagementPoliciesGetRequestAttributes {\n"); - sb.append(" repositoryId: ").append(toIndentedString(repositoryId)).append("\n"); + sb.append("class TriggerInvestigationResponseDataAttributes {\n"); + sb.append(" investigationId: ").append(toIndentedString(investigationId)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseType.java b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseType.java new file mode 100644 index 00000000000..d373b11c2be --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerInvestigationResponseType.java @@ -0,0 +1,58 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The resource type for trigger investigation responses. */ +@JsonSerialize( + using = TriggerInvestigationResponseType.TriggerInvestigationResponseTypeSerializer.class) +public class TriggerInvestigationResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("trigger_investigation_response")); + + public static final TriggerInvestigationResponseType TRIGGER_INVESTIGATION_RESPONSE = + new TriggerInvestigationResponseType("trigger_investigation_response"); + + TriggerInvestigationResponseType(String value) { + super(value, allowedValues); + } + + public static class TriggerInvestigationResponseTypeSerializer + extends StdSerializer { + public TriggerInvestigationResponseTypeSerializer(Class t) { + super(t); + } + + public TriggerInvestigationResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + TriggerInvestigationResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TriggerInvestigationResponseType fromValue(String value) { + return new TriggerInvestigationResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/TriggerType.java b/src/main/java/com/datadog/api/client/v2/model/TriggerType.java new file mode 100644 index 00000000000..ad95927b728 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/TriggerType.java @@ -0,0 +1,54 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** The type of trigger for the investigation. */ +@JsonSerialize(using = TriggerType.TriggerTypeSerializer.class) +public class TriggerType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("monitor_alert_trigger")); + + public static final TriggerType MONITOR_ALERT_TRIGGER = new TriggerType("monitor_alert_trigger"); + + TriggerType(String value) { + super(value, allowedValues); + } + + public static class TriggerTypeSerializer extends StdSerializer { + public TriggerTypeSerializer(Class t) { + super(t); + } + + public TriggerTypeSerializer() { + this(null); + } + + @Override + public void serialize(TriggerType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static TriggerType fromValue(String value) { + return new TriggerType(value); + } +} diff --git a/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature b/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature new file mode 100644 index 00000000000..bc5ec941d8f --- /dev/null +++ b/src/test/resources/com/datadog/api/client/v2/api/bits_ai.feature @@ -0,0 +1,69 @@ +@endpoint(bits-ai) @endpoint(bits-ai-v2) +Feature: Bits AI + Use the Bits AI endpoints to retrieve AI-powered investigations. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "BitsAI" API + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI investigation returns "Bad Request" response + Given operation "GetInvestigation" enabled + And new "GetInvestigation" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI investigation returns "Not Found" response + Given operation "GetInvestigation" enabled + And new "GetInvestigation" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/bits-ai + Scenario: Get a Bits AI investigation returns "OK" response + Given operation "GetInvestigation" enabled + And new "GetInvestigation" request + And request contains "id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bits-ai + Scenario: List Bits AI investigations returns "Bad Request" response + Given operation "ListInvestigations" enabled + And new "ListInvestigations" request + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bits-ai + Scenario: List Bits AI investigations returns "OK" response + Given operation "ListInvestigations" enabled + And new "ListInvestigations" request + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bits-ai @with-pagination + Scenario: List Bits AI investigations returns "OK" response with pagination + Given operation "ListInvestigations" enabled + And new "ListInvestigations" request + When the request with pagination is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/bits-ai + Scenario: Trigger a Bits AI investigation returns "Bad Request" response + Given operation "TriggerInvestigation" enabled + And new "TriggerInvestigation" request + And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/bits-ai + Scenario: Trigger a Bits AI investigation returns "OK" response + Given operation "TriggerInvestigation" enabled + And new "TriggerInvestigation" request + And body with value {"data": {"attributes": {"trigger": {"monitor_alert_trigger": {"event_id": "1234567890123456789", "event_ts": 1700000000000, "monitor_id": 12345678}, "type": "monitor_alert_trigger"}}, "type": "trigger_investigation_request"}} + When the request is sent + Then the response status is 200 OK diff --git a/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature b/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature index eeeec1dd340..427db05baf4 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/test_optimization.feature @@ -33,38 +33,6 @@ Feature: Test Optimization When the request is sent Then the response status is 404 Not Found - @generated @skip @team:DataDog/ci-app-backend - Scenario: Get Flaky Tests Management policies returns "Bad Request" response - Given operation "GetFlakyTestsManagementPolicies" enabled - And new "GetFlakyTestsManagementPolicies" request - And body with value {"data": {"attributes": {"repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_get_flaky_tests_management_policies_request"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/ci-app-backend - Scenario: Get Flaky Tests Management policies returns "Not Found" response - Given operation "GetFlakyTestsManagementPolicies" enabled - And new "GetFlakyTestsManagementPolicies" request - And body with value {"data": {"attributes": {"repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_get_flaky_tests_management_policies_request"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/ci-app-backend - Scenario: Get Flaky Tests Management policies returns "OK" response - Given operation "GetFlakyTestsManagementPolicies" enabled - And new "GetFlakyTestsManagementPolicies" request - And body with value {"data": {"attributes": {"repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_get_flaky_tests_management_policies_request"}} - When the request is sent - Then the response status is 200 OK - - @skip @team:DataDog/ci-app-backend - Scenario: Get Flaky Tests Management policies with empty repository_id returns bad request - Given operation "GetFlakyTestsManagementPolicies" enabled - And new "GetFlakyTestsManagementPolicies" request - And body with value {"data": {"attributes": {"repository_id": ""}, "type": "test_optimization_get_flaky_tests_management_policies_request"}} - When the request is sent - Then the response status is 400 Bad Request - @generated @skip @team:DataDog/ci-app-backend Scenario: Get Test Optimization service settings returns "Bad Request" response Given operation "GetTestOptimizationServiceSettings" enabled @@ -165,38 +133,6 @@ Feature: Test Optimization When the request with pagination is sent Then the response status is 200 OK - @generated @skip @team:DataDog/ci-app-backend - Scenario: Update Flaky Tests Management policies returns "Bad Request" response - Given operation "UpdateFlakyTestsManagementPolicies" enabled - And new "UpdateFlakyTestsManagementPolicies" request - And body with value {"data": {"attributes": {"attempt_to_fix": {"retries": 3}, "disabled": {"auto_disable_rule": {"enabled": false, "status": "active", "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": false, "failure_rate_rule": {"branches": [], "enabled": false, "min_runs": 10, "status": "active", "threshold": 0.5}}, "quarantined": {"auto_quarantine_rule": {"enabled": true, "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": true, "failure_rate_rule": {"branches": ["main"], "enabled": true, "min_runs": 10, "threshold": 0.5}}, "repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_update_flaky_tests_management_policies_request"}} - When the request is sent - Then the response status is 400 Bad Request - - @generated @skip @team:DataDog/ci-app-backend - Scenario: Update Flaky Tests Management policies returns "Not Found" response - Given operation "UpdateFlakyTestsManagementPolicies" enabled - And new "UpdateFlakyTestsManagementPolicies" request - And body with value {"data": {"attributes": {"attempt_to_fix": {"retries": 3}, "disabled": {"auto_disable_rule": {"enabled": false, "status": "active", "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": false, "failure_rate_rule": {"branches": [], "enabled": false, "min_runs": 10, "status": "active", "threshold": 0.5}}, "quarantined": {"auto_quarantine_rule": {"enabled": true, "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": true, "failure_rate_rule": {"branches": ["main"], "enabled": true, "min_runs": 10, "threshold": 0.5}}, "repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_update_flaky_tests_management_policies_request"}} - When the request is sent - Then the response status is 404 Not Found - - @generated @skip @team:DataDog/ci-app-backend - Scenario: Update Flaky Tests Management policies returns "OK" response - Given operation "UpdateFlakyTestsManagementPolicies" enabled - And new "UpdateFlakyTestsManagementPolicies" request - And body with value {"data": {"attributes": {"attempt_to_fix": {"retries": 3}, "disabled": {"auto_disable_rule": {"enabled": false, "status": "active", "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": false, "failure_rate_rule": {"branches": [], "enabled": false, "min_runs": 10, "status": "active", "threshold": 0.5}}, "quarantined": {"auto_quarantine_rule": {"enabled": true, "window_seconds": 3600}, "branch_rule": {"branches": ["main"], "enabled": true, "excluded_branches": [], "excluded_test_services": []}, "enabled": true, "failure_rate_rule": {"branches": ["main"], "enabled": true, "min_runs": 10, "threshold": 0.5}}, "repository_id": "github.com/datadog/shopist"}, "type": "test_optimization_update_flaky_tests_management_policies_request"}} - When the request is sent - Then the response status is 200 OK - - @skip @team:DataDog/ci-app-backend - Scenario: Update Flaky Tests Management policies with empty repository_id returns bad request - Given operation "UpdateFlakyTestsManagementPolicies" enabled - And new "UpdateFlakyTestsManagementPolicies" request - And body with value {"data": {"attributes": {"repository_id": ""}, "type": "test_optimization_update_flaky_tests_management_policies_request"}} - When the request is sent - Then the response status is 400 Bad Request - @generated @skip @team:DataDog/ci-app-backend Scenario: Update Test Optimization service settings returns "Bad Request" response Given operation "UpdateTestOptimizationServiceSettings" enabled 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 4245804e18b..db3aeec910c 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/undo.json +++ b/src/test/resources/com/datadog/api/client/v2/api/undo.json @@ -650,6 +650,24 @@ "type": "idempotent" } }, + "ListInvestigations": { + "tag": "Bits AI", + "undo": { + "type": "safe" + } + }, + "TriggerInvestigation": { + "tag": "Bits AI", + "undo": { + "type": "unsafe" + } + }, + "GetInvestigation": { + "tag": "Bits AI", + "undo": { + "type": "safe" + } + }, "SearchCases": { "tag": "Case Management", "undo": { @@ -1036,18 +1054,6 @@ "type": "safe" } }, - "UpdateFlakyTestsManagementPolicies": { - "tag": "Test Optimization", - "undo": { - "type": "unsafe" - } - }, - "GetFlakyTestsManagementPolicies": { - "tag": "Test Optimization", - "undo": { - "type": "safe" - } - }, "DeleteTestOptimizationServiceSettings": { "tag": "Test Optimization", "undo": {