From c6d601e249ac6b2a6b94564ef37d0d450c1d7075 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 17 Feb 2026 14:57:25 +0000 Subject: [PATCH] Regenerate client from commit 34d5e6e of spec repo --- .generator/schemas/v1/openapi.yaml | 27 +- .generator/schemas/v2/openapi.yaml | 780 +++++++++++++++++- ...twork-Path-test-returns-OK-response.frozen | 1 + ...-Network-Path-test-returns-OK-response.yml | 53 ++ ...twork-Path-test-returns-OK-response.frozen | 1 + ...-Network-Path-test-returns-OK-response.yml | 23 + .../synthetics/CreateSyntheticsNetworkTest.rb | 46 ++ .../v2/synthetics/DeleteSyntheticsTests.rb | 16 + .../v2/synthetics/GetSyntheticsNetworkTest.rb | 5 + .../synthetics/UpdateSyntheticsNetworkTest.rb | 67 ++ features/scenarios_model_mapping.rb | 13 + features/v1/synthetics.feature | 18 +- features/v2/synthetics.feature | 77 +- features/v2/undo.json | 31 + lib/datadog_api_client/inflector.rb | 37 + .../v1/models/synthetics_assertion_type.rb | 2 + .../v1/models/synthetics_batch_result.rb | 2 +- .../v1/models/synthetics_test_details.rb | 2 +- .../v1/models/synthetics_test_details_type.rb | 3 +- .../synthetics_test_details_without_steps.rb | 2 +- .../v2/api/synthetics_api.rb | 259 ++++++ .../v2/models/deleted_test_response_data.rb | 125 +++ .../deleted_test_response_data_attributes.rb | 115 +++ .../v2/models/deleted_tests_request_delete.rb | 143 ++++ ...deleted_tests_request_delete_attributes.rb | 135 +++ .../deleted_tests_request_delete_request.rb | 123 +++ .../v2/models/deleted_tests_request_type.rb | 26 + .../v2/models/deleted_tests_response.rb | 107 +++ .../v2/models/deleted_tests_response_type.rb | 26 + .../v2/models/synthetics_network_assertion.rb | 65 ++ .../synthetics_network_assertion_jitter.rb | 165 ++++ ...ynthetics_network_assertion_jitter_type.rb | 26 + .../synthetics_network_assertion_latency.rb | 186 +++++ ...nthetics_network_assertion_latency_type.rb | 26 + ...ics_network_assertion_multi_network_hop.rb | 186 +++++ ...etwork_assertion_multi_network_hop_type.rb | 26 + .../synthetics_network_assertion_operator.rb | 31 + ...etwork_assertion_packet_loss_percentage.rb | 173 ++++ ...k_assertion_packet_loss_percentage_type.rb | 26 + .../synthetics_network_assertion_property.rb | 28 + .../v2/models/synthetics_network_test.rb | 284 +++++++ .../models/synthetics_network_test_config.rb | 117 +++ .../v2/models/synthetics_network_test_edit.rb | 144 ++++ .../synthetics_network_test_edit_request.rb | 123 +++ .../models/synthetics_network_test_request.rb | 237 ++++++ ...thetics_network_test_request_tcp_method.rb | 28 + .../synthetics_network_test_response.rb | 105 +++ .../synthetics_network_test_response_data.rb | 125 +++ .../synthetics_network_test_response_type.rb | 26 + .../synthetics_network_test_sub_type.rb | 28 + .../v2/models/synthetics_network_test_type.rb | 26 + .../v2/models/synthetics_test_options.rb | 226 +++++ ...synthetics_test_options_monitor_options.rb | 155 ++++ ...onitor_options_notification_preset_name.rb | 32 + .../models/synthetics_test_options_retry.rb | 117 +++ .../synthetics_test_options_scheduling.rb | 146 ++++ ...etics_test_options_scheduling_timeframe.rb | 173 ++++ .../v2/models/synthetics_test_pause_status.rb | 28 + 58 files changed, 5288 insertions(+), 35 deletions(-) create mode 100644 cassettes/features/v2/synthetics/Synthetics-Create-a-Network-Path-test-returns-OK-response.frozen create mode 100644 cassettes/features/v2/synthetics/Synthetics-Create-a-Network-Path-test-returns-OK-response.yml create mode 100644 cassettes/features/v2/synthetics/Synthetics-Get-a-Network-Path-test-returns-OK-response.frozen create mode 100644 cassettes/features/v2/synthetics/Synthetics-Get-a-Network-Path-test-returns-OK-response.yml create mode 100644 examples/v2/synthetics/CreateSyntheticsNetworkTest.rb create mode 100644 examples/v2/synthetics/DeleteSyntheticsTests.rb create mode 100644 examples/v2/synthetics/GetSyntheticsNetworkTest.rb create mode 100644 examples/v2/synthetics/UpdateSyntheticsNetworkTest.rb create mode 100644 lib/datadog_api_client/v2/models/deleted_test_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/deleted_test_response_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/deleted_tests_request_delete.rb create mode 100644 lib/datadog_api_client/v2/models/deleted_tests_request_delete_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/deleted_tests_request_delete_request.rb create mode 100644 lib/datadog_api_client/v2/models/deleted_tests_request_type.rb create mode 100644 lib/datadog_api_client/v2/models/deleted_tests_response.rb create mode 100644 lib/datadog_api_client/v2/models/deleted_tests_response_type.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_jitter.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_jitter_type.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_latency.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_latency_type.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_multi_network_hop.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_multi_network_hop_type.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_operator.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_packet_loss_percentage.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_packet_loss_percentage_type.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_assertion_property.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_config.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_edit.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_edit_request.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_request.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_request_tcp_method.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_response.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_response_data.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_response_type.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_sub_type.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_network_test_type.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_test_options.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_test_options_monitor_options.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_test_options_monitor_options_notification_preset_name.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_test_options_retry.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_test_options_scheduling.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_test_options_scheduling_timeframe.rb create mode 100644 lib/datadog_api_client/v2/models/synthetics_test_pause_status.rb diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 3e86f3a82c2d..ac0bc1b08ef1 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -15720,6 +15720,8 @@ components: - grpcMetadata - grpcProto - connection + - multiNetworkHop + - jitter example: statusCode type: string x-enum-varnames: @@ -15742,6 +15744,8 @@ components: - GRPC_METADATA - GRPC_PROTO - CONNECTION + - MULTI_NETWORK_HOP + - JITTER SyntheticsAssertionXPathOperator: description: Assertion operator to apply. enum: @@ -18125,16 +18129,18 @@ components: - WEBSOCKET - GRPC SyntheticsTestDetailsType: - description: Type of the Synthetic test, either `api` or `browser`. + description: Type of the Synthetic test. enum: - api - browser - mobile + - network type: string x-enum-varnames: - API - BROWSER - MOBILE + - NETWORK SyntheticsTestDetailsWithoutSteps: description: Object containing details about your Synthetic test, without test steps. @@ -39523,18 +39529,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 use simulated requests and actions so you can monitor + the availability and performance of systems and applications. Datadog supports + the following types of synthetic tests: + + - [API tests](https://docs.datadoghq.com/synthetics/api_tests/) + + - [Browser tests](https://docs.datadoghq.com/synthetics/browser_tests) - identify regional issues, and track your application performance. Synthetic tests - come in + - [Network Path tests](https://docs.datadoghq.com/synthetics/network_path_tests/) - two different flavors, [API tests](https://docs.datadoghq.com/synthetics/api_tests/?tab=httptest) + - [Mobile Application tests](https://docs.datadoghq.com/synthetics/mobile_app_testing) - and [browser tests](https://docs.datadoghq.com/synthetics/browser_tests). You - can use Datadog''s API to - manage both test types programmatically. + You can use the Datadog API to create, manage, and organize 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 093a28a0b5be..aa9623cfe067 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -19542,6 +19542,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: @@ -61573,6 +61645,361 @@ 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 to run the test from. + 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 is 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: '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, @@ -61728,6 +62155,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: @@ -99950,6 +100534,178 @@ paths: operator: OR permissions: - synthetics_write + /api/v2/synthetics/tests/bulk-delete: + post: + operationId: DeleteSyntheticsTests + 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). @@ -104281,12 +105037,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 use simulated requests and actions so you can monitor + the availability and performance of systems and applications. Datadog supports + the following types of synthetic tests: + + - [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/) + + - [Mobile Application tests](https://docs.datadoghq.com/synthetics/mobile_app_testing) + + + You can use the Datadog API to create, manage, and organize 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/cassettes/features/v2/synthetics/Synthetics-Create-a-Network-Path-test-returns-OK-response.frozen b/cassettes/features/v2/synthetics/Synthetics-Create-a-Network-Path-test-returns-OK-response.frozen new file mode 100644 index 000000000000..d30828c2f767 --- /dev/null +++ b/cassettes/features/v2/synthetics/Synthetics-Create-a-Network-Path-test-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-02-02T10:35:23.539Z \ No newline at end of file diff --git a/cassettes/features/v2/synthetics/Synthetics-Create-a-Network-Path-test-returns-OK-response.yml b/cassettes/features/v2/synthetics/Synthetics-Create-a-Network-Path-test-returns-OK-response.yml new file mode 100644 index 000000000000..721f66293b80 --- /dev/null +++ b/cassettes/features/v2/synthetics/Synthetics-Create-a-Network-Path-test-returns-OK-response.yml @@ -0,0 +1,53 @@ +http_interactions: +- recorded_at: Mon, 02 Feb 2026 10:35:23 GMT + request: + body: + encoding: UTF-8 + string: '{"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: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/synthetics/tests/network + response: + body: + encoding: UTF-8 + string: '{"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"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +- recorded_at: Mon, 02 Feb 2026 10:35:23 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"public_ids":["iab-wcx-mhp"]},"type":"delete_tests_request"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: POST + uri: https://api.datadoghq.com/api/v2/synthetics/tests/bulk-delete + response: + body: + encoding: UTF-8 + string: '{"data":[{"type":"delete_tests","attributes":{"deleted_at":"2026-02-02T10:35:25.382918+00:00","public_id":"iab-wcx-mhp"},"id":"iab-wcx-mhp"}]} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/synthetics/Synthetics-Get-a-Network-Path-test-returns-OK-response.frozen b/cassettes/features/v2/synthetics/Synthetics-Get-a-Network-Path-test-returns-OK-response.frozen new file mode 100644 index 000000000000..7ba3f2dd33d5 --- /dev/null +++ b/cassettes/features/v2/synthetics/Synthetics-Get-a-Network-Path-test-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-01-29T16:23:56.538Z \ No newline at end of file diff --git a/cassettes/features/v2/synthetics/Synthetics-Get-a-Network-Path-test-returns-OK-response.yml b/cassettes/features/v2/synthetics/Synthetics-Get-a-Network-Path-test-returns-OK-response.yml new file mode 100644 index 000000000000..f5a3c64ab35e --- /dev/null +++ b/cassettes/features/v2/synthetics/Synthetics-Get-a-Network-Path-test-returns-OK-response.yml @@ -0,0 +1,23 @@ +http_interactions: +- recorded_at: Thu, 29 Jan 2026 16:23:56 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/synthetics/tests/network/amg-96x-tps + response: + body: + encoding: UTF-8 + string: '{"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"}} + + ' + headers: + Content-Type: + - application/json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/synthetics/CreateSyntheticsNetworkTest.rb b/examples/v2/synthetics/CreateSyntheticsNetworkTest.rb new file mode 100644 index 000000000000..8f6de011371b --- /dev/null +++ b/examples/v2/synthetics/CreateSyntheticsNetworkTest.rb @@ -0,0 +1,46 @@ +# Synthetics: Create a Network Path test returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new + +body = DatadogAPIClient::V2::SyntheticsNetworkTestEditRequest.new({ + data: DatadogAPIClient::V2::SyntheticsNetworkTestEdit.new({ + attributes: DatadogAPIClient::V2::SyntheticsNetworkTest.new({ + config: DatadogAPIClient::V2::SyntheticsNetworkTestConfig.new({ + assertions: [ + DatadogAPIClient::V2::SyntheticsNetworkAssertionLatency.new({ + operator: DatadogAPIClient::V2::SyntheticsNetworkAssertionOperator::LESS_THAN, + property: DatadogAPIClient::V2::SyntheticsNetworkAssertionProperty::AVG, + target: 500, + type: DatadogAPIClient::V2::SyntheticsNetworkAssertionLatencyType::LATENCY, + }), + ], + request: DatadogAPIClient::V2::SyntheticsNetworkTestRequest.new({ + host: "example.com", + port: 443, + tcp_method: DatadogAPIClient::V2::SyntheticsNetworkTestRequestTCPMethod::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: DatadogAPIClient::V2::SyntheticsTestOptions.new({ + tick_every: 60, + }), + status: DatadogAPIClient::V2::SyntheticsTestPauseStatus::LIVE, + subtype: DatadogAPIClient::V2::SyntheticsNetworkTestSubType::TCP, + tags: [ + "env:production", + ], + type: DatadogAPIClient::V2::SyntheticsNetworkTestType::NETWORK, + }), + type: DatadogAPIClient::V2::SyntheticsNetworkTestType::NETWORK, + }), +}) +p api_instance.create_synthetics_network_test(body) diff --git a/examples/v2/synthetics/DeleteSyntheticsTests.rb b/examples/v2/synthetics/DeleteSyntheticsTests.rb new file mode 100644 index 000000000000..0ed8e537ac61 --- /dev/null +++ b/examples/v2/synthetics/DeleteSyntheticsTests.rb @@ -0,0 +1,16 @@ +# Synthetics: Bulk delete tests returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new + +body = DatadogAPIClient::V2::DeletedTestsRequestDeleteRequest.new({ + data: DatadogAPIClient::V2::DeletedTestsRequestDelete.new({ + attributes: DatadogAPIClient::V2::DeletedTestsRequestDeleteAttributes.new({ + public_ids: [ + "", + ], + }), + type: DatadogAPIClient::V2::DeletedTestsRequestType::DELETE_TESTS_REQUEST, + }), +}) +p api_instance.delete_synthetics_tests(body) diff --git a/examples/v2/synthetics/GetSyntheticsNetworkTest.rb b/examples/v2/synthetics/GetSyntheticsNetworkTest.rb new file mode 100644 index 000000000000..7aa8e7c5d2a6 --- /dev/null +++ b/examples/v2/synthetics/GetSyntheticsNetworkTest.rb @@ -0,0 +1,5 @@ +# Synthetics: Get a Network Path test returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new +p api_instance.get_synthetics_network_test("amg-96x-tps") diff --git a/examples/v2/synthetics/UpdateSyntheticsNetworkTest.rb b/examples/v2/synthetics/UpdateSyntheticsNetworkTest.rb new file mode 100644 index 000000000000..36f72d709c3b --- /dev/null +++ b/examples/v2/synthetics/UpdateSyntheticsNetworkTest.rb @@ -0,0 +1,67 @@ +# Synthetics: Edit a Network Path test returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::SyntheticsAPI.new + +body = DatadogAPIClient::V2::SyntheticsNetworkTestEditRequest.new({ + data: DatadogAPIClient::V2::SyntheticsNetworkTestEdit.new({ + attributes: DatadogAPIClient::V2::SyntheticsNetworkTest.new({ + config: DatadogAPIClient::V2::SyntheticsNetworkTestConfig.new({ + assertions: [ + DatadogAPIClient::V2::SyntheticsNetworkAssertionLatency.new({ + operator: DatadogAPIClient::V2::SyntheticsNetworkAssertionOperator::LESS_THAN, + property: DatadogAPIClient::V2::SyntheticsNetworkAssertionProperty::AVG, + target: 500, + type: DatadogAPIClient::V2::SyntheticsNetworkAssertionLatencyType::LATENCY, + }), + ], + request: DatadogAPIClient::V2::SyntheticsNetworkTestRequest.new({ + e2e_queries: 50, + host: "", + max_ttl: 30, + port: 443, + tcp_method: DatadogAPIClient::V2::SyntheticsNetworkTestRequestTCPMethod::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: DatadogAPIClient::V2::SyntheticsTestOptions.new({ + monitor_options: DatadogAPIClient::V2::SyntheticsTestOptionsMonitorOptions.new({ + notification_preset_name: DatadogAPIClient::V2::SyntheticsTestOptionsMonitorOptionsNotificationPresetName::SHOW_ALL, + }), + restricted_roles: [ + "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + ], + _retry: DatadogAPIClient::V2::SyntheticsTestOptionsRetry.new({}), + scheduling: DatadogAPIClient::V2::SyntheticsTestOptionsScheduling.new({ + timeframes: [ + DatadogAPIClient::V2::SyntheticsTestOptionsSchedulingTimeframe.new({ + day: 1, + from: "07:00", + to: "16:00", + }), + DatadogAPIClient::V2::SyntheticsTestOptionsSchedulingTimeframe.new({ + day: 3, + from: "07:00", + to: "16:00", + }), + ], + timezone: "America/New_York", + }), + }), + status: DatadogAPIClient::V2::SyntheticsTestPauseStatus::LIVE, + subtype: DatadogAPIClient::V2::SyntheticsNetworkTestSubType::TCP, + tags: [ + "env:production", + ], + type: DatadogAPIClient::V2::SyntheticsNetworkTestType::NETWORK, + }), + type: DatadogAPIClient::V2::SyntheticsNetworkTestType::NETWORK, + }), +}) +p api_instance.update_synthetics_network_test("public_id", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index c226dd7a5165..cf7727c9b2d4 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -3668,6 +3668,19 @@ "public_id" => "String", "body" => "SuiteCreateEditRequest", }, + "v2.DeleteSyntheticsTests" => { + "body" => "DeletedTestsRequestDeleteRequest", + }, + "v2.CreateSyntheticsNetworkTest" => { + "body" => "SyntheticsNetworkTestEditRequest", + }, + "v2.GetSyntheticsNetworkTest" => { + "public_id" => "String", + }, + "v2.UpdateSyntheticsNetworkTest" => { + "public_id" => "String", + "body" => "SyntheticsNetworkTestEditRequest", + }, "v2.PatchGlobalVariable" => { "variable_id" => "String", "body" => "GlobalVariableJsonPatchRequest", diff --git a/features/v1/synthetics.feature b/features/v1/synthetics.feature index 25b209f05ade..9b362dbe23cd 100644 --- a/features/v1/synthetics.feature +++ b/features/v1/synthetics.feature @@ -1,13 +1,15 @@ @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 - more information, see the [Synthetic Monitoring + Synthetic tests use simulated requests and actions so you can monitor the + availability and performance of systems and applications. Datadog supports + the following types of synthetic tests: - [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/) - + [Mobile Application + tests](https://docs.datadoghq.com/synthetics/mobile_app_testing) You can + use the Datadog API to create, manage, and organize tests and test suites + programmatically. For more information, see the [Synthetic Monitoring documentation](https://docs.datadoghq.com/synthetics/). Background: diff --git a/features/v2/synthetics.feature b/features/v2/synthetics.feature index 5697490c97b3..07b9750052b2 100644 --- a/features/v2/synthetics.feature +++ b/features/v2/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 use simulated requests and actions so you can monitor the + availability and performance of systems and applications. Datadog supports + the following types of synthetic tests: - [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/) - + [Mobile Application + tests](https://docs.datadoghq.com/synthetics/mobile_app_testing) You can + use the Datadog API to create, manage, and organize 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 "DeleteSyntheticsTests" 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 "DeleteSyntheticsTests" 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/features/v2/undo.json b/features/v2/undo.json index ef9246c8e646..a540bd8fd4aa 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -5344,6 +5344,37 @@ "type": "idempotent" } }, + "DeleteSyntheticsTests": { + "tag": "Synthetics", + "undo": { + "type": "idempotent" + } + }, + "CreateSyntheticsNetworkTest": { + "tag": "Synthetics", + "undo": { + "operationId": "DeleteSyntheticsTests", + "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": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 4a0ac91fa81b..72447c38d90f 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2082,6 +2082,14 @@ def overrides "v2.deleted_suites_request_delete_request" => "DeletedSuitesRequestDeleteRequest", "v2.deleted_suites_request_type" => "DeletedSuitesRequestType", "v2.deleted_suites_response" => "DeletedSuitesResponse", + "v2.deleted_test_response_data" => "DeletedTestResponseData", + "v2.deleted_test_response_data_attributes" => "DeletedTestResponseDataAttributes", + "v2.deleted_tests_request_delete" => "DeletedTestsRequestDelete", + "v2.deleted_tests_request_delete_attributes" => "DeletedTestsRequestDeleteAttributes", + "v2.deleted_tests_request_delete_request" => "DeletedTestsRequestDeleteRequest", + "v2.deleted_tests_request_type" => "DeletedTestsRequestType", + "v2.deleted_tests_response" => "DeletedTestsResponse", + "v2.deleted_tests_response_type" => "DeletedTestsResponseType", "v2.dependency_location" => "DependencyLocation", "v2.deployment" => "Deployment", "v2.deployment_attributes" => "DeploymentAttributes", @@ -4834,6 +4842,28 @@ def overrides "v2.synthetics_global_variable_parse_test_options_type" => "SyntheticsGlobalVariableParseTestOptionsType", "v2.synthetics_global_variable_totp_parameters" => "SyntheticsGlobalVariableTOTPParameters", "v2.synthetics_global_variable_value" => "SyntheticsGlobalVariableValue", + "v2.synthetics_network_assertion" => "SyntheticsNetworkAssertion", + "v2.synthetics_network_assertion_jitter" => "SyntheticsNetworkAssertionJitter", + "v2.synthetics_network_assertion_jitter_type" => "SyntheticsNetworkAssertionJitterType", + "v2.synthetics_network_assertion_latency" => "SyntheticsNetworkAssertionLatency", + "v2.synthetics_network_assertion_latency_type" => "SyntheticsNetworkAssertionLatencyType", + "v2.synthetics_network_assertion_multi_network_hop" => "SyntheticsNetworkAssertionMultiNetworkHop", + "v2.synthetics_network_assertion_multi_network_hop_type" => "SyntheticsNetworkAssertionMultiNetworkHopType", + "v2.synthetics_network_assertion_operator" => "SyntheticsNetworkAssertionOperator", + "v2.synthetics_network_assertion_packet_loss_percentage" => "SyntheticsNetworkAssertionPacketLossPercentage", + "v2.synthetics_network_assertion_packet_loss_percentage_type" => "SyntheticsNetworkAssertionPacketLossPercentageType", + "v2.synthetics_network_assertion_property" => "SyntheticsNetworkAssertionProperty", + "v2.synthetics_network_test" => "SyntheticsNetworkTest", + "v2.synthetics_network_test_config" => "SyntheticsNetworkTestConfig", + "v2.synthetics_network_test_edit" => "SyntheticsNetworkTestEdit", + "v2.synthetics_network_test_edit_request" => "SyntheticsNetworkTestEditRequest", + "v2.synthetics_network_test_request" => "SyntheticsNetworkTestRequest", + "v2.synthetics_network_test_request_tcp_method" => "SyntheticsNetworkTestRequestTCPMethod", + "v2.synthetics_network_test_response" => "SyntheticsNetworkTestResponse", + "v2.synthetics_network_test_response_data" => "SyntheticsNetworkTestResponseData", + "v2.synthetics_network_test_response_type" => "SyntheticsNetworkTestResponseType", + "v2.synthetics_network_test_sub_type" => "SyntheticsNetworkTestSubType", + "v2.synthetics_network_test_type" => "SyntheticsNetworkTestType", "v2.synthetics_suite" => "SyntheticsSuite", "v2.synthetics_suite_options" => "SyntheticsSuiteOptions", "v2.synthetics_suite_response" => "SyntheticsSuiteResponse", @@ -4845,6 +4875,13 @@ def overrides "v2.synthetics_suite_test_alerting_criticality" => "SyntheticsSuiteTestAlertingCriticality", "v2.synthetics_suite_type" => "SyntheticsSuiteType", "v2.synthetics_suite_types" => "SyntheticsSuiteTypes", + "v2.synthetics_test_options" => "SyntheticsTestOptions", + "v2.synthetics_test_options_monitor_options" => "SyntheticsTestOptionsMonitorOptions", + "v2.synthetics_test_options_monitor_options_notification_preset_name" => "SyntheticsTestOptionsMonitorOptionsNotificationPresetName", + "v2.synthetics_test_options_retry" => "SyntheticsTestOptionsRetry", + "v2.synthetics_test_options_scheduling" => "SyntheticsTestOptionsScheduling", + "v2.synthetics_test_options_scheduling_timeframe" => "SyntheticsTestOptionsSchedulingTimeframe", + "v2.synthetics_test_pause_status" => "SyntheticsTestPauseStatus", "v2.synthetics_variable_parser" => "SyntheticsVariableParser", "v2.table_result_v2" => "TableResultV2", "v2.table_result_v2_array" => "TableResultV2Array", diff --git a/lib/datadog_api_client/v1/models/synthetics_assertion_type.rb b/lib/datadog_api_client/v1/models/synthetics_assertion_type.rb index 319f12508df6..d992b32cdb22 100644 --- a/lib/datadog_api_client/v1/models/synthetics_assertion_type.rb +++ b/lib/datadog_api_client/v1/models/synthetics_assertion_type.rb @@ -40,5 +40,7 @@ class SyntheticsAssertionType GRPC_METADATA = "grpcMetadata".freeze GRPC_PROTO = "grpcProto".freeze CONNECTION = "connection".freeze + MULTI_NETWORK_HOP = "multiNetworkHop".freeze + JITTER = "jitter".freeze end end diff --git a/lib/datadog_api_client/v1/models/synthetics_batch_result.rb b/lib/datadog_api_client/v1/models/synthetics_batch_result.rb index dab7004461f9..6ee21636e40e 100644 --- a/lib/datadog_api_client/v1/models/synthetics_batch_result.rb +++ b/lib/datadog_api_client/v1/models/synthetics_batch_result.rb @@ -48,7 +48,7 @@ class SyntheticsBatchResult # The public ID of the Synthetic test. attr_accessor :test_public_id - # Type of the Synthetic test, either `api` or `browser`. + # Type of the Synthetic test. attr_accessor :test_type attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v1/models/synthetics_test_details.rb b/lib/datadog_api_client/v1/models/synthetics_test_details.rb index 283afe7d0e77..b979df84d68a 100644 --- a/lib/datadog_api_client/v1/models/synthetics_test_details.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_details.rb @@ -59,7 +59,7 @@ class SyntheticsTestDetails # Array of tags attached to the test. attr_accessor :tags - # Type of the Synthetic test, either `api` or `browser`. + # Type of the Synthetic test. attr_accessor :type attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v1/models/synthetics_test_details_type.rb b/lib/datadog_api_client/v1/models/synthetics_test_details_type.rb index a0964965ccba..b07b5f068190 100644 --- a/lib/datadog_api_client/v1/models/synthetics_test_details_type.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_details_type.rb @@ -17,12 +17,13 @@ require 'time' module DatadogAPIClient::V1 - # Type of the Synthetic test, either `api` or `browser`. + # Type of the Synthetic test. class SyntheticsTestDetailsType include BaseEnumModel API = "api".freeze BROWSER = "browser".freeze MOBILE = "mobile".freeze + NETWORK = "network".freeze end end diff --git a/lib/datadog_api_client/v1/models/synthetics_test_details_without_steps.rb b/lib/datadog_api_client/v1/models/synthetics_test_details_without_steps.rb index b330ec76bde2..790594545c76 100644 --- a/lib/datadog_api_client/v1/models/synthetics_test_details_without_steps.rb +++ b/lib/datadog_api_client/v1/models/synthetics_test_details_without_steps.rb @@ -56,7 +56,7 @@ class SyntheticsTestDetailsWithoutSteps # Array of tags attached to the test. attr_accessor :tags - # Type of the Synthetic test, either `api` or `browser`. + # Type of the Synthetic test. attr_accessor :type attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/api/synthetics_api.rb b/lib/datadog_api_client/v2/api/synthetics_api.rb index f9745f06e547..83594a0c3ec4 100644 --- a/lib/datadog_api_client/v2/api/synthetics_api.rb +++ b/lib/datadog_api_client/v2/api/synthetics_api.rb @@ -23,6 +23,70 @@ def initialize(api_client = DatadogAPIClient::APIClient.default) @api_client = api_client end + # Synthetics: Create a Network Path test. + # + # @see #create_synthetics_network_test_with_http_info + def create_synthetics_network_test(body, opts = {}) + data, _status_code, _headers = create_synthetics_network_test_with_http_info(body, opts) + data + end + + # Synthetics: Create a Network Path test. + # @param body [SyntheticsNetworkTestEditRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(SyntheticsNetworkTestResponse, Integer, Hash)>] SyntheticsNetworkTestResponse data, response status code and response headers + def create_synthetics_network_test_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.create_synthetics_network_test ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.create_synthetics_network_test" + end + # resource path + local_var_path = '/api/v2/synthetics/tests/network' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsNetworkTestResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :create_synthetics_network_test, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#create_synthetics_network_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Synthetics: Create a test suite. # # @see #create_synthetics_suite_with_http_info @@ -151,6 +215,70 @@ def delete_synthetics_suites_with_http_info(body, opts = {}) return data, status_code, headers end + # Synthetics: Bulk delete tests. + # + # @see #delete_synthetics_tests_with_http_info + def delete_synthetics_tests(body, opts = {}) + data, _status_code, _headers = delete_synthetics_tests_with_http_info(body, opts) + data + end + + # Synthetics: Bulk delete tests. + # @param body [DeletedTestsRequestDeleteRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(DeletedTestsResponse, Integer, Hash)>] DeletedTestsResponse data, response status code and response headers + def delete_synthetics_tests_with_http_info(body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.delete_synthetics_tests ...' + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.delete_synthetics_tests" + end + # resource path + local_var_path = '/api/v2/synthetics/tests/bulk-delete' + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'DeletedTestsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :delete_synthetics_tests, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Post, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#delete_synthetics_tests\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Synthetics: Edit a test suite. # # @see #edit_synthetics_suite_with_http_info @@ -280,6 +408,68 @@ def get_on_demand_concurrency_cap_with_http_info(opts = {}) return data, status_code, headers end + # Synthetics: Get a Network Path test. + # + # @see #get_synthetics_network_test_with_http_info + def get_synthetics_network_test(public_id, opts = {}) + data, _status_code, _headers = get_synthetics_network_test_with_http_info(public_id, opts) + data + end + + # Synthetics: Get a Network Path test. + # @param public_id [String] The public ID of the Network Path test to get details from. + # @param opts [Hash] the optional parameters + # @return [Array<(SyntheticsNetworkTestResponse, Integer, Hash)>] SyntheticsNetworkTestResponse data, response status code and response headers + def get_synthetics_network_test_with_http_info(public_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.get_synthetics_network_test ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.get_synthetics_network_test" + end + # resource path + local_var_path = '/api/v2/synthetics/tests/network/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsNetworkTestResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_synthetics_network_test, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#get_synthetics_network_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Synthetics: Get a suite. # # @see #get_synthetics_suite_with_http_info @@ -557,5 +747,74 @@ def set_on_demand_concurrency_cap_with_http_info(body, opts = {}) end return data, status_code, headers end + + # Synthetics: Edit a Network Path test. + # + # @see #update_synthetics_network_test_with_http_info + def update_synthetics_network_test(public_id, body, opts = {}) + data, _status_code, _headers = update_synthetics_network_test_with_http_info(public_id, body, opts) + data + end + + # Synthetics: Edit a Network Path test. + # @param public_id [String] The public ID of the Network Path test to edit. + # @param body [SyntheticsNetworkTestEditRequest] New Network Path test details to be saved. + # @param opts [Hash] the optional parameters + # @return [Array<(SyntheticsNetworkTestResponse, Integer, Hash)>] SyntheticsNetworkTestResponse data, response status code and response headers + def update_synthetics_network_test_with_http_info(public_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: SyntheticsAPI.update_synthetics_network_test ...' + end + # verify the required parameter 'public_id' is set + if @api_client.config.client_side_validation && public_id.nil? + fail ArgumentError, "Missing the required parameter 'public_id' when calling SyntheticsAPI.update_synthetics_network_test" + end + # verify the required parameter 'body' is set + if @api_client.config.client_side_validation && body.nil? + fail ArgumentError, "Missing the required parameter 'body' when calling SyntheticsAPI.update_synthetics_network_test" + end + # resource path + local_var_path = '/api/v2/synthetics/tests/network/{public_id}'.sub('{public_id}', CGI.escape(public_id.to_s).gsub('%2F', '/')) + + # query parameters + query_params = opts[:query_params] || {} + + # header parameters + header_params = opts[:header_params] || {} + # HTTP header 'Accept' (if needed) + header_params['Accept'] = @api_client.select_header_accept(['application/json']) + # HTTP header 'Content-Type' + header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + + # return_type + return_type = opts[:debug_return_type] || 'SyntheticsNetworkTestResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :update_synthetics_network_test, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: SyntheticsAPI#update_synthetics_network_test\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end end end diff --git a/lib/datadog_api_client/v2/models/deleted_test_response_data.rb b/lib/datadog_api_client/v2/models/deleted_test_response_data.rb new file mode 100644 index 000000000000..533905789cb6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deleted_test_response_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class DeletedTestResponseData + include BaseGenericModel + + # + attr_accessor :attributes + + # + attr_accessor :id + + # + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DeletedTestResponseDataAttributes', + :'id' => :'String', + :'type' => :'DeletedTestsResponseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeletedTestResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deleted_test_response_data_attributes.rb b/lib/datadog_api_client/v2/models/deleted_test_response_data_attributes.rb new file mode 100644 index 000000000000..a10057cb1dff --- /dev/null +++ b/lib/datadog_api_client/v2/models/deleted_test_response_data_attributes.rb @@ -0,0 +1,115 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class DeletedTestResponseDataAttributes + include BaseGenericModel + + # Deletion timestamp of the Synthetic test ID. + attr_accessor :deleted_at + + # The Synthetic test ID deleted. + attr_accessor :public_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'deleted_at' => :'deleted_at', + :'public_id' => :'public_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'deleted_at' => :'String', + :'public_id' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeletedTestResponseDataAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'deleted_at') + self.deleted_at = attributes[:'deleted_at'] + end + + if attributes.key?(:'public_id') + self.public_id = attributes[:'public_id'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + deleted_at == o.deleted_at && + public_id == o.public_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [deleted_at, public_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deleted_tests_request_delete.rb b/lib/datadog_api_client/v2/models/deleted_tests_request_delete.rb new file mode 100644 index 000000000000..77ffa349a3c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deleted_tests_request_delete.rb @@ -0,0 +1,143 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class DeletedTestsRequestDelete + include BaseGenericModel + + # + attr_reader :attributes + + # + attr_accessor :id + + # + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'DeletedTestsRequestDeleteAttributes', + :'id' => :'String', + :'type' => :'DeletedTestsRequestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeletedTestsRequestDelete` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deleted_tests_request_delete_attributes.rb b/lib/datadog_api_client/v2/models/deleted_tests_request_delete_attributes.rb new file mode 100644 index 000000000000..a7602922e96a --- /dev/null +++ b/lib/datadog_api_client/v2/models/deleted_tests_request_delete_attributes.rb @@ -0,0 +1,135 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class DeletedTestsRequestDeleteAttributes + include BaseGenericModel + + # + attr_accessor :force_delete_dependencies + + # + attr_reader :public_ids + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'force_delete_dependencies' => :'force_delete_dependencies', + :'public_ids' => :'public_ids' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'force_delete_dependencies' => :'Boolean', + :'public_ids' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeletedTestsRequestDeleteAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'force_delete_dependencies') + self.force_delete_dependencies = attributes[:'force_delete_dependencies'] + end + + if attributes.key?(:'public_ids') + if (value = attributes[:'public_ids']).is_a?(Array) + self.public_ids = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @public_ids.nil? + true + end + + # Custom attribute writer method with validation + # @param public_ids [Object] Object to be assigned + # @!visibility private + def public_ids=(public_ids) + if public_ids.nil? + fail ArgumentError, 'invalid value for "public_ids", public_ids cannot be nil.' + end + @public_ids = public_ids + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + force_delete_dependencies == o.force_delete_dependencies && + public_ids == o.public_ids && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [force_delete_dependencies, public_ids, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deleted_tests_request_delete_request.rb b/lib/datadog_api_client/v2/models/deleted_tests_request_delete_request.rb new file mode 100644 index 000000000000..d5b1b8f74342 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deleted_tests_request_delete_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class DeletedTestsRequestDeleteRequest + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'DeletedTestsRequestDelete' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeletedTestsRequestDeleteRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deleted_tests_request_type.rb b/lib/datadog_api_client/v2/models/deleted_tests_request_type.rb new file mode 100644 index 000000000000..2f97768ff285 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deleted_tests_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class DeletedTestsRequestType + include BaseEnumModel + + DELETE_TESTS_REQUEST = "delete_tests_request".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/deleted_tests_response.rb b/lib/datadog_api_client/v2/models/deleted_tests_response.rb new file mode 100644 index 000000000000..51cf0e71628c --- /dev/null +++ b/lib/datadog_api_client/v2/models/deleted_tests_response.rb @@ -0,0 +1,107 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class DeletedTestsResponse + include BaseGenericModel + + # + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DeletedTestsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/deleted_tests_response_type.rb b/lib/datadog_api_client/v2/models/deleted_tests_response_type.rb new file mode 100644 index 000000000000..02994cdce026 --- /dev/null +++ b/lib/datadog_api_client/v2/models/deleted_tests_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class DeletedTestsResponseType + include BaseEnumModel + + DELETE_TESTS = "delete_tests".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion.rb new file mode 100644 index 000000000000..ba59651abdfc --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion.rb @@ -0,0 +1,65 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing an assertion for a Network Path test. + module SyntheticsNetworkAssertion + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'SyntheticsNetworkAssertionLatency', + :'SyntheticsNetworkAssertionMultiNetworkHop', + :'SyntheticsNetworkAssertionPacketLossPercentage', + :'SyntheticsNetworkAssertionJitter' + ] + end + # Builds the object + # @param data [Mixed] Data to be matched against the list of oneOf items + # @return [Object] Returns the model or the data itself + def build(data) + # Go through the list of oneOf items and attempt to identify the appropriate one. + # Note: + # - We do not attempt to check whether exactly one item matches. + # - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 }) + # due to the way the deserialization is made in the base_object template (it just casts without verifying). + # - TODO: scalar values are de facto behaving as if they were nullable. + # - TODO: logging when debugging is set. + openapi_one_of.each do |klass| + begin + next if klass == :AnyType # "nullable: true" + typed_data = find_and_cast_into_type(klass, data) + next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed + return typed_data if typed_data + rescue # rescue all errors so we keep iterating even if the current item lookup raises + end + end + + if openapi_one_of.include?(:AnyType) + data + else + self._unparsed = true + DatadogAPIClient::UnparsedObject.new(data) + end + end + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_jitter.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_jitter.rb new file mode 100644 index 000000000000..16ab48a5849e --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_jitter.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Jitter assertion for a Network Path test. + class SyntheticsNetworkAssertionJitter + include BaseGenericModel + + # Assertion operator to apply. + attr_reader :operator + + # Target value in milliseconds. + attr_reader :target + + # Type of the jitter assertion. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'operator' => :'operator', + :'target' => :'target', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'operator' => :'SyntheticsNetworkAssertionOperator', + :'target' => :'Float', + :'type' => :'SyntheticsNetworkAssertionJitterType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkAssertionJitter` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'operator') + self.operator = attributes[:'operator'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @operator.nil? + return false if @target.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param operator [Object] Object to be assigned + # @!visibility private + def operator=(operator) + if operator.nil? + fail ArgumentError, 'invalid value for "operator", operator cannot be nil.' + end + @operator = operator + end + + # Custom attribute writer method with validation + # @param target [Object] Object to be assigned + # @!visibility private + def target=(target) + if target.nil? + fail ArgumentError, 'invalid value for "target", target cannot be nil.' + end + @target = target + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + operator == o.operator && + target == o.target && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [operator, target, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_jitter_type.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_jitter_type.rb new file mode 100644 index 000000000000..f573d60a1b80 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_jitter_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the jitter assertion. + class SyntheticsNetworkAssertionJitterType + include BaseEnumModel + + JITTER = "jitter".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_latency.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_latency.rb new file mode 100644 index 000000000000..9d9abd9108be --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_latency.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Network latency assertion for a Network Path test. + class SyntheticsNetworkAssertionLatency + include BaseGenericModel + + # Assertion operator to apply. + attr_reader :operator + + # The associated assertion property. + attr_reader :property + + # Target value in milliseconds. + attr_reader :target + + # Type of the latency assertion. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'operator' => :'operator', + :'property' => :'property', + :'target' => :'target', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'operator' => :'SyntheticsNetworkAssertionOperator', + :'property' => :'SyntheticsNetworkAssertionProperty', + :'target' => :'Float', + :'type' => :'SyntheticsNetworkAssertionLatencyType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkAssertionLatency` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'operator') + self.operator = attributes[:'operator'] + end + + if attributes.key?(:'property') + self.property = attributes[:'property'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @operator.nil? + return false if @property.nil? + return false if @target.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param operator [Object] Object to be assigned + # @!visibility private + def operator=(operator) + if operator.nil? + fail ArgumentError, 'invalid value for "operator", operator cannot be nil.' + end + @operator = operator + end + + # Custom attribute writer method with validation + # @param property [Object] Object to be assigned + # @!visibility private + def property=(property) + if property.nil? + fail ArgumentError, 'invalid value for "property", property cannot be nil.' + end + @property = property + end + + # Custom attribute writer method with validation + # @param target [Object] Object to be assigned + # @!visibility private + def target=(target) + if target.nil? + fail ArgumentError, 'invalid value for "target", target cannot be nil.' + end + @target = target + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + operator == o.operator && + property == o.property && + target == o.target && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [operator, property, target, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_latency_type.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_latency_type.rb new file mode 100644 index 000000000000..f6ddbddef3ff --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_latency_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the latency assertion. + class SyntheticsNetworkAssertionLatencyType + include BaseEnumModel + + LATENCY = "latency".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_multi_network_hop.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_multi_network_hop.rb new file mode 100644 index 000000000000..cbdeead9930c --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_multi_network_hop.rb @@ -0,0 +1,186 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Multi-network hop assertion for a Network Path test. + class SyntheticsNetworkAssertionMultiNetworkHop + include BaseGenericModel + + # Assertion operator to apply. + attr_reader :operator + + # The associated assertion property. + attr_reader :property + + # Target value in number of hops. + attr_reader :target + + # Type of the multi-network hop assertion. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'operator' => :'operator', + :'property' => :'property', + :'target' => :'target', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'operator' => :'SyntheticsNetworkAssertionOperator', + :'property' => :'SyntheticsNetworkAssertionProperty', + :'target' => :'Float', + :'type' => :'SyntheticsNetworkAssertionMultiNetworkHopType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkAssertionMultiNetworkHop` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'operator') + self.operator = attributes[:'operator'] + end + + if attributes.key?(:'property') + self.property = attributes[:'property'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @operator.nil? + return false if @property.nil? + return false if @target.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param operator [Object] Object to be assigned + # @!visibility private + def operator=(operator) + if operator.nil? + fail ArgumentError, 'invalid value for "operator", operator cannot be nil.' + end + @operator = operator + end + + # Custom attribute writer method with validation + # @param property [Object] Object to be assigned + # @!visibility private + def property=(property) + if property.nil? + fail ArgumentError, 'invalid value for "property", property cannot be nil.' + end + @property = property + end + + # Custom attribute writer method with validation + # @param target [Object] Object to be assigned + # @!visibility private + def target=(target) + if target.nil? + fail ArgumentError, 'invalid value for "target", target cannot be nil.' + end + @target = target + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + operator == o.operator && + property == o.property && + target == o.target && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [operator, property, target, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_multi_network_hop_type.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_multi_network_hop_type.rb new file mode 100644 index 000000000000..ed10d0ec39c0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_multi_network_hop_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the multi-network hop assertion. + class SyntheticsNetworkAssertionMultiNetworkHopType + include BaseEnumModel + + MULTI_NETWORK_HOP = "multiNetworkHop".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_operator.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_operator.rb new file mode 100644 index 000000000000..d2c9e60249ef --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_operator.rb @@ -0,0 +1,31 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Assertion operator to apply. + class SyntheticsNetworkAssertionOperator + include BaseEnumModel + + IS = "is".freeze + IS_NOT = "isNot".freeze + LESS_THAN = "lessThan".freeze + LESS_THAN_OR_EQUAL = "lessThanOrEqual".freeze + MORE_THAN = "moreThan".freeze + MORE_THAN_OR_EQUAL = "moreThanOrEqual".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_packet_loss_percentage.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_packet_loss_percentage.rb new file mode 100644 index 000000000000..0f2a14bc50a7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_packet_loss_percentage.rb @@ -0,0 +1,173 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Packet loss percentage assertion for a Network Path test. + class SyntheticsNetworkAssertionPacketLossPercentage + include BaseGenericModel + + # Assertion operator to apply. + attr_reader :operator + + # Target value as a percentage (0 to 1). + attr_reader :target + + # Type of the packet loss percentage assertion. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'operator' => :'operator', + :'target' => :'target', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'operator' => :'SyntheticsNetworkAssertionOperator', + :'target' => :'Float', + :'type' => :'SyntheticsNetworkAssertionPacketLossPercentageType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkAssertionPacketLossPercentage` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'operator') + self.operator = attributes[:'operator'] + end + + if attributes.key?(:'target') + self.target = attributes[:'target'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @operator.nil? + return false if @target.nil? + return false if @target > 1 + return false if @target < 0 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param operator [Object] Object to be assigned + # @!visibility private + def operator=(operator) + if operator.nil? + fail ArgumentError, 'invalid value for "operator", operator cannot be nil.' + end + @operator = operator + end + + # Custom attribute writer method with validation + # @param target [Object] Object to be assigned + # @!visibility private + def target=(target) + if target.nil? + fail ArgumentError, 'invalid value for "target", target cannot be nil.' + end + if target > 1 + fail ArgumentError, 'invalid value for "target", must be smaller than or equal to 1.' + end + if target < 0 + fail ArgumentError, 'invalid value for "target", must be greater than or equal to 0.' + end + @target = target + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + operator == o.operator && + target == o.target && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [operator, target, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_packet_loss_percentage_type.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_packet_loss_percentage_type.rb new file mode 100644 index 000000000000..24c0bfca9e21 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_packet_loss_percentage_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the packet loss percentage assertion. + class SyntheticsNetworkAssertionPacketLossPercentageType + include BaseEnumModel + + PACKET_LOSS_PERCENTAGE = "packetLossPercentage".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_assertion_property.rb b/lib/datadog_api_client/v2/models/synthetics_network_assertion_property.rb new file mode 100644 index 000000000000..13f17de670d9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_assertion_property.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The associated assertion property. + class SyntheticsNetworkAssertionProperty + include BaseEnumModel + + AVG = "avg".freeze + MAX = "max".freeze + MIN = "min".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test.rb b/lib/datadog_api_client/v2/models/synthetics_network_test.rb new file mode 100644 index 000000000000..e3660b18bda6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test.rb @@ -0,0 +1,284 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing details about a Network Path test. + class SyntheticsNetworkTest + include BaseGenericModel + + # Configuration object for a Network Path test. + attr_reader :config + + # 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. + attr_reader :locations + + # Notification message associated with the test. + attr_reader :message + + # The associated monitor ID. + attr_accessor :monitor_id + + # Name of the test. + attr_reader :name + + # Object describing the extra options for a Synthetic test. + attr_reader :options + + # The public ID for the test. + attr_accessor :public_id + + # Define whether you want to start (`live`) or pause (`paused`) a + # Synthetic test. + attr_accessor :status + + # Subtype of the Synthetic Network Path test: `tcp`, `udp`, or `icmp`. + attr_accessor :subtype + + # Array of tags attached to the test. + attr_accessor :tags + + # Type of the Synthetic test, `network`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'config' => :'config', + :'locations' => :'locations', + :'message' => :'message', + :'monitor_id' => :'monitor_id', + :'name' => :'name', + :'options' => :'options', + :'public_id' => :'public_id', + :'status' => :'status', + :'subtype' => :'subtype', + :'tags' => :'tags', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'config' => :'SyntheticsNetworkTestConfig', + :'locations' => :'Array', + :'message' => :'String', + :'monitor_id' => :'Integer', + :'name' => :'String', + :'options' => :'SyntheticsTestOptions', + :'public_id' => :'String', + :'status' => :'SyntheticsTestPauseStatus', + :'subtype' => :'SyntheticsNetworkTestSubType', + :'tags' => :'Array', + :'type' => :'SyntheticsNetworkTestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkTest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'config') + self.config = attributes[:'config'] + end + + if attributes.key?(:'locations') + if (value = attributes[:'locations']).is_a?(Array) + self.locations = value + end + end + + if attributes.key?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'monitor_id') + self.monitor_id = attributes[:'monitor_id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'options') + self.options = attributes[:'options'] + end + + if attributes.key?(:'public_id') + self.public_id = attributes[:'public_id'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'subtype') + self.subtype = attributes[:'subtype'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @config.nil? + return false if @locations.nil? + return false if @message.nil? + return false if @name.nil? + return false if @options.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param config [Object] Object to be assigned + # @!visibility private + def config=(config) + if config.nil? + fail ArgumentError, 'invalid value for "config", config cannot be nil.' + end + @config = config + end + + # Custom attribute writer method with validation + # @param locations [Object] Object to be assigned + # @!visibility private + def locations=(locations) + if locations.nil? + fail ArgumentError, 'invalid value for "locations", locations cannot be nil.' + end + @locations = locations + end + + # Custom attribute writer method with validation + # @param message [Object] Object to be assigned + # @!visibility private + def message=(message) + if message.nil? + fail ArgumentError, 'invalid value for "message", message cannot be nil.' + end + @message = message + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Custom attribute writer method with validation + # @param options [Object] Object to be assigned + # @!visibility private + def options=(options) + if options.nil? + fail ArgumentError, 'invalid value for "options", options cannot be nil.' + end + @options = options + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + config == o.config && + locations == o.locations && + message == o.message && + monitor_id == o.monitor_id && + name == o.name && + options == o.options && + public_id == o.public_id && + status == o.status && + subtype == o.subtype && + tags == o.tags && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [config, locations, message, monitor_id, name, options, public_id, status, subtype, tags, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_config.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_config.rb new file mode 100644 index 000000000000..19eaa6595262 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_config.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Configuration object for a Network Path test. + class SyntheticsNetworkTestConfig + include BaseGenericModel + + # Array of assertions used for the test. + attr_accessor :assertions + + # Object describing the request for a Network Path test. + attr_accessor :request + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'assertions' => :'assertions', + :'request' => :'request' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'assertions' => :'Array', + :'request' => :'SyntheticsNetworkTestRequest' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkTestConfig` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'assertions') + if (value = attributes[:'assertions']).is_a?(Array) + self.assertions = value + end + end + + if attributes.key?(:'request') + self.request = attributes[:'request'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + assertions == o.assertions && + request == o.request && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [assertions, request, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_edit.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_edit.rb new file mode 100644 index 000000000000..d7051949785f --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_edit.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # + class SyntheticsNetworkTestEdit + include BaseGenericModel + + # Object containing details about a Network Path test. + attr_reader :attributes + + # Type of the Synthetic test, `network`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SyntheticsNetworkTest', + :'type' => :'SyntheticsNetworkTestType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkTestEdit` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_edit_request.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_edit_request.rb new file mode 100644 index 000000000000..758cf4226570 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_edit_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Network Path test request. + class SyntheticsNetworkTestEditRequest + include BaseGenericModel + + # + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SyntheticsNetworkTestEdit' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkTestEditRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_request.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_request.rb new file mode 100644 index 000000000000..baa610d8428d --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_request.rb @@ -0,0 +1,237 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing the request for a Network Path test. + class SyntheticsNetworkTestRequest + include BaseGenericModel + + # Destination service name. + attr_accessor :destination_service + + # Number of end-to-end queries. + attr_reader :e2e_queries + + # Host name to query. + attr_reader :host + + # Maximum TTL for network packets. + attr_reader :max_ttl + + # For TCP or UDP tests, the port to use when performing the test. + # If not set on a UDP test, a random port is assigned, which may affect the results. + attr_accessor :port + + # Source service name. + attr_accessor :source_service + + # For TCP tests, the TCP method to use. + attr_accessor :tcp_method + + # Timeout in seconds. + attr_accessor :timeout + + # Number of traceroute queries. + attr_reader :traceroute_queries + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'destination_service' => :'destination_service', + :'e2e_queries' => :'e2e_queries', + :'host' => :'host', + :'max_ttl' => :'max_ttl', + :'port' => :'port', + :'source_service' => :'source_service', + :'tcp_method' => :'tcp_method', + :'timeout' => :'timeout', + :'traceroute_queries' => :'traceroute_queries' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'destination_service' => :'String', + :'e2e_queries' => :'Integer', + :'host' => :'String', + :'max_ttl' => :'Integer', + :'port' => :'Integer', + :'source_service' => :'String', + :'tcp_method' => :'SyntheticsNetworkTestRequestTCPMethod', + :'timeout' => :'Integer', + :'traceroute_queries' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkTestRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'destination_service') + self.destination_service = attributes[:'destination_service'] + end + + if attributes.key?(:'e2e_queries') + self.e2e_queries = attributes[:'e2e_queries'] + end + + if attributes.key?(:'host') + self.host = attributes[:'host'] + end + + if attributes.key?(:'max_ttl') + self.max_ttl = attributes[:'max_ttl'] + end + + if attributes.key?(:'port') + self.port = attributes[:'port'] + end + + if attributes.key?(:'source_service') + self.source_service = attributes[:'source_service'] + end + + if attributes.key?(:'tcp_method') + self.tcp_method = attributes[:'tcp_method'] + end + + if attributes.key?(:'timeout') + self.timeout = attributes[:'timeout'] + end + + if attributes.key?(:'traceroute_queries') + self.traceroute_queries = attributes[:'traceroute_queries'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @e2e_queries.nil? + return false if @host.nil? + return false if @max_ttl.nil? + return false if @traceroute_queries.nil? + true + end + + # Custom attribute writer method with validation + # @param e2e_queries [Object] Object to be assigned + # @!visibility private + def e2e_queries=(e2e_queries) + if e2e_queries.nil? + fail ArgumentError, 'invalid value for "e2e_queries", e2e_queries cannot be nil.' + end + @e2e_queries = e2e_queries + end + + # Custom attribute writer method with validation + # @param host [Object] Object to be assigned + # @!visibility private + def host=(host) + if host.nil? + fail ArgumentError, 'invalid value for "host", host cannot be nil.' + end + @host = host + end + + # Custom attribute writer method with validation + # @param max_ttl [Object] Object to be assigned + # @!visibility private + def max_ttl=(max_ttl) + if max_ttl.nil? + fail ArgumentError, 'invalid value for "max_ttl", max_ttl cannot be nil.' + end + @max_ttl = max_ttl + end + + # Custom attribute writer method with validation + # @param traceroute_queries [Object] Object to be assigned + # @!visibility private + def traceroute_queries=(traceroute_queries) + if traceroute_queries.nil? + fail ArgumentError, 'invalid value for "traceroute_queries", traceroute_queries cannot be nil.' + end + @traceroute_queries = traceroute_queries + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + destination_service == o.destination_service && + e2e_queries == o.e2e_queries && + host == o.host && + max_ttl == o.max_ttl && + port == o.port && + source_service == o.source_service && + tcp_method == o.tcp_method && + timeout == o.timeout && + traceroute_queries == o.traceroute_queries && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [destination_service, e2e_queries, host, max_ttl, port, source_service, tcp_method, timeout, traceroute_queries, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_request_tcp_method.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_request_tcp_method.rb new file mode 100644 index 000000000000..8b741300aaa0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_request_tcp_method.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # For TCP tests, the TCP method to use. + class SyntheticsNetworkTestRequestTCPMethod + include BaseEnumModel + + PREFER_SACK = "prefer_sack".freeze + SYN = "syn".freeze + SACK = "sack".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_response.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_response.rb new file mode 100644 index 000000000000..c6d36be12eb7 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_response.rb @@ -0,0 +1,105 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Network Path test response. + class SyntheticsNetworkTestResponse + include BaseGenericModel + + # Network Path test response data. + attr_accessor :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'SyntheticsNetworkTestResponseData' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkTestResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_response_data.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_response_data.rb new file mode 100644 index 000000000000..96454528cf8f --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_response_data.rb @@ -0,0 +1,125 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Network Path test response data. + class SyntheticsNetworkTestResponseData + include BaseGenericModel + + # Object containing details about a Network Path test. + attr_accessor :attributes + + # The public ID of the Network Path test. + attr_accessor :id + + # Type of response, `network_test`. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'SyntheticsNetworkTest', + :'id' => :'String', + :'type' => :'SyntheticsNetworkTestResponseType' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsNetworkTestResponseData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + id == o.id && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, id, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_response_type.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_response_type.rb new file mode 100644 index 000000000000..096e98725ac0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_response_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of response, `network_test`. + class SyntheticsNetworkTestResponseType + include BaseEnumModel + + NETWORK_TEST = "network_test".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_sub_type.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_sub_type.rb new file mode 100644 index 000000000000..3b7f9eb8dd2d --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_sub_type.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Subtype of the Synthetic Network Path test: `tcp`, `udp`, or `icmp`. + class SyntheticsNetworkTestSubType + include BaseEnumModel + + TCP = "tcp".freeze + UDP = "udp".freeze + ICMP = "icmp".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_network_test_type.rb b/lib/datadog_api_client/v2/models/synthetics_network_test_type.rb new file mode 100644 index 000000000000..376a43c05624 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_network_test_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Type of the Synthetic test, `network`. + class SyntheticsNetworkTestType + include BaseEnumModel + + NETWORK = "network".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_options.rb b/lib/datadog_api_client/v2/models/synthetics_test_options.rb new file mode 100644 index 000000000000..78cd56bda58a --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_options.rb @@ -0,0 +1,226 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing the extra options for a Synthetic test. + class SyntheticsTestOptions + include BaseGenericModel + + # Minimum amount of time in failure required to trigger an alert. + attr_accessor :min_failure_duration + + # Minimum number of locations in failure required to trigger + # an alert. + attr_accessor :min_location_failed + + # The monitor name is used for the alert title as well as for all monitor dashboard widgets and SLOs. + attr_accessor :monitor_name + + # Object containing the options for a Synthetic test as a monitor + # (for example, renotification). + attr_accessor :monitor_options + + # Integer from 1 (high) to 5 (low) indicating alert severity. + attr_reader :monitor_priority + + # 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. + attr_accessor :restricted_roles + + # Object describing the retry strategy to apply to a Synthetic test. + attr_accessor :_retry + + # Object containing timeframes and timezone used for advanced scheduling. + attr_accessor :scheduling + + # The frequency at which to run the Synthetic test (in seconds). + attr_reader :tick_every + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'min_failure_duration' => :'min_failure_duration', + :'min_location_failed' => :'min_location_failed', + :'monitor_name' => :'monitor_name', + :'monitor_options' => :'monitor_options', + :'monitor_priority' => :'monitor_priority', + :'restricted_roles' => :'restricted_roles', + :'_retry' => :'retry', + :'scheduling' => :'scheduling', + :'tick_every' => :'tick_every' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'min_failure_duration' => :'Integer', + :'min_location_failed' => :'Integer', + :'monitor_name' => :'String', + :'monitor_options' => :'SyntheticsTestOptionsMonitorOptions', + :'monitor_priority' => :'Integer', + :'restricted_roles' => :'Array', + :'_retry' => :'SyntheticsTestOptionsRetry', + :'scheduling' => :'SyntheticsTestOptionsScheduling', + :'tick_every' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestOptions` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'min_failure_duration') + self.min_failure_duration = attributes[:'min_failure_duration'] + end + + if attributes.key?(:'min_location_failed') + self.min_location_failed = attributes[:'min_location_failed'] + end + + if attributes.key?(:'monitor_name') + self.monitor_name = attributes[:'monitor_name'] + end + + if attributes.key?(:'monitor_options') + self.monitor_options = attributes[:'monitor_options'] + end + + if attributes.key?(:'monitor_priority') + self.monitor_priority = attributes[:'monitor_priority'] + end + + if attributes.key?(:'restricted_roles') + if (value = attributes[:'restricted_roles']).is_a?(Array) + self.restricted_roles = value + end + end + + if attributes.key?(:'_retry') + self._retry = attributes[:'_retry'] + end + + if attributes.key?(:'scheduling') + self.scheduling = attributes[:'scheduling'] + end + + if attributes.key?(:'tick_every') + self.tick_every = attributes[:'tick_every'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@monitor_priority.nil? && @monitor_priority > 5 + return false if !@monitor_priority.nil? && @monitor_priority < 1 + return false if !@tick_every.nil? && @tick_every > 604800 + return false if !@tick_every.nil? && @tick_every < 30 + true + end + + # Custom attribute writer method with validation + # @param monitor_priority [Object] Object to be assigned + # @!visibility private + def monitor_priority=(monitor_priority) + if !monitor_priority.nil? && monitor_priority > 5 + fail ArgumentError, 'invalid value for "monitor_priority", must be smaller than or equal to 5.' + end + if !monitor_priority.nil? && monitor_priority < 1 + fail ArgumentError, 'invalid value for "monitor_priority", must be greater than or equal to 1.' + end + @monitor_priority = monitor_priority + end + + # Custom attribute writer method with validation + # @param tick_every [Object] Object to be assigned + # @!visibility private + def tick_every=(tick_every) + if !tick_every.nil? && tick_every > 604800 + fail ArgumentError, 'invalid value for "tick_every", must be smaller than or equal to 604800.' + end + if !tick_every.nil? && tick_every < 30 + fail ArgumentError, 'invalid value for "tick_every", must be greater than or equal to 30.' + end + @tick_every = tick_every + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + min_failure_duration == o.min_failure_duration && + min_location_failed == o.min_location_failed && + monitor_name == o.monitor_name && + monitor_options == o.monitor_options && + monitor_priority == o.monitor_priority && + restricted_roles == o.restricted_roles && + _retry == o._retry && + scheduling == o.scheduling && + tick_every == o.tick_every && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [min_failure_duration, min_location_failed, monitor_name, monitor_options, monitor_priority, restricted_roles, _retry, scheduling, tick_every, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_options_monitor_options.rb b/lib/datadog_api_client/v2/models/synthetics_test_options_monitor_options.rb new file mode 100644 index 000000000000..849cbdd73642 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_options_monitor_options.rb @@ -0,0 +1,155 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing the options for a Synthetic test as a monitor + # (for example, renotification). + class SyntheticsTestOptionsMonitorOptions + include BaseGenericModel + + # Message to include in the escalation notification. + attr_accessor :escalation_message + + # The name of the preset for the notification for the monitor. + attr_accessor :notification_preset_name + + # Time interval before renotifying if the test is still failing + # (in minutes). + attr_reader :renotify_interval + + # The number of times to renotify if the test is still failing. + attr_accessor :renotify_occurrences + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'escalation_message' => :'escalation_message', + :'notification_preset_name' => :'notification_preset_name', + :'renotify_interval' => :'renotify_interval', + :'renotify_occurrences' => :'renotify_occurrences' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'escalation_message' => :'String', + :'notification_preset_name' => :'SyntheticsTestOptionsMonitorOptionsNotificationPresetName', + :'renotify_interval' => :'Integer', + :'renotify_occurrences' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestOptionsMonitorOptions` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'escalation_message') + self.escalation_message = attributes[:'escalation_message'] + end + + if attributes.key?(:'notification_preset_name') + self.notification_preset_name = attributes[:'notification_preset_name'] + end + + if attributes.key?(:'renotify_interval') + self.renotify_interval = attributes[:'renotify_interval'] + end + + if attributes.key?(:'renotify_occurrences') + self.renotify_occurrences = attributes[:'renotify_occurrences'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if !@renotify_interval.nil? && @renotify_interval < 0 + true + end + + # Custom attribute writer method with validation + # @param renotify_interval [Object] Object to be assigned + # @!visibility private + def renotify_interval=(renotify_interval) + if !renotify_interval.nil? && renotify_interval < 0 + fail ArgumentError, 'invalid value for "renotify_interval", must be greater than or equal to 0.' + end + @renotify_interval = renotify_interval + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + escalation_message == o.escalation_message && + notification_preset_name == o.notification_preset_name && + renotify_interval == o.renotify_interval && + renotify_occurrences == o.renotify_occurrences && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [escalation_message, notification_preset_name, renotify_interval, renotify_occurrences, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_options_monitor_options_notification_preset_name.rb b/lib/datadog_api_client/v2/models/synthetics_test_options_monitor_options_notification_preset_name.rb new file mode 100644 index 000000000000..7df297da9495 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_options_monitor_options_notification_preset_name.rb @@ -0,0 +1,32 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The name of the preset for the notification for the monitor. + class SyntheticsTestOptionsMonitorOptionsNotificationPresetName + include BaseEnumModel + + SHOW_ALL = "show_all".freeze + HIDE_ALL = "hide_all".freeze + HIDE_QUERY = "hide_query".freeze + HIDE_HANDLES = "hide_handles".freeze + HIDE_QUERY_AND_HANDLES = "hide_query_and_handles".freeze + SHOW_ONLY_SNAPSHOT = "show_only_snapshot".freeze + HIDE_HANDLES_AND_FOOTER = "hide_handles_and_footer".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_options_retry.rb b/lib/datadog_api_client/v2/models/synthetics_test_options_retry.rb new file mode 100644 index 000000000000..1b02faca67a4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_options_retry.rb @@ -0,0 +1,117 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing the retry strategy to apply to a Synthetic test. + class SyntheticsTestOptionsRetry + include BaseGenericModel + + # Number of times a test needs to be retried before marking a + # location as failed. Defaults to 0. + attr_accessor :count + + # Time interval between retries (in milliseconds). Defaults to + # 300ms. + attr_accessor :interval + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'count' => :'count', + :'interval' => :'interval' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'count' => :'Integer', + :'interval' => :'Float' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestOptionsRetry` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'count') + self.count = attributes[:'count'] + end + + if attributes.key?(:'interval') + self.interval = attributes[:'interval'] + end + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + count == o.count && + interval == o.interval && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [count, interval, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_options_scheduling.rb b/lib/datadog_api_client/v2/models/synthetics_test_options_scheduling.rb new file mode 100644 index 000000000000..6c27178ebdfb --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_options_scheduling.rb @@ -0,0 +1,146 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object containing timeframes and timezone used for advanced scheduling. + class SyntheticsTestOptionsScheduling + include BaseGenericModel + + # Array containing objects describing the scheduling pattern to apply to each day. + attr_reader :timeframes + + # Timezone in which the timeframe is based. + attr_reader :timezone + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'timeframes' => :'timeframes', + :'timezone' => :'timezone' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'timeframes' => :'Array', + :'timezone' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestOptionsScheduling` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'timeframes') + if (value = attributes[:'timeframes']).is_a?(Array) + self.timeframes = value + end + end + + if attributes.key?(:'timezone') + self.timezone = attributes[:'timezone'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @timeframes.nil? + return false if @timezone.nil? + true + end + + # Custom attribute writer method with validation + # @param timeframes [Object] Object to be assigned + # @!visibility private + def timeframes=(timeframes) + if timeframes.nil? + fail ArgumentError, 'invalid value for "timeframes", timeframes cannot be nil.' + end + @timeframes = timeframes + end + + # Custom attribute writer method with validation + # @param timezone [Object] Object to be assigned + # @!visibility private + def timezone=(timezone) + if timezone.nil? + fail ArgumentError, 'invalid value for "timezone", timezone cannot be nil.' + end + @timezone = timezone + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + timeframes == o.timeframes && + timezone == o.timezone && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [timeframes, timezone, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_options_scheduling_timeframe.rb b/lib/datadog_api_client/v2/models/synthetics_test_options_scheduling_timeframe.rb new file mode 100644 index 000000000000..7285178158d4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_options_scheduling_timeframe.rb @@ -0,0 +1,173 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Object describing a timeframe. + class SyntheticsTestOptionsSchedulingTimeframe + include BaseGenericModel + + # Number representing the day of the week. + attr_reader :day + + # The hour of the day on which scheduling starts. + attr_reader :from + + # The hour of the day on which scheduling ends. + attr_reader :to + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'day' => :'day', + :'from' => :'from', + :'to' => :'to' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'day' => :'Integer', + :'from' => :'String', + :'to' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::SyntheticsTestOptionsSchedulingTimeframe` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'day') + self.day = attributes[:'day'] + end + + if attributes.key?(:'from') + self.from = attributes[:'from'] + end + + if attributes.key?(:'to') + self.to = attributes[:'to'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @day.nil? + return false if @day > 7 + return false if @day < 1 + return false if @from.nil? + return false if @to.nil? + true + end + + # Custom attribute writer method with validation + # @param day [Object] Object to be assigned + # @!visibility private + def day=(day) + if day.nil? + fail ArgumentError, 'invalid value for "day", day cannot be nil.' + end + if day > 7 + fail ArgumentError, 'invalid value for "day", must be smaller than or equal to 7.' + end + if day < 1 + fail ArgumentError, 'invalid value for "day", must be greater than or equal to 1.' + end + @day = day + end + + # Custom attribute writer method with validation + # @param from [Object] Object to be assigned + # @!visibility private + def from=(from) + if from.nil? + fail ArgumentError, 'invalid value for "from", from cannot be nil.' + end + @from = from + end + + # Custom attribute writer method with validation + # @param to [Object] Object to be assigned + # @!visibility private + def to=(to) + if to.nil? + fail ArgumentError, 'invalid value for "to", to cannot be nil.' + end + @to = to + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + day == o.day && + from == o.from && + to == o.to && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [day, from, to, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/synthetics_test_pause_status.rb b/lib/datadog_api_client/v2/models/synthetics_test_pause_status.rb new file mode 100644 index 000000000000..dca66f71d622 --- /dev/null +++ b/lib/datadog_api_client/v2/models/synthetics_test_pause_status.rb @@ -0,0 +1,28 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + 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 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Define whether you want to start (`live`) or pause (`paused`) a + # Synthetic test. + class SyntheticsTestPauseStatus + include BaseEnumModel + + LIVE = "live".freeze + PAUSED = "paused".freeze + end +end