From 0b11b316d4b25ab535ab518f47987906ea3d311f Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 2 Feb 2026 11:22:13 +0000 Subject: [PATCH] Regenerate client from commit 590694c of spec repo --- .generator/schemas/v1/openapi.yaml | 19 +- .generator/schemas/v2/openapi.yaml | 781 +++++++++++++++++- .../CreateSyntheticsNetworkTest.java | 81 ++ .../synthetics/DeleteSyntheticsTestsV2.java | 38 + .../synthetics/GetSyntheticsNetworkTest.java | 24 + .../UpdateSyntheticsNetworkTest.java | 110 +++ .../api/client/v2/api/SyntheticsApi.java | 568 +++++++++++++ .../v2/model/DeletedTestResponseData.java | 196 +++++ .../DeletedTestResponseDataAttributes.java | 166 ++++ .../v2/model/DeletedTestsRequestDelete.java | 207 +++++ .../DeletedTestsRequestDeleteAttributes.java | 186 +++++ .../DeletedTestsRequestDeleteRequest.java | 147 ++++ .../v2/model/DeletedTestsRequestType.java | 57 ++ .../client/v2/model/DeletedTestsResponse.java | 149 ++++ .../v2/model/DeletedTestsResponseType.java | 57 ++ .../v2/model/SyntheticsNetworkAssertion.java | 454 ++++++++++ .../SyntheticsNetworkAssertionJitter.java | 215 +++++ .../SyntheticsNetworkAssertionJitterType.java | 59 ++ .../SyntheticsNetworkAssertionLatency.java | 250 ++++++ ...SyntheticsNetworkAssertionLatencyType.java | 61 ++ ...heticsNetworkAssertionMultiNetworkHop.java | 254 ++++++ ...csNetworkAssertionMultiNetworkHopType.java | 63 ++ .../SyntheticsNetworkAssertionOperator.java | 71 ++ ...sNetworkAssertionPacketLossPercentage.java | 220 +++++ ...workAssertionPacketLossPercentageType.java | 63 ++ .../SyntheticsNetworkAssertionProperty.java | 63 ++ .../v2/model/SyntheticsNetworkTest.java | 452 ++++++++++ .../v2/model/SyntheticsNetworkTestConfig.java | 180 ++++ .../v2/model/SyntheticsNetworkTestEdit.java | 182 ++++ .../SyntheticsNetworkTestEditRequest.java | 147 ++++ .../model/SyntheticsNetworkTestRequest.java | 381 +++++++++ ...SyntheticsNetworkTestRequestTCPMethod.java | 66 ++ .../model/SyntheticsNetworkTestResponse.java | 137 +++ .../SyntheticsNetworkTestResponseData.java | 189 +++++ .../SyntheticsNetworkTestResponseType.java | 58 ++ .../model/SyntheticsNetworkTestSubType.java | 61 ++ .../v2/model/SyntheticsNetworkTestType.java | 55 ++ .../v2/model/SyntheticsTestOptions.java | 381 +++++++++ .../SyntheticsTestOptionsMonitorOptions.java | 241 ++++++ ...sMonitorOptionsNotificationPresetName.java | 85 ++ .../v2/model/SyntheticsTestOptionsRetry.java | 165 ++++ .../SyntheticsTestOptionsScheduling.java | 189 +++++ ...theticsTestOptionsSchedulingTimeframe.java | 204 +++++ .../v2/model/SyntheticsTestPauseStatus.java | 60 ++ ...twork_Path_test_returns_OK_response.freeze | 1 + ...Network_Path_test_returns_OK_response.json | 62 ++ ...twork_Path_test_returns_OK_response.freeze | 1 + ...Network_Path_test_returns_OK_response.json | 28 + .../api/client/v1/api/synthetics.feature | 16 +- .../api/client/v2/api/synthetics.feature | 77 +- .../com/datadog/api/client/v2/api/undo.json | 31 + 51 files changed, 7979 insertions(+), 29 deletions(-) create mode 100644 examples/v2/synthetics/CreateSyntheticsNetworkTest.java create mode 100644 examples/v2/synthetics/DeleteSyntheticsTestsV2.java create mode 100644 examples/v2/synthetics/GetSyntheticsNetworkTest.java create mode 100644 examples/v2/synthetics/UpdateSyntheticsNetworkTest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeletedTestResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeletedTestResponseDataAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestDelete.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestDeleteAttributes.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestDeleteRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeletedTestsResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/DeletedTestsResponseType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertion.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionJitter.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionJitterType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionLatency.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionLatencyType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionMultiNetworkHop.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionMultiNetworkHopType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionOperator.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionPacketLossPercentage.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionPacketLossPercentageType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionProperty.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestConfig.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestEdit.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestEditRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestRequest.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestRequestTCPMethod.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponse.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponseData.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponseType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestSubType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestType.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptions.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsMonitorOptions.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsMonitorOptionsNotificationPresetName.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsRetry.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsScheduling.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsSchedulingTimeframe.java create mode 100644 src/main/java/com/datadog/api/client/v2/model/SyntheticsTestPauseStatus.java create mode 100644 src/test/resources/cassettes/features/v2/Synthetics_Create_a_Network_Path_test_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Synthetics_Create_a_Network_Path_test_returns_OK_response.json create mode 100644 src/test/resources/cassettes/features/v2/Synthetics_Get_a_Network_Path_test_returns_OK_response.freeze create mode 100644 src/test/resources/cassettes/features/v2/Synthetics_Get_a_Network_Path_test_returns_OK_response.json diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index a38d274f9b8..3720113a10e 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -39463,18 +39463,21 @@ tags: name: Slack Integration - description: Take graph snapshots using the API. name: Snapshots -- description: 'Datadog Synthetic Monitoring uses simulated user requests and browser - rendering to help you ensure uptime, +- description: 'Synthetic tests allow you to observe how your systems and applications + are performing using simulated requests and actions from around the globe. - identify regional issues, and track your application performance. Synthetic tests - come in + They come in different flavors: - two different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest) + [API tests](https://docs.datadoghq.com/synthetics/api_tests/), - and [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You - can use Datadog''s API to + [browser tests](https://docs.datadoghq.com/synthetics/browser_tests), - manage both test types programmatically. + [Network Path tests](https://docs.datadoghq.com/synthetics/network_path_tests/) + and + + [Mobile Application tests](https://docs.datadoghq.com/synthetics/mobile_app_testing). + + You can use Datadog''s API to manage tests and test suites programmatically. For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/).' diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index b58b6fe70e8..9aa57cc0d36 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -19117,6 +19117,78 @@ components: $ref: '#/components/schemas/DeletedSuiteResponseData' type: array type: object + DeletedTestResponseData: + properties: + attributes: + $ref: '#/components/schemas/DeletedTestResponseDataAttributes' + id: + type: string + type: + $ref: '#/components/schemas/DeletedTestsResponseType' + type: object + DeletedTestResponseDataAttributes: + properties: + deleted_at: + description: Deletion timestamp of the Synthetic test ID. + type: string + public_id: + description: The Synthetic test ID deleted. + type: string + type: object + DeletedTestsRequestDelete: + properties: + attributes: + $ref: '#/components/schemas/DeletedTestsRequestDeleteAttributes' + id: + type: string + type: + $ref: '#/components/schemas/DeletedTestsRequestType' + required: + - attributes + type: object + DeletedTestsRequestDeleteAttributes: + properties: + force_delete_dependencies: + type: boolean + public_ids: + example: + - '' + items: + type: string + type: array + required: + - public_ids + type: object + DeletedTestsRequestDeleteRequest: + properties: + data: + $ref: '#/components/schemas/DeletedTestsRequestDelete' + required: + - data + type: object + DeletedTestsRequestType: + default: delete_tests_request + enum: + - delete_tests_request + example: delete_tests_request + type: string + x-enum-varnames: + - DELETE_TESTS_REQUEST + DeletedTestsResponse: + properties: + data: + items: + $ref: '#/components/schemas/DeletedTestResponseData' + type: array + type: object + DeletedTestsResponseType: + default: delete_tests + enum: + - delete_tests + example: delete_tests + type: string + x-enum-varnames: + - DELETE_TESTS DependencyLocation: description: Static library vulnerability location. properties: @@ -60221,6 +60293,362 @@ components: example: example-value type: string type: object + SyntheticsNetworkAssertion: + description: Object describing an assertion for a Network Path test. + oneOf: + - $ref: '#/components/schemas/SyntheticsNetworkAssertionLatency' + - $ref: '#/components/schemas/SyntheticsNetworkAssertionMultiNetworkHop' + - $ref: '#/components/schemas/SyntheticsNetworkAssertionPacketLossPercentage' + - $ref: '#/components/schemas/SyntheticsNetworkAssertionJitter' + SyntheticsNetworkAssertionJitter: + description: Jitter assertion for a Network Path test. + properties: + operator: + $ref: '#/components/schemas/SyntheticsNetworkAssertionOperator' + target: + description: Target value in milliseconds. + example: 5 + format: double + type: number + type: + $ref: '#/components/schemas/SyntheticsNetworkAssertionJitterType' + required: + - operator + - target + - type + type: object + SyntheticsNetworkAssertionJitterType: + default: jitter + description: Type of the jitter assertion. + enum: + - jitter + example: jitter + type: string + x-enum-varnames: + - JITTER + SyntheticsNetworkAssertionLatency: + description: Network latency assertion for a Network Path test. + properties: + operator: + $ref: '#/components/schemas/SyntheticsNetworkAssertionOperator' + property: + $ref: '#/components/schemas/SyntheticsNetworkAssertionProperty' + target: + description: Target value in milliseconds. + example: 500 + format: double + type: number + type: + $ref: '#/components/schemas/SyntheticsNetworkAssertionLatencyType' + required: + - operator + - property + - target + - type + type: object + SyntheticsNetworkAssertionLatencyType: + default: latency + description: Type of the latency assertion. + enum: + - latency + example: latency + type: string + x-enum-varnames: + - LATENCY + SyntheticsNetworkAssertionMultiNetworkHop: + description: Multi-network hop assertion for a Network Path test. + properties: + operator: + $ref: '#/components/schemas/SyntheticsNetworkAssertionOperator' + property: + $ref: '#/components/schemas/SyntheticsNetworkAssertionProperty' + target: + description: Target value in number of hops. + example: 3 + format: double + type: number + type: + $ref: '#/components/schemas/SyntheticsNetworkAssertionMultiNetworkHopType' + required: + - operator + - property + - target + - type + type: object + SyntheticsNetworkAssertionMultiNetworkHopType: + default: multiNetworkHop + description: Type of the multi-network hop assertion. + enum: + - multiNetworkHop + example: multiNetworkHop + type: string + x-enum-varnames: + - MULTI_NETWORK_HOP + SyntheticsNetworkAssertionOperator: + description: Assertion operator to apply. + enum: + - is + - isNot + - lessThan + - lessThanOrEqual + - moreThan + - moreThanOrEqual + example: lessThan + type: string + x-enum-varnames: + - IS + - IS_NOT + - LESS_THAN + - LESS_THAN_OR_EQUAL + - MORE_THAN + - MORE_THAN_OR_EQUAL + SyntheticsNetworkAssertionPacketLossPercentage: + description: Packet loss percentage assertion for a Network Path test. + properties: + operator: + $ref: '#/components/schemas/SyntheticsNetworkAssertionOperator' + target: + description: Target value as a percentage (0 to 1). + example: 0.05 + format: double + maximum: 1 + minimum: 0 + type: number + type: + $ref: '#/components/schemas/SyntheticsNetworkAssertionPacketLossPercentageType' + required: + - operator + - target + - type + type: object + SyntheticsNetworkAssertionPacketLossPercentageType: + default: packetLossPercentage + description: Type of the packet loss percentage assertion. + enum: + - packetLossPercentage + example: packetLossPercentage + type: string + x-enum-varnames: + - PACKET_LOSS_PERCENTAGE + SyntheticsNetworkAssertionProperty: + description: The associated assertion property. + enum: + - avg + - max + - min + example: avg + type: string + x-enum-varnames: + - AVG + - MAX + - MIN + SyntheticsNetworkTest: + description: Object containing details about a Network Path test. + properties: + config: + $ref: '#/components/schemas/SyntheticsNetworkTestConfig' + locations: + description: 'Array of locations used to run the test. Network Path tests + can be run from managed locations to test public endpoints, + + or from a [Datadog Agent](https://docs.datadoghq.com/synthetics/network_path_tests/#agent-configuration) + to test private environments.' + example: + - aws:us-east-1 + - agent:my-agent-name + items: + description: A location from which the test was run. + type: string + type: array + message: + description: Notification message associated with the test. + example: Network Path test notification + type: string + monitor_id: + description: The associated monitor ID. + example: 12345678 + format: int64 + readOnly: true + type: integer + name: + description: Name of the test. + example: Example Network Path test + type: string + options: + $ref: '#/components/schemas/SyntheticsTestOptions' + public_id: + description: The public ID for the test. + example: abc-def-123 + readOnly: true + type: string + status: + $ref: '#/components/schemas/SyntheticsTestPauseStatus' + subtype: + $ref: '#/components/schemas/SyntheticsNetworkTestSubType' + tags: + description: Array of tags attached to the test. + example: + - env:production + items: + description: A tag attached to the test. + type: string + type: array + type: + $ref: '#/components/schemas/SyntheticsNetworkTestType' + required: + - name + - config + - locations + - options + - type + - message + type: object + SyntheticsNetworkTestConfig: + description: Configuration object for a Network Path test. + properties: + assertions: + default: [] + description: Array of assertions used for the test. + example: + - operator: lessThan + property: avg + target: 500 + type: latency + items: + $ref: '#/components/schemas/SyntheticsNetworkAssertion' + type: array + request: + $ref: '#/components/schemas/SyntheticsNetworkTestRequest' + type: object + SyntheticsNetworkTestEdit: + properties: + attributes: + $ref: '#/components/schemas/SyntheticsNetworkTest' + type: + $ref: '#/components/schemas/SyntheticsNetworkTestType' + required: + - attributes + - type + type: object + SyntheticsNetworkTestEditRequest: + description: Network Path test request + properties: + data: + $ref: '#/components/schemas/SyntheticsNetworkTestEdit' + required: + - data + type: object + SyntheticsNetworkTestRequest: + description: Object describing the request for a Network Path test. + properties: + destination_service: + description: Destination service name. + type: string + e2e_queries: + description: Number of end-to-end queries. + example: 50 + format: int64 + type: integer + host: + description: Host name to query. + example: '' + type: string + max_ttl: + description: Maximum TTL for network packets. + example: 30 + format: int64 + type: integer + port: + description: 'For TCP or UDP tests, the port to use when performing the + test. + + If not set on a UDP test, a random port will be assigned, which may affect + the results.' + example: 443 + format: int64 + type: integer + source_service: + description: Source service name. + type: string + tcp_method: + $ref: '#/components/schemas/SyntheticsNetworkTestRequestTCPMethod' + timeout: + description: Timeout in seconds. + format: int64 + type: integer + traceroute_queries: + description: Number of traceroute queries. + example: 3 + format: int64 + type: integer + required: + - host + - max_ttl + - e2e_queries + - traceroute_queries + type: object + SyntheticsNetworkTestRequestTCPMethod: + description: For TCP tests, the TCP method to use. + enum: + - prefer_sack + - syn + - sack + example: prefer_sack + type: string + x-enum-varnames: + - PREFER_SACK + - SYN + - SACK + SyntheticsNetworkTestResponse: + description: Network Path test response + properties: + data: + $ref: '#/components/schemas/SyntheticsNetworkTestResponseData' + type: object + SyntheticsNetworkTestResponseData: + description: Network Path test response data + properties: + attributes: + $ref: '#/components/schemas/SyntheticsNetworkTest' + id: + description: The public ID of the Network Path test. + example: abc-def-123 + readOnly: true + type: string + type: + $ref: '#/components/schemas/SyntheticsNetworkTestResponseType' + type: object + SyntheticsNetworkTestResponseType: + default: network_test + description: Type of response, `network_test`. + enum: + - network_test + example: network_test + type: string + x-enum-varnames: + - NETWORK_TEST + SyntheticsNetworkTestSubType: + description: The subtype of the Synthetic Network Path test, `tcp`, `udp`, or + `icmp`. + enum: + - tcp + - udp + - icmp + example: tcp + type: string + x-enum-varnames: + - TCP + - UDP + - ICMP + SyntheticsNetworkTestType: + default: network + description: Type of the Synthetic test, `network`. + enum: + - network + example: network + type: string + x-enum-varnames: + - NETWORK SyntheticsRestrictedRoles: deprecated: true description: A list of role identifiers that can be pulled from the Roles API, @@ -60376,6 +60804,163 @@ components: type: string x-enum-varnames: - SUITES + SyntheticsTestOptions: + description: Object describing the extra options for a Synthetic test. + properties: + min_failure_duration: + description: Minimum amount of time in failure required to trigger an alert. + format: int64 + type: integer + min_location_failed: + description: 'Minimum number of locations in failure required to trigger + + an alert.' + format: int64 + type: integer + monitor_name: + description: The monitor name is used for the alert title as well as for + all monitor dashboard widgets and SLOs. + type: string + monitor_options: + $ref: '#/components/schemas/SyntheticsTestOptionsMonitorOptions' + monitor_priority: + description: Integer from 1 (high) to 5 (low) indicating alert severity. + format: int32 + maximum: 5 + minimum: 1 + type: integer + restricted_roles: + $ref: '#/components/schemas/SyntheticsRestrictedRoles' + retry: + $ref: '#/components/schemas/SyntheticsTestOptionsRetry' + scheduling: + $ref: '#/components/schemas/SyntheticsTestOptionsScheduling' + tick_every: + description: The frequency at which to run the Synthetic test (in seconds). + format: int64 + maximum: 604800 + minimum: 30 + type: integer + type: object + SyntheticsTestOptionsMonitorOptions: + description: 'Object containing the options for a Synthetic test as a monitor + + (for example, renotification).' + properties: + escalation_message: + description: Message to include in the escalation notification. + type: string + notification_preset_name: + $ref: '#/components/schemas/SyntheticsTestOptionsMonitorOptionsNotificationPresetName' + renotify_interval: + description: 'Time interval before renotifying if the test is still failing + + (in minutes).' + format: int64 + minimum: 0 + type: integer + renotify_occurrences: + description: The number of times to renotify if the test is still failing. + format: int64 + type: integer + type: object + SyntheticsTestOptionsMonitorOptionsNotificationPresetName: + description: The name of the preset for the notification for the monitor. + enum: + - show_all + - hide_all + - hide_query + - hide_handles + - hide_query_and_handles + - show_only_snapshot + - hide_handles_and_footer + type: string + x-enum-varnames: + - SHOW_ALL + - HIDE_ALL + - HIDE_QUERY + - HIDE_HANDLES + - HIDE_QUERY_AND_HANDLES + - SHOW_ONLY_SNAPSHOT + - HIDE_HANDLES_AND_FOOTER + SyntheticsTestOptionsRetry: + description: Object describing the retry strategy to apply to a Synthetic test. + properties: + count: + description: 'Number of times a test needs to be retried before marking + a + + location as failed. Defaults to 0.' + format: int64 + type: integer + interval: + description: 'Time interval between retries (in milliseconds). Defaults + to + + 300ms.' + format: double + type: number + type: object + SyntheticsTestOptionsScheduling: + description: Object containing timeframes and timezone used for advanced scheduling. + properties: + timeframes: + description: Array containing objects describing the scheduling pattern + to apply to each day. + example: + - day: 1 + from: 07:00 + to: '16:00' + - day: 3 + from: 07:00 + to: '16:00' + items: + $ref: '#/components/schemas/SyntheticsTestOptionsSchedulingTimeframe' + type: array + timezone: + description: Timezone in which the timeframe is based. + example: America/New_York + type: string + required: + - timeframes + - timezone + type: object + SyntheticsTestOptionsSchedulingTimeframe: + description: Object describing a timeframe. + properties: + day: + description: Number representing the day of the week. + example: 1 + format: int32 + maximum: 7 + minimum: 1 + type: integer + from: + description: The hour of the day on which scheduling starts. + example: 07:00 + type: string + to: + description: The hour of the day on which scheduling ends. + example: '16:00' + type: string + required: + - day + - from + - to + type: object + SyntheticsTestPauseStatus: + description: 'Define whether you want to start (`live`) or pause (`paused`) + a + + Synthetic test.' + enum: + - live + - paused + example: live + type: string + x-enum-varnames: + - LIVE + - PAUSED SyntheticsVariableParser: description: Details of the parser to use for the global variable. example: @@ -96465,6 +97050,178 @@ paths: operator: OR permissions: - synthetics_write + /api/v2/synthetics/tests/bulk-delete: + post: + operationId: DeleteSyntheticsTestsV2 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeletedTestsRequestDeleteRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeletedTestsResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: 'Synthetics: Bulk delete tests' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + /api/v2/synthetics/tests/network: + post: + operationId: CreateSyntheticsNetworkTest + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestEditRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: 'Synthetics: Create a Network Path test' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger + /api/v2/synthetics/tests/network/{public_id}: + get: + operationId: GetSyntheticsNetworkTest + parameters: + - description: The public ID of the Network Path test to get details from. + in: path + name: public_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_read + summary: 'Synthetics: Get a Network Path test' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_read + put: + operationId: UpdateSyntheticsNetworkTest + parameters: + - description: The public ID of the Network Path test to edit. + in: path + name: public_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestEditRequest' + description: New Network Path test details to be saved. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SyntheticsNetworkTestResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: API error response. + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - synthetics_write + summary: 'Synthetics: Edit a Network Path test' + tags: + - Synthetics + x-permission: + operator: OR + permissions: + - synthetics_write + - synthetics_create_edit_trigger /api/v2/synthetics/variables/{variable_id}/jsonpatch: patch: description: 'Patch a global variable using JSON Patch (RFC 6902). @@ -100748,12 +101505,24 @@ tags: via Datadog's API. See the [Status Pages documentation](https://docs.datadoghq.com/incident_response/status_pages/) for more information. name: Status Pages -- description: "Datadog Synthetics uses simulated user requests and browser rendering - to help you ensure uptime,\nidentify regional issues, and track your application - performance. Datadog Synthetics tests come in\ntwo different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/)\nand - [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You can - use Datadog\u2019s API to\nmanage both test types programmatically.\n\nFor more - information about Synthetics, see the [Synthetics overview](https://docs.datadoghq.com/synthetics/)." +- description: 'Synthetic tests allow you to observe how your systems and applications + are performing using simulated requests and actions from around the globe. + + They come in different flavors: + + [API tests](https://docs.datadoghq.com/synthetics/api_tests/), + + [browser tests](https://docs.datadoghq.com/synthetics/browser_tests), + + [Network Path tests](https://docs.datadoghq.com/synthetics/network_path_tests/) + and + + [Mobile Application tests](https://docs.datadoghq.com/synthetics/mobile_app_testing). + + You can use Datadog''s API to manage tests and test suites programmatically. + + + For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/).' name: Synthetics - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. diff --git a/examples/v2/synthetics/CreateSyntheticsNetworkTest.java b/examples/v2/synthetics/CreateSyntheticsNetworkTest.java new file mode 100644 index 00000000000..d358ddfd069 --- /dev/null +++ b/examples/v2/synthetics/CreateSyntheticsNetworkTest.java @@ -0,0 +1,81 @@ +// Synthetics: Create a Network Path test returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertion; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertionLatency; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertionLatencyType; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertionOperator; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertionProperty; +import com.datadog.api.client.v2.model.SyntheticsNetworkTest; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestConfig; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestEdit; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestEditRequest; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestRequest; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestRequestTCPMethod; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestResponse; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestSubType; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestType; +import com.datadog.api.client.v2.model.SyntheticsTestOptions; +import com.datadog.api.client.v2.model.SyntheticsTestPauseStatus; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + SyntheticsNetworkTestEditRequest body = + new SyntheticsNetworkTestEditRequest() + .data( + new SyntheticsNetworkTestEdit() + .attributes( + new SyntheticsNetworkTest() + .config( + new SyntheticsNetworkTestConfig() + .assertions( + Collections.singletonList( + new SyntheticsNetworkAssertion( + new SyntheticsNetworkAssertionLatency() + .operator( + SyntheticsNetworkAssertionOperator + .LESS_THAN) + .property( + SyntheticsNetworkAssertionProperty.AVG) + .target(500.0) + .type( + SyntheticsNetworkAssertionLatencyType + .LATENCY)))) + .request( + new SyntheticsNetworkTestRequest() + .host("example.com") + .port(443L) + .tcpMethod( + SyntheticsNetworkTestRequestTCPMethod.PREFER_SACK) + .maxTtl(30L) + .e2eQueries(50L) + .tracerouteQueries(3L))) + .locations(Arrays.asList("aws:us-east-1", "agent:my-agent-name")) + .message("Network Path test notification") + .name("Example Network Path test") + .options(new SyntheticsTestOptions().tickEvery(60L)) + .status(SyntheticsTestPauseStatus.LIVE) + .subtype(SyntheticsNetworkTestSubType.TCP) + .tags(Collections.singletonList("env:production")) + .type(SyntheticsNetworkTestType.NETWORK)) + .type(SyntheticsNetworkTestType.NETWORK)); + + try { + SyntheticsNetworkTestResponse result = apiInstance.createSyntheticsNetworkTest(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#createSyntheticsNetworkTest"); + 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/synthetics/DeleteSyntheticsTestsV2.java b/examples/v2/synthetics/DeleteSyntheticsTestsV2.java new file mode 100644 index 00000000000..78a25df95f3 --- /dev/null +++ b/examples/v2/synthetics/DeleteSyntheticsTestsV2.java @@ -0,0 +1,38 @@ +// Synthetics: Bulk delete tests returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.DeletedTestsRequestDelete; +import com.datadog.api.client.v2.model.DeletedTestsRequestDeleteAttributes; +import com.datadog.api.client.v2.model.DeletedTestsRequestDeleteRequest; +import com.datadog.api.client.v2.model.DeletedTestsRequestType; +import com.datadog.api.client.v2.model.DeletedTestsResponse; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + DeletedTestsRequestDeleteRequest body = + new DeletedTestsRequestDeleteRequest() + .data( + new DeletedTestsRequestDelete() + .attributes( + new DeletedTestsRequestDeleteAttributes() + .publicIds(Collections.singletonList(""))) + .type(DeletedTestsRequestType.DELETE_TESTS_REQUEST)); + + try { + DeletedTestsResponse result = apiInstance.deleteSyntheticsTestsV2(body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#deleteSyntheticsTestsV2"); + 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/synthetics/GetSyntheticsNetworkTest.java b/examples/v2/synthetics/GetSyntheticsNetworkTest.java new file mode 100644 index 00000000000..f93b7e69764 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsNetworkTest.java @@ -0,0 +1,24 @@ +// Synthetics: Get a Network Path test returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestResponse; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + try { + SyntheticsNetworkTestResponse result = apiInstance.getSyntheticsNetworkTest("amg-96x-tps"); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#getSyntheticsNetworkTest"); + 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/synthetics/UpdateSyntheticsNetworkTest.java b/examples/v2/synthetics/UpdateSyntheticsNetworkTest.java new file mode 100644 index 00000000000..ba4500ca1f7 --- /dev/null +++ b/examples/v2/synthetics/UpdateSyntheticsNetworkTest.java @@ -0,0 +1,110 @@ +// Synthetics: Edit a Network Path test returns "OK" response + +import com.datadog.api.client.ApiClient; +import com.datadog.api.client.ApiException; +import com.datadog.api.client.v2.api.SyntheticsApi; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertion; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertionLatency; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertionLatencyType; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertionOperator; +import com.datadog.api.client.v2.model.SyntheticsNetworkAssertionProperty; +import com.datadog.api.client.v2.model.SyntheticsNetworkTest; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestConfig; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestEdit; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestEditRequest; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestRequest; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestRequestTCPMethod; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestResponse; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestSubType; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestType; +import com.datadog.api.client.v2.model.SyntheticsTestOptions; +import com.datadog.api.client.v2.model.SyntheticsTestOptionsMonitorOptions; +import com.datadog.api.client.v2.model.SyntheticsTestOptionsMonitorOptionsNotificationPresetName; +import com.datadog.api.client.v2.model.SyntheticsTestOptionsRetry; +import com.datadog.api.client.v2.model.SyntheticsTestOptionsScheduling; +import com.datadog.api.client.v2.model.SyntheticsTestOptionsSchedulingTimeframe; +import com.datadog.api.client.v2.model.SyntheticsTestPauseStatus; +import java.util.Arrays; +import java.util.Collections; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = ApiClient.getDefaultApiClient(); + SyntheticsApi apiInstance = new SyntheticsApi(defaultClient); + + SyntheticsNetworkTestEditRequest body = + new SyntheticsNetworkTestEditRequest() + .data( + new SyntheticsNetworkTestEdit() + .attributes( + new SyntheticsNetworkTest() + .config( + new SyntheticsNetworkTestConfig() + .assertions( + Collections.singletonList( + new SyntheticsNetworkAssertion( + new SyntheticsNetworkAssertionLatency() + .operator( + SyntheticsNetworkAssertionOperator + .LESS_THAN) + .property( + SyntheticsNetworkAssertionProperty.AVG) + .target(500.0) + .type( + SyntheticsNetworkAssertionLatencyType + .LATENCY)))) + .request( + new SyntheticsNetworkTestRequest() + .e2eQueries(50L) + .host("") + .maxTtl(30L) + .port(443L) + .tcpMethod( + SyntheticsNetworkTestRequestTCPMethod.PREFER_SACK) + .tracerouteQueries(3L))) + .locations(Arrays.asList("aws:us-east-1", "agent:my-agent-name")) + .message("Network Path test notification") + .name("Example Network Path test") + .options( + new SyntheticsTestOptions() + .monitorOptions( + new SyntheticsTestOptionsMonitorOptions() + .notificationPresetName( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName + .SHOW_ALL)) + .restrictedRoles( + Collections.singletonList( + "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")) + .retry(new SyntheticsTestOptionsRetry()) + .scheduling( + new SyntheticsTestOptionsScheduling() + .timeframes( + Arrays.asList( + new SyntheticsTestOptionsSchedulingTimeframe() + .day(1) + .from("07:00") + .to("16:00"), + new SyntheticsTestOptionsSchedulingTimeframe() + .day(3) + .from("07:00") + .to("16:00"))) + .timezone("America/New_York"))) + .status(SyntheticsTestPauseStatus.LIVE) + .subtype(SyntheticsNetworkTestSubType.TCP) + .tags(Collections.singletonList("env:production")) + .type(SyntheticsNetworkTestType.NETWORK)) + .type(SyntheticsNetworkTestType.NETWORK)); + + try { + SyntheticsNetworkTestResponse result = + apiInstance.updateSyntheticsNetworkTest("public_id", body); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling SyntheticsApi#updateSyntheticsNetworkTest"); + 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/v2/api/SyntheticsApi.java b/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java index 78f8b4e8602..da99eb5b179 100644 --- a/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/SyntheticsApi.java @@ -6,11 +6,15 @@ import com.datadog.api.client.Pair; import com.datadog.api.client.v2.model.DeletedSuitesRequestDeleteRequest; import com.datadog.api.client.v2.model.DeletedSuitesResponse; +import com.datadog.api.client.v2.model.DeletedTestsRequestDeleteRequest; +import com.datadog.api.client.v2.model.DeletedTestsResponse; import com.datadog.api.client.v2.model.GlobalVariableJsonPatchRequest; import com.datadog.api.client.v2.model.GlobalVariableResponse; import com.datadog.api.client.v2.model.OnDemandConcurrencyCapAttributes; import com.datadog.api.client.v2.model.OnDemandConcurrencyCapResponse; import com.datadog.api.client.v2.model.SuiteCreateEditRequest; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestEditRequest; +import com.datadog.api.client.v2.model.SyntheticsNetworkTestResponse; import com.datadog.api.client.v2.model.SyntheticsSuiteResponse; import com.datadog.api.client.v2.model.SyntheticsSuiteSearchResponse; import jakarta.ws.rs.client.Invocation; @@ -52,6 +56,139 @@ public void setApiClient(ApiClient apiClient) { this.apiClient = apiClient; } + /** + * Synthetics: Create a Network Path test. + * + *

See {@link #createSyntheticsNetworkTestWithHttpInfo}. + * + * @param body (required) + * @return SyntheticsNetworkTestResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsNetworkTestResponse createSyntheticsNetworkTest( + SyntheticsNetworkTestEditRequest body) throws ApiException { + return createSyntheticsNetworkTestWithHttpInfo(body).getData(); + } + + /** + * Synthetics: Create a Network Path test. + * + *

See {@link #createSyntheticsNetworkTestWithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<SyntheticsNetworkTestResponse> + */ + public CompletableFuture createSyntheticsNetworkTestAsync( + SyntheticsNetworkTestEditRequest body) { + return createSyntheticsNetworkTestWithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param body (required) + * @return ApiResponse<SyntheticsNetworkTestResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 API error response. -
429 Too many requests -
+ */ + public ApiResponse createSyntheticsNetworkTestWithHttpInfo( + SyntheticsNetworkTestEditRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling createSyntheticsNetworkTest"); + } + // create path and map variables + String localVarPath = "/api/v2/synthetics/tests/network"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.createSyntheticsNetworkTest", + 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() {}); + } + + /** + * Synthetics: Create a Network Path test. + * + *

See {@link #createSyntheticsNetworkTestWithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<SyntheticsNetworkTestResponse>> + */ + public CompletableFuture> + createSyntheticsNetworkTestWithHttpInfoAsync(SyntheticsNetworkTestEditRequest body) { + 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 createSyntheticsNetworkTest")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/synthetics/tests/network"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.createSyntheticsNetworkTest", + 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() {}); + } + /** * Synthetics: Create a test suite. * @@ -312,6 +449,137 @@ public ApiResponse deleteSyntheticsSuitesWithHttpInfo( new GenericType() {}); } + /** + * Synthetics: Bulk delete tests. + * + *

See {@link #deleteSyntheticsTestsV2WithHttpInfo}. + * + * @param body (required) + * @return DeletedTestsResponse + * @throws ApiException if fails to make API call + */ + public DeletedTestsResponse deleteSyntheticsTestsV2(DeletedTestsRequestDeleteRequest body) + throws ApiException { + return deleteSyntheticsTestsV2WithHttpInfo(body).getData(); + } + + /** + * Synthetics: Bulk delete tests. + * + *

See {@link #deleteSyntheticsTestsV2WithHttpInfoAsync}. + * + * @param body (required) + * @return CompletableFuture<DeletedTestsResponse> + */ + public CompletableFuture deleteSyntheticsTestsV2Async( + DeletedTestsRequestDeleteRequest body) { + return deleteSyntheticsTestsV2WithHttpInfoAsync(body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param body (required) + * @return ApiResponse<DeletedTestsResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 API error response. -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse deleteSyntheticsTestsV2WithHttpInfo( + DeletedTestsRequestDeleteRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling deleteSyntheticsTestsV2"); + } + // create path and map variables + String localVarPath = "/api/v2/synthetics/tests/bulk-delete"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.deleteSyntheticsTestsV2", + 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() {}); + } + + /** + * Synthetics: Bulk delete tests. + * + *

See {@link #deleteSyntheticsTestsV2WithHttpInfo}. + * + * @param body (required) + * @return CompletableFuture<ApiResponse<DeletedTestsResponse>> + */ + public CompletableFuture> + deleteSyntheticsTestsV2WithHttpInfoAsync(DeletedTestsRequestDeleteRequest body) { + 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 deleteSyntheticsTestsV2")); + return result; + } + // create path and map variables + String localVarPath = "/api/v2/synthetics/tests/bulk-delete"; + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.deleteSyntheticsTestsV2", + 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() {}); + } + /** * Synthetics: Edit a test suite. * @@ -576,6 +844,144 @@ public ApiResponse getOnDemandConcurrencyCapWith new GenericType() {}); } + /** + * Synthetics: Get a Network Path test. + * + *

See {@link #getSyntheticsNetworkTestWithHttpInfo}. + * + * @param publicId The public ID of the Network Path test to get details from. (required) + * @return SyntheticsNetworkTestResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsNetworkTestResponse getSyntheticsNetworkTest(String publicId) + throws ApiException { + return getSyntheticsNetworkTestWithHttpInfo(publicId).getData(); + } + + /** + * Synthetics: Get a Network Path test. + * + *

See {@link #getSyntheticsNetworkTestWithHttpInfoAsync}. + * + * @param publicId The public ID of the Network Path test to get details from. (required) + * @return CompletableFuture<SyntheticsNetworkTestResponse> + */ + public CompletableFuture getSyntheticsNetworkTestAsync( + String publicId) { + return getSyntheticsNetworkTestWithHttpInfoAsync(publicId) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param publicId The public ID of the Network Path test to get details from. (required) + * @return ApiResponse<SyntheticsNetworkTestResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 API error response. -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse getSyntheticsNetworkTestWithHttpInfo( + String publicId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + throw new ApiException( + 400, "Missing the required parameter 'publicId' when calling getSyntheticsNetworkTest"); + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/network/{public_id}" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getSyntheticsNetworkTest", + 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() {}); + } + + /** + * Synthetics: Get a Network Path test. + * + *

See {@link #getSyntheticsNetworkTestWithHttpInfo}. + * + * @param publicId The public ID of the Network Path test to get details from. (required) + * @return CompletableFuture<ApiResponse<SyntheticsNetworkTestResponse>> + */ + public CompletableFuture> + getSyntheticsNetworkTestWithHttpInfoAsync(String publicId) { + Object localVarPostBody = null; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'publicId' when calling getSyntheticsNetworkTest")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/network/{public_id}" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.getSyntheticsNetworkTest", + 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() {}); + } + /** * Synthetics: Get a suite. * @@ -1240,4 +1646,166 @@ public ApiResponse setOnDemandConcurrencyCapWith false, new GenericType() {}); } + + /** + * Synthetics: Edit a Network Path test. + * + *

See {@link #updateSyntheticsNetworkTestWithHttpInfo}. + * + * @param publicId The public ID of the Network Path test to edit. (required) + * @param body New Network Path test details to be saved. (required) + * @return SyntheticsNetworkTestResponse + * @throws ApiException if fails to make API call + */ + public SyntheticsNetworkTestResponse updateSyntheticsNetworkTest( + String publicId, SyntheticsNetworkTestEditRequest body) throws ApiException { + return updateSyntheticsNetworkTestWithHttpInfo(publicId, body).getData(); + } + + /** + * Synthetics: Edit a Network Path test. + * + *

See {@link #updateSyntheticsNetworkTestWithHttpInfoAsync}. + * + * @param publicId The public ID of the Network Path test to edit. (required) + * @param body New Network Path test details to be saved. (required) + * @return CompletableFuture<SyntheticsNetworkTestResponse> + */ + public CompletableFuture updateSyntheticsNetworkTestAsync( + String publicId, SyntheticsNetworkTestEditRequest body) { + return updateSyntheticsNetworkTestWithHttpInfoAsync(publicId, body) + .thenApply( + response -> { + return response.getData(); + }); + } + + /** + * @param publicId The public ID of the Network Path test to edit. (required) + * @param body New Network Path test details to be saved. (required) + * @return ApiResponse<SyntheticsNetworkTestResponse> + * @throws ApiException if fails to make API call + * @http.response.details + * + * + * + * + * + * + * + *
Response details
Status Code Description Response Headers
200 OK -
400 API error response. -
404 API error response. -
429 Too many requests -
+ */ + public ApiResponse updateSyntheticsNetworkTestWithHttpInfo( + String publicId, SyntheticsNetworkTestEditRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + throw new ApiException( + 400, + "Missing the required parameter 'publicId' when calling updateSyntheticsNetworkTest"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException( + 400, "Missing the required parameter 'body' when calling updateSyntheticsNetworkTest"); + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/network/{public_id}" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder = + apiClient.createBuilder( + "v2.SyntheticsApi.updateSyntheticsNetworkTest", + localVarPath, + new ArrayList(), + localVarHeaderParams, + new HashMap(), + new String[] {"application/json"}, + new String[] {"apiKeyAuth", "appKeyAuth", "AuthZ"}); + return apiClient.invokeAPI( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } + + /** + * Synthetics: Edit a Network Path test. + * + *

See {@link #updateSyntheticsNetworkTestWithHttpInfo}. + * + * @param publicId The public ID of the Network Path test to edit. (required) + * @param body New Network Path test details to be saved. (required) + * @return CompletableFuture<ApiResponse<SyntheticsNetworkTestResponse>> + */ + public CompletableFuture> + updateSyntheticsNetworkTestWithHttpInfoAsync( + String publicId, SyntheticsNetworkTestEditRequest body) { + Object localVarPostBody = body; + + // verify the required parameter 'publicId' is set + if (publicId == null) { + CompletableFuture> result = + new CompletableFuture<>(); + result.completeExceptionally( + new ApiException( + 400, + "Missing the required parameter 'publicId' when calling" + + " updateSyntheticsNetworkTest")); + return result; + } + + // 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 updateSyntheticsNetworkTest")); + return result; + } + // create path and map variables + String localVarPath = + "/api/v2/synthetics/tests/network/{public_id}" + .replaceAll("\\{" + "public_id" + "\\}", apiClient.escapeString(publicId.toString())); + + Map localVarHeaderParams = new HashMap(); + + Invocation.Builder builder; + try { + builder = + apiClient.createBuilder( + "v2.SyntheticsApi.updateSyntheticsNetworkTest", + 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( + "PUT", + builder, + localVarHeaderParams, + new String[] {"application/json"}, + localVarPostBody, + new HashMap(), + false, + new GenericType() {}); + } } diff --git a/src/main/java/com/datadog/api/client/v2/model/DeletedTestResponseData.java b/src/main/java/com/datadog/api/client/v2/model/DeletedTestResponseData.java new file mode 100644 index 00000000000..5d8c0d6886c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeletedTestResponseData.java @@ -0,0 +1,196 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + DeletedTestResponseData.JSON_PROPERTY_ATTRIBUTES, + DeletedTestResponseData.JSON_PROPERTY_ID, + DeletedTestResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeletedTestResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeletedTestResponseDataAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeletedTestsResponseType type = DeletedTestsResponseType.DELETE_TESTS; + + public DeletedTestResponseData attributes(DeletedTestResponseDataAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeletedTestResponseDataAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeletedTestResponseDataAttributes attributes) { + this.attributes = attributes; + } + + public DeletedTestResponseData id(String id) { + this.id = id; + return this; + } + + /** + * Getid + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeletedTestResponseData type(DeletedTestsResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Gettype + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeletedTestsResponseType getType() { + return type; + } + + public void setType(DeletedTestsResponseType 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 DeletedTestResponseData + */ + @JsonAnySetter + public DeletedTestResponseData 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 DeletedTestResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletedTestResponseData deletedTestResponseData = (DeletedTestResponseData) o; + return Objects.equals(this.attributes, deletedTestResponseData.attributes) + && Objects.equals(this.id, deletedTestResponseData.id) + && Objects.equals(this.type, deletedTestResponseData.type) + && Objects.equals(this.additionalProperties, deletedTestResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletedTestResponseData {\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/DeletedTestResponseDataAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeletedTestResponseDataAttributes.java new file mode 100644 index 00000000000..79db6ca1bce --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeletedTestResponseDataAttributes.java @@ -0,0 +1,166 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + DeletedTestResponseDataAttributes.JSON_PROPERTY_DELETED_AT, + DeletedTestResponseDataAttributes.JSON_PROPERTY_PUBLIC_ID +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeletedTestResponseDataAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DELETED_AT = "deleted_at"; + private String deletedAt; + + public static final String JSON_PROPERTY_PUBLIC_ID = "public_id"; + private String publicId; + + public DeletedTestResponseDataAttributes deletedAt(String deletedAt) { + this.deletedAt = deletedAt; + return this; + } + + /** + * Deletion timestamp of the Synthetic test ID. + * + * @return deletedAt + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DELETED_AT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDeletedAt() { + return deletedAt; + } + + public void setDeletedAt(String deletedAt) { + this.deletedAt = deletedAt; + } + + public DeletedTestResponseDataAttributes publicId(String publicId) { + this.publicId = publicId; + return this; + } + + /** + * The Synthetic test ID deleted. + * + * @return publicId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublicId() { + return publicId; + } + + public void setPublicId(String publicId) { + this.publicId = publicId; + } + + /** + * 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 DeletedTestResponseDataAttributes + */ + @JsonAnySetter + public DeletedTestResponseDataAttributes 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 DeletedTestResponseDataAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletedTestResponseDataAttributes deletedTestResponseDataAttributes = + (DeletedTestResponseDataAttributes) o; + return Objects.equals(this.deletedAt, deletedTestResponseDataAttributes.deletedAt) + && Objects.equals(this.publicId, deletedTestResponseDataAttributes.publicId) + && Objects.equals( + this.additionalProperties, deletedTestResponseDataAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(deletedAt, publicId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletedTestResponseDataAttributes {\n"); + sb.append(" deletedAt: ").append(toIndentedString(deletedAt)).append("\n"); + sb.append(" publicId: ").append(toIndentedString(publicId)).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/DeletedTestsRequestDelete.java b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestDelete.java new file mode 100644 index 00000000000..c2a03251cde --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestDelete.java @@ -0,0 +1,207 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + DeletedTestsRequestDelete.JSON_PROPERTY_ATTRIBUTES, + DeletedTestsRequestDelete.JSON_PROPERTY_ID, + DeletedTestsRequestDelete.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeletedTestsRequestDelete { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private DeletedTestsRequestDeleteAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private DeletedTestsRequestType type = DeletedTestsRequestType.DELETE_TESTS_REQUEST; + + public DeletedTestsRequestDelete() {} + + @JsonCreator + public DeletedTestsRequestDelete( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + DeletedTestsRequestDeleteAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + } + + public DeletedTestsRequestDelete attributes(DeletedTestsRequestDeleteAttributes attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Getattributes + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeletedTestsRequestDeleteAttributes getAttributes() { + return attributes; + } + + public void setAttributes(DeletedTestsRequestDeleteAttributes attributes) { + this.attributes = attributes; + } + + public DeletedTestsRequestDelete id(String id) { + this.id = id; + return this; + } + + /** + * Getid + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public DeletedTestsRequestDelete type(DeletedTestsRequestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Gettype + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public DeletedTestsRequestType getType() { + return type; + } + + public void setType(DeletedTestsRequestType 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 DeletedTestsRequestDelete + */ + @JsonAnySetter + public DeletedTestsRequestDelete 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 DeletedTestsRequestDelete object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletedTestsRequestDelete deletedTestsRequestDelete = (DeletedTestsRequestDelete) o; + return Objects.equals(this.attributes, deletedTestsRequestDelete.attributes) + && Objects.equals(this.id, deletedTestsRequestDelete.id) + && Objects.equals(this.type, deletedTestsRequestDelete.type) + && Objects.equals( + this.additionalProperties, deletedTestsRequestDelete.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletedTestsRequestDelete {\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/DeletedTestsRequestDeleteAttributes.java b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestDeleteAttributes.java new file mode 100644 index 00000000000..2510aa9656b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestDeleteAttributes.java @@ -0,0 +1,186 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + DeletedTestsRequestDeleteAttributes.JSON_PROPERTY_FORCE_DELETE_DEPENDENCIES, + DeletedTestsRequestDeleteAttributes.JSON_PROPERTY_PUBLIC_IDS +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeletedTestsRequestDeleteAttributes { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_FORCE_DELETE_DEPENDENCIES = "force_delete_dependencies"; + private Boolean forceDeleteDependencies; + + public static final String JSON_PROPERTY_PUBLIC_IDS = "public_ids"; + private List publicIds = new ArrayList<>(); + + public DeletedTestsRequestDeleteAttributes() {} + + @JsonCreator + public DeletedTestsRequestDeleteAttributes( + @JsonProperty(required = true, value = JSON_PROPERTY_PUBLIC_IDS) List publicIds) { + this.publicIds = publicIds; + } + + public DeletedTestsRequestDeleteAttributes forceDeleteDependencies( + Boolean forceDeleteDependencies) { + this.forceDeleteDependencies = forceDeleteDependencies; + return this; + } + + /** + * GetforceDeleteDependencies + * + * @return forceDeleteDependencies + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_FORCE_DELETE_DEPENDENCIES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Boolean getForceDeleteDependencies() { + return forceDeleteDependencies; + } + + public void setForceDeleteDependencies(Boolean forceDeleteDependencies) { + this.forceDeleteDependencies = forceDeleteDependencies; + } + + public DeletedTestsRequestDeleteAttributes publicIds(List publicIds) { + this.publicIds = publicIds; + return this; + } + + public DeletedTestsRequestDeleteAttributes addPublicIdsItem(String publicIdsItem) { + this.publicIds.add(publicIdsItem); + return this; + } + + /** + * GetpublicIds + * + * @return publicIds + */ + @JsonProperty(JSON_PROPERTY_PUBLIC_IDS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getPublicIds() { + return publicIds; + } + + public void setPublicIds(List publicIds) { + this.publicIds = publicIds; + } + + /** + * 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 DeletedTestsRequestDeleteAttributes + */ + @JsonAnySetter + public DeletedTestsRequestDeleteAttributes 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 DeletedTestsRequestDeleteAttributes object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletedTestsRequestDeleteAttributes deletedTestsRequestDeleteAttributes = + (DeletedTestsRequestDeleteAttributes) o; + return Objects.equals( + this.forceDeleteDependencies, + deletedTestsRequestDeleteAttributes.forceDeleteDependencies) + && Objects.equals(this.publicIds, deletedTestsRequestDeleteAttributes.publicIds) + && Objects.equals( + this.additionalProperties, deletedTestsRequestDeleteAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(forceDeleteDependencies, publicIds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletedTestsRequestDeleteAttributes {\n"); + sb.append(" forceDeleteDependencies: ") + .append(toIndentedString(forceDeleteDependencies)) + .append("\n"); + sb.append(" publicIds: ").append(toIndentedString(publicIds)).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/DeletedTestsRequestDeleteRequest.java b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestDeleteRequest.java new file mode 100644 index 00000000000..7ee79a93376 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestDeleteRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** */ +@JsonPropertyOrder({DeletedTestsRequestDeleteRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeletedTestsRequestDeleteRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private DeletedTestsRequestDelete data; + + public DeletedTestsRequestDeleteRequest() {} + + @JsonCreator + public DeletedTestsRequestDeleteRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) DeletedTestsRequestDelete data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public DeletedTestsRequestDeleteRequest data(DeletedTestsRequestDelete data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public DeletedTestsRequestDelete getData() { + return data; + } + + public void setData(DeletedTestsRequestDelete data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return DeletedTestsRequestDeleteRequest + */ + @JsonAnySetter + public DeletedTestsRequestDeleteRequest 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 DeletedTestsRequestDeleteRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletedTestsRequestDeleteRequest deletedTestsRequestDeleteRequest = + (DeletedTestsRequestDeleteRequest) o; + return Objects.equals(this.data, deletedTestsRequestDeleteRequest.data) + && Objects.equals( + this.additionalProperties, deletedTestsRequestDeleteRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletedTestsRequestDeleteRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestType.java b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestType.java new file mode 100644 index 00000000000..829d73564a0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsRequestType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** */ +@JsonSerialize(using = DeletedTestsRequestType.DeletedTestsRequestTypeSerializer.class) +public class DeletedTestsRequestType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("delete_tests_request")); + + public static final DeletedTestsRequestType DELETE_TESTS_REQUEST = + new DeletedTestsRequestType("delete_tests_request"); + + DeletedTestsRequestType(String value) { + super(value, allowedValues); + } + + public static class DeletedTestsRequestTypeSerializer + extends StdSerializer { + public DeletedTestsRequestTypeSerializer(Class t) { + super(t); + } + + public DeletedTestsRequestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DeletedTestsRequestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeletedTestsRequestType fromValue(String value) { + return new DeletedTestsRequestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeletedTestsResponse.java b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsResponse.java new file mode 100644 index 00000000000..191efcbde81 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsResponse.java @@ -0,0 +1,149 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.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; + +/** */ +@JsonPropertyOrder({DeletedTestsResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class DeletedTestsResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + public DeletedTestsResponse data(List data) { + this.data = data; + for (DeletedTestResponseData item : data) { + this.unparsed |= item.unparsed; + } + return this; + } + + public DeletedTestsResponse addDataItem(DeletedTestResponseData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + this.unparsed |= dataItem.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + /** + * 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 DeletedTestsResponse + */ + @JsonAnySetter + public DeletedTestsResponse 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 DeletedTestsResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeletedTestsResponse deletedTestsResponse = (DeletedTestsResponse) o; + return Objects.equals(this.data, deletedTestsResponse.data) + && Objects.equals(this.additionalProperties, deletedTestsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeletedTestsResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/DeletedTestsResponseType.java b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsResponseType.java new file mode 100644 index 00000000000..abf29508261 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/DeletedTestsResponseType.java @@ -0,0 +1,57 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.datadog.api.client.ModelEnum; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +/** */ +@JsonSerialize(using = DeletedTestsResponseType.DeletedTestsResponseTypeSerializer.class) +public class DeletedTestsResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("delete_tests")); + + public static final DeletedTestsResponseType DELETE_TESTS = + new DeletedTestsResponseType("delete_tests"); + + DeletedTestsResponseType(String value) { + super(value, allowedValues); + } + + public static class DeletedTestsResponseTypeSerializer + extends StdSerializer { + public DeletedTestsResponseTypeSerializer(Class t) { + super(t); + } + + public DeletedTestsResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + DeletedTestsResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static DeletedTestsResponseType fromValue(String value) { + return new DeletedTestsResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertion.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertion.java new file mode 100644 index 00000000000..a2b78111723 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertion.java @@ -0,0 +1,454 @@ +/* + * 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.AbstractOpenApiSchema; +import com.datadog.api.client.JSON; +import com.datadog.api.client.UnparsedObject; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.JsonToken; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonMappingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.MapperFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; +import com.fasterxml.jackson.databind.ser.std.StdSerializer; +import jakarta.ws.rs.core.GenericType; +import java.io.IOException; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +@JsonDeserialize(using = SyntheticsNetworkAssertion.SyntheticsNetworkAssertionDeserializer.class) +@JsonSerialize(using = SyntheticsNetworkAssertion.SyntheticsNetworkAssertionSerializer.class) +public class SyntheticsNetworkAssertion extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(SyntheticsNetworkAssertion.class.getName()); + + @JsonIgnore public boolean unparsed = false; + + public static class SyntheticsNetworkAssertionSerializer + extends StdSerializer { + public SyntheticsNetworkAssertionSerializer(Class t) { + super(t); + } + + public SyntheticsNetworkAssertionSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkAssertion value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.getActualInstance()); + } + } + + public static class SyntheticsNetworkAssertionDeserializer + extends StdDeserializer { + public SyntheticsNetworkAssertionDeserializer() { + this(SyntheticsNetworkAssertion.class); + } + + public SyntheticsNetworkAssertionDeserializer(Class vc) { + super(vc); + } + + @Override + public SyntheticsNetworkAssertion deserialize(JsonParser jp, DeserializationContext ctxt) + throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + Object deserialized = null; + Object tmp = null; + boolean typeCoercion = ctxt.isEnabled(MapperFeature.ALLOW_COERCION_OF_SCALARS); + int match = 0; + JsonToken token = tree.traverse(jp.getCodec()).nextToken(); + // deserialize SyntheticsNetworkAssertionLatency + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SyntheticsNetworkAssertionLatency.class.equals(Integer.class) + || SyntheticsNetworkAssertionLatency.class.equals(Long.class) + || SyntheticsNetworkAssertionLatency.class.equals(Float.class) + || SyntheticsNetworkAssertionLatency.class.equals(Double.class) + || SyntheticsNetworkAssertionLatency.class.equals(Boolean.class) + || SyntheticsNetworkAssertionLatency.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SyntheticsNetworkAssertionLatency.class.equals(Integer.class) + || SyntheticsNetworkAssertionLatency.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SyntheticsNetworkAssertionLatency.class.equals(Float.class) + || SyntheticsNetworkAssertionLatency.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SyntheticsNetworkAssertionLatency.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SyntheticsNetworkAssertionLatency.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SyntheticsNetworkAssertionLatency.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SyntheticsNetworkAssertionLatency) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SyntheticsNetworkAssertionLatency'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'SyntheticsNetworkAssertionLatency'", e); + } + + // deserialize SyntheticsNetworkAssertionMultiNetworkHop + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Integer.class) + || SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Long.class) + || SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Float.class) + || SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Double.class) + || SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Boolean.class) + || SyntheticsNetworkAssertionMultiNetworkHop.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Integer.class) + || SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Float.class) + || SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SyntheticsNetworkAssertionMultiNetworkHop.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SyntheticsNetworkAssertionMultiNetworkHop.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(SyntheticsNetworkAssertionMultiNetworkHop.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SyntheticsNetworkAssertionMultiNetworkHop) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, "Input data matches schema 'SyntheticsNetworkAssertionMultiNetworkHop'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'SyntheticsNetworkAssertionMultiNetworkHop'", + e); + } + + // deserialize SyntheticsNetworkAssertionPacketLossPercentage + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SyntheticsNetworkAssertionPacketLossPercentage.class.equals(Integer.class) + || SyntheticsNetworkAssertionPacketLossPercentage.class.equals(Long.class) + || SyntheticsNetworkAssertionPacketLossPercentage.class.equals(Float.class) + || SyntheticsNetworkAssertionPacketLossPercentage.class.equals(Double.class) + || SyntheticsNetworkAssertionPacketLossPercentage.class.equals(Boolean.class) + || SyntheticsNetworkAssertionPacketLossPercentage.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SyntheticsNetworkAssertionPacketLossPercentage.class.equals(Integer.class) + || SyntheticsNetworkAssertionPacketLossPercentage.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SyntheticsNetworkAssertionPacketLossPercentage.class.equals(Float.class) + || SyntheticsNetworkAssertionPacketLossPercentage.class.equals( + Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SyntheticsNetworkAssertionPacketLossPercentage.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SyntheticsNetworkAssertionPacketLossPercentage.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = + tree.traverse(jp.getCodec()) + .readValueAs(SyntheticsNetworkAssertionPacketLossPercentage.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SyntheticsNetworkAssertionPacketLossPercentage) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log( + Level.FINER, + "Input data matches schema 'SyntheticsNetworkAssertionPacketLossPercentage'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, + "Input data does not match schema 'SyntheticsNetworkAssertionPacketLossPercentage'", + e); + } + + // deserialize SyntheticsNetworkAssertionJitter + try { + boolean attemptParsing = true; + // ensure that we respect type coercion as set on the client ObjectMapper + if (SyntheticsNetworkAssertionJitter.class.equals(Integer.class) + || SyntheticsNetworkAssertionJitter.class.equals(Long.class) + || SyntheticsNetworkAssertionJitter.class.equals(Float.class) + || SyntheticsNetworkAssertionJitter.class.equals(Double.class) + || SyntheticsNetworkAssertionJitter.class.equals(Boolean.class) + || SyntheticsNetworkAssertionJitter.class.equals(String.class)) { + attemptParsing = typeCoercion; + if (!attemptParsing) { + attemptParsing |= + ((SyntheticsNetworkAssertionJitter.class.equals(Integer.class) + || SyntheticsNetworkAssertionJitter.class.equals(Long.class)) + && token == JsonToken.VALUE_NUMBER_INT); + attemptParsing |= + ((SyntheticsNetworkAssertionJitter.class.equals(Float.class) + || SyntheticsNetworkAssertionJitter.class.equals(Double.class)) + && (token == JsonToken.VALUE_NUMBER_FLOAT + || token == JsonToken.VALUE_NUMBER_INT)); + attemptParsing |= + (SyntheticsNetworkAssertionJitter.class.equals(Boolean.class) + && (token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE)); + attemptParsing |= + (SyntheticsNetworkAssertionJitter.class.equals(String.class) + && token == JsonToken.VALUE_STRING); + } + } + if (attemptParsing) { + tmp = tree.traverse(jp.getCodec()).readValueAs(SyntheticsNetworkAssertionJitter.class); + // TODO: there is no validation against JSON schema constraints + // (min, max, enum, pattern...), this does not perform a strict JSON + // validation, which means the 'match' count may be higher than it should be. + if (!((SyntheticsNetworkAssertionJitter) tmp).unparsed) { + deserialized = tmp; + match++; + } + log.log(Level.FINER, "Input data matches schema 'SyntheticsNetworkAssertionJitter'"); + } + } catch (Exception e) { + // deserialization failed, continue + log.log( + Level.FINER, "Input data does not match schema 'SyntheticsNetworkAssertionJitter'", e); + } + + SyntheticsNetworkAssertion ret = new SyntheticsNetworkAssertion(); + if (match == 1) { + ret.setActualInstance(deserialized); + } else { + Map res = + new ObjectMapper() + .readValue( + tree.traverse(jp.getCodec()).readValueAsTree().toString(), + new TypeReference>() {}); + ret.setActualInstance(new UnparsedObject(res)); + } + return ret; + } + + /** Handle deserialization of the 'null' value. */ + @Override + public SyntheticsNetworkAssertion getNullValue(DeserializationContext ctxt) + throws JsonMappingException { + throw new JsonMappingException(ctxt.getParser(), "SyntheticsNetworkAssertion cannot be null"); + } + } + + // store a list of schema names defined in oneOf + public static final Map schemas = new HashMap(); + + public SyntheticsNetworkAssertion() { + super("oneOf", Boolean.FALSE); + } + + public SyntheticsNetworkAssertion(SyntheticsNetworkAssertionLatency o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public SyntheticsNetworkAssertion(SyntheticsNetworkAssertionMultiNetworkHop o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public SyntheticsNetworkAssertion(SyntheticsNetworkAssertionPacketLossPercentage o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public SyntheticsNetworkAssertion(SyntheticsNetworkAssertionJitter o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put( + "SyntheticsNetworkAssertionLatency", + new GenericType() {}); + schemas.put( + "SyntheticsNetworkAssertionMultiNetworkHop", + new GenericType() {}); + schemas.put( + "SyntheticsNetworkAssertionPacketLossPercentage", + new GenericType() {}); + schemas.put( + "SyntheticsNetworkAssertionJitter", new GenericType() {}); + JSON.registerDescendants( + SyntheticsNetworkAssertion.class, Collections.unmodifiableMap(schemas)); + } + + @Override + public Map getSchemas() { + return SyntheticsNetworkAssertion.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check the instance parameter is valid + * against the oneOf child schemas: SyntheticsNetworkAssertionLatency, + * SyntheticsNetworkAssertionMultiNetworkHop, SyntheticsNetworkAssertionPacketLossPercentage, + * SyntheticsNetworkAssertionJitter + * + *

It could be an instance of the 'oneOf' schemas. The oneOf child schemas may themselves be a + * composed schema (allOf, anyOf, oneOf). + */ + @Override + public void setActualInstance(Object instance) { + if (JSON.isInstanceOf( + SyntheticsNetworkAssertionLatency.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + SyntheticsNetworkAssertionMultiNetworkHop.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + SyntheticsNetworkAssertionPacketLossPercentage.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + if (JSON.isInstanceOf( + SyntheticsNetworkAssertionJitter.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + + if (JSON.isInstanceOf(UnparsedObject.class, instance, new HashSet>())) { + super.setActualInstance(instance); + return; + } + throw new RuntimeException( + "Invalid instance type. Must be SyntheticsNetworkAssertionLatency," + + " SyntheticsNetworkAssertionMultiNetworkHop," + + " SyntheticsNetworkAssertionPacketLossPercentage, SyntheticsNetworkAssertionJitter"); + } + + /** + * Get the actual instance, which can be the following: SyntheticsNetworkAssertionLatency, + * SyntheticsNetworkAssertionMultiNetworkHop, SyntheticsNetworkAssertionPacketLossPercentage, + * SyntheticsNetworkAssertionJitter + * + * @return The actual instance (SyntheticsNetworkAssertionLatency, + * SyntheticsNetworkAssertionMultiNetworkHop, SyntheticsNetworkAssertionPacketLossPercentage, + * SyntheticsNetworkAssertionJitter) + */ + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SyntheticsNetworkAssertionLatency`. If the actual instance is not + * `SyntheticsNetworkAssertionLatency`, the ClassCastException will be thrown. + * + * @return The actual instance of `SyntheticsNetworkAssertionLatency` + * @throws ClassCastException if the instance is not `SyntheticsNetworkAssertionLatency` + */ + public SyntheticsNetworkAssertionLatency getSyntheticsNetworkAssertionLatency() + throws ClassCastException { + return (SyntheticsNetworkAssertionLatency) super.getActualInstance(); + } + + /** + * Get the actual instance of `SyntheticsNetworkAssertionMultiNetworkHop`. If the actual instance + * is not `SyntheticsNetworkAssertionMultiNetworkHop`, the ClassCastException will be thrown. + * + * @return The actual instance of `SyntheticsNetworkAssertionMultiNetworkHop` + * @throws ClassCastException if the instance is not `SyntheticsNetworkAssertionMultiNetworkHop` + */ + public SyntheticsNetworkAssertionMultiNetworkHop getSyntheticsNetworkAssertionMultiNetworkHop() + throws ClassCastException { + return (SyntheticsNetworkAssertionMultiNetworkHop) super.getActualInstance(); + } + + /** + * Get the actual instance of `SyntheticsNetworkAssertionPacketLossPercentage`. If the actual + * instance is not `SyntheticsNetworkAssertionPacketLossPercentage`, the ClassCastException will + * be thrown. + * + * @return The actual instance of `SyntheticsNetworkAssertionPacketLossPercentage` + * @throws ClassCastException if the instance is not + * `SyntheticsNetworkAssertionPacketLossPercentage` + */ + public SyntheticsNetworkAssertionPacketLossPercentage + getSyntheticsNetworkAssertionPacketLossPercentage() throws ClassCastException { + return (SyntheticsNetworkAssertionPacketLossPercentage) super.getActualInstance(); + } + + /** + * Get the actual instance of `SyntheticsNetworkAssertionJitter`. If the actual instance is not + * `SyntheticsNetworkAssertionJitter`, the ClassCastException will be thrown. + * + * @return The actual instance of `SyntheticsNetworkAssertionJitter` + * @throws ClassCastException if the instance is not `SyntheticsNetworkAssertionJitter` + */ + public SyntheticsNetworkAssertionJitter getSyntheticsNetworkAssertionJitter() + throws ClassCastException { + return (SyntheticsNetworkAssertionJitter) super.getActualInstance(); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionJitter.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionJitter.java new file mode 100644 index 00000000000..4db459083ff --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionJitter.java @@ -0,0 +1,215 @@ +/* + * 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; + +/** Jitter assertion for a Network Path test. */ +@JsonPropertyOrder({ + SyntheticsNetworkAssertionJitter.JSON_PROPERTY_OPERATOR, + SyntheticsNetworkAssertionJitter.JSON_PROPERTY_TARGET, + SyntheticsNetworkAssertionJitter.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkAssertionJitter { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private SyntheticsNetworkAssertionOperator operator; + + public static final String JSON_PROPERTY_TARGET = "target"; + private Double target; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsNetworkAssertionJitterType type = SyntheticsNetworkAssertionJitterType.JITTER; + + public SyntheticsNetworkAssertionJitter() {} + + @JsonCreator + public SyntheticsNetworkAssertionJitter( + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATOR) + SyntheticsNetworkAssertionOperator operator, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) Double target, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SyntheticsNetworkAssertionJitterType type) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + this.target = target; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SyntheticsNetworkAssertionJitter operator(SyntheticsNetworkAssertionOperator operator) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + return this; + } + + /** + * Assertion operator to apply. + * + * @return operator + */ + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionOperator getOperator() { + return operator; + } + + public void setOperator(SyntheticsNetworkAssertionOperator operator) { + if (!operator.isValid()) { + this.unparsed = true; + } + this.operator = operator; + } + + public SyntheticsNetworkAssertionJitter target(Double target) { + this.target = target; + return this; + } + + /** + * Target value in milliseconds. + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getTarget() { + return target; + } + + public void setTarget(Double target) { + this.target = target; + } + + public SyntheticsNetworkAssertionJitter type(SyntheticsNetworkAssertionJitterType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the jitter assertion. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionJitterType getType() { + return type; + } + + public void setType(SyntheticsNetworkAssertionJitterType 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 SyntheticsNetworkAssertionJitter + */ + @JsonAnySetter + public SyntheticsNetworkAssertionJitter 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 SyntheticsNetworkAssertionJitter object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkAssertionJitter syntheticsNetworkAssertionJitter = + (SyntheticsNetworkAssertionJitter) o; + return Objects.equals(this.operator, syntheticsNetworkAssertionJitter.operator) + && Objects.equals(this.target, syntheticsNetworkAssertionJitter.target) + && Objects.equals(this.type, syntheticsNetworkAssertionJitter.type) + && Objects.equals( + this.additionalProperties, syntheticsNetworkAssertionJitter.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operator, target, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkAssertionJitter {\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/SyntheticsNetworkAssertionJitterType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionJitterType.java new file mode 100644 index 00000000000..ffa39d50cf9 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionJitterType.java @@ -0,0 +1,59 @@ +/* + * 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; + +/** Type of the jitter assertion. */ +@JsonSerialize( + using = + SyntheticsNetworkAssertionJitterType.SyntheticsNetworkAssertionJitterTypeSerializer.class) +public class SyntheticsNetworkAssertionJitterType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("jitter")); + + public static final SyntheticsNetworkAssertionJitterType JITTER = + new SyntheticsNetworkAssertionJitterType("jitter"); + + SyntheticsNetworkAssertionJitterType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkAssertionJitterTypeSerializer + extends StdSerializer { + public SyntheticsNetworkAssertionJitterTypeSerializer( + Class t) { + super(t); + } + + public SyntheticsNetworkAssertionJitterTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkAssertionJitterType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkAssertionJitterType fromValue(String value) { + return new SyntheticsNetworkAssertionJitterType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionLatency.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionLatency.java new file mode 100644 index 00000000000..1edef912427 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionLatency.java @@ -0,0 +1,250 @@ +/* + * 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; + +/** Network latency assertion for a Network Path test. */ +@JsonPropertyOrder({ + SyntheticsNetworkAssertionLatency.JSON_PROPERTY_OPERATOR, + SyntheticsNetworkAssertionLatency.JSON_PROPERTY_PROPERTY, + SyntheticsNetworkAssertionLatency.JSON_PROPERTY_TARGET, + SyntheticsNetworkAssertionLatency.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkAssertionLatency { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private SyntheticsNetworkAssertionOperator operator; + + public static final String JSON_PROPERTY_PROPERTY = "property"; + private SyntheticsNetworkAssertionProperty property; + + public static final String JSON_PROPERTY_TARGET = "target"; + private Double target; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsNetworkAssertionLatencyType type = + SyntheticsNetworkAssertionLatencyType.LATENCY; + + public SyntheticsNetworkAssertionLatency() {} + + @JsonCreator + public SyntheticsNetworkAssertionLatency( + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATOR) + SyntheticsNetworkAssertionOperator operator, + @JsonProperty(required = true, value = JSON_PROPERTY_PROPERTY) + SyntheticsNetworkAssertionProperty property, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) Double target, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SyntheticsNetworkAssertionLatencyType type) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + this.property = property; + this.unparsed |= !property.isValid(); + this.target = target; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SyntheticsNetworkAssertionLatency operator(SyntheticsNetworkAssertionOperator operator) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + return this; + } + + /** + * Assertion operator to apply. + * + * @return operator + */ + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionOperator getOperator() { + return operator; + } + + public void setOperator(SyntheticsNetworkAssertionOperator operator) { + if (!operator.isValid()) { + this.unparsed = true; + } + this.operator = operator; + } + + public SyntheticsNetworkAssertionLatency property(SyntheticsNetworkAssertionProperty property) { + this.property = property; + this.unparsed |= !property.isValid(); + return this; + } + + /** + * The associated assertion property. + * + * @return property + */ + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionProperty getProperty() { + return property; + } + + public void setProperty(SyntheticsNetworkAssertionProperty property) { + if (!property.isValid()) { + this.unparsed = true; + } + this.property = property; + } + + public SyntheticsNetworkAssertionLatency target(Double target) { + this.target = target; + return this; + } + + /** + * Target value in milliseconds. + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getTarget() { + return target; + } + + public void setTarget(Double target) { + this.target = target; + } + + public SyntheticsNetworkAssertionLatency type(SyntheticsNetworkAssertionLatencyType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the latency assertion. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionLatencyType getType() { + return type; + } + + public void setType(SyntheticsNetworkAssertionLatencyType 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 SyntheticsNetworkAssertionLatency + */ + @JsonAnySetter + public SyntheticsNetworkAssertionLatency 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 SyntheticsNetworkAssertionLatency object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkAssertionLatency syntheticsNetworkAssertionLatency = + (SyntheticsNetworkAssertionLatency) o; + return Objects.equals(this.operator, syntheticsNetworkAssertionLatency.operator) + && Objects.equals(this.property, syntheticsNetworkAssertionLatency.property) + && Objects.equals(this.target, syntheticsNetworkAssertionLatency.target) + && Objects.equals(this.type, syntheticsNetworkAssertionLatency.type) + && Objects.equals( + this.additionalProperties, syntheticsNetworkAssertionLatency.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operator, property, target, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkAssertionLatency {\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/SyntheticsNetworkAssertionLatencyType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionLatencyType.java new file mode 100644 index 00000000000..720bbc42293 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionLatencyType.java @@ -0,0 +1,61 @@ +/* + * 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; + +/** Type of the latency assertion. */ +@JsonSerialize( + using = + SyntheticsNetworkAssertionLatencyType.SyntheticsNetworkAssertionLatencyTypeSerializer.class) +public class SyntheticsNetworkAssertionLatencyType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("latency")); + + public static final SyntheticsNetworkAssertionLatencyType LATENCY = + new SyntheticsNetworkAssertionLatencyType("latency"); + + SyntheticsNetworkAssertionLatencyType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkAssertionLatencyTypeSerializer + extends StdSerializer { + public SyntheticsNetworkAssertionLatencyTypeSerializer( + Class t) { + super(t); + } + + public SyntheticsNetworkAssertionLatencyTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkAssertionLatencyType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkAssertionLatencyType fromValue(String value) { + return new SyntheticsNetworkAssertionLatencyType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionMultiNetworkHop.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionMultiNetworkHop.java new file mode 100644 index 00000000000..e45297f4f41 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionMultiNetworkHop.java @@ -0,0 +1,254 @@ +/* + * 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; + +/** Multi-network hop assertion for a Network Path test. */ +@JsonPropertyOrder({ + SyntheticsNetworkAssertionMultiNetworkHop.JSON_PROPERTY_OPERATOR, + SyntheticsNetworkAssertionMultiNetworkHop.JSON_PROPERTY_PROPERTY, + SyntheticsNetworkAssertionMultiNetworkHop.JSON_PROPERTY_TARGET, + SyntheticsNetworkAssertionMultiNetworkHop.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkAssertionMultiNetworkHop { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private SyntheticsNetworkAssertionOperator operator; + + public static final String JSON_PROPERTY_PROPERTY = "property"; + private SyntheticsNetworkAssertionProperty property; + + public static final String JSON_PROPERTY_TARGET = "target"; + private Double target; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsNetworkAssertionMultiNetworkHopType type = + SyntheticsNetworkAssertionMultiNetworkHopType.MULTI_NETWORK_HOP; + + public SyntheticsNetworkAssertionMultiNetworkHop() {} + + @JsonCreator + public SyntheticsNetworkAssertionMultiNetworkHop( + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATOR) + SyntheticsNetworkAssertionOperator operator, + @JsonProperty(required = true, value = JSON_PROPERTY_PROPERTY) + SyntheticsNetworkAssertionProperty property, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) Double target, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SyntheticsNetworkAssertionMultiNetworkHopType type) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + this.property = property; + this.unparsed |= !property.isValid(); + this.target = target; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SyntheticsNetworkAssertionMultiNetworkHop operator( + SyntheticsNetworkAssertionOperator operator) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + return this; + } + + /** + * Assertion operator to apply. + * + * @return operator + */ + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionOperator getOperator() { + return operator; + } + + public void setOperator(SyntheticsNetworkAssertionOperator operator) { + if (!operator.isValid()) { + this.unparsed = true; + } + this.operator = operator; + } + + public SyntheticsNetworkAssertionMultiNetworkHop property( + SyntheticsNetworkAssertionProperty property) { + this.property = property; + this.unparsed |= !property.isValid(); + return this; + } + + /** + * The associated assertion property. + * + * @return property + */ + @JsonProperty(JSON_PROPERTY_PROPERTY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionProperty getProperty() { + return property; + } + + public void setProperty(SyntheticsNetworkAssertionProperty property) { + if (!property.isValid()) { + this.unparsed = true; + } + this.property = property; + } + + public SyntheticsNetworkAssertionMultiNetworkHop target(Double target) { + this.target = target; + return this; + } + + /** + * Target value in number of hops. + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getTarget() { + return target; + } + + public void setTarget(Double target) { + this.target = target; + } + + public SyntheticsNetworkAssertionMultiNetworkHop type( + SyntheticsNetworkAssertionMultiNetworkHopType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the multi-network hop assertion. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionMultiNetworkHopType getType() { + return type; + } + + public void setType(SyntheticsNetworkAssertionMultiNetworkHopType 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 SyntheticsNetworkAssertionMultiNetworkHop + */ + @JsonAnySetter + public SyntheticsNetworkAssertionMultiNetworkHop 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 SyntheticsNetworkAssertionMultiNetworkHop object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkAssertionMultiNetworkHop syntheticsNetworkAssertionMultiNetworkHop = + (SyntheticsNetworkAssertionMultiNetworkHop) o; + return Objects.equals(this.operator, syntheticsNetworkAssertionMultiNetworkHop.operator) + && Objects.equals(this.property, syntheticsNetworkAssertionMultiNetworkHop.property) + && Objects.equals(this.target, syntheticsNetworkAssertionMultiNetworkHop.target) + && Objects.equals(this.type, syntheticsNetworkAssertionMultiNetworkHop.type) + && Objects.equals( + this.additionalProperties, + syntheticsNetworkAssertionMultiNetworkHop.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operator, property, target, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkAssertionMultiNetworkHop {\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" property: ").append(toIndentedString(property)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/SyntheticsNetworkAssertionMultiNetworkHopType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionMultiNetworkHopType.java new file mode 100644 index 00000000000..3ead7e95a00 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionMultiNetworkHopType.java @@ -0,0 +1,63 @@ +/* + * 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; + +/** Type of the multi-network hop assertion. */ +@JsonSerialize( + using = + SyntheticsNetworkAssertionMultiNetworkHopType + .SyntheticsNetworkAssertionMultiNetworkHopTypeSerializer.class) +public class SyntheticsNetworkAssertionMultiNetworkHopType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("multiNetworkHop")); + + public static final SyntheticsNetworkAssertionMultiNetworkHopType MULTI_NETWORK_HOP = + new SyntheticsNetworkAssertionMultiNetworkHopType("multiNetworkHop"); + + SyntheticsNetworkAssertionMultiNetworkHopType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkAssertionMultiNetworkHopTypeSerializer + extends StdSerializer { + public SyntheticsNetworkAssertionMultiNetworkHopTypeSerializer( + Class t) { + super(t); + } + + public SyntheticsNetworkAssertionMultiNetworkHopTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkAssertionMultiNetworkHopType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkAssertionMultiNetworkHopType fromValue(String value) { + return new SyntheticsNetworkAssertionMultiNetworkHopType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionOperator.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionOperator.java new file mode 100644 index 00000000000..a92e24fe321 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionOperator.java @@ -0,0 +1,71 @@ +/* + * 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; + +/** Assertion operator to apply. */ +@JsonSerialize( + using = SyntheticsNetworkAssertionOperator.SyntheticsNetworkAssertionOperatorSerializer.class) +public class SyntheticsNetworkAssertionOperator extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "is", "isNot", "lessThan", "lessThanOrEqual", "moreThan", "moreThanOrEqual")); + + public static final SyntheticsNetworkAssertionOperator IS = + new SyntheticsNetworkAssertionOperator("is"); + public static final SyntheticsNetworkAssertionOperator IS_NOT = + new SyntheticsNetworkAssertionOperator("isNot"); + public static final SyntheticsNetworkAssertionOperator LESS_THAN = + new SyntheticsNetworkAssertionOperator("lessThan"); + public static final SyntheticsNetworkAssertionOperator LESS_THAN_OR_EQUAL = + new SyntheticsNetworkAssertionOperator("lessThanOrEqual"); + public static final SyntheticsNetworkAssertionOperator MORE_THAN = + new SyntheticsNetworkAssertionOperator("moreThan"); + public static final SyntheticsNetworkAssertionOperator MORE_THAN_OR_EQUAL = + new SyntheticsNetworkAssertionOperator("moreThanOrEqual"); + + SyntheticsNetworkAssertionOperator(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkAssertionOperatorSerializer + extends StdSerializer { + public SyntheticsNetworkAssertionOperatorSerializer( + Class t) { + super(t); + } + + public SyntheticsNetworkAssertionOperatorSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkAssertionOperator value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkAssertionOperator fromValue(String value) { + return new SyntheticsNetworkAssertionOperator(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionPacketLossPercentage.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionPacketLossPercentage.java new file mode 100644 index 00000000000..8785344c325 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionPacketLossPercentage.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.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Packet loss percentage assertion for a Network Path test. */ +@JsonPropertyOrder({ + SyntheticsNetworkAssertionPacketLossPercentage.JSON_PROPERTY_OPERATOR, + SyntheticsNetworkAssertionPacketLossPercentage.JSON_PROPERTY_TARGET, + SyntheticsNetworkAssertionPacketLossPercentage.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkAssertionPacketLossPercentage { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_OPERATOR = "operator"; + private SyntheticsNetworkAssertionOperator operator; + + public static final String JSON_PROPERTY_TARGET = "target"; + private Double target; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsNetworkAssertionPacketLossPercentageType type = + SyntheticsNetworkAssertionPacketLossPercentageType.PACKET_LOSS_PERCENTAGE; + + public SyntheticsNetworkAssertionPacketLossPercentage() {} + + @JsonCreator + public SyntheticsNetworkAssertionPacketLossPercentage( + @JsonProperty(required = true, value = JSON_PROPERTY_OPERATOR) + SyntheticsNetworkAssertionOperator operator, + @JsonProperty(required = true, value = JSON_PROPERTY_TARGET) Double target, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) + SyntheticsNetworkAssertionPacketLossPercentageType type) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + this.target = target; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SyntheticsNetworkAssertionPacketLossPercentage operator( + SyntheticsNetworkAssertionOperator operator) { + this.operator = operator; + this.unparsed |= !operator.isValid(); + return this; + } + + /** + * Assertion operator to apply. + * + * @return operator + */ + @JsonProperty(JSON_PROPERTY_OPERATOR) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionOperator getOperator() { + return operator; + } + + public void setOperator(SyntheticsNetworkAssertionOperator operator) { + if (!operator.isValid()) { + this.unparsed = true; + } + this.operator = operator; + } + + public SyntheticsNetworkAssertionPacketLossPercentage target(Double target) { + this.target = target; + return this; + } + + /** + * Target value as a percentage (0 to 1). minimum: 0 maximum: 1 + * + * @return target + */ + @JsonProperty(JSON_PROPERTY_TARGET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Double getTarget() { + return target; + } + + public void setTarget(Double target) { + this.target = target; + } + + public SyntheticsNetworkAssertionPacketLossPercentage type( + SyntheticsNetworkAssertionPacketLossPercentageType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the packet loss percentage assertion. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkAssertionPacketLossPercentageType getType() { + return type; + } + + public void setType(SyntheticsNetworkAssertionPacketLossPercentageType 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 SyntheticsNetworkAssertionPacketLossPercentage + */ + @JsonAnySetter + public SyntheticsNetworkAssertionPacketLossPercentage 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 SyntheticsNetworkAssertionPacketLossPercentage object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkAssertionPacketLossPercentage syntheticsNetworkAssertionPacketLossPercentage = + (SyntheticsNetworkAssertionPacketLossPercentage) o; + return Objects.equals(this.operator, syntheticsNetworkAssertionPacketLossPercentage.operator) + && Objects.equals(this.target, syntheticsNetworkAssertionPacketLossPercentage.target) + && Objects.equals(this.type, syntheticsNetworkAssertionPacketLossPercentage.type) + && Objects.equals( + this.additionalProperties, + syntheticsNetworkAssertionPacketLossPercentage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operator, target, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkAssertionPacketLossPercentage {\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" target: ").append(toIndentedString(target)).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/SyntheticsNetworkAssertionPacketLossPercentageType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionPacketLossPercentageType.java new file mode 100644 index 00000000000..e4625a74fc0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionPacketLossPercentageType.java @@ -0,0 +1,63 @@ +/* + * 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; + +/** Type of the packet loss percentage assertion. */ +@JsonSerialize( + using = + SyntheticsNetworkAssertionPacketLossPercentageType + .SyntheticsNetworkAssertionPacketLossPercentageTypeSerializer.class) +public class SyntheticsNetworkAssertionPacketLossPercentageType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("packetLossPercentage")); + + public static final SyntheticsNetworkAssertionPacketLossPercentageType PACKET_LOSS_PERCENTAGE = + new SyntheticsNetworkAssertionPacketLossPercentageType("packetLossPercentage"); + + SyntheticsNetworkAssertionPacketLossPercentageType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkAssertionPacketLossPercentageTypeSerializer + extends StdSerializer { + public SyntheticsNetworkAssertionPacketLossPercentageTypeSerializer( + Class t) { + super(t); + } + + public SyntheticsNetworkAssertionPacketLossPercentageTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkAssertionPacketLossPercentageType value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkAssertionPacketLossPercentageType fromValue(String value) { + return new SyntheticsNetworkAssertionPacketLossPercentageType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionProperty.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionProperty.java new file mode 100644 index 00000000000..e395942439b --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkAssertionProperty.java @@ -0,0 +1,63 @@ +/* + * 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 associated assertion property. */ +@JsonSerialize( + using = SyntheticsNetworkAssertionProperty.SyntheticsNetworkAssertionPropertySerializer.class) +public class SyntheticsNetworkAssertionProperty extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("avg", "max", "min")); + + public static final SyntheticsNetworkAssertionProperty AVG = + new SyntheticsNetworkAssertionProperty("avg"); + public static final SyntheticsNetworkAssertionProperty MAX = + new SyntheticsNetworkAssertionProperty("max"); + public static final SyntheticsNetworkAssertionProperty MIN = + new SyntheticsNetworkAssertionProperty("min"); + + SyntheticsNetworkAssertionProperty(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkAssertionPropertySerializer + extends StdSerializer { + public SyntheticsNetworkAssertionPropertySerializer( + Class t) { + super(t); + } + + public SyntheticsNetworkAssertionPropertySerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkAssertionProperty value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkAssertionProperty fromValue(String value) { + return new SyntheticsNetworkAssertionProperty(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTest.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTest.java new file mode 100644 index 00000000000..989f14e4ccb --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTest.java @@ -0,0 +1,452 @@ +/* + * 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; + +/** Object containing details about a Network Path test. */ +@JsonPropertyOrder({ + SyntheticsNetworkTest.JSON_PROPERTY_CONFIG, + SyntheticsNetworkTest.JSON_PROPERTY_LOCATIONS, + SyntheticsNetworkTest.JSON_PROPERTY_MESSAGE, + SyntheticsNetworkTest.JSON_PROPERTY_MONITOR_ID, + SyntheticsNetworkTest.JSON_PROPERTY_NAME, + SyntheticsNetworkTest.JSON_PROPERTY_OPTIONS, + SyntheticsNetworkTest.JSON_PROPERTY_PUBLIC_ID, + SyntheticsNetworkTest.JSON_PROPERTY_STATUS, + SyntheticsNetworkTest.JSON_PROPERTY_SUBTYPE, + SyntheticsNetworkTest.JSON_PROPERTY_TAGS, + SyntheticsNetworkTest.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkTest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_CONFIG = "config"; + private SyntheticsNetworkTestConfig config; + + public static final String JSON_PROPERTY_LOCATIONS = "locations"; + private List locations = new ArrayList<>(); + + public static final String JSON_PROPERTY_MESSAGE = "message"; + private String message; + + public static final String JSON_PROPERTY_MONITOR_ID = "monitor_id"; + private Long monitorId; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_OPTIONS = "options"; + private SyntheticsTestOptions options; + + public static final String JSON_PROPERTY_PUBLIC_ID = "public_id"; + private String publicId; + + public static final String JSON_PROPERTY_STATUS = "status"; + private SyntheticsTestPauseStatus status; + + public static final String JSON_PROPERTY_SUBTYPE = "subtype"; + private SyntheticsNetworkTestSubType subtype; + + public static final String JSON_PROPERTY_TAGS = "tags"; + private List tags = null; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsNetworkTestType type = SyntheticsNetworkTestType.NETWORK; + + public SyntheticsNetworkTest() {} + + @JsonCreator + public SyntheticsNetworkTest( + @JsonProperty(required = true, value = JSON_PROPERTY_CONFIG) + SyntheticsNetworkTestConfig config, + @JsonProperty(required = true, value = JSON_PROPERTY_LOCATIONS) List locations, + @JsonProperty(required = true, value = JSON_PROPERTY_MESSAGE) String message, + @JsonProperty(required = true, value = JSON_PROPERTY_NAME) String name, + @JsonProperty(required = true, value = JSON_PROPERTY_OPTIONS) SyntheticsTestOptions options, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SyntheticsNetworkTestType type) { + this.config = config; + this.unparsed |= config.unparsed; + this.locations = locations; + this.message = message; + this.name = name; + this.options = options; + this.unparsed |= options.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SyntheticsNetworkTest config(SyntheticsNetworkTestConfig config) { + this.config = config; + this.unparsed |= config.unparsed; + return this; + } + + /** + * Configuration object for a Network Path test. + * + * @return config + */ + @JsonProperty(JSON_PROPERTY_CONFIG) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkTestConfig getConfig() { + return config; + } + + public void setConfig(SyntheticsNetworkTestConfig config) { + this.config = config; + } + + public SyntheticsNetworkTest locations(List locations) { + this.locations = locations; + return this; + } + + public SyntheticsNetworkTest addLocationsItem(String locationsItem) { + this.locations.add(locationsItem); + return this; + } + + /** + * Array of locations used to run the test. Network Path tests can be run from managed locations + * to test public endpoints, or from a Datadog + * Agent to test private environments. + * + * @return locations + */ + @JsonProperty(JSON_PROPERTY_LOCATIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getLocations() { + return locations; + } + + public void setLocations(List locations) { + this.locations = locations; + } + + public SyntheticsNetworkTest message(String message) { + this.message = message; + return this; + } + + /** + * Notification message associated with the test. + * + * @return message + */ + @JsonProperty(JSON_PROPERTY_MESSAGE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + /** + * The associated monitor ID. + * + * @return monitorId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MONITOR_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMonitorId() { + return monitorId; + } + + public SyntheticsNetworkTest name(String name) { + this.name = name; + return this; + } + + /** + * Name of the test. + * + * @return name + */ + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public SyntheticsNetworkTest options(SyntheticsTestOptions options) { + this.options = options; + this.unparsed |= options.unparsed; + return this; + } + + /** + * Object describing the extra options for a Synthetic test. + * + * @return options + */ + @JsonProperty(JSON_PROPERTY_OPTIONS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsTestOptions getOptions() { + return options; + } + + public void setOptions(SyntheticsTestOptions options) { + this.options = options; + } + + /** + * The public ID for the test. + * + * @return publicId + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PUBLIC_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getPublicId() { + return publicId; + } + + public SyntheticsNetworkTest status(SyntheticsTestPauseStatus status) { + this.status = status; + this.unparsed |= !status.isValid(); + return this; + } + + /** + * Define whether you want to start (live) or pause (paused) a Synthetic + * test. + * + * @return status + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_STATUS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestPauseStatus getStatus() { + return status; + } + + public void setStatus(SyntheticsTestPauseStatus status) { + if (!status.isValid()) { + this.unparsed = true; + } + this.status = status; + } + + public SyntheticsNetworkTest subtype(SyntheticsNetworkTestSubType subtype) { + this.subtype = subtype; + this.unparsed |= !subtype.isValid(); + return this; + } + + /** + * The subtype of the Synthetic Network Path test, tcp, udp, or + * icmp. + * + * @return subtype + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SUBTYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsNetworkTestSubType getSubtype() { + return subtype; + } + + public void setSubtype(SyntheticsNetworkTestSubType subtype) { + if (!subtype.isValid()) { + this.unparsed = true; + } + this.subtype = subtype; + } + + public SyntheticsNetworkTest tags(List tags) { + this.tags = tags; + return this; + } + + public SyntheticsNetworkTest addTagsItem(String tagsItem) { + if (this.tags == null) { + this.tags = new ArrayList<>(); + } + this.tags.add(tagsItem); + return this; + } + + /** + * Array of tags attached to the test. + * + * @return tags + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TAGS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getTags() { + return tags; + } + + public void setTags(List tags) { + this.tags = tags; + } + + public SyntheticsNetworkTest type(SyntheticsNetworkTestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Synthetic test, network. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkTestType getType() { + return type; + } + + public void setType(SyntheticsNetworkTestType 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 SyntheticsNetworkTest + */ + @JsonAnySetter + public SyntheticsNetworkTest 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 SyntheticsNetworkTest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkTest syntheticsNetworkTest = (SyntheticsNetworkTest) o; + return Objects.equals(this.config, syntheticsNetworkTest.config) + && Objects.equals(this.locations, syntheticsNetworkTest.locations) + && Objects.equals(this.message, syntheticsNetworkTest.message) + && Objects.equals(this.monitorId, syntheticsNetworkTest.monitorId) + && Objects.equals(this.name, syntheticsNetworkTest.name) + && Objects.equals(this.options, syntheticsNetworkTest.options) + && Objects.equals(this.publicId, syntheticsNetworkTest.publicId) + && Objects.equals(this.status, syntheticsNetworkTest.status) + && Objects.equals(this.subtype, syntheticsNetworkTest.subtype) + && Objects.equals(this.tags, syntheticsNetworkTest.tags) + && Objects.equals(this.type, syntheticsNetworkTest.type) + && Objects.equals(this.additionalProperties, syntheticsNetworkTest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + config, + locations, + message, + monitorId, + name, + options, + publicId, + status, + subtype, + tags, + type, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkTest {\n"); + sb.append(" config: ").append(toIndentedString(config)).append("\n"); + sb.append(" locations: ").append(toIndentedString(locations)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" monitorId: ").append(toIndentedString(monitorId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" publicId: ").append(toIndentedString(publicId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" subtype: ").append(toIndentedString(subtype)).append("\n"); + sb.append(" tags: ").append(toIndentedString(tags)).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/SyntheticsNetworkTestConfig.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestConfig.java new file mode 100644 index 00000000000..1ca1a32aa8f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestConfig.java @@ -0,0 +1,180 @@ +/* + * 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; + +/** Configuration object for a Network Path test. */ +@JsonPropertyOrder({ + SyntheticsNetworkTestConfig.JSON_PROPERTY_ASSERTIONS, + SyntheticsNetworkTestConfig.JSON_PROPERTY_REQUEST +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkTestConfig { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ASSERTIONS = "assertions"; + private List assertions = null; + + public static final String JSON_PROPERTY_REQUEST = "request"; + private SyntheticsNetworkTestRequest request; + + public SyntheticsNetworkTestConfig assertions(List assertions) { + this.assertions = assertions; + for (SyntheticsNetworkAssertion item : assertions) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsNetworkTestConfig addAssertionsItem(SyntheticsNetworkAssertion assertionsItem) { + if (this.assertions == null) { + this.assertions = new ArrayList<>(); + } + this.assertions.add(assertionsItem); + this.unparsed |= assertionsItem.unparsed; + return this; + } + + /** + * Array of assertions used for the test. + * + * @return assertions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ASSERTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getAssertions() { + return assertions; + } + + public void setAssertions(List assertions) { + this.assertions = assertions; + } + + public SyntheticsNetworkTestConfig request(SyntheticsNetworkTestRequest request) { + this.request = request; + this.unparsed |= request.unparsed; + return this; + } + + /** + * Object describing the request for a Network Path test. + * + * @return request + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_REQUEST) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsNetworkTestRequest getRequest() { + return request; + } + + public void setRequest(SyntheticsNetworkTestRequest request) { + this.request = request; + } + + /** + * 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 SyntheticsNetworkTestConfig + */ + @JsonAnySetter + public SyntheticsNetworkTestConfig 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 SyntheticsNetworkTestConfig object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkTestConfig syntheticsNetworkTestConfig = (SyntheticsNetworkTestConfig) o; + return Objects.equals(this.assertions, syntheticsNetworkTestConfig.assertions) + && Objects.equals(this.request, syntheticsNetworkTestConfig.request) + && Objects.equals( + this.additionalProperties, syntheticsNetworkTestConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(assertions, request, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkTestConfig {\n"); + sb.append(" assertions: ").append(toIndentedString(assertions)).append("\n"); + sb.append(" request: ").append(toIndentedString(request)).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/SyntheticsNetworkTestEdit.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestEdit.java new file mode 100644 index 00000000000..9a476aaf917 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestEdit.java @@ -0,0 +1,182 @@ +/* + * 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; + +/** */ +@JsonPropertyOrder({ + SyntheticsNetworkTestEdit.JSON_PROPERTY_ATTRIBUTES, + SyntheticsNetworkTestEdit.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkTestEdit { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SyntheticsNetworkTest attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsNetworkTestType type = SyntheticsNetworkTestType.NETWORK; + + public SyntheticsNetworkTestEdit() {} + + @JsonCreator + public SyntheticsNetworkTestEdit( + @JsonProperty(required = true, value = JSON_PROPERTY_ATTRIBUTES) + SyntheticsNetworkTest attributes, + @JsonProperty(required = true, value = JSON_PROPERTY_TYPE) SyntheticsNetworkTestType type) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + this.type = type; + this.unparsed |= !type.isValid(); + } + + public SyntheticsNetworkTestEdit attributes(SyntheticsNetworkTest attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object containing details about a Network Path test. + * + * @return attributes + */ + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkTest getAttributes() { + return attributes; + } + + public void setAttributes(SyntheticsNetworkTest attributes) { + this.attributes = attributes; + } + + public SyntheticsNetworkTestEdit type(SyntheticsNetworkTestType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of the Synthetic test, network. + * + * @return type + */ + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkTestType getType() { + return type; + } + + public void setType(SyntheticsNetworkTestType 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 SyntheticsNetworkTestEdit + */ + @JsonAnySetter + public SyntheticsNetworkTestEdit 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 SyntheticsNetworkTestEdit object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkTestEdit syntheticsNetworkTestEdit = (SyntheticsNetworkTestEdit) o; + return Objects.equals(this.attributes, syntheticsNetworkTestEdit.attributes) + && Objects.equals(this.type, syntheticsNetworkTestEdit.type) + && Objects.equals( + this.additionalProperties, syntheticsNetworkTestEdit.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkTestEdit {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestEditRequest.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestEditRequest.java new file mode 100644 index 00000000000..a1f251e0585 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestEditRequest.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Network Path test request */ +@JsonPropertyOrder({SyntheticsNetworkTestEditRequest.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkTestEditRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SyntheticsNetworkTestEdit data; + + public SyntheticsNetworkTestEditRequest() {} + + @JsonCreator + public SyntheticsNetworkTestEditRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_DATA) SyntheticsNetworkTestEdit data) { + this.data = data; + this.unparsed |= data.unparsed; + } + + public SyntheticsNetworkTestEditRequest data(SyntheticsNetworkTestEdit data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Getdata + * + * @return data + */ + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public SyntheticsNetworkTestEdit getData() { + return data; + } + + public void setData(SyntheticsNetworkTestEdit data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsNetworkTestEditRequest + */ + @JsonAnySetter + public SyntheticsNetworkTestEditRequest 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 SyntheticsNetworkTestEditRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkTestEditRequest syntheticsNetworkTestEditRequest = + (SyntheticsNetworkTestEditRequest) o; + return Objects.equals(this.data, syntheticsNetworkTestEditRequest.data) + && Objects.equals( + this.additionalProperties, syntheticsNetworkTestEditRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkTestEditRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestRequest.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestRequest.java new file mode 100644 index 00000000000..96ad0d29975 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestRequest.java @@ -0,0 +1,381 @@ +/* + * 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; + +/** Object describing the request for a Network Path test. */ +@JsonPropertyOrder({ + SyntheticsNetworkTestRequest.JSON_PROPERTY_DESTINATION_SERVICE, + SyntheticsNetworkTestRequest.JSON_PROPERTY_E2E_QUERIES, + SyntheticsNetworkTestRequest.JSON_PROPERTY_HOST, + SyntheticsNetworkTestRequest.JSON_PROPERTY_MAX_TTL, + SyntheticsNetworkTestRequest.JSON_PROPERTY_PORT, + SyntheticsNetworkTestRequest.JSON_PROPERTY_SOURCE_SERVICE, + SyntheticsNetworkTestRequest.JSON_PROPERTY_TCP_METHOD, + SyntheticsNetworkTestRequest.JSON_PROPERTY_TIMEOUT, + SyntheticsNetworkTestRequest.JSON_PROPERTY_TRACEROUTE_QUERIES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkTestRequest { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DESTINATION_SERVICE = "destination_service"; + private String destinationService; + + public static final String JSON_PROPERTY_E2E_QUERIES = "e2e_queries"; + private Long e2eQueries; + + public static final String JSON_PROPERTY_HOST = "host"; + private String host; + + public static final String JSON_PROPERTY_MAX_TTL = "max_ttl"; + private Long maxTtl; + + public static final String JSON_PROPERTY_PORT = "port"; + private Long port; + + public static final String JSON_PROPERTY_SOURCE_SERVICE = "source_service"; + private String sourceService; + + public static final String JSON_PROPERTY_TCP_METHOD = "tcp_method"; + private SyntheticsNetworkTestRequestTCPMethod tcpMethod; + + public static final String JSON_PROPERTY_TIMEOUT = "timeout"; + private Long timeout; + + public static final String JSON_PROPERTY_TRACEROUTE_QUERIES = "traceroute_queries"; + private Long tracerouteQueries; + + public SyntheticsNetworkTestRequest() {} + + @JsonCreator + public SyntheticsNetworkTestRequest( + @JsonProperty(required = true, value = JSON_PROPERTY_E2E_QUERIES) Long e2eQueries, + @JsonProperty(required = true, value = JSON_PROPERTY_HOST) String host, + @JsonProperty(required = true, value = JSON_PROPERTY_MAX_TTL) Long maxTtl, + @JsonProperty(required = true, value = JSON_PROPERTY_TRACEROUTE_QUERIES) + Long tracerouteQueries) { + this.e2eQueries = e2eQueries; + this.host = host; + this.maxTtl = maxTtl; + this.tracerouteQueries = tracerouteQueries; + } + + public SyntheticsNetworkTestRequest destinationService(String destinationService) { + this.destinationService = destinationService; + return this; + } + + /** + * Destination service name. + * + * @return destinationService + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DESTINATION_SERVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getDestinationService() { + return destinationService; + } + + public void setDestinationService(String destinationService) { + this.destinationService = destinationService; + } + + public SyntheticsNetworkTestRequest e2eQueries(Long e2eQueries) { + this.e2eQueries = e2eQueries; + return this; + } + + /** + * Number of end-to-end queries. + * + * @return e2eQueries + */ + @JsonProperty(JSON_PROPERTY_E2E_QUERIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getE2eQueries() { + return e2eQueries; + } + + public void setE2eQueries(Long e2eQueries) { + this.e2eQueries = e2eQueries; + } + + public SyntheticsNetworkTestRequest host(String host) { + this.host = host; + return this; + } + + /** + * Host name to query. + * + * @return host + */ + @JsonProperty(JSON_PROPERTY_HOST) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public SyntheticsNetworkTestRequest maxTtl(Long maxTtl) { + this.maxTtl = maxTtl; + return this; + } + + /** + * Maximum TTL for network packets. + * + * @return maxTtl + */ + @JsonProperty(JSON_PROPERTY_MAX_TTL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getMaxTtl() { + return maxTtl; + } + + public void setMaxTtl(Long maxTtl) { + this.maxTtl = maxTtl; + } + + public SyntheticsNetworkTestRequest port(Long port) { + this.port = port; + return this; + } + + /** + * For TCP or UDP tests, the port to use when performing the test. If not set on a UDP test, a + * random port will be assigned, which may affect the results. + * + * @return port + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_PORT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getPort() { + return port; + } + + public void setPort(Long port) { + this.port = port; + } + + public SyntheticsNetworkTestRequest sourceService(String sourceService) { + this.sourceService = sourceService; + return this; + } + + /** + * Source service name. + * + * @return sourceService + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SOURCE_SERVICE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getSourceService() { + return sourceService; + } + + public void setSourceService(String sourceService) { + this.sourceService = sourceService; + } + + public SyntheticsNetworkTestRequest tcpMethod(SyntheticsNetworkTestRequestTCPMethod tcpMethod) { + this.tcpMethod = tcpMethod; + this.unparsed |= !tcpMethod.isValid(); + return this; + } + + /** + * For TCP tests, the TCP method to use. + * + * @return tcpMethod + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TCP_METHOD) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsNetworkTestRequestTCPMethod getTcpMethod() { + return tcpMethod; + } + + public void setTcpMethod(SyntheticsNetworkTestRequestTCPMethod tcpMethod) { + if (!tcpMethod.isValid()) { + this.unparsed = true; + } + this.tcpMethod = tcpMethod; + } + + public SyntheticsNetworkTestRequest timeout(Long timeout) { + this.timeout = timeout; + return this; + } + + /** + * Timeout in seconds. + * + * @return timeout + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TIMEOUT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTimeout() { + return timeout; + } + + public void setTimeout(Long timeout) { + this.timeout = timeout; + } + + public SyntheticsNetworkTestRequest tracerouteQueries(Long tracerouteQueries) { + this.tracerouteQueries = tracerouteQueries; + return this; + } + + /** + * Number of traceroute queries. + * + * @return tracerouteQueries + */ + @JsonProperty(JSON_PROPERTY_TRACEROUTE_QUERIES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Long getTracerouteQueries() { + return tracerouteQueries; + } + + public void setTracerouteQueries(Long tracerouteQueries) { + this.tracerouteQueries = tracerouteQueries; + } + + /** + * 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 SyntheticsNetworkTestRequest + */ + @JsonAnySetter + public SyntheticsNetworkTestRequest 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 SyntheticsNetworkTestRequest object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkTestRequest syntheticsNetworkTestRequest = (SyntheticsNetworkTestRequest) o; + return Objects.equals(this.destinationService, syntheticsNetworkTestRequest.destinationService) + && Objects.equals(this.e2eQueries, syntheticsNetworkTestRequest.e2eQueries) + && Objects.equals(this.host, syntheticsNetworkTestRequest.host) + && Objects.equals(this.maxTtl, syntheticsNetworkTestRequest.maxTtl) + && Objects.equals(this.port, syntheticsNetworkTestRequest.port) + && Objects.equals(this.sourceService, syntheticsNetworkTestRequest.sourceService) + && Objects.equals(this.tcpMethod, syntheticsNetworkTestRequest.tcpMethod) + && Objects.equals(this.timeout, syntheticsNetworkTestRequest.timeout) + && Objects.equals(this.tracerouteQueries, syntheticsNetworkTestRequest.tracerouteQueries) + && Objects.equals( + this.additionalProperties, syntheticsNetworkTestRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + destinationService, + e2eQueries, + host, + maxTtl, + port, + sourceService, + tcpMethod, + timeout, + tracerouteQueries, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkTestRequest {\n"); + sb.append(" destinationService: ").append(toIndentedString(destinationService)).append("\n"); + sb.append(" e2eQueries: ").append(toIndentedString(e2eQueries)).append("\n"); + sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" maxTtl: ").append(toIndentedString(maxTtl)).append("\n"); + sb.append(" port: ").append(toIndentedString(port)).append("\n"); + sb.append(" sourceService: ").append(toIndentedString(sourceService)).append("\n"); + sb.append(" tcpMethod: ").append(toIndentedString(tcpMethod)).append("\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" tracerouteQueries: ").append(toIndentedString(tracerouteQueries)).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/SyntheticsNetworkTestRequestTCPMethod.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestRequestTCPMethod.java new file mode 100644 index 00000000000..9e71b020e8c --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestRequestTCPMethod.java @@ -0,0 +1,66 @@ +/* + * 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; + +/** For TCP tests, the TCP method to use. */ +@JsonSerialize( + using = + SyntheticsNetworkTestRequestTCPMethod.SyntheticsNetworkTestRequestTCPMethodSerializer.class) +public class SyntheticsNetworkTestRequestTCPMethod extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("prefer_sack", "syn", "sack")); + + public static final SyntheticsNetworkTestRequestTCPMethod PREFER_SACK = + new SyntheticsNetworkTestRequestTCPMethod("prefer_sack"); + public static final SyntheticsNetworkTestRequestTCPMethod SYN = + new SyntheticsNetworkTestRequestTCPMethod("syn"); + public static final SyntheticsNetworkTestRequestTCPMethod SACK = + new SyntheticsNetworkTestRequestTCPMethod("sack"); + + SyntheticsNetworkTestRequestTCPMethod(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkTestRequestTCPMethodSerializer + extends StdSerializer { + public SyntheticsNetworkTestRequestTCPMethodSerializer( + Class t) { + super(t); + } + + public SyntheticsNetworkTestRequestTCPMethodSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkTestRequestTCPMethod value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkTestRequestTCPMethod fromValue(String value) { + return new SyntheticsNetworkTestRequestTCPMethod(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponse.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponse.java new file mode 100644 index 00000000000..8fdd8019971 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponse.java @@ -0,0 +1,137 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Network Path test response */ +@JsonPropertyOrder({SyntheticsNetworkTestResponse.JSON_PROPERTY_DATA}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkTestResponse { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DATA = "data"; + private SyntheticsNetworkTestResponseData data; + + public SyntheticsNetworkTestResponse data(SyntheticsNetworkTestResponseData data) { + this.data = data; + this.unparsed |= data.unparsed; + return this; + } + + /** + * Network Path test response data + * + * @return data + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsNetworkTestResponseData getData() { + return data; + } + + public void setData(SyntheticsNetworkTestResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return SyntheticsNetworkTestResponse + */ + @JsonAnySetter + public SyntheticsNetworkTestResponse 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 SyntheticsNetworkTestResponse object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkTestResponse syntheticsNetworkTestResponse = (SyntheticsNetworkTestResponse) o; + return Objects.equals(this.data, syntheticsNetworkTestResponse.data) + && Objects.equals( + this.additionalProperties, syntheticsNetworkTestResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkTestResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponseData.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponseData.java new file mode 100644 index 00000000000..0b4f83d1032 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponseData.java @@ -0,0 +1,189 @@ +/* + * 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; + +/** Network Path test response data */ +@JsonPropertyOrder({ + SyntheticsNetworkTestResponseData.JSON_PROPERTY_ATTRIBUTES, + SyntheticsNetworkTestResponseData.JSON_PROPERTY_ID, + SyntheticsNetworkTestResponseData.JSON_PROPERTY_TYPE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsNetworkTestResponseData { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private SyntheticsNetworkTest attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private SyntheticsNetworkTestResponseType type = SyntheticsNetworkTestResponseType.NETWORK_TEST; + + public SyntheticsNetworkTestResponseData attributes(SyntheticsNetworkTest attributes) { + this.attributes = attributes; + this.unparsed |= attributes.unparsed; + return this; + } + + /** + * Object containing details about a Network Path test. + * + * @return attributes + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsNetworkTest getAttributes() { + return attributes; + } + + public void setAttributes(SyntheticsNetworkTest attributes) { + this.attributes = attributes; + } + + /** + * The public ID of the Network Path test. + * + * @return id + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getId() { + return id; + } + + public SyntheticsNetworkTestResponseData type(SyntheticsNetworkTestResponseType type) { + this.type = type; + this.unparsed |= !type.isValid(); + return this; + } + + /** + * Type of response, network_test. + * + * @return type + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsNetworkTestResponseType getType() { + return type; + } + + public void setType(SyntheticsNetworkTestResponseType 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 SyntheticsNetworkTestResponseData + */ + @JsonAnySetter + public SyntheticsNetworkTestResponseData 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 SyntheticsNetworkTestResponseData object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsNetworkTestResponseData syntheticsNetworkTestResponseData = + (SyntheticsNetworkTestResponseData) o; + return Objects.equals(this.attributes, syntheticsNetworkTestResponseData.attributes) + && Objects.equals(this.id, syntheticsNetworkTestResponseData.id) + && Objects.equals(this.type, syntheticsNetworkTestResponseData.type) + && Objects.equals( + this.additionalProperties, syntheticsNetworkTestResponseData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsNetworkTestResponseData {\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/SyntheticsNetworkTestResponseType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponseType.java new file mode 100644 index 00000000000..97d67df90d4 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestResponseType.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; + +/** Type of response, network_test. */ +@JsonSerialize( + using = SyntheticsNetworkTestResponseType.SyntheticsNetworkTestResponseTypeSerializer.class) +public class SyntheticsNetworkTestResponseType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("network_test")); + + public static final SyntheticsNetworkTestResponseType NETWORK_TEST = + new SyntheticsNetworkTestResponseType("network_test"); + + SyntheticsNetworkTestResponseType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkTestResponseTypeSerializer + extends StdSerializer { + public SyntheticsNetworkTestResponseTypeSerializer(Class t) { + super(t); + } + + public SyntheticsNetworkTestResponseTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkTestResponseType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkTestResponseType fromValue(String value) { + return new SyntheticsNetworkTestResponseType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestSubType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestSubType.java new file mode 100644 index 00000000000..768f1874a89 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestSubType.java @@ -0,0 +1,61 @@ +/* + * 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 subtype of the Synthetic Network Path test, tcp, udp, or icmp + * . + */ +@JsonSerialize(using = SyntheticsNetworkTestSubType.SyntheticsNetworkTestSubTypeSerializer.class) +public class SyntheticsNetworkTestSubType extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("tcp", "udp", "icmp")); + + public static final SyntheticsNetworkTestSubType TCP = new SyntheticsNetworkTestSubType("tcp"); + public static final SyntheticsNetworkTestSubType UDP = new SyntheticsNetworkTestSubType("udp"); + public static final SyntheticsNetworkTestSubType ICMP = new SyntheticsNetworkTestSubType("icmp"); + + SyntheticsNetworkTestSubType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkTestSubTypeSerializer + extends StdSerializer { + public SyntheticsNetworkTestSubTypeSerializer(Class t) { + super(t); + } + + public SyntheticsNetworkTestSubTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkTestSubType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkTestSubType fromValue(String value) { + return new SyntheticsNetworkTestSubType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestType.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestType.java new file mode 100644 index 00000000000..99a25c4ffb3 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsNetworkTestType.java @@ -0,0 +1,55 @@ +/* + * 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; + +/** Type of the Synthetic test, network. */ +@JsonSerialize(using = SyntheticsNetworkTestType.SyntheticsNetworkTestTypeSerializer.class) +public class SyntheticsNetworkTestType extends ModelEnum { + + private static final Set allowedValues = new HashSet(Arrays.asList("network")); + + public static final SyntheticsNetworkTestType NETWORK = new SyntheticsNetworkTestType("network"); + + SyntheticsNetworkTestType(String value) { + super(value, allowedValues); + } + + public static class SyntheticsNetworkTestTypeSerializer + extends StdSerializer { + public SyntheticsNetworkTestTypeSerializer(Class t) { + super(t); + } + + public SyntheticsNetworkTestTypeSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsNetworkTestType value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsNetworkTestType fromValue(String value) { + return new SyntheticsNetworkTestType(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptions.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptions.java new file mode 100644 index 00000000000..e638256ce9d --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptions.java @@ -0,0 +1,381 @@ +/* + * 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; + +/** Object describing the extra options for a Synthetic test. */ +@JsonPropertyOrder({ + SyntheticsTestOptions.JSON_PROPERTY_MIN_FAILURE_DURATION, + SyntheticsTestOptions.JSON_PROPERTY_MIN_LOCATION_FAILED, + SyntheticsTestOptions.JSON_PROPERTY_MONITOR_NAME, + SyntheticsTestOptions.JSON_PROPERTY_MONITOR_OPTIONS, + SyntheticsTestOptions.JSON_PROPERTY_MONITOR_PRIORITY, + SyntheticsTestOptions.JSON_PROPERTY_RESTRICTED_ROLES, + SyntheticsTestOptions.JSON_PROPERTY_RETRY, + SyntheticsTestOptions.JSON_PROPERTY_SCHEDULING, + SyntheticsTestOptions.JSON_PROPERTY_TICK_EVERY +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestOptions { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_MIN_FAILURE_DURATION = "min_failure_duration"; + private Long minFailureDuration; + + public static final String JSON_PROPERTY_MIN_LOCATION_FAILED = "min_location_failed"; + private Long minLocationFailed; + + public static final String JSON_PROPERTY_MONITOR_NAME = "monitor_name"; + private String monitorName; + + public static final String JSON_PROPERTY_MONITOR_OPTIONS = "monitor_options"; + private SyntheticsTestOptionsMonitorOptions monitorOptions; + + public static final String JSON_PROPERTY_MONITOR_PRIORITY = "monitor_priority"; + private Integer monitorPriority; + + public static final String JSON_PROPERTY_RESTRICTED_ROLES = "restricted_roles"; + private List restrictedRoles = null; + + public static final String JSON_PROPERTY_RETRY = "retry"; + private SyntheticsTestOptionsRetry retry; + + public static final String JSON_PROPERTY_SCHEDULING = "scheduling"; + private SyntheticsTestOptionsScheduling scheduling; + + public static final String JSON_PROPERTY_TICK_EVERY = "tick_every"; + private Long tickEvery; + + public SyntheticsTestOptions minFailureDuration(Long minFailureDuration) { + this.minFailureDuration = minFailureDuration; + return this; + } + + /** + * Minimum amount of time in failure required to trigger an alert. + * + * @return minFailureDuration + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN_FAILURE_DURATION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMinFailureDuration() { + return minFailureDuration; + } + + public void setMinFailureDuration(Long minFailureDuration) { + this.minFailureDuration = minFailureDuration; + } + + public SyntheticsTestOptions minLocationFailed(Long minLocationFailed) { + this.minLocationFailed = minLocationFailed; + return this; + } + + /** + * Minimum number of locations in failure required to trigger an alert. + * + * @return minLocationFailed + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MIN_LOCATION_FAILED) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getMinLocationFailed() { + return minLocationFailed; + } + + public void setMinLocationFailed(Long minLocationFailed) { + this.minLocationFailed = minLocationFailed; + } + + public SyntheticsTestOptions monitorName(String monitorName) { + this.monitorName = monitorName; + return this; + } + + /** + * The monitor name is used for the alert title as well as for all monitor dashboard widgets and + * SLOs. + * + * @return monitorName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MONITOR_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getMonitorName() { + return monitorName; + } + + public void setMonitorName(String monitorName) { + this.monitorName = monitorName; + } + + public SyntheticsTestOptions monitorOptions(SyntheticsTestOptionsMonitorOptions monitorOptions) { + this.monitorOptions = monitorOptions; + this.unparsed |= monitorOptions.unparsed; + return this; + } + + /** + * Object containing the options for a Synthetic test as a monitor (for example, renotification). + * + * @return monitorOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MONITOR_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestOptionsMonitorOptions getMonitorOptions() { + return monitorOptions; + } + + public void setMonitorOptions(SyntheticsTestOptionsMonitorOptions monitorOptions) { + this.monitorOptions = monitorOptions; + } + + public SyntheticsTestOptions monitorPriority(Integer monitorPriority) { + this.monitorPriority = monitorPriority; + return this; + } + + /** + * Integer from 1 (high) to 5 (low) indicating alert severity. minimum: 1 maximum: 5 + * + * @return monitorPriority + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_MONITOR_PRIORITY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Integer getMonitorPriority() { + return monitorPriority; + } + + public void setMonitorPriority(Integer monitorPriority) { + this.monitorPriority = monitorPriority; + } + + public SyntheticsTestOptions restrictedRoles(List restrictedRoles) { + this.restrictedRoles = restrictedRoles; + return this; + } + + public SyntheticsTestOptions addRestrictedRolesItem(String restrictedRolesItem) { + if (this.restrictedRoles == null) { + this.restrictedRoles = new ArrayList<>(); + } + this.restrictedRoles.add(restrictedRolesItem); + return this; + } + + /** + * A list of role identifiers that can be pulled from the Roles API, for restricting read and + * write access. This field is deprecated. Use the restriction policies API to manage permissions. + * + * @return restrictedRoles + * @deprecated + */ + @Deprecated + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RESTRICTED_ROLES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public List getRestrictedRoles() { + return restrictedRoles; + } + + @Deprecated + public void setRestrictedRoles(List restrictedRoles) { + this.restrictedRoles = restrictedRoles; + } + + public SyntheticsTestOptions retry(SyntheticsTestOptionsRetry retry) { + this.retry = retry; + this.unparsed |= retry.unparsed; + return this; + } + + /** + * Object describing the retry strategy to apply to a Synthetic test. + * + * @return retry + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RETRY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestOptionsRetry getRetry() { + return retry; + } + + public void setRetry(SyntheticsTestOptionsRetry retry) { + this.retry = retry; + } + + public SyntheticsTestOptions scheduling(SyntheticsTestOptionsScheduling scheduling) { + this.scheduling = scheduling; + this.unparsed |= scheduling.unparsed; + return this; + } + + /** + * Object containing timeframes and timezone used for advanced scheduling. + * + * @return scheduling + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_SCHEDULING) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestOptionsScheduling getScheduling() { + return scheduling; + } + + public void setScheduling(SyntheticsTestOptionsScheduling scheduling) { + this.scheduling = scheduling; + } + + public SyntheticsTestOptions tickEvery(Long tickEvery) { + this.tickEvery = tickEvery; + return this; + } + + /** + * The frequency at which to run the Synthetic test (in seconds). minimum: 30 maximum: 604800 + * + * @return tickEvery + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_TICK_EVERY) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getTickEvery() { + return tickEvery; + } + + public void setTickEvery(Long tickEvery) { + this.tickEvery = tickEvery; + } + + /** + * 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 SyntheticsTestOptions + */ + @JsonAnySetter + public SyntheticsTestOptions 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 SyntheticsTestOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestOptions syntheticsTestOptions = (SyntheticsTestOptions) o; + return Objects.equals(this.minFailureDuration, syntheticsTestOptions.minFailureDuration) + && Objects.equals(this.minLocationFailed, syntheticsTestOptions.minLocationFailed) + && Objects.equals(this.monitorName, syntheticsTestOptions.monitorName) + && Objects.equals(this.monitorOptions, syntheticsTestOptions.monitorOptions) + && Objects.equals(this.monitorPriority, syntheticsTestOptions.monitorPriority) + && Objects.equals(this.restrictedRoles, syntheticsTestOptions.restrictedRoles) + && Objects.equals(this.retry, syntheticsTestOptions.retry) + && Objects.equals(this.scheduling, syntheticsTestOptions.scheduling) + && Objects.equals(this.tickEvery, syntheticsTestOptions.tickEvery) + && Objects.equals(this.additionalProperties, syntheticsTestOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + minFailureDuration, + minLocationFailed, + monitorName, + monitorOptions, + monitorPriority, + restrictedRoles, + retry, + scheduling, + tickEvery, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestOptions {\n"); + sb.append(" minFailureDuration: ").append(toIndentedString(minFailureDuration)).append("\n"); + sb.append(" minLocationFailed: ").append(toIndentedString(minLocationFailed)).append("\n"); + sb.append(" monitorName: ").append(toIndentedString(monitorName)).append("\n"); + sb.append(" monitorOptions: ").append(toIndentedString(monitorOptions)).append("\n"); + sb.append(" monitorPriority: ").append(toIndentedString(monitorPriority)).append("\n"); + sb.append(" restrictedRoles: ").append(toIndentedString(restrictedRoles)).append("\n"); + sb.append(" retry: ").append(toIndentedString(retry)).append("\n"); + sb.append(" scheduling: ").append(toIndentedString(scheduling)).append("\n"); + sb.append(" tickEvery: ").append(toIndentedString(tickEvery)).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/SyntheticsTestOptionsMonitorOptions.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsMonitorOptions.java new file mode 100644 index 00000000000..29af532ef28 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsMonitorOptions.java @@ -0,0 +1,241 @@ +/* + * 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; + +/** + * Object containing the options for a Synthetic test as a monitor (for example, renotification). + */ +@JsonPropertyOrder({ + SyntheticsTestOptionsMonitorOptions.JSON_PROPERTY_ESCALATION_MESSAGE, + SyntheticsTestOptionsMonitorOptions.JSON_PROPERTY_NOTIFICATION_PRESET_NAME, + SyntheticsTestOptionsMonitorOptions.JSON_PROPERTY_RENOTIFY_INTERVAL, + SyntheticsTestOptionsMonitorOptions.JSON_PROPERTY_RENOTIFY_OCCURRENCES +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestOptionsMonitorOptions { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_ESCALATION_MESSAGE = "escalation_message"; + private String escalationMessage; + + public static final String JSON_PROPERTY_NOTIFICATION_PRESET_NAME = "notification_preset_name"; + private SyntheticsTestOptionsMonitorOptionsNotificationPresetName notificationPresetName; + + public static final String JSON_PROPERTY_RENOTIFY_INTERVAL = "renotify_interval"; + private Long renotifyInterval; + + public static final String JSON_PROPERTY_RENOTIFY_OCCURRENCES = "renotify_occurrences"; + private Long renotifyOccurrences; + + public SyntheticsTestOptionsMonitorOptions escalationMessage(String escalationMessage) { + this.escalationMessage = escalationMessage; + return this; + } + + /** + * Message to include in the escalation notification. + * + * @return escalationMessage + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_ESCALATION_MESSAGE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public String getEscalationMessage() { + return escalationMessage; + } + + public void setEscalationMessage(String escalationMessage) { + this.escalationMessage = escalationMessage; + } + + public SyntheticsTestOptionsMonitorOptions notificationPresetName( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName notificationPresetName) { + this.notificationPresetName = notificationPresetName; + this.unparsed |= !notificationPresetName.isValid(); + return this; + } + + /** + * The name of the preset for the notification for the monitor. + * + * @return notificationPresetName + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_NOTIFICATION_PRESET_NAME) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public SyntheticsTestOptionsMonitorOptionsNotificationPresetName getNotificationPresetName() { + return notificationPresetName; + } + + public void setNotificationPresetName( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName notificationPresetName) { + if (!notificationPresetName.isValid()) { + this.unparsed = true; + } + this.notificationPresetName = notificationPresetName; + } + + public SyntheticsTestOptionsMonitorOptions renotifyInterval(Long renotifyInterval) { + this.renotifyInterval = renotifyInterval; + return this; + } + + /** + * Time interval before renotifying if the test is still failing (in minutes). minimum: 0 + * + * @return renotifyInterval + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RENOTIFY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRenotifyInterval() { + return renotifyInterval; + } + + public void setRenotifyInterval(Long renotifyInterval) { + this.renotifyInterval = renotifyInterval; + } + + public SyntheticsTestOptionsMonitorOptions renotifyOccurrences(Long renotifyOccurrences) { + this.renotifyOccurrences = renotifyOccurrences; + return this; + } + + /** + * The number of times to renotify if the test is still failing. + * + * @return renotifyOccurrences + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RENOTIFY_OCCURRENCES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getRenotifyOccurrences() { + return renotifyOccurrences; + } + + public void setRenotifyOccurrences(Long renotifyOccurrences) { + this.renotifyOccurrences = renotifyOccurrences; + } + + /** + * 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 SyntheticsTestOptionsMonitorOptions + */ + @JsonAnySetter + public SyntheticsTestOptionsMonitorOptions 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 SyntheticsTestOptionsMonitorOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestOptionsMonitorOptions syntheticsTestOptionsMonitorOptions = + (SyntheticsTestOptionsMonitorOptions) o; + return Objects.equals( + this.escalationMessage, syntheticsTestOptionsMonitorOptions.escalationMessage) + && Objects.equals( + this.notificationPresetName, syntheticsTestOptionsMonitorOptions.notificationPresetName) + && Objects.equals( + this.renotifyInterval, syntheticsTestOptionsMonitorOptions.renotifyInterval) + && Objects.equals( + this.renotifyOccurrences, syntheticsTestOptionsMonitorOptions.renotifyOccurrences) + && Objects.equals( + this.additionalProperties, syntheticsTestOptionsMonitorOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash( + escalationMessage, + notificationPresetName, + renotifyInterval, + renotifyOccurrences, + additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestOptionsMonitorOptions {\n"); + sb.append(" escalationMessage: ").append(toIndentedString(escalationMessage)).append("\n"); + sb.append(" notificationPresetName: ") + .append(toIndentedString(notificationPresetName)) + .append("\n"); + sb.append(" renotifyInterval: ").append(toIndentedString(renotifyInterval)).append("\n"); + sb.append(" renotifyOccurrences: ") + .append(toIndentedString(renotifyOccurrences)) + .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/SyntheticsTestOptionsMonitorOptionsNotificationPresetName.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsMonitorOptionsNotificationPresetName.java new file mode 100644 index 00000000000..4e0fa36199f --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsMonitorOptionsNotificationPresetName.java @@ -0,0 +1,85 @@ +/* + * 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 name of the preset for the notification for the monitor. */ +@JsonSerialize( + using = + SyntheticsTestOptionsMonitorOptionsNotificationPresetName + .SyntheticsTestOptionsMonitorOptionsNotificationPresetNameSerializer.class) +public class SyntheticsTestOptionsMonitorOptionsNotificationPresetName extends ModelEnum { + + private static final Set allowedValues = + new HashSet( + Arrays.asList( + "show_all", + "hide_all", + "hide_query", + "hide_handles", + "hide_query_and_handles", + "show_only_snapshot", + "hide_handles_and_footer")); + + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName SHOW_ALL = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("show_all"); + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName HIDE_ALL = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_all"); + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName HIDE_QUERY = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_query"); + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName HIDE_HANDLES = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_handles"); + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName + HIDE_QUERY_AND_HANDLES = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_query_and_handles"); + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName SHOW_ONLY_SNAPSHOT = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("show_only_snapshot"); + public static final SyntheticsTestOptionsMonitorOptionsNotificationPresetName + HIDE_HANDLES_AND_FOOTER = + new SyntheticsTestOptionsMonitorOptionsNotificationPresetName("hide_handles_and_footer"); + + SyntheticsTestOptionsMonitorOptionsNotificationPresetName(String value) { + super(value, allowedValues); + } + + public static class SyntheticsTestOptionsMonitorOptionsNotificationPresetNameSerializer + extends StdSerializer { + public SyntheticsTestOptionsMonitorOptionsNotificationPresetNameSerializer( + Class t) { + super(t); + } + + public SyntheticsTestOptionsMonitorOptionsNotificationPresetNameSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsTestOptionsMonitorOptionsNotificationPresetName value, + JsonGenerator jgen, + SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsTestOptionsMonitorOptionsNotificationPresetName fromValue(String value) { + return new SyntheticsTestOptionsMonitorOptionsNotificationPresetName(value); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsRetry.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsRetry.java new file mode 100644 index 00000000000..62b3677eabd --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsRetry.java @@ -0,0 +1,165 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Object describing the retry strategy to apply to a Synthetic test. */ +@JsonPropertyOrder({ + SyntheticsTestOptionsRetry.JSON_PROPERTY_COUNT, + SyntheticsTestOptionsRetry.JSON_PROPERTY_INTERVAL +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestOptionsRetry { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_COUNT = "count"; + private Long count; + + public static final String JSON_PROPERTY_INTERVAL = "interval"; + private Double interval; + + public SyntheticsTestOptionsRetry count(Long count) { + this.count = count; + return this; + } + + /** + * Number of times a test needs to be retried before marking a location as failed. Defaults to 0. + * + * @return count + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_COUNT) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Long getCount() { + return count; + } + + public void setCount(Long count) { + this.count = count; + } + + public SyntheticsTestOptionsRetry interval(Double interval) { + this.interval = interval; + return this; + } + + /** + * Time interval between retries (in milliseconds). Defaults to 300ms. + * + * @return interval + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_INTERVAL) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public Double getInterval() { + return interval; + } + + public void setInterval(Double interval) { + this.interval = interval; + } + + /** + * 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 SyntheticsTestOptionsRetry + */ + @JsonAnySetter + public SyntheticsTestOptionsRetry 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 SyntheticsTestOptionsRetry object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestOptionsRetry syntheticsTestOptionsRetry = (SyntheticsTestOptionsRetry) o; + return Objects.equals(this.count, syntheticsTestOptionsRetry.count) + && Objects.equals(this.interval, syntheticsTestOptionsRetry.interval) + && Objects.equals( + this.additionalProperties, syntheticsTestOptionsRetry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, interval, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestOptionsRetry {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).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/SyntheticsTestOptionsScheduling.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsScheduling.java new file mode 100644 index 00000000000..86387d655c0 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsScheduling.java @@ -0,0 +1,189 @@ +/* + * 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; + +/** Object containing timeframes and timezone used for advanced scheduling. */ +@JsonPropertyOrder({ + SyntheticsTestOptionsScheduling.JSON_PROPERTY_TIMEFRAMES, + SyntheticsTestOptionsScheduling.JSON_PROPERTY_TIMEZONE +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestOptionsScheduling { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_TIMEFRAMES = "timeframes"; + private List timeframes = new ArrayList<>(); + + public static final String JSON_PROPERTY_TIMEZONE = "timezone"; + private String timezone; + + public SyntheticsTestOptionsScheduling() {} + + @JsonCreator + public SyntheticsTestOptionsScheduling( + @JsonProperty(required = true, value = JSON_PROPERTY_TIMEFRAMES) + List timeframes, + @JsonProperty(required = true, value = JSON_PROPERTY_TIMEZONE) String timezone) { + this.timeframes = timeframes; + this.timezone = timezone; + } + + public SyntheticsTestOptionsScheduling timeframes( + List timeframes) { + this.timeframes = timeframes; + for (SyntheticsTestOptionsSchedulingTimeframe item : timeframes) { + this.unparsed |= item.unparsed; + } + return this; + } + + public SyntheticsTestOptionsScheduling addTimeframesItem( + SyntheticsTestOptionsSchedulingTimeframe timeframesItem) { + this.timeframes.add(timeframesItem); + this.unparsed |= timeframesItem.unparsed; + return this; + } + + /** + * Array containing objects describing the scheduling pattern to apply to each day. + * + * @return timeframes + */ + @JsonProperty(JSON_PROPERTY_TIMEFRAMES) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public List getTimeframes() { + return timeframes; + } + + public void setTimeframes(List timeframes) { + this.timeframes = timeframes; + } + + public SyntheticsTestOptionsScheduling timezone(String timezone) { + this.timezone = timezone; + return this; + } + + /** + * Timezone in which the timeframe is based. + * + * @return timezone + */ + @JsonProperty(JSON_PROPERTY_TIMEZONE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTimezone() { + return timezone; + } + + public void setTimezone(String timezone) { + this.timezone = timezone; + } + + /** + * 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 SyntheticsTestOptionsScheduling + */ + @JsonAnySetter + public SyntheticsTestOptionsScheduling 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 SyntheticsTestOptionsScheduling object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestOptionsScheduling syntheticsTestOptionsScheduling = + (SyntheticsTestOptionsScheduling) o; + return Objects.equals(this.timeframes, syntheticsTestOptionsScheduling.timeframes) + && Objects.equals(this.timezone, syntheticsTestOptionsScheduling.timezone) + && Objects.equals( + this.additionalProperties, syntheticsTestOptionsScheduling.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(timeframes, timezone, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestOptionsScheduling {\n"); + sb.append(" timeframes: ").append(toIndentedString(timeframes)).append("\n"); + sb.append(" timezone: ").append(toIndentedString(timezone)).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/SyntheticsTestOptionsSchedulingTimeframe.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsSchedulingTimeframe.java new file mode 100644 index 00000000000..7e65e186b64 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestOptionsSchedulingTimeframe.java @@ -0,0 +1,204 @@ +/* + * 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; + +/** Object describing a timeframe. */ +@JsonPropertyOrder({ + SyntheticsTestOptionsSchedulingTimeframe.JSON_PROPERTY_DAY, + SyntheticsTestOptionsSchedulingTimeframe.JSON_PROPERTY_FROM, + SyntheticsTestOptionsSchedulingTimeframe.JSON_PROPERTY_TO +}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class SyntheticsTestOptionsSchedulingTimeframe { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_DAY = "day"; + private Integer day; + + public static final String JSON_PROPERTY_FROM = "from"; + private String from; + + public static final String JSON_PROPERTY_TO = "to"; + private String to; + + public SyntheticsTestOptionsSchedulingTimeframe() {} + + @JsonCreator + public SyntheticsTestOptionsSchedulingTimeframe( + @JsonProperty(required = true, value = JSON_PROPERTY_DAY) Integer day, + @JsonProperty(required = true, value = JSON_PROPERTY_FROM) String from, + @JsonProperty(required = true, value = JSON_PROPERTY_TO) String to) { + this.day = day; + this.from = from; + this.to = to; + } + + public SyntheticsTestOptionsSchedulingTimeframe day(Integer day) { + this.day = day; + return this; + } + + /** + * Number representing the day of the week. minimum: 1 maximum: 7 + * + * @return day + */ + @JsonProperty(JSON_PROPERTY_DAY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Integer getDay() { + return day; + } + + public void setDay(Integer day) { + this.day = day; + } + + public SyntheticsTestOptionsSchedulingTimeframe from(String from) { + this.from = from; + return this; + } + + /** + * The hour of the day on which scheduling starts. + * + * @return from + */ + @JsonProperty(JSON_PROPERTY_FROM) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getFrom() { + return from; + } + + public void setFrom(String from) { + this.from = from; + } + + public SyntheticsTestOptionsSchedulingTimeframe to(String to) { + this.to = to; + return this; + } + + /** + * The hour of the day on which scheduling ends. + * + * @return to + */ + @JsonProperty(JSON_PROPERTY_TO) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public String getTo() { + return to; + } + + public void setTo(String to) { + this.to = to; + } + + /** + * 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 SyntheticsTestOptionsSchedulingTimeframe + */ + @JsonAnySetter + public SyntheticsTestOptionsSchedulingTimeframe 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 SyntheticsTestOptionsSchedulingTimeframe object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SyntheticsTestOptionsSchedulingTimeframe syntheticsTestOptionsSchedulingTimeframe = + (SyntheticsTestOptionsSchedulingTimeframe) o; + return Objects.equals(this.day, syntheticsTestOptionsSchedulingTimeframe.day) + && Objects.equals(this.from, syntheticsTestOptionsSchedulingTimeframe.from) + && Objects.equals(this.to, syntheticsTestOptionsSchedulingTimeframe.to) + && Objects.equals( + this.additionalProperties, + syntheticsTestOptionsSchedulingTimeframe.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(day, from, to, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SyntheticsTestOptionsSchedulingTimeframe {\n"); + sb.append(" day: ").append(toIndentedString(day)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).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/SyntheticsTestPauseStatus.java b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestPauseStatus.java new file mode 100644 index 00000000000..86409ea3e12 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/SyntheticsTestPauseStatus.java @@ -0,0 +1,60 @@ +/* + * 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; + +/** + * Define whether you want to start (live) or pause (paused) a Synthetic + * test. + */ +@JsonSerialize(using = SyntheticsTestPauseStatus.SyntheticsTestPauseStatusSerializer.class) +public class SyntheticsTestPauseStatus extends ModelEnum { + + private static final Set allowedValues = + new HashSet(Arrays.asList("live", "paused")); + + public static final SyntheticsTestPauseStatus LIVE = new SyntheticsTestPauseStatus("live"); + public static final SyntheticsTestPauseStatus PAUSED = new SyntheticsTestPauseStatus("paused"); + + SyntheticsTestPauseStatus(String value) { + super(value, allowedValues); + } + + public static class SyntheticsTestPauseStatusSerializer + extends StdSerializer { + public SyntheticsTestPauseStatusSerializer(Class t) { + super(t); + } + + public SyntheticsTestPauseStatusSerializer() { + this(null); + } + + @Override + public void serialize( + SyntheticsTestPauseStatus value, JsonGenerator jgen, SerializerProvider provider) + throws IOException, JsonProcessingException { + jgen.writeObject(value.value); + } + } + + @JsonCreator + public static SyntheticsTestPauseStatus fromValue(String value) { + return new SyntheticsTestPauseStatus(value); + } +} diff --git a/src/test/resources/cassettes/features/v2/Synthetics_Create_a_Network_Path_test_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Synthetics_Create_a_Network_Path_test_returns_OK_response.freeze new file mode 100644 index 00000000000..d30828c2f76 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Synthetics_Create_a_Network_Path_test_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-02-02T10:35:23.539Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Synthetics_Create_a_Network_Path_test_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Synthetics_Create_a_Network_Path_test_returns_OK_response.json new file mode 100644 index 00000000000..9fe1264e4fa --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Synthetics_Create_a_Network_Path_test_returns_OK_response.json @@ -0,0 +1,62 @@ +[ + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"config\":{\"assertions\":[{\"operator\":\"lessThan\",\"property\":\"avg\",\"target\":500,\"type\":\"latency\"}],\"request\":{\"e2e_queries\":50,\"host\":\"example.com\",\"max_ttl\":30,\"port\":443,\"tcp_method\":\"prefer_sack\",\"traceroute_queries\":3}},\"locations\":[\"aws:us-east-1\",\"agent:my-agent-name\"],\"message\":\"Network Path test notification\",\"name\":\"Example Network Path test\",\"options\":{\"tick_every\":60},\"status\":\"live\",\"subtype\":\"tcp\",\"tags\":[\"env:production\"],\"type\":\"network\"},\"type\":\"network\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/synthetics/tests/network", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"network_test\",\"attributes\":{\"public_id\":\"iab-wcx-mhp\",\"name\":\"Example Network Path test\",\"locations\":[\"aws:us-east-1\",\"agent:my-agent-name\"],\"subtype\":\"tcp\",\"status\":\"live\",\"options\":{\"tick_every\":60},\"config\":{\"assertions\":[{\"operator\":\"lessThan\",\"property\":\"avg\",\"target\":500,\"type\":\"latency\"}],\"request\":{\"max_ttl\":30,\"tcp_method\":\"prefer_sack\",\"host\":\"example.com\",\"traceroute_queries\":3,\"e2e_queries\":50,\"port\":443}},\"type\":\"network\",\"tags\":[\"env:production\"],\"message\":\"Network Path test notification\"},\"id\":\"iab-wcx-mhp\"}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "3e9c7578-282c-3e74-af19-c5c1adf2db20" + }, + { + "httpRequest": { + "body": { + "type": "JSON", + "json": "{\"data\":{\"attributes\":{\"public_ids\":[\"iab-wcx-mhp\"]},\"type\":\"delete_tests_request\"}}" + }, + "headers": {}, + "method": "POST", + "path": "/api/v2/synthetics/tests/bulk-delete", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":[{\"type\":\"delete_tests\",\"attributes\":{\"deleted_at\":\"2026-02-02T10:35:25.382918+00:00\",\"public_id\":\"iab-wcx-mhp\"},\"id\":\"iab-wcx-mhp\"}]}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "6fa27e8b-cfa1-19a5-e9b9-633b289465bd" + } +] \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Synthetics_Get_a_Network_Path_test_returns_OK_response.freeze b/src/test/resources/cassettes/features/v2/Synthetics_Get_a_Network_Path_test_returns_OK_response.freeze new file mode 100644 index 00000000000..7ba3f2dd33d --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Synthetics_Get_a_Network_Path_test_returns_OK_response.freeze @@ -0,0 +1 @@ +2026-01-29T16:23:56.538Z \ No newline at end of file diff --git a/src/test/resources/cassettes/features/v2/Synthetics_Get_a_Network_Path_test_returns_OK_response.json b/src/test/resources/cassettes/features/v2/Synthetics_Get_a_Network_Path_test_returns_OK_response.json new file mode 100644 index 00000000000..85f21b101e8 --- /dev/null +++ b/src/test/resources/cassettes/features/v2/Synthetics_Get_a_Network_Path_test_returns_OK_response.json @@ -0,0 +1,28 @@ +[ + { + "httpRequest": { + "headers": {}, + "method": "GET", + "path": "/api/v2/synthetics/tests/network/amg-96x-tps", + "keepAlive": false, + "secure": true + }, + "httpResponse": { + "body": "{\"data\":{\"type\":\"network_test\",\"attributes\":{\"config\":{\"request\":{\"traceroute_queries\":3,\"tcp_method\":\"prefer_sack\",\"max_ttl\":30,\"e2e_queries\":50,\"host\":\"example.com\",\"port\":443},\"assertions\":[{\"operator\":\"lessThan\",\"property\":\"avg\",\"target\":500,\"type\":\"latency\"}]},\"public_id\":\"amg-96x-tps\",\"locations\":[\"aws:us-east-1\",\"agent:my-agent-name\"],\"options\":{\"tick_every\":60},\"name\":\"Example Network Path test\",\"message\":\"Network Path test notification\",\"type\":\"network\",\"status\":\"paused\",\"subtype\":\"tcp\",\"tags\":[\"env:production\"]},\"id\":\"amg-96x-tps\"}}\n", + "headers": { + "Content-Type": [ + "application/json" + ] + }, + "statusCode": 200, + "reasonPhrase": "OK" + }, + "times": { + "remainingTimes": 1 + }, + "timeToLive": { + "unlimited": true + }, + "id": "a1a86dd2-617f-349d-1356-93ac698b833c" + } +] \ No newline at end of file diff --git a/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature b/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature index 25b209f05ad..5f97101a5d6 100644 --- a/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature +++ b/src/test/resources/com/datadog/api/client/v1/api/synthetics.feature @@ -1,12 +1,14 @@ @endpoint(synthetics) @endpoint(synthetics-v1) Feature: Synthetics - Datadog Synthetic Monitoring uses simulated user requests and browser - rendering to help you ensure uptime, identify regional issues, and track - your application performance. Synthetic tests come in two different - flavors, [API - tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest) and - [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You - can use Datadog's API to manage both test types programmatically. For + Synthetic tests allow you to observe how your systems and applications are + performing using simulated requests and actions from around the globe. + They come in different flavors: [API + tests](https://docs.datadoghq.com/synthetics/api_tests/), [browser + tests](https://docs.datadoghq.com/synthetics/browser_tests), [Network Path + tests](https://docs.datadoghq.com/synthetics/network_path_tests/) and + [Mobile Application + tests](https://docs.datadoghq.com/synthetics/mobile_app_testing). You can + use Datadog's API to manage tests and test suites programmatically. For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/). diff --git a/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature b/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature index 5697490c97b..6cec9a1e13e 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/synthetics.feature @@ -1,13 +1,16 @@ @endpoint(synthetics) @endpoint(synthetics-v2) Feature: Synthetics - Datadog Synthetics uses simulated user requests and browser rendering to - help you ensure uptime, identify regional issues, and track your - application performance. Datadog Synthetics tests come in two different - flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/) and - [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You - can use Datadog’s API to manage both test types programmatically. For - more information about Synthetics, see the [Synthetics - overview](https://docs.datadoghq.com/synthetics/). + Synthetic tests allow you to observe how your systems and applications are + performing using simulated requests and actions from around the globe. + They come in different flavors: [API + tests](https://docs.datadoghq.com/synthetics/api_tests/), [browser + tests](https://docs.datadoghq.com/synthetics/browser_tests), [Network Path + tests](https://docs.datadoghq.com/synthetics/network_path_tests/) and + [Mobile Application + tests](https://docs.datadoghq.com/synthetics/mobile_app_testing). You can + use Datadog's API to manage tests and test suites programmatically. For + more information, see the [Synthetic Monitoring + documentation](https://docs.datadoghq.com/synthetics/). Background: Given a valid "apiKeyAuth" key in the system @@ -78,6 +81,34 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Bulk delete tests returns "API error response." response + Given new "DeleteSyntheticsTestsV2" request + And body with value {"data": {"attributes": {"public_ids": [""]}, "type": "delete_tests_request"}} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Bulk delete tests returns "OK" response + Given new "DeleteSyntheticsTestsV2" request + And body with value {"data": {"attributes": {"public_ids": [""]}, "type": "delete_tests_request"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Create a Network Path test returns "API error response." response + Given new "CreateSyntheticsNetworkTest" request + And body with value {"data": {"attributes": {"config": {"assertions": [{"operator": "lessThan", "property": "avg", "target": 500, "type": "latency"}], "request": {"e2e_queries": 50, "host": "", "max_ttl": 30, "port": 443, "tcp_method": "prefer_sack", "traceroute_queries": 3}}, "locations": ["aws:us-east-1", "agent:my-agent-name"], "message": "Network Path test notification", "name": "Example Network Path test", "options": {"monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "tcp", "tags": ["env:production"], "type": "network"}, "type": "network"}} + When the request is sent + Then the response status is 400 API error response. + + @team:DataDog/synthetics-managing + Scenario: Synthetics: Create a Network Path test returns "OK" response + Given new "CreateSyntheticsNetworkTest" request + And body with value {"data": {"attributes": {"config": {"assertions": [{"operator": "lessThan", "property": "avg", "target": 500, "type": "latency"}], "request": {"host": "example.com", "port": 443, "tcp_method": "prefer_sack", "max_ttl": 30, "e2e_queries": 50, "traceroute_queries": 3}}, "locations": ["aws:us-east-1", "agent:my-agent-name"], "message": "Network Path test notification", "name": "Example Network Path test", "options": {"tick_every": 60}, "status": "live", "subtype": "tcp", "tags": ["env:production"], "type": "network"}, "type": "network"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Synthetics: Create a test suite returns "API error response." response Given new "CreateSyntheticsSuite" request @@ -92,6 +123,22 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Edit a Network Path test returns "API error response." response + Given new "UpdateSyntheticsNetworkTest" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"assertions": [{"operator": "lessThan", "property": "avg", "target": 500, "type": "latency"}], "request": {"e2e_queries": 50, "host": "", "max_ttl": 30, "port": 443, "tcp_method": "prefer_sack", "traceroute_queries": 3}}, "locations": ["aws:us-east-1", "agent:my-agent-name"], "message": "Network Path test notification", "name": "Example Network Path test", "options": {"monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "tcp", "tags": ["env:production"], "type": "network"}, "type": "network"}} + When the request is sent + Then the response status is 404 API error response. + + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Edit a Network Path test returns "OK" response + Given new "UpdateSyntheticsNetworkTest" request + And request contains "public_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"assertions": [{"operator": "lessThan", "property": "avg", "target": 500, "type": "latency"}], "request": {"e2e_queries": 50, "host": "", "max_ttl": 30, "port": 443, "tcp_method": "prefer_sack", "traceroute_queries": 3}}, "locations": ["aws:us-east-1", "agent:my-agent-name"], "message": "Network Path test notification", "name": "Example Network Path test", "options": {"monitor_options": {"notification_preset_name": "show_all"}, "restricted_roles": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"], "retry": {}, "scheduling": {"timeframes": [{"day": 1, "from": "07:00", "to": "16:00"}, {"day": 3, "from": "07:00", "to": "16:00"}], "timezone": "America/New_York"}}, "status": "live", "subtype": "tcp", "tags": ["env:production"], "type": "network"}, "type": "network"}} + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Synthetics: Edit a test suite returns "API error response." response Given new "EditSyntheticsSuite" request @@ -108,6 +155,20 @@ Feature: Synthetics When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing + Scenario: Synthetics: Get a Network Path test returns "API error response." response + Given new "GetSyntheticsNetworkTest" request + And request contains "public_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 API error response. + + @replay-only @team:DataDog/synthetics-managing + Scenario: Synthetics: Get a Network Path test returns "OK" response + Given new "GetSyntheticsNetworkTest" request + And request contains "public_id" parameter with value "amg-96x-tps" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/synthetics-managing Scenario: Synthetics: Get a suite returns "API error response." response Given new "GetSyntheticsSuite" request diff --git a/src/test/resources/com/datadog/api/client/v2/api/undo.json b/src/test/resources/com/datadog/api/client/v2/api/undo.json index c0ec7dbe41a..e12921d5369 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 @@ -5054,6 +5054,37 @@ "type": "idempotent" } }, + "DeleteSyntheticsTestsV2": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, + "CreateSyntheticsNetworkTest": { + "tag": "Synthetics", + "undo": { + "operationId": "DeleteSyntheticsTestsV2", + "parameters": [ + { + "name": "body", + "template": "{\"data\": {\"type\": \"delete_tests_request\", \"attributes\": {\"public_ids\": [\"{{ data.attributes.public_id }}\"]}}}" + } + ], + "type": "unsafe" + } + }, + "GetSyntheticsNetworkTest": { + "tag": "Synthetics", + "undo": { + "type": "safe" + } + }, + "UpdateSyntheticsNetworkTest": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, "PatchGlobalVariable": { "tag": "Synthetics", "undo": {