From 8db828452de2120925edf17a2959fe6d7d0ce6f7 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Fri, 22 May 2026 14:00:26 +0000 Subject: [PATCH] Regenerate client from commit 0070cdf of spec repo --- .generator/schemas/v2/openapi.yaml | 58 +++++++ examples/v2/test-examples/ListTestExamples.rb | 5 + features/v2/test_examples.feature | 12 ++ features/v2/undo.json | 6 + lib/datadog_api_client/inflector.rb | 3 + .../v2/api/test_examples_api.rb | 86 ++++++++++ .../v2/models/test_example.rb | 154 ++++++++++++++++++ .../v2/models/test_examples_response.rb | 107 ++++++++++++ 8 files changed, 431 insertions(+) create mode 100644 examples/v2/test-examples/ListTestExamples.rb create mode 100644 features/v2/test_examples.feature create mode 100644 lib/datadog_api_client/v2/api/test_examples_api.rb create mode 100644 lib/datadog_api_client/v2/models/test_example.rb create mode 100644 lib/datadog_api_client/v2/models/test_examples_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 97213ec2fe9e..45e6d8157709 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -86549,6 +86549,34 @@ components: required: - data type: object + TestExample: + description: A test example resource. + properties: + created_at: + description: Creation time of the test example. + format: date-time + readOnly: true + type: string + id: + description: The ID of the test example. + example: "abc-123" + type: string + name: + description: The name of the test example. + example: "My Test Example" + type: string + required: + - id + - name + type: object + TestExamplesResponse: + description: Response containing a list of test examples. + properties: + data: + items: + $ref: "#/components/schemas/TestExample" + type: array + type: object TestOptimizationDeleteServiceSettingsRequest: description: Request object for deleting Test Optimization service settings. properties: @@ -158742,6 +158770,34 @@ paths: operator: OR permissions: - teams_read + /api/v2/test-examples: + get: + description: Get a list of all test examples. + operationId: ListTestExamples + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - id: "abc-123" + name: "My Test Example" + schema: + $ref: "#/components/schemas/TestExamplesResponse" + description: OK + "403": + $ref: "#/components/responses/ForbiddenResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: List test examples + tags: + - Test Examples + x-permission: + operator: OR + permissions: + - test_read /api/v2/test/flaky-test-management/tests: patch: description: |- @@ -162115,6 +162171,8 @@ tags: name: Synthetics - description: View and manage teams within Datadog. See the [Teams page](https://docs.datadoghq.com/account_management/teams/) for more information. name: Teams + - description: Manage test example resources. + name: Test Examples - description: |- Search and manage flaky tests through Test Optimization. See the [Test Optimization page](https://docs.datadoghq.com/tests/) for more information. name: Test Optimization diff --git a/examples/v2/test-examples/ListTestExamples.rb b/examples/v2/test-examples/ListTestExamples.rb new file mode 100644 index 000000000000..e31618ace925 --- /dev/null +++ b/examples/v2/test-examples/ListTestExamples.rb @@ -0,0 +1,5 @@ +# List test examples returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::TestExamplesAPI.new +p api_instance.list_test_examples() diff --git a/features/v2/test_examples.feature b/features/v2/test_examples.feature new file mode 100644 index 000000000000..263011b0ce3c --- /dev/null +++ b/features/v2/test_examples.feature @@ -0,0 +1,12 @@ +@endpoint(test-examples) @endpoint(test-examples-v2) +Feature: Test Examples + Manage test example resources. + + @generated @skip @team:DataDog/webframeworks-test + Scenario: List test examples returns "OK" response + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "TestExamples" API + And new "ListTestExamples" request + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index 7a8309d2ceff..09d56ad5577c 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -7776,6 +7776,12 @@ "type": "idempotent" } }, + "ListTestExamples": { + "tag": "Test Examples", + "undo": { + "type": "safe" + } + }, "UpdateFlakyTests": { "tag": "Test Optimization", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 483d26abc1a2..e22656cf59cc 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -6465,6 +6465,8 @@ def overrides "v2.tenancy_products_data_attributes_products_items" => "TenancyProductsDataAttributesProductsItems", "v2.tenancy_products_data_type" => "TenancyProductsDataType", "v2.tenancy_products_list" => "TenancyProductsList", + "v2.test_example" => "TestExample", + "v2.test_examples_response" => "TestExamplesResponse", "v2.test_optimization_delete_service_settings_request" => "TestOptimizationDeleteServiceSettingsRequest", "v2.test_optimization_delete_service_settings_request_attributes" => "TestOptimizationDeleteServiceSettingsRequestAttributes", "v2.test_optimization_delete_service_settings_request_data" => "TestOptimizationDeleteServiceSettingsRequestData", @@ -6969,6 +6971,7 @@ def overrides "v2.storage_management_api" => "StorageManagementAPI", "v2.synthetics_api" => "SyntheticsAPI", "v2.teams_api" => "TeamsAPI", + "v2.test_examples_api" => "TestExamplesAPI", "v2.test_optimization_api" => "TestOptimizationAPI", "v2.usage_metering_api" => "UsageMeteringAPI", "v2.users_api" => "UsersAPI", diff --git a/lib/datadog_api_client/v2/api/test_examples_api.rb b/lib/datadog_api_client/v2/api/test_examples_api.rb new file mode 100644 index 000000000000..80495a66857c --- /dev/null +++ b/lib/datadog_api_client/v2/api/test_examples_api.rb @@ -0,0 +1,86 @@ +=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 'cgi' + +module DatadogAPIClient::V2 + class TestExamplesAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # List test examples. + # + # @see #list_test_examples_with_http_info + def list_test_examples(opts = {}) + data, _status_code, _headers = list_test_examples_with_http_info(opts) + data + end + + # List test examples. + # + # Get a list of all test examples. + # + # @param opts [Hash] the optional parameters + # @return [Array<(TestExamplesResponse, Integer, Hash)>] TestExamplesResponse data, response status code and response headers + def list_test_examples_with_http_info(opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: TestExamplesAPI.list_test_examples ...' + end + # resource path + local_var_path = '/api/v2/test-examples' + + # 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] || 'TestExamplesResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_test_examples, + :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: TestExamplesAPI#list_test_examples\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/test_example.rb b/lib/datadog_api_client/v2/models/test_example.rb new file mode 100644 index 000000000000..cfeca071e893 --- /dev/null +++ b/lib/datadog_api_client/v2/models/test_example.rb @@ -0,0 +1,154 @@ +=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 + # A test example resource. + class TestExample + include BaseGenericModel + + # Creation time of the test example. + attr_accessor :created_at + + # The ID of the test example. + attr_reader :id + + # The name of the test example. + attr_reader :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'created_at' => :'created_at', + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'created_at' => :'Time', + :'id' => :'String', + :'name' => :'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::TestExample` 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?(:'created_at') + self.created_at = attributes[:'created_at'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + 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 @id.nil? + return false if @name.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + 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 + + # 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 && + created_at == o.created_at && + id == o.id && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [created_at, id, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/test_examples_response.rb b/lib/datadog_api_client/v2/models/test_examples_response.rb new file mode 100644 index 000000000000..21ebcaf50ba0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/test_examples_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 + # Response containing a list of test examples. + class TestExamplesResponse + 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::TestExamplesResponse` 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