From dbdb8030574aa9a667f8903fbe07884651f96300 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:14:13 +0000 Subject: [PATCH 1/3] Create API spec for v2 get an event (#2480) Co-authored-by: ci.datadog-api-spec --- .generated-info | 4 +- .generator/schemas/v2/openapi.yaml | 334 ++++++++++++++++++ examples/v2/events/GetEvent.rb | 5 + features/scenarios_model_mapping.rb | 3 + features/v2/events.feature | 21 ++ features/v2/undo.json | 6 + lib/datadog_api_client/inflector.rb | 19 + lib/datadog_api_client/v2/api/events_api.rb | 65 ++++ .../v2/models/alert_event_attributes.rb | 187 ++++++++++ .../alert_event_attributes_links_item.rb | 125 +++++++ ...rt_event_attributes_links_item_category.rb | 28 ++ .../models/alert_event_attributes_priority.rb | 30 ++ .../models/alert_event_attributes_status.rb | 28 ++ .../v2/models/change_event_attributes.rb | 207 +++++++++++ .../models/change_event_attributes_author.rb | 115 ++++++ .../change_event_attributes_author_type.rb | 29 ++ ...hange_event_attributes_changed_resource.rb | 115 ++++++ ..._event_attributes_changed_resource_type.rb | 27 ++ ...vent_attributes_impacted_resources_item.rb | 115 ++++++ ...attributes_impacted_resources_item_type.rb | 26 ++ .../v2/models/event_system_attributes.rb | 145 ++++++++ .../event_system_attributes_category.rb | 27 ++ .../event_system_attributes_integration_id.rb | 26 ++ lib/datadog_api_client/v2/models/v2_event.rb | 125 +++++++ .../v2/models/v2_event_attributes.rb | 137 +++++++ .../models/v2_event_attributes_attributes.rb | 63 ++++ .../v2/models/v2_event_response.rb | 105 ++++++ 27 files changed, 2115 insertions(+), 2 deletions(-) create mode 100644 examples/v2/events/GetEvent.rb create mode 100644 lib/datadog_api_client/v2/models/alert_event_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/alert_event_attributes_links_item.rb create mode 100644 lib/datadog_api_client/v2/models/alert_event_attributes_links_item_category.rb create mode 100644 lib/datadog_api_client/v2/models/alert_event_attributes_priority.rb create mode 100644 lib/datadog_api_client/v2/models/alert_event_attributes_status.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_attributes_author.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_attributes_author_type.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_attributes_changed_resource.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_attributes_changed_resource_type.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_attributes_impacted_resources_item.rb create mode 100644 lib/datadog_api_client/v2/models/change_event_attributes_impacted_resources_item_type.rb create mode 100644 lib/datadog_api_client/v2/models/event_system_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/event_system_attributes_category.rb create mode 100644 lib/datadog_api_client/v2/models/event_system_attributes_integration_id.rb create mode 100644 lib/datadog_api_client/v2/models/v2_event.rb create mode 100644 lib/datadog_api_client/v2/models/v2_event_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/v2_event_attributes_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/v2_event_response.rb diff --git a/.generated-info b/.generated-info index 28a92f49c9b8..ee79306d1958 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "0becaa3", - "generated": "2025-07-17 13:13:07.458" + "spec_repo_commit": "214381f", + "generated": "2025-07-17 15:36:40.869" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index affbc2622b22..5709841fc5ca 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -2291,6 +2291,88 @@ components: - id - base_severity type: object + AlertEventAttributes: + description: Alert event attributes. + properties: + aggregation_key: + $ref: '#/components/schemas/V2EventAggregationKey' + custom: + description: JSON object of custom attributes. + example: {} + type: object + evt: + $ref: '#/components/schemas/EventSystemAttributes' + links: + description: The links related to the event. + example: + - category: runbook + title: Runbook Link + url: https://app.datadoghq.com/runbook + items: + $ref: '#/components/schemas/AlertEventAttributesLinksItem' + type: array + priority: + $ref: '#/components/schemas/AlertEventAttributesPriority' + service: + $ref: '#/components/schemas/V2EventService' + status: + $ref: '#/components/schemas/AlertEventAttributesStatus' + timestamp: + $ref: '#/components/schemas/V2EventTimestamp' + title: + $ref: '#/components/schemas/V2EventTitle' + type: object + AlertEventAttributesLinksItem: + description: A link. + properties: + category: + $ref: '#/components/schemas/AlertEventAttributesLinksItemCategory' + title: + description: The display text of the link. + type: string + url: + description: The URL of the link. + type: string + type: object + AlertEventAttributesLinksItemCategory: + description: The category of the link. + enum: + - runbook + - documentation + - dashboard + type: string + x-enum-varnames: + - RUNBOOK + - DOCUMENTATION + - DASHBOARD + AlertEventAttributesPriority: + description: The priority of the alert. + enum: + - '1' + - '2' + - '3' + - '4' + - '5' + example: '5' + type: string + x-enum-varnames: + - PRIORITY_ONE + - PRIORITY_TWO + - PRIORITY_THREE + - PRIORITY_FOUR + - PRIORITY_FIVE + AlertEventAttributesStatus: + description: The status of the alert. + enum: + - warn + - error + - ok + example: error + type: string + x-enum-varnames: + - WARN + - ERROR + - OK AlertEventCustomAttributes: additionalProperties: false description: Alert event attributes. @@ -7102,6 +7184,116 @@ components: format: int64 type: integer type: object + ChangeEventAttributes: + description: Change event attributes. + properties: + aggregation_key: + $ref: '#/components/schemas/V2EventAggregationKey' + author: + $ref: '#/components/schemas/ChangeEventAttributesAuthor' + change_metadata: + description: JSON object of change metadata. + example: + dd: + team: datadog_team + user_email: datadog@datadog.com + user_id: datadog_user_id + user_name: datadog_username + type: object + changed_resource: + $ref: '#/components/schemas/ChangeEventAttributesChangedResource' + evt: + $ref: '#/components/schemas/EventSystemAttributes' + impacted_resources: + description: A list of resources impacted by this change. + example: + - name: service-name + type: service + items: + $ref: '#/components/schemas/ChangeEventAttributesImpactedResourcesItem' + type: array + new_value: + description: The new state of the changed resource. + example: + enabled: true + percentage: 50% + rule: + datacenter: devcycle.us1.prod + type: object + prev_value: + description: The previous state of the changed resource. + example: + enabled: true + percentage: 10% + rule: + datacenter: devcycle.us1.prod + type: object + service: + $ref: '#/components/schemas/V2EventService' + timestamp: + $ref: '#/components/schemas/V2EventTimestamp' + title: + $ref: '#/components/schemas/V2EventTitle' + type: object + ChangeEventAttributesAuthor: + description: The entity that made the change. + properties: + name: + description: The name of the user or system that made the change. + example: example@datadog.com + type: string + type: + $ref: '#/components/schemas/ChangeEventAttributesAuthorType' + type: object + ChangeEventAttributesAuthorType: + description: The type of the author. + enum: + - user + - system + - api + - automation + example: user + type: string + x-enum-varnames: + - USER + - SYSTEM + - API + - AUTOMATION + ChangeEventAttributesChangedResource: + description: A uniquely identified resource. + properties: + name: + description: The name of the changed resource. + type: string + type: + $ref: '#/components/schemas/ChangeEventAttributesChangedResourceType' + type: object + ChangeEventAttributesChangedResourceType: + description: The type of the changed resource. + enum: + - feature_flag + - configuration + example: feature_flag + type: string + x-enum-varnames: + - FEATURE_FLAG + - CONFIGURATION + ChangeEventAttributesImpactedResourcesItem: + description: A uniquely identified resource. + properties: + name: + description: The name of the impacted resource. + type: string + type: + $ref: '#/components/schemas/ChangeEventAttributesImpactedResourcesItemType' + type: object + ChangeEventAttributesImpactedResourcesItemType: + description: The type of the impacted resource. + enum: + - service + type: string + x-enum-varnames: + - SERVICE ChangeEventCustomAttributes: additionalProperties: false description: Change event attributes. @@ -15189,6 +15381,44 @@ components: - USER_UPDATE - RECOMMENDATION - SNAPSHOT + EventSystemAttributes: + description: JSON object of event system attributes. + properties: + category: + $ref: '#/components/schemas/EventSystemAttributesCategory' + id: + description: Event identifier. This field is deprecated and will be removed + in a future version. Use the `uid` field instead. + type: string + integration_id: + $ref: '#/components/schemas/EventSystemAttributesIntegrationId' + source_id: + description: The source type ID of the event. + format: int64 + type: integer + uid: + description: A unique identifier for the event. You can use this identifier + to query or reference the event. + type: string + type: object + EventSystemAttributesCategory: + description: Event category identifying the type of event. + enum: + - change + - alert + example: change + type: string + x-enum-varnames: + - CHANGE + - ALERT + EventSystemAttributesIntegrationId: + description: Integration ID sourced from integration manifests. + enum: + - custom-events + example: custom-events + type: string + x-enum-varnames: + - CUSTOM_EVENTS EventType: default: event description: Type of the event. @@ -41557,6 +41787,70 @@ components: type: string x-enum-varnames: - USERS + V2Event: + description: An event object. + properties: + attributes: + $ref: '#/components/schemas/V2EventAttributes' + id: + description: The event's ID. + example: '' + type: string + type: + description: Entity type. + example: event + type: string + type: object + V2EventAggregationKey: + description: Aggregation key of the event. + example: aggregation-key + type: string + V2EventAttributes: + description: Event attributes. + properties: + attributes: + $ref: '#/components/schemas/V2EventAttributesAttributes' + message: + description: Free-form text associated with the event. + example: The event message + type: string + tags: + description: A list of tags associated with the event. + example: + - env:api_client_test + items: + description: A tag. + type: string + type: array + timestamp: + description: Timestamp when the event occurred. + example: '2017-01-15T01:30:15.010000Z' + type: string + type: object + V2EventAttributesAttributes: + description: JSON object for category-specific attributes. + oneOf: + - $ref: '#/components/schemas/ChangeEventAttributes' + - $ref: '#/components/schemas/AlertEventAttributes' + V2EventResponse: + description: Get an event response. + properties: + data: + $ref: '#/components/schemas/V2Event' + type: object + V2EventService: + description: Service that triggered the event. + example: service-name + type: string + V2EventTimestamp: + description: POSIX timestamp of the event. + example: 175019386627 + format: int64 + type: integer + V2EventTitle: + description: The title of the event. + example: The event title + type: string ValidationError: description: Represents a single validation error, including a human-readable title and metadata. @@ -48828,6 +49122,46 @@ paths: operator: OR permissions: - events_read + /api/v2/events/{event_id}: + get: + description: Get the details of an event by `event_id`. + operationId: GetEvent + parameters: + - description: The UID of the event. + in: path + name: event_id + required: true + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/V2EventResponse' + description: OK + '400': + $ref: '#/components/responses/BadRequestResponse' + '401': + $ref: '#/components/responses/UnauthorizedResponse' + '403': + $ref: '#/components/responses/ForbiddenResponse' + '404': + $ref: '#/components/responses/NotFoundResponse' + '429': + $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: + - events_read + summary: Get an event + tags: + - Events + x-permission: + operator: OR + permissions: + - events_read /api/v2/incidents: get: description: Get all incidents for the user's organization. diff --git a/examples/v2/events/GetEvent.rb b/examples/v2/events/GetEvent.rb new file mode 100644 index 000000000000..ad15b842dc79 --- /dev/null +++ b/examples/v2/events/GetEvent.rb @@ -0,0 +1,5 @@ +# Get an event returns "OK" response + +require "datadog_api_client" +api_instance = DatadogAPIClient::V2::EventsAPI.new +p api_instance.get_event("AZeF-nTCAABzkAgGXzYPtgAA") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index c4c57353da7e..d9c5dbaf1c3c 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1674,6 +1674,9 @@ "v2.SearchEvents" => { "body" => "EventsListRequest", }, + "v2.GetEvent" => { + "event_id" => "String", + }, "v2.ListIncidents" => { "include" => "Array", "page_size" => "Integer", diff --git a/features/v2/events.feature b/features/v2/events.feature index 0a69d195201a..61d824ce1084 100644 --- a/features/v2/events.feature +++ b/features/v2/events.feature @@ -50,6 +50,27 @@ Feature: Events Then the response status is 200 OK And the response "data" has length 0 + @generated @skip @team:DataDog/event-management + Scenario: Get an event returns "Bad Request" response + Given new "GetEvent" request + And request contains "event_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @skip @team:DataDog/event-management + Scenario: Get an event returns "Not Found" response + Given new "GetEvent" request + And request contains "event_id" parameter with value "AAAAAAAAAAAAAAAAAAAAAAAA" + When the request is sent + Then the response status is 404 Not Found + + @skip @team:DataDog/event-management + Scenario: Get an event returns "OK" response + Given new "GetEvent" request + And request contains "event_id" parameter with value "AZeF-nTCAABzkAgGXzYPtgAA" + When the request is sent + Then the response status is 200 OK + @team:DataDog/event-management Scenario: Post an event returns "Bad request" response Given new "CreateEvent" request diff --git a/features/v2/undo.json b/features/v2/undo.json index df87d8d6c901..abe0c0b370d1 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -1022,6 +1022,12 @@ "type": "safe" } }, + "GetEvent": { + "tag": "Events", + "undo": { + "type": "safe" + } + }, "ListIncidents": { "tag": "Incidents", "undo": { diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index a94cb5e2b044..678a0a3f9c92 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -967,6 +967,11 @@ def overrides "v2.active_billing_dimensions_type" => "ActiveBillingDimensionsType", "v2.add_member_team_request" => "AddMemberTeamRequest", "v2.advisory" => "Advisory", + "v2.alert_event_attributes" => "AlertEventAttributes", + "v2.alert_event_attributes_links_item" => "AlertEventAttributesLinksItem", + "v2.alert_event_attributes_links_item_category" => "AlertEventAttributesLinksItemCategory", + "v2.alert_event_attributes_priority" => "AlertEventAttributesPriority", + "v2.alert_event_attributes_status" => "AlertEventAttributesStatus", "v2.alert_event_custom_attributes" => "AlertEventCustomAttributes", "v2.alert_event_custom_attributes_links_items" => "AlertEventCustomAttributesLinksItems", "v2.alert_event_custom_attributes_links_items_category" => "AlertEventCustomAttributesLinksItemsCategory", @@ -1251,6 +1256,13 @@ def overrides "v2.case_update_status" => "CaseUpdateStatus", "v2.case_update_status_attributes" => "CaseUpdateStatusAttributes", "v2.case_update_status_request" => "CaseUpdateStatusRequest", + "v2.change_event_attributes" => "ChangeEventAttributes", + "v2.change_event_attributes_author" => "ChangeEventAttributesAuthor", + "v2.change_event_attributes_author_type" => "ChangeEventAttributesAuthorType", + "v2.change_event_attributes_changed_resource" => "ChangeEventAttributesChangedResource", + "v2.change_event_attributes_changed_resource_type" => "ChangeEventAttributesChangedResourceType", + "v2.change_event_attributes_impacted_resources_item" => "ChangeEventAttributesImpactedResourcesItem", + "v2.change_event_attributes_impacted_resources_item_type" => "ChangeEventAttributesImpactedResourcesItemType", "v2.change_event_custom_attributes" => "ChangeEventCustomAttributes", "v2.change_event_custom_attributes_author" => "ChangeEventCustomAttributesAuthor", "v2.change_event_custom_attributes_author_type" => "ChangeEventCustomAttributesAuthorType", @@ -1832,6 +1844,9 @@ def overrides "v2.event_status_type" => "EventStatusType", "v2.events_timeseries_query" => "EventsTimeseriesQuery", "v2.events_warning" => "EventsWarning", + "v2.event_system_attributes" => "EventSystemAttributes", + "v2.event_system_attributes_category" => "EventSystemAttributesCategory", + "v2.event_system_attributes_integration_id" => "EventSystemAttributesIntegrationId", "v2.event_type" => "EventType", "v2.fastly_accoun_response_attributes" => "FastlyAccounResponseAttributes", "v2.fastly_account_create_request" => "FastlyAccountCreateRequest", @@ -3509,6 +3524,10 @@ def overrides "v2.user_update_attributes" => "UserUpdateAttributes", "v2.user_update_data" => "UserUpdateData", "v2.user_update_request" => "UserUpdateRequest", + "v2.v2_event" => "V2Event", + "v2.v2_event_attributes" => "V2EventAttributes", + "v2.v2_event_attributes_attributes" => "V2EventAttributesAttributes", + "v2.v2_event_response" => "V2EventResponse", "v2.validation_error" => "ValidationError", "v2.validation_error_meta" => "ValidationErrorMeta", "v2.validation_response" => "ValidationResponse", diff --git a/lib/datadog_api_client/v2/api/events_api.rb b/lib/datadog_api_client/v2/api/events_api.rb index 076ee38f506e..51478b6fc5c7 100644 --- a/lib/datadog_api_client/v2/api/events_api.rb +++ b/lib/datadog_api_client/v2/api/events_api.rb @@ -98,6 +98,71 @@ def create_event_with_http_info(body, opts = {}) return data, status_code, headers end + # Get an event. + # + # @see #get_event_with_http_info + def get_event(event_id, opts = {}) + data, _status_code, _headers = get_event_with_http_info(event_id, opts) + data + end + + # Get an event. + # + # Get the details of an event by `event_id`. + # + # @param event_id [String] The UID of the event. + # @param opts [Hash] the optional parameters + # @return [Array<(V2EventResponse, Integer, Hash)>] V2EventResponse data, response status code and response headers + def get_event_with_http_info(event_id, opts = {}) + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EventsAPI.get_event ...' + end + # verify the required parameter 'event_id' is set + if @api_client.config.client_side_validation && event_id.nil? + fail ArgumentError, "Missing the required parameter 'event_id' when calling EventsAPI.get_event" + end + # resource path + local_var_path = '/api/v2/events/{event_id}'.sub('{event_id}', CGI.escape(event_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] || 'V2EventResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + + new_options = opts.merge( + :operation => :get_event, + :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: EventsAPI#get_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Get a list of events. # # @see #list_events_with_http_info diff --git a/lib/datadog_api_client/v2/models/alert_event_attributes.rb b/lib/datadog_api_client/v2/models/alert_event_attributes.rb new file mode 100644 index 000000000000..2d9f5e1ae2af --- /dev/null +++ b/lib/datadog_api_client/v2/models/alert_event_attributes.rb @@ -0,0 +1,187 @@ +=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 + # Alert event attributes. + class AlertEventAttributes + include BaseGenericModel + + # Aggregation key of the event. + attr_accessor :aggregation_key + + # JSON object of custom attributes. + attr_accessor :custom + + # JSON object of event system attributes. + attr_accessor :evt + + # The links related to the event. + attr_accessor :links + + # The priority of the alert. + attr_accessor :priority + + # Service that triggered the event. + attr_accessor :service + + # The status of the alert. + attr_accessor :status + + # POSIX timestamp of the event. + attr_accessor :timestamp + + # The title of the event. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation_key' => :'aggregation_key', + :'custom' => :'custom', + :'evt' => :'evt', + :'links' => :'links', + :'priority' => :'priority', + :'service' => :'service', + :'status' => :'status', + :'timestamp' => :'timestamp', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation_key' => :'String', + :'custom' => :'Object', + :'evt' => :'EventSystemAttributes', + :'links' => :'Array', + :'priority' => :'AlertEventAttributesPriority', + :'service' => :'String', + :'status' => :'AlertEventAttributesStatus', + :'timestamp' => :'Integer', + :'title' => :'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::AlertEventAttributes` 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?(:'aggregation_key') + self.aggregation_key = attributes[:'aggregation_key'] + end + + if attributes.key?(:'custom') + self.custom = attributes[:'custom'] + end + + if attributes.key?(:'evt') + self.evt = attributes[:'evt'] + end + + if attributes.key?(:'links') + if (value = attributes[:'links']).is_a?(Array) + self.links = value + end + end + + if attributes.key?(:'priority') + self.priority = attributes[:'priority'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'status') + self.status = attributes[:'status'] + end + + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + 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 && + aggregation_key == o.aggregation_key && + custom == o.custom && + evt == o.evt && + links == o.links && + priority == o.priority && + service == o.service && + status == o.status && + timestamp == o.timestamp && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation_key, custom, evt, links, priority, service, status, timestamp, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/alert_event_attributes_links_item.rb b/lib/datadog_api_client/v2/models/alert_event_attributes_links_item.rb new file mode 100644 index 000000000000..a0142bdf0952 --- /dev/null +++ b/lib/datadog_api_client/v2/models/alert_event_attributes_links_item.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 + # A link. + class AlertEventAttributesLinksItem + include BaseGenericModel + + # The category of the link. + attr_accessor :category + + # The display text of the link. + attr_accessor :title + + # The URL of the link. + attr_accessor :url + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'title' => :'title', + :'url' => :'url' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'AlertEventAttributesLinksItemCategory', + :'title' => :'String', + :'url' => :'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::AlertEventAttributesLinksItem` 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?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + end + + if attributes.key?(:'url') + self.url = attributes[:'url'] + 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 && + category == o.category && + title == o.title && + url == o.url && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, title, url, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/alert_event_attributes_links_item_category.rb b/lib/datadog_api_client/v2/models/alert_event_attributes_links_item_category.rb new file mode 100644 index 000000000000..1935a6871007 --- /dev/null +++ b/lib/datadog_api_client/v2/models/alert_event_attributes_links_item_category.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 category of the link. + class AlertEventAttributesLinksItemCategory + include BaseEnumModel + + RUNBOOK = "runbook".freeze + DOCUMENTATION = "documentation".freeze + DASHBOARD = "dashboard".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/alert_event_attributes_priority.rb b/lib/datadog_api_client/v2/models/alert_event_attributes_priority.rb new file mode 100644 index 000000000000..ffa1db5bb366 --- /dev/null +++ b/lib/datadog_api_client/v2/models/alert_event_attributes_priority.rb @@ -0,0 +1,30 @@ +=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 priority of the alert. + class AlertEventAttributesPriority + include BaseEnumModel + + PRIORITY_ONE = "1".freeze + PRIORITY_TWO = "2".freeze + PRIORITY_THREE = "3".freeze + PRIORITY_FOUR = "4".freeze + PRIORITY_FIVE = "5".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/alert_event_attributes_status.rb b/lib/datadog_api_client/v2/models/alert_event_attributes_status.rb new file mode 100644 index 000000000000..af4ddd9e473a --- /dev/null +++ b/lib/datadog_api_client/v2/models/alert_event_attributes_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 + # The status of the alert. + class AlertEventAttributesStatus + include BaseEnumModel + + WARN = "warn".freeze + ERROR = "error".freeze + OK = "ok".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_attributes.rb b/lib/datadog_api_client/v2/models/change_event_attributes.rb new file mode 100644 index 000000000000..c4121781d15e --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_attributes.rb @@ -0,0 +1,207 @@ +=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 + # Change event attributes. + class ChangeEventAttributes + include BaseGenericModel + + # Aggregation key of the event. + attr_accessor :aggregation_key + + # The entity that made the change. + attr_accessor :author + + # JSON object of change metadata. + attr_accessor :change_metadata + + # A uniquely identified resource. + attr_accessor :changed_resource + + # JSON object of event system attributes. + attr_accessor :evt + + # A list of resources impacted by this change. + attr_accessor :impacted_resources + + # The new state of the changed resource. + attr_accessor :new_value + + # The previous state of the changed resource. + attr_accessor :prev_value + + # Service that triggered the event. + attr_accessor :service + + # POSIX timestamp of the event. + attr_accessor :timestamp + + # The title of the event. + attr_accessor :title + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'aggregation_key' => :'aggregation_key', + :'author' => :'author', + :'change_metadata' => :'change_metadata', + :'changed_resource' => :'changed_resource', + :'evt' => :'evt', + :'impacted_resources' => :'impacted_resources', + :'new_value' => :'new_value', + :'prev_value' => :'prev_value', + :'service' => :'service', + :'timestamp' => :'timestamp', + :'title' => :'title' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'aggregation_key' => :'String', + :'author' => :'ChangeEventAttributesAuthor', + :'change_metadata' => :'Object', + :'changed_resource' => :'ChangeEventAttributesChangedResource', + :'evt' => :'EventSystemAttributes', + :'impacted_resources' => :'Array', + :'new_value' => :'Object', + :'prev_value' => :'Object', + :'service' => :'String', + :'timestamp' => :'Integer', + :'title' => :'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::ChangeEventAttributes` 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?(:'aggregation_key') + self.aggregation_key = attributes[:'aggregation_key'] + end + + if attributes.key?(:'author') + self.author = attributes[:'author'] + end + + if attributes.key?(:'change_metadata') + self.change_metadata = attributes[:'change_metadata'] + end + + if attributes.key?(:'changed_resource') + self.changed_resource = attributes[:'changed_resource'] + end + + if attributes.key?(:'evt') + self.evt = attributes[:'evt'] + end + + if attributes.key?(:'impacted_resources') + if (value = attributes[:'impacted_resources']).is_a?(Array) + self.impacted_resources = value + end + end + + if attributes.key?(:'new_value') + self.new_value = attributes[:'new_value'] + end + + if attributes.key?(:'prev_value') + self.prev_value = attributes[:'prev_value'] + end + + if attributes.key?(:'service') + self.service = attributes[:'service'] + end + + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] + end + + if attributes.key?(:'title') + self.title = attributes[:'title'] + 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 && + aggregation_key == o.aggregation_key && + author == o.author && + change_metadata == o.change_metadata && + changed_resource == o.changed_resource && + evt == o.evt && + impacted_resources == o.impacted_resources && + new_value == o.new_value && + prev_value == o.prev_value && + service == o.service && + timestamp == o.timestamp && + title == o.title && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [aggregation_key, author, change_metadata, changed_resource, evt, impacted_resources, new_value, prev_value, service, timestamp, title, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_attributes_author.rb b/lib/datadog_api_client/v2/models/change_event_attributes_author.rb new file mode 100644 index 000000000000..6cde128989d8 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_attributes_author.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 + # The entity that made the change. + class ChangeEventAttributesAuthor + include BaseGenericModel + + # The name of the user or system that made the change. + attr_accessor :name + + # The type of the author. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'ChangeEventAttributesAuthorType' + } + 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::ChangeEventAttributesAuthor` 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?(:'name') + self.name = attributes[:'name'] + 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 && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_attributes_author_type.rb b/lib/datadog_api_client/v2/models/change_event_attributes_author_type.rb new file mode 100644 index 000000000000..0af98c5f6bdd --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_attributes_author_type.rb @@ -0,0 +1,29 @@ +=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 type of the author. + class ChangeEventAttributesAuthorType + include BaseEnumModel + + USER = "user".freeze + SYSTEM = "system".freeze + API = "api".freeze + AUTOMATION = "automation".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_attributes_changed_resource.rb b/lib/datadog_api_client/v2/models/change_event_attributes_changed_resource.rb new file mode 100644 index 000000000000..112ab60334f9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_attributes_changed_resource.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 + # A uniquely identified resource. + class ChangeEventAttributesChangedResource + include BaseGenericModel + + # The name of the changed resource. + attr_accessor :name + + # The type of the changed resource. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'ChangeEventAttributesChangedResourceType' + } + 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::ChangeEventAttributesChangedResource` 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?(:'name') + self.name = attributes[:'name'] + 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 && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_attributes_changed_resource_type.rb b/lib/datadog_api_client/v2/models/change_event_attributes_changed_resource_type.rb new file mode 100644 index 000000000000..8f54beb00419 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_attributes_changed_resource_type.rb @@ -0,0 +1,27 @@ +=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 type of the changed resource. + class ChangeEventAttributesChangedResourceType + include BaseEnumModel + + FEATURE_FLAG = "feature_flag".freeze + CONFIGURATION = "configuration".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_attributes_impacted_resources_item.rb b/lib/datadog_api_client/v2/models/change_event_attributes_impacted_resources_item.rb new file mode 100644 index 000000000000..e1b99bc05f51 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_attributes_impacted_resources_item.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 + # A uniquely identified resource. + class ChangeEventAttributesImpactedResourcesItem + include BaseGenericModel + + # The name of the impacted resource. + attr_accessor :name + + # The type of the impacted resource. + attr_accessor :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'name' => :'name', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'name' => :'String', + :'type' => :'ChangeEventAttributesImpactedResourcesItemType' + } + 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::ChangeEventAttributesImpactedResourcesItem` 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?(:'name') + self.name = attributes[:'name'] + 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 && + name == o.name && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [name, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/change_event_attributes_impacted_resources_item_type.rb b/lib/datadog_api_client/v2/models/change_event_attributes_impacted_resources_item_type.rb new file mode 100644 index 000000000000..179c5b490d06 --- /dev/null +++ b/lib/datadog_api_client/v2/models/change_event_attributes_impacted_resources_item_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 + # The type of the impacted resource. + class ChangeEventAttributesImpactedResourcesItemType + include BaseEnumModel + + SERVICE = "service".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/event_system_attributes.rb b/lib/datadog_api_client/v2/models/event_system_attributes.rb new file mode 100644 index 000000000000..367541867d4b --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_system_attributes.rb @@ -0,0 +1,145 @@ +=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 + # JSON object of event system attributes. + class EventSystemAttributes + include BaseGenericModel + + # Event category identifying the type of event. + attr_accessor :category + + # Event identifier. This field is deprecated and will be removed in a future version. Use the `uid` field instead. + attr_accessor :id + + # Integration ID sourced from integration manifests. + attr_accessor :integration_id + + # The source type ID of the event. + attr_accessor :source_id + + # A unique identifier for the event. You can use this identifier to query or reference the event. + attr_accessor :uid + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'category' => :'category', + :'id' => :'id', + :'integration_id' => :'integration_id', + :'source_id' => :'source_id', + :'uid' => :'uid' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'category' => :'EventSystemAttributesCategory', + :'id' => :'String', + :'integration_id' => :'EventSystemAttributesIntegrationId', + :'source_id' => :'Integer', + :'uid' => :'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::EventSystemAttributes` 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?(:'category') + self.category = attributes[:'category'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'integration_id') + self.integration_id = attributes[:'integration_id'] + end + + if attributes.key?(:'source_id') + self.source_id = attributes[:'source_id'] + end + + if attributes.key?(:'uid') + self.uid = attributes[:'uid'] + 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 && + category == o.category && + id == o.id && + integration_id == o.integration_id && + source_id == o.source_id && + uid == o.uid && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [category, id, integration_id, source_id, uid, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/event_system_attributes_category.rb b/lib/datadog_api_client/v2/models/event_system_attributes_category.rb new file mode 100644 index 000000000000..9943931b3793 --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_system_attributes_category.rb @@ -0,0 +1,27 @@ +=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 + # Event category identifying the type of event. + class EventSystemAttributesCategory + include BaseEnumModel + + CHANGE = "change".freeze + ALERT = "alert".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/event_system_attributes_integration_id.rb b/lib/datadog_api_client/v2/models/event_system_attributes_integration_id.rb new file mode 100644 index 000000000000..43375775a086 --- /dev/null +++ b/lib/datadog_api_client/v2/models/event_system_attributes_integration_id.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 + # Integration ID sourced from integration manifests. + class EventSystemAttributesIntegrationId + include BaseEnumModel + + CUSTOM_EVENTS = "custom-events".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/v2_event.rb b/lib/datadog_api_client/v2/models/v2_event.rb new file mode 100644 index 000000000000..3336197e5482 --- /dev/null +++ b/lib/datadog_api_client/v2/models/v2_event.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 + # An event object. + class V2Event + include BaseGenericModel + + # Event attributes. + attr_accessor :attributes + + # The event's ID. + attr_accessor :id + + # Entity type. + 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' => :'V2EventAttributes', + :'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::V2Event` 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/v2_event_attributes.rb b/lib/datadog_api_client/v2/models/v2_event_attributes.rb new file mode 100644 index 000000000000..cd2c4380ac9e --- /dev/null +++ b/lib/datadog_api_client/v2/models/v2_event_attributes.rb @@ -0,0 +1,137 @@ +=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 + # Event attributes. + class V2EventAttributes + include BaseGenericModel + + # JSON object for category-specific attributes. + attr_accessor :attributes + + # Free-form text associated with the event. + attr_accessor :message + + # A list of tags associated with the event. + attr_accessor :tags + + # Timestamp when the event occurred. + attr_accessor :timestamp + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'message' => :'message', + :'tags' => :'tags', + :'timestamp' => :'timestamp' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'V2EventAttributesAttributes', + :'message' => :'String', + :'tags' => :'Array', + :'timestamp' => :'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::V2EventAttributes` 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?(:'message') + self.message = attributes[:'message'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'timestamp') + self.timestamp = attributes[:'timestamp'] + 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 && + message == o.message && + tags == o.tags && + timestamp == o.timestamp && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, message, tags, timestamp, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/v2_event_attributes_attributes.rb b/lib/datadog_api_client/v2/models/v2_event_attributes_attributes.rb new file mode 100644 index 000000000000..4d28a290a4e4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/v2_event_attributes_attributes.rb @@ -0,0 +1,63 @@ +=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 + # JSON object for category-specific attributes. + module V2EventAttributesAttributes + class << self + include BaseOneOfModel + include BaseOneOfModelNoDiscriminator + + # List of class defined in oneOf (OpenAPI v3) + def openapi_one_of + [ + :'ChangeEventAttributes', + :'AlertEventAttributes' + ] + 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/v2_event_response.rb b/lib/datadog_api_client/v2/models/v2_event_response.rb new file mode 100644 index 000000000000..aeca6a251443 --- /dev/null +++ b/lib/datadog_api_client/v2/models/v2_event_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 + # Get an event response. + class V2EventResponse + include BaseGenericModel + + # An event object. + 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' => :'V2Event' + } + 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::V2EventResponse` 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 From 2c9e7722189a84634c8938e2e40e8b13ab33618a Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:27:41 +0000 Subject: [PATCH 2/3] Backend synced security changes (#2550) Co-authored-by: ci.datadog-api-spec --- .generated-info | 4 +- .generator/schemas/v1/openapi.yaml | 29 ++-- .generator/schemas/v2/openapi.yaml | 150 ++++++++++-------- lib/datadog_api_client/v1/api/logs_api.rb | 2 +- .../v1/api/logs_indexes_api.rb | 2 +- .../v1/api/synthetics_api.rb | 2 +- lib/datadog_api_client/v2/api/rum_api.rb | 6 +- 7 files changed, 106 insertions(+), 89 deletions(-) diff --git a/.generated-info b/.generated-info index ee79306d1958..8c549ea86e44 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "214381f", - "generated": "2025-07-17 15:36:40.869" + "spec_repo_commit": "ef70ddf", + "generated": "2025-07-17 17:27:00.939" } diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 6511a44e0429..4cfe65c3f411 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -29170,6 +29170,10 @@ paths: description: Authentication error '429': $ref: '#/components/responses/TooManyRequestsResponse' + security: + - apiKeyAuth: [] + appKeyAuth: [] + - AuthZ: [] summary: Search logs tags: - Logs @@ -29268,10 +29272,6 @@ paths: description: Forbidden '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] summary: Get all indexes tags: - Logs Indexes @@ -30475,7 +30475,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - monitors_write + - monitors_read summary: Validate a monitor tags: - Monitors @@ -30483,7 +30483,7 @@ paths: x-permission: operator: OR permissions: - - monitors_write + - monitors_read /api/v1/monitor/{monitor_id}: delete: description: Delete the specified monitor @@ -30776,7 +30776,7 @@ paths: - apiKeyAuth: [] appKeyAuth: [] - AuthZ: - - monitors_write + - monitors_read summary: Validate an existing monitor tags: - Monitors @@ -30784,7 +30784,7 @@ paths: x-permission: operator: OR permissions: - - monitors_write + - monitors_read /api/v1/monthly_custom_reports: get: deprecated: true @@ -31644,13 +31644,15 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - metrics_read summary: Search metrics tags: - Metrics x-permission: - operator: OPEN - permissions: [] + operator: OR + permissions: + - metrics_read /api/v1/security_analytics/signals/{signal_id}/add_to_incident: patch: description: Add a security signal to an incident. This makes it possible to @@ -33852,7 +33854,7 @@ paths: default: 50 format: int64 type: integer - - description: The sort order for the results (e.g., 'name,asc' or 'name,desc'). + - description: The sort order for the results (e.g., `name,asc` or `name,desc`). in: query name: sort required: false @@ -34332,6 +34334,8 @@ paths: appKeyAuth: [] - AuthZ: - synthetics_global_variable_read + - AuthZ: + - apm_api_catalog_read summary: Get all global variables tags: - Synthetics @@ -34339,6 +34343,7 @@ paths: operator: OR permissions: - synthetics_global_variable_read + - apm_api_catalog_read post: description: Create a Synthetic global variable. operationId: CreateGlobalVariable diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 5709841fc5ca..aff47f4974de 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -44884,8 +44884,9 @@ paths: tags: - AuthN Mappings x-permission: - operator: OPEN - permissions: [] + operator: OR + permissions: + - user_access_read post: description: Create an AuthN Mapping. operationId: CreateAuthNMapping @@ -44990,8 +44991,9 @@ paths: tags: - AuthN Mappings x-permission: - operator: OPEN - permissions: [] + operator: OR + permissions: + - user_access_read patch: description: Edit an AuthN Mapping. operationId: UpdateAuthNMapping @@ -46038,6 +46040,8 @@ paths: appKeyAuth: [] - AuthZ: - ci_visibility_read + - AuthZ: + - test_optimization_read summary: Aggregate tests events tags: - CI Visibility Tests @@ -46046,6 +46050,7 @@ paths: operator: OR permissions: - ci_visibility_read + - test_optimization_read /api/v2/ci/tests/events: get: description: 'List endpoint returns CI Visibility test events that match a [search @@ -46122,6 +46127,8 @@ paths: appKeyAuth: [] - AuthZ: - ci_visibility_read + - AuthZ: + - test_optimization_read summary: Get a list of tests events tags: - CI Visibility Tests @@ -46134,6 +46141,7 @@ paths: operator: OR permissions: - ci_visibility_read + - test_optimization_read /api/v2/ci/tests/events/search: post: description: 'List endpoint returns CI Visibility test events that match a [search @@ -46168,6 +46176,8 @@ paths: appKeyAuth: [] - AuthZ: - ci_visibility_read + - AuthZ: + - test_optimization_read summary: Search tests events tags: - CI Visibility Tests @@ -46181,6 +46191,7 @@ paths: operator: OR permissions: - ci_visibility_read + - test_optimization_read /api/v2/cloud_security_management/custom_frameworks: post: description: Create a custom framework. @@ -47384,15 +47395,13 @@ paths: appKeyAuth: [] - AuthZ: - usage_read - - billing_read summary: Get Monthly Cost Attribution tags: - Usage Metering x-permission: - operator: AND + operator: OR permissions: - usage_read - - billing_read /api/v2/csm/onboarding/agents: get: description: Get the list of all CSM Agents running on your hosts and containers. @@ -47969,13 +47978,15 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - user_access_read summary: Get all datasets tags: - Datasets x-permission: - operator: OPEN - permissions: [] + operator: OR + permissions: + - user_access_read post: description: Create a dataset with the configurations in the request. operationId: CreateDataset @@ -48015,14 +48026,16 @@ paths: security: - apiKeyAuth: [] appKeyAuth: [] - - AuthZ: [] + - AuthZ: + - user_access_manage summary: Create a dataset tags: - Datasets x-codegen-request-body-name: body x-permission: - operator: OPEN - permissions: [] + operator: OR + permissions: + - user_access_manage /api/v2/datasets/{dataset_id}: delete: description: Deletes the dataset associated with the ID. @@ -48273,6 +48286,8 @@ paths: appKeyAuth: [] - AuthZ: - org_management + - AuthZ: + - monitors_write summary: Get Domain Allowlist tags: - Domain Allowlist @@ -48280,6 +48295,10 @@ paths: operator: OR permissions: - org_management + - monitors_write + - generate_dashboard_reports + - generate_log_reports + - manage_log_reports patch: description: Update the domain allowlist for an organization. operationId: PatchDomainAllowlist @@ -48303,6 +48322,8 @@ paths: appKeyAuth: [] - AuthZ: - org_management + - AuthZ: + - monitors_write summary: Sets Domain Allowlist tags: - Domain Allowlist @@ -48310,6 +48331,10 @@ paths: operator: OR permissions: - org_management + - monitors_write + - generate_dashboard_reports + - generate_log_reports + - manage_log_reports /api/v2/dora/deployment: post: description: 'Use this API endpoint to provide data about deployments for DORA @@ -52627,8 +52652,8 @@ paths: x-permission: operator: OR permissions: - - logs_read_data - logs_read_config + - logs_read_data post: description: Create a custom destination in your organization. operationId: CreateLogsCustomDestination @@ -52712,8 +52737,8 @@ paths: x-permission: operator: OR permissions: - - logs_read_data - logs_read_config + - logs_read_data patch: description: Update the given fields of a specific custom destination in your organization. @@ -53898,9 +53923,6 @@ paths: description: Forbidden '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] summary: Create a monitor notification rule tags: - Monitors @@ -53936,9 +53958,6 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] summary: Delete a monitor notification rule tags: - Monitors @@ -54043,9 +54062,6 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] summary: Update a monitor notification rule tags: - Monitors @@ -54284,6 +54300,10 @@ paths: summary: Get all monitor user templates tags: - Monitors + x-permission: + operator: OR + permissions: + - monitors_read x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -54311,12 +54331,13 @@ paths: description: Bad Request '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] summary: Create a monitor user template tags: - Monitors + x-permission: + operator: OR + permissions: + - monitor_config_policy_write x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -54341,12 +54362,13 @@ paths: description: Bad Request '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] summary: Validate a monitor user template tags: - Monitors + x-permission: + operator: OR + permissions: + - monitor_config_policy_write x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -54372,12 +54394,13 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] summary: Delete a monitor user template tags: - Monitors + x-permission: + operator: OR + permissions: + - monitor_config_policy_write x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -54423,6 +54446,10 @@ paths: summary: Get a monitor user template tags: - Monitors + x-permission: + operator: OR + permissions: + - monitors_read x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -54463,12 +54490,13 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] summary: Update a monitor user template to a new version tags: - Monitors + x-permission: + operator: OR + permissions: + - monitor_config_policy_write x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -54508,12 +54536,13 @@ paths: description: Not Found '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] summary: Validate an existing monitor user template tags: - Monitors + x-permission: + operator: OR + permissions: + - monitor_config_policy_write x-unstable: '**Note**: This endpoint is in Preview. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' @@ -57914,17 +57943,14 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] summary: Aggregate RUM events tags: - RUM x-codegen-request-body-name: body x-permission: - operator: OPEN - permissions: [] + operator: OR + permissions: + - rum_apps_read /api/v2/rum/applications: get: description: List all the RUM applications in your organization. @@ -58430,10 +58456,6 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] summary: Get a list of RUM events tags: - RUM @@ -58443,8 +58465,9 @@ paths: limitParam: page[limit] resultsPath: data x-permission: - operator: OPEN - permissions: [] + operator: OR + permissions: + - rum_apps_read /api/v2/rum/events/search: post: description: 'List endpoint returns RUM events that match a RUM search query. @@ -58476,10 +58499,6 @@ paths: $ref: '#/components/responses/NotAuthorizedResponse' '429': $ref: '#/components/responses/TooManyRequestsResponse' - security: - - apiKeyAuth: [] - appKeyAuth: [] - - AuthZ: [] summary: Search RUM events tags: - RUM @@ -58490,8 +58509,9 @@ paths: limitParam: body.page.limit resultsPath: data x-permission: - operator: OPEN - permissions: [] + operator: OR + permissions: + - rum_apps_read /api/v2/saml_configurations/idp_metadata: post: description: 'Endpoint for uploading IdP metadata for SAML setup. @@ -64127,15 +64147,13 @@ paths: appKeyAuth: [] - AuthZ: - usage_read - - billing_read summary: Get cost across multi-org account tags: - Usage Metering x-permission: - operator: AND + operator: OR permissions: - usage_read - - billing_read /api/v2/usage/estimated_cost: get: description: 'Get estimated cost across multi-org and single root-org accounts. @@ -64233,15 +64251,13 @@ paths: appKeyAuth: [] - AuthZ: - usage_read - - billing_read summary: Get estimated cost across your account tags: - Usage Metering x-permission: - operator: AND + operator: OR permissions: - usage_read - - billing_read /api/v2/usage/historical_cost: get: description: 'Get historical cost across multi-org and single root-org accounts. @@ -64316,15 +64332,13 @@ paths: appKeyAuth: [] - AuthZ: - usage_read - - billing_read summary: Get historical cost across your account tags: - Usage Metering x-permission: - operator: AND + operator: OR permissions: - usage_read - - billing_read /api/v2/usage/hourly_usage: get: description: Get hourly usage by product family. @@ -64653,15 +64667,13 @@ paths: appKeyAuth: [] - AuthZ: - usage_read - - billing_read summary: Get projected cost across your account tags: - Usage Metering x-permission: - operator: AND + operator: OR permissions: - usage_read - - billing_read /api/v2/user_invitations: post: description: Sends emails to one or more users inviting them to join the organization. diff --git a/lib/datadog_api_client/v1/api/logs_api.rb b/lib/datadog_api_client/v1/api/logs_api.rb index 8174a02eef08..943011746ec0 100644 --- a/lib/datadog_api_client/v1/api/logs_api.rb +++ b/lib/datadog_api_client/v1/api/logs_api.rb @@ -78,7 +78,7 @@ def list_logs_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'LogsListResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] new_options = opts.merge( :operation => :list_logs, diff --git a/lib/datadog_api_client/v1/api/logs_indexes_api.rb b/lib/datadog_api_client/v1/api/logs_indexes_api.rb index 08aeedb61ab5..157db7c2caad 100644 --- a/lib/datadog_api_client/v1/api/logs_indexes_api.rb +++ b/lib/datadog_api_client/v1/api/logs_indexes_api.rb @@ -322,7 +322,7 @@ def list_log_indexes_with_http_info(opts = {}) return_type = opts[:debug_return_type] || 'LogsIndexListResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :list_log_indexes, diff --git a/lib/datadog_api_client/v1/api/synthetics_api.rb b/lib/datadog_api_client/v1/api/synthetics_api.rb index 74d06ee745e7..5336e12704e1 100644 --- a/lib/datadog_api_client/v1/api/synthetics_api.rb +++ b/lib/datadog_api_client/v1/api/synthetics_api.rb @@ -1793,7 +1793,7 @@ def search_tests(opts = {}) # @option opts [Boolean] :facets_only If true, return only facets instead of full test details. # @option opts [Integer] :start The offset from which to start returning results. # @option opts [Integer] :count The maximum number of results to return. - # @option opts [String] :sort The sort order for the results (e.g., 'name,asc' or 'name,desc'). + # @option opts [String] :sort The sort order for the results (e.g., `name,asc` or `name,desc`). # @return [Array<(SyntheticsListTestsResponse, Integer, Hash)>] SyntheticsListTestsResponse data, response status code and response headers def search_tests_with_http_info(opts = {}) diff --git a/lib/datadog_api_client/v2/api/rum_api.rb b/lib/datadog_api_client/v2/api/rum_api.rb index 226d0de8cf65..9f69daa806d1 100644 --- a/lib/datadog_api_client/v2/api/rum_api.rb +++ b/lib/datadog_api_client/v2/api/rum_api.rb @@ -70,7 +70,7 @@ def aggregate_rum_events_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'RUMAnalyticsAggregateResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :aggregate_rum_events, @@ -411,7 +411,7 @@ def list_rum_events_with_http_info(opts = {}) return_type = opts[:debug_return_type] || 'RUMEventsResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :list_rum_events, @@ -504,7 +504,7 @@ def search_rum_events_with_http_info(body, opts = {}) return_type = opts[:debug_return_type] || 'RUMEventsResponse' # auth_names - auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ] + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] new_options = opts.merge( :operation => :search_rum_events, From 95d53e34c0774fcaccdae647893b654627cb79bb Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Thu, 17 Jul 2025 21:02:41 +0000 Subject: [PATCH 3/3] Allow to make XPQ queries to the DORA data source (#2526) Co-authored-by: ci.datadog-api-spec --- .generated-info | 4 ++-- .generator/schemas/v2/openapi.yaml | 2 ++ lib/datadog_api_client/v2/models/events_data_source.rb | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.generated-info b/.generated-info index 8c549ea86e44..dd5463082c65 100644 --- a/.generated-info +++ b/.generated-info @@ -1,4 +1,4 @@ { - "spec_repo_commit": "ef70ddf", - "generated": "2025-07-17 17:27:00.939" + "spec_repo_commit": "f2ae7eb", + "generated": "2025-07-17 19:53:16.203" } diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index aff47f4974de..725b65b41ac9 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -15479,11 +15479,13 @@ components: enum: - logs - rum + - dora example: logs type: string x-enum-varnames: - LOGS - RUM + - DORA EventsGroupBy: description: A dimension on which to split a query's results. properties: diff --git a/lib/datadog_api_client/v2/models/events_data_source.rb b/lib/datadog_api_client/v2/models/events_data_source.rb index d9c07ba0a2c4..cbf84d1ac604 100644 --- a/lib/datadog_api_client/v2/models/events_data_source.rb +++ b/lib/datadog_api_client/v2/models/events_data_source.rb @@ -23,5 +23,6 @@ class EventsDataSource LOGS = "logs".freeze RUM = "rum".freeze + DORA = "dora".freeze end end