diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 093a28a0b5be..f731f36b7945 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -33939,6 +33939,25 @@ components: - data - meta type: object + ListInterfaceTagsResponse: + description: Response for listing interface tags. + properties: + data: + $ref: '#/components/schemas/ListInterfaceTagsResponseData' + type: object + ListInterfaceTagsResponseData: + description: Response data for listing interface tags. + properties: + attributes: + $ref: '#/components/schemas/ListTagsResponseDataAttributes' + id: + description: The interface ID + example: example:1.2.3.4:1 + type: string + type: + description: The type of the resource. The value should always be tags. + type: string + type: object ListKindCatalogResponse: description: List kind response. properties: @@ -55890,6 +55909,7 @@ components: - -start_date - -expiration_date - -update_date + - -creation_date - -enabled type: string x-enum-varnames: @@ -55902,6 +55922,7 @@ components: - START_DATE_DESCENDING - EXPIRATION_DATE_DESCENDING - UPDATE_DATE_DESCENDING + - CREATION_DATE_DESCENDING - ENABLED_DESCENDING SecurityMonitoringSuppressionType: default: suppressions @@ -86637,6 +86658,67 @@ paths: summary: Update the tags for a device tags: - Network Device Monitoring + /api/v2/ndm/tags/interfaces/{interface_id}: + get: + description: Returns the tags associated with the specified interface. + operationId: ListInterfaceUserTags + parameters: + - description: The ID of the interface for which to retrieve tags. + example: example:1.2.3.4:1 + in: path + name: interface_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListInterfaceTagsResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: List tags for an interface + tags: + - Network Device Monitoring + patch: + description: Updates the tags associated with the specified interface. + operationId: UpdateInterfaceUserTags + parameters: + - description: The ID of the interface for which to update tags. + example: example:1.2.3.4:1 + in: path + name: interface_id + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ListInterfaceTagsResponse' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListInterfaceTagsResponse' + description: OK + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + summary: Update the tags for an interface + tags: + - Network Device Monitoring /api/v2/network/connections/aggregate: get: description: Get all aggregated connections. diff --git a/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-Not-Found-response.frozen b/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..a695995fbb6b --- /dev/null +++ b/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-02-17T10:20:35.870Z \ No newline at end of file diff --git a/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-Not-Found-response.yml b/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-Not-Found-response.yml new file mode 100644 index 000000000000..4dae52840ea8 --- /dev/null +++ b/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-Not-Found-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 17 Feb 2026 10:20:35 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/ndm/tags/interfaces/unknown_interface_id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-OK-response.frozen b/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-OK-response.frozen new file mode 100644 index 000000000000..e67a37915277 --- /dev/null +++ b/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-02-17T10:20:36.480Z \ No newline at end of file diff --git a/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-OK-response.yml b/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-OK-response.yml new file mode 100644 index 000000000000..85fb14847083 --- /dev/null +++ b/cassettes/features/v2/network_device_monitoring/List-tags-for-an-interface-returns-OK-response.yml @@ -0,0 +1,20 @@ +http_interactions: +- recorded_at: Tue, 17 Feb 2026 10:20:36 GMT + request: + body: null + headers: + Accept: + - application/json + method: GET + uri: https://api.datadoghq.com/api/v2/ndm/tags/interfaces/example%3A1.2.3.4%3A1 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"example:1.2.3.4:1","type":"tags","attributes":{"tags":["tag:test","tag:testbis"]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-Not-Found-response.frozen b/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-Not-Found-response.frozen new file mode 100644 index 000000000000..b5d1d980bf46 --- /dev/null +++ b/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-Not-Found-response.frozen @@ -0,0 +1 @@ +2026-02-17T10:20:36.989Z \ No newline at end of file diff --git a/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-Not-Found-response.yml b/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-Not-Found-response.yml new file mode 100644 index 000000000000..f9edb0cb2098 --- /dev/null +++ b/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-Not-Found-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Tue, 17 Feb 2026 10:20:36 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"tags":["tag:test","tag:testbis"]},"id":"unknown_interface_id","type":"tags"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/ndm/tags/interfaces/unknown_interface_id + response: + body: + encoding: UTF-8 + string: '{"errors":[{"status":"404","title":"Not Found"}]}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 404 + message: Not Found +recorded_with: VCR 6.0.0 diff --git a/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-OK-response.frozen b/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-OK-response.frozen new file mode 100644 index 000000000000..66efae74120e --- /dev/null +++ b/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-OK-response.frozen @@ -0,0 +1 @@ +2026-02-17T10:20:37.189Z \ No newline at end of file diff --git a/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-OK-response.yml b/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-OK-response.yml new file mode 100644 index 000000000000..9419fb680abc --- /dev/null +++ b/cassettes/features/v2/network_device_monitoring/Update-the-tags-for-an-interface-returns-OK-response.yml @@ -0,0 +1,24 @@ +http_interactions: +- recorded_at: Tue, 17 Feb 2026 10:20:37 GMT + request: + body: + encoding: UTF-8 + string: '{"data":{"attributes":{"tags":["tag:test","tag:testbis"]},"id":"example:1.2.3.4:1","type":"tags"}}' + headers: + Accept: + - application/json + Content-Type: + - application/json + method: PATCH + uri: https://api.datadoghq.com/api/v2/ndm/tags/interfaces/example%3A1.2.3.4%3A1 + response: + body: + encoding: UTF-8 + string: '{"data":{"id":"example:1.2.3.4:1","type":"tags","attributes":{"tags":["tag:test","tag:testbis"]}}}' + headers: + Content-Type: + - application/vnd.api+json + status: + code: 200 + message: OK +recorded_with: VCR 6.0.0 diff --git a/examples/v2/network-device-monitoring/ListInterfaceUserTags.rb b/examples/v2/network-device-monitoring/ListInterfaceUserTags.rb new file mode 100644 index 000000000000..9954c4dadfb1 --- /dev/null +++ b/examples/v2/network-device-monitoring/ListInterfaceUserTags.rb @@ -0,0 +1,5 @@ +# List tags for an interface returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::NetworkDeviceMonitoringAPI.new +p api_instance.list_interface_user_tags("example:1.2.3.4:1") diff --git a/examples/v2/network-device-monitoring/UpdateInterfaceUserTags.rb b/examples/v2/network-device-monitoring/UpdateInterfaceUserTags.rb new file mode 100644 index 000000000000..7853a58a9e86 --- /dev/null +++ b/examples/v2/network-device-monitoring/UpdateInterfaceUserTags.rb @@ -0,0 +1,18 @@ +# Update the tags for an interface returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::NetworkDeviceMonitoringAPI.new + +body = DatadogAPIClient::V2::ListInterfaceTagsResponse.new({ + data: DatadogAPIClient::V2::ListInterfaceTagsResponseData.new({ + attributes: DatadogAPIClient::V2::ListTagsResponseDataAttributes.new({ + tags: [ + "tag:test", + "tag:testbis", + ], + }), + id: "example:1.2.3.4:1", + type: "tags", + }), +}) +p api_instance.update_interface_user_tags("example:1.2.3.4:1", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index c226dd7a5165..cb334f67c5c1 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2808,6 +2808,13 @@ "device_id" => "String", "body" => "ListTagsResponse", }, + "v2.ListInterfaceUserTags" => { + "interface_id" => "String", + }, + "v2.UpdateInterfaceUserTags" => { + "interface_id" => "String", + "body" => "ListInterfaceTagsResponse", + }, "v2.GetAggregatedConnections" => { "from" => "Integer", "to" => "Integer", diff --git a/features/v2/network_device_monitoring.feature b/features/v2/network_device_monitoring.feature index f6f7a78f257c..165564dc39c4 100644 --- a/features/v2/network_device_monitoring.feature +++ b/features/v2/network_device_monitoring.feature @@ -124,6 +124,24 @@ Feature: Network Device Monitoring And the response "data.attributes.tags[0]" is equal to "tag:test" And the response "data.attributes.tags[1]" is equal to "tag:testbis" + @replay-only @team:DataDog/network-device-monitoring + Scenario: List tags for an interface returns "Not Found" response + Given new "ListInterfaceUserTags" request + And request contains "interface_id" parameter with value "unknown_interface_id" + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/network-device-monitoring + Scenario: List tags for an interface returns "OK" response + Given new "ListInterfaceUserTags" request + And request contains "interface_id" parameter with value "example:1.2.3.4:1" + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "example:1.2.3.4:1" + And the response "data.type" is equal to "tags" + And the response "data.attributes.tags[0]" is equal to "tag:test" + And the response "data.attributes.tags[1]" is equal to "tag:testbis" + @replay-only @team:DataDog/network-device-monitoring Scenario: Update the tags for a device returns "Not Found" response Given new "UpdateDeviceUserTags" request @@ -143,3 +161,23 @@ Feature: Network Device Monitoring And the response "data.type" is equal to "tags" And the response "data.attributes.tags[0]" is equal to "tag:test" And the response "data.attributes.tags[1]" is equal to "tag:testbis" + + @replay-only @team:DataDog/network-device-monitoring + Scenario: Update the tags for an interface returns "Not Found" response + Given new "UpdateInterfaceUserTags" request + And request contains "interface_id" parameter with value "unknown_interface_id" + And body with value {"data": {"attributes": {"tags": ["tag:test", "tag:testbis"]}, "id": "unknown_interface_id", "type":"tags"}} + When the request is sent + Then the response status is 404 Not Found + + @replay-only @team:DataDog/network-device-monitoring + Scenario: Update the tags for an interface returns "OK" response + Given new "UpdateInterfaceUserTags" request + And request contains "interface_id" parameter with value "example:1.2.3.4:1" + And body with value {"data": {"attributes": {"tags": ["tag:test", "tag:testbis"]}, "id": "example:1.2.3.4:1", "type":"tags"}} + When the request is sent + Then the response status is 200 OK + And the response "data.id" is equal to "example:1.2.3.4:1" + And the response "data.type" is equal to "tags" + And the response "data.attributes.tags[0]" is equal to "tag:test" + And the response "data.attributes.tags[1]" is equal to "tag:testbis" diff --git a/features/v2/undo.json b/features/v2/undo.json index ef9246c8e646..5758d28e0364 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3197,6 +3197,18 @@ "type": "idempotent" } }, + "ListInterfaceUserTags": { + "tag": "Network Device Monitoring", + "undo": { + "type": "safe" + } + }, + "UpdateInterfaceUserTags": { + "tag": "Network Device Monitoring", + "undo": { + "type": "idempotent" + } + }, "GetAggregatedConnections": { "tag": "Cloud Network Monitoring", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 4a0ac91fa81b..f337e528d2d4 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3052,6 +3052,8 @@ def overrides "v2.list_findings_meta" => "ListFindingsMeta", "v2.list_findings_page" => "ListFindingsPage", "v2.list_findings_response" => "ListFindingsResponse", + "v2.list_interface_tags_response" => "ListInterfaceTagsResponse", + "v2.list_interface_tags_response_data" => "ListInterfaceTagsResponseData", "v2.list_kind_catalog_response" => "ListKindCatalogResponse", "v2.list_notification_channels_response" => "ListNotificationChannelsResponse", "v2.list_on_call_notification_rules_response" => "ListOnCallNotificationRulesResponse", diff --git a/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb b/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb index 205c555dd593..a3ff9ccfd540 100644 --- a/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/network_device_monitoring_api.rb @@ -311,6 +311,71 @@ def list_device_user_tags_with_http_info(device_id, opts = {}) return data, status_code, headers end + # List tags for an interface. + # + # @see #list_interface_user_tags_with_http_info + def list_interface_user_tags(interface_id, opts = {}) + data, _status_code, _headers = list_interface_user_tags_with_http_info(interface_id, opts) + data + end + + # List tags for an interface. + # + # Returns the tags associated with the specified interface. + # + # @param interface_id [String] The ID of the interface for which to retrieve tags. + # @param opts [Hash] the optional parameters + # @return [Array<(ListInterfaceTagsResponse, Integer, Hash)>] ListInterfaceTagsResponse data, response status code and response headers + def list_interface_user_tags_with_http_info(interface_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: NetworkDeviceMonitoringAPI.list_interface_user_tags ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling NetworkDeviceMonitoringAPI.list_interface_user_tags" + end + # resource path + local_var_path = '/api/v2/ndm/tags/interfaces/{interface_id}'.sub('{interface_id}', CGI.escape(interface_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] || 'ListInterfaceTagsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_interface_user_tags, + :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: NetworkDeviceMonitoringAPI#list_interface_user_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update the tags for a device. # # @see #update_device_user_tags_with_http_info @@ -382,5 +447,77 @@ def update_device_user_tags_with_http_info(device_id, body, opts = {}) end return data, status_code, headers end + + # Update the tags for an interface. + # + # @see #update_interface_user_tags_with_http_info + def update_interface_user_tags(interface_id, body, opts = {}) + data, _status_code, _headers = update_interface_user_tags_with_http_info(interface_id, body, opts) + data + end + + # Update the tags for an interface. + # + # Updates the tags associated with the specified interface. + # + # @param interface_id [String] The ID of the interface for which to update tags. + # @param body [ListInterfaceTagsResponse] + # @param opts [Hash] the optional parameters + # @return [Array<(ListInterfaceTagsResponse, Integer, Hash)>] ListInterfaceTagsResponse data, response status code and response headers + def update_interface_user_tags_with_http_info(interface_id, body, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: NetworkDeviceMonitoringAPI.update_interface_user_tags ...' + end + # verify the required parameter 'interface_id' is set + if @api_client.config.client_side_validation && interface_id.nil? + fail ArgumentError, "Missing the required parameter 'interface_id' when calling NetworkDeviceMonitoringAPI.update_interface_user_tags" + 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 NetworkDeviceMonitoringAPI.update_interface_user_tags" + end + # resource path + local_var_path = '/api/v2/ndm/tags/interfaces/{interface_id}'.sub('{interface_id}', CGI.escape(interface_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] || 'ListInterfaceTagsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_interface_user_tags, + :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::Patch, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: NetworkDeviceMonitoringAPI#update_interface_user_tags\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/api/security_monitoring_api.rb b/lib/datadog_api_client/v2/api/security_monitoring_api.rb index 1b324c3877a8..20a6a388f600 100644 --- a/lib/datadog_api_client/v2/api/security_monitoring_api.rb +++ b/lib/datadog_api_client/v2/api/security_monitoring_api.rb @@ -4651,7 +4651,7 @@ def list_security_monitoring_suppressions_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SecurityMonitoringAPI.list_security_monitoring_suppressions ...' end - allowable_values = ['name', 'start_date', 'expiration_date', 'update_date', 'enabled', '-name', '-start_date', '-expiration_date', '-update_date', '-enabled'] + allowable_values = ['name', 'start_date', 'expiration_date', 'update_date', 'enabled', '-name', '-start_date', '-expiration_date', '-update_date', '-creation_date', '-enabled'] if @api_client.config.client_side_validation && opts[:'sort'] && !allowable_values.include?(opts[:'sort']) fail ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}" end diff --git a/lib/datadog_api_client/v2/models/list_interface_tags_response.rb b/lib/datadog_api_client/v2/models/list_interface_tags_response.rb new file mode 100644 index 000000000000..871ab8d150e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_interface_tags_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 + # Response for listing interface tags. + class ListInterfaceTagsResponse + include BaseGenericModel + + # Response data for listing interface tags. + 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' => :'ListInterfaceTagsResponseData' + } + 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::ListInterfaceTagsResponse` 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/list_interface_tags_response_data.rb b/lib/datadog_api_client/v2/models/list_interface_tags_response_data.rb new file mode 100644 index 000000000000..c4eb2c54bc5b --- /dev/null +++ b/lib/datadog_api_client/v2/models/list_interface_tags_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 + # Response data for listing interface tags. + class ListInterfaceTagsResponseData + include BaseGenericModel + + # The definition of ListTagsResponseDataAttributes object. + attr_accessor :attributes + + # The interface ID + attr_accessor :id + + # The type of the resource. The value should always be tags. + 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' => :'ListTagsResponseDataAttributes', + :'id' => :'String', + :'type' => :'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::ListInterfaceTagsResponseData` 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/security_monitoring_suppression_sort.rb b/lib/datadog_api_client/v2/models/security_monitoring_suppression_sort.rb index ebcf5ce84f5e..c9004d712ac5 100644 --- a/lib/datadog_api_client/v2/models/security_monitoring_suppression_sort.rb +++ b/lib/datadog_api_client/v2/models/security_monitoring_suppression_sort.rb @@ -30,6 +30,7 @@ class SecurityMonitoringSuppressionSort START_DATE_DESCENDING = "-start_date".freeze EXPIRATION_DATE_DESCENDING = "-expiration_date".freeze UPDATE_DATE_DESCENDING = "-update_date".freeze + CREATION_DATE_DESCENDING = "-creation_date".freeze ENABLED_DESCENDING = "-enabled".freeze end end