From 38aace5fb28aaf917e505de275ad06ad9c6f8dd5 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 17:19:10 +0000 Subject: [PATCH 1/5] Add new metrics processors in Observability Pipelines (#3348) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 307 ++++++++++++++++++ lib/datadog_api_client/inflector.rb | 15 + ...lity_pipeline_add_metric_tags_processor.rb | 225 +++++++++++++ ...pipeline_add_metric_tags_processor_type.rb | 26 ++ ...ervability_pipeline_aggregate_processor.rb | 248 ++++++++++++++ ...ility_pipeline_aggregate_processor_mode.rb | 32 ++ ...ility_pipeline_aggregate_processor_type.rb | 26 ++ ...vability_pipeline_config_processor_item.rb | 6 +- ...y_pipeline_rename_metric_tags_processor.rb | 225 +++++++++++++ ...peline_rename_metric_tags_processor_tag.rb | 144 ++++++++ ...eline_rename_metric_tags_processor_type.rb | 26 ++ ...ipeline_tag_cardinality_limit_processor.rb | 271 ++++++++++++++++ ..._tag_cardinality_limit_processor_action.rb | 27 ++ ...nality_limit_processor_per_metric_limit.rb | 202 ++++++++++++ ...inality_limit_processor_per_metric_mode.rb | 27 ++ ...rdinality_limit_processor_per_tag_limit.rb | 169 ++++++++++ ...ardinality_limit_processor_per_tag_mode.rb | 27 ++ ...ne_tag_cardinality_limit_processor_type.rb | 26 ++ 18 files changed, 2028 insertions(+), 1 deletion(-) create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor_type.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_mode.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_type.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_tag.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_type.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_action.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb create mode 100644 lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 22fc24351728..598e9c0987bf 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -53036,6 +53036,118 @@ components: type: string x-enum-varnames: - ADD_HOSTNAME + ObservabilityPipelineAddMetricTagsProcessor: + description: |- + The `add_metric_tags` processor adds static tags to metrics. + + **Supported pipeline types:** metrics + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: "add-metric-tags-processor" + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + tags: + description: A list of static tags (key-value pairs) added to each metric processed by this component. + items: + $ref: "#/components/schemas/ObservabilityPipelineFieldValue" + maxItems: 15 + type: array + type: + $ref: "#/components/schemas/ObservabilityPipelineAddMetricTagsProcessorType" + required: + - id + - type + - include + - tags + - enabled + type: object + x-pipeline-types: [metrics] + ObservabilityPipelineAddMetricTagsProcessorType: + default: add_metric_tags + description: The processor type. The value must be `add_metric_tags`. + enum: [add_metric_tags] + example: add_metric_tags + type: string + x-enum-varnames: + - ADD_METRIC_TAGS + ObservabilityPipelineAggregateProcessor: + description: |- + The `aggregate` processor combines metrics that share the same name and tags into a single metric over a configurable interval. + + **Supported pipeline types:** metrics + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: "aggregate-processor" + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + interval_secs: + description: The interval, in seconds, over which metrics are aggregated. + example: 10 + format: int64 + maximum: 60 + minimum: 1 + type: integer + mode: + $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessorMode" + type: + $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessorType" + required: + - id + - type + - include + - interval_secs + - mode + - enabled + type: object + x-pipeline-types: [metrics] + ObservabilityPipelineAggregateProcessorMode: + description: The aggregation mode applied to metrics that share the same name and tags within the interval. + enum: + - auto + - sum + - latest + - count + - max + - min + - mean + example: auto + type: string + x-enum-varnames: + - AUTO + - SUM + - LATEST + - COUNT + - MAX + - MIN + - MEAN + ObservabilityPipelineAggregateProcessorType: + default: aggregate + description: The processor type. The value must be `aggregate`. + enum: [aggregate] + example: aggregate + type: string + x-enum-varnames: + - AGGREGATE ObservabilityPipelineAmazonDataFirehoseSource: description: |- The `amazon_data_firehose` source ingests logs from AWS Data Firehose. @@ -53751,7 +53863,11 @@ components: - $ref: "#/components/schemas/ObservabilityPipelineSensitiveDataScannerProcessor" - $ref: "#/components/schemas/ObservabilityPipelineSplitArrayProcessor" - $ref: "#/components/schemas/ObservabilityPipelineThrottleProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineAddMetricTagsProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineAggregateProcessor" - $ref: "#/components/schemas/ObservabilityPipelineMetricTagsProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineRenameMetricTagsProcessor" + - $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessor" ObservabilityPipelineConfigSourceItem: description: "A data source for the pipeline." oneOf: @@ -56799,6 +56915,65 @@ components: type: string x-enum-varnames: - RENAME_FIELDS + ObservabilityPipelineRenameMetricTagsProcessor: + description: |- + The `rename_metric_tags` processor changes the keys of tags on metrics. + + **Supported pipeline types:** metrics + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: "rename-metric-tags-processor" + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + tags: + description: A list of rename rules specifying which tag keys to rename on each metric. + items: + $ref: "#/components/schemas/ObservabilityPipelineRenameMetricTagsProcessorTag" + maxItems: 15 + type: array + type: + $ref: "#/components/schemas/ObservabilityPipelineRenameMetricTagsProcessorType" + required: + - id + - type + - include + - tags + - enabled + type: object + x-pipeline-types: [metrics] + ObservabilityPipelineRenameMetricTagsProcessorTag: + description: Defines how to rename a tag on metric events. + properties: + rename_to: + description: The new tag key to assign in place of the original. + example: "destination_tag" + type: string + tag: + description: The original tag key on the metric event. + example: "source_tag" + type: string + required: + - tag + - rename_to + type: object + ObservabilityPipelineRenameMetricTagsProcessorType: + default: rename_metric_tags + description: The processor type. The value must be `rename_metric_tags`. + enum: [rename_metric_tags] + example: rename_metric_tags + type: string + x-enum-varnames: + - RENAME_METRIC_TAGS ObservabilityPipelineRsyslogDestination: description: |- The `rsyslog` destination forwards logs to an external `rsyslog` server over TCP or UDP using the syslog protocol. @@ -58040,6 +58215,138 @@ components: x-enum-varnames: - TCP - UDP + ObservabilityPipelineTagCardinalityLimitProcessor: + description: |- + The `tag_cardinality_limit` processor caps the number of distinct tag value combinations on metrics, dropping tags or events once the limit is exceeded. + + **Supported pipeline types:** metrics + properties: + display_name: + $ref: "#/components/schemas/ObservabilityPipelineComponentDisplayName" + enabled: + description: Indicates whether the processor is enabled. + example: true + type: boolean + id: + description: The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + example: "tag-cardinality-limit-processor" + type: string + include: + description: A Datadog search query used to determine which metrics this processor targets. + example: "*" + type: string + limit_exceeded_action: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorAction" + per_metric_limits: + description: A list of per-metric cardinality overrides that take precedence over the default `value_limit`. + items: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit" + maxItems: 100 + type: array + type: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorType" + value_limit: + description: The default maximum number of distinct tag value combinations allowed per metric. + example: 10000 + format: int64 + maximum: 1000000 + minimum: 0 + type: integer + required: + - id + - type + - include + - limit_exceeded_action + - value_limit + - enabled + type: object + x-pipeline-types: [metrics] + ObservabilityPipelineTagCardinalityLimitProcessorAction: + description: The action to take when the cardinality limit is exceeded. + enum: + - drop_tag + - drop_event + example: drop_tag + type: string + x-enum-varnames: + - DROP_TAG + - DROP_EVENT + ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit: + description: A cardinality override applied to a specific metric. + properties: + limit_exceeded_action: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorAction" + metric_name: + description: The name of the metric this override applies to. + example: "system.cpu.user" + type: string + mode: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode" + per_tag_limits: + description: A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `mode` is `excluded`. + items: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit" + maxItems: 50 + type: array + value_limit: + description: The maximum number of distinct tag value combinations allowed for this metric. Required when `mode` is `tracked`. Must be omitted when `mode` is `excluded`. + example: 10000 + format: int64 + maximum: 1000000 + minimum: 0 + type: integer + required: + - metric_name + - mode + type: object + ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode: + description: How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. + enum: + - tracked + - excluded + example: tracked + type: string + x-enum-varnames: + - TRACKED + - EXCLUDED + ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit: + description: A cardinality override for a specific tag key within a per-metric limit. + properties: + mode: + $ref: "#/components/schemas/ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode" + tag_key: + description: The tag key this override applies to. + example: "host" + type: string + value_limit: + description: The maximum number of distinct values allowed for this tag. Required when `mode` is `limit_override`. Must be omitted when `mode` is `excluded`. + example: 5000 + format: int64 + maximum: 1000000 + minimum: 0 + type: integer + required: + - tag_key + - mode + type: object + ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode: + description: How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + enum: + - limit_override + - excluded + example: limit_override + type: string + x-enum-varnames: + - LIMIT_OVERRIDE + - EXCLUDED + ObservabilityPipelineTagCardinalityLimitProcessorType: + default: tag_cardinality_limit + description: The processor type. The value must be `tag_cardinality_limit`. + enum: [tag_cardinality_limit] + example: tag_cardinality_limit + type: string + x-enum-varnames: + - TAG_CARDINALITY_LIMIT ObservabilityPipelineThrottleProcessor: description: |- The `throttle` processor limits the number of events that pass through over a given time window. diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 187627b2d0a6..54fa0f473384 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4338,6 +4338,11 @@ def overrides "v2.observability_pipeline_add_fields_processor_type" => "ObservabilityPipelineAddFieldsProcessorType", "v2.observability_pipeline_add_hostname_processor" => "ObservabilityPipelineAddHostnameProcessor", "v2.observability_pipeline_add_hostname_processor_type" => "ObservabilityPipelineAddHostnameProcessorType", + "v2.observability_pipeline_add_metric_tags_processor" => "ObservabilityPipelineAddMetricTagsProcessor", + "v2.observability_pipeline_add_metric_tags_processor_type" => "ObservabilityPipelineAddMetricTagsProcessorType", + "v2.observability_pipeline_aggregate_processor" => "ObservabilityPipelineAggregateProcessor", + "v2.observability_pipeline_aggregate_processor_mode" => "ObservabilityPipelineAggregateProcessorMode", + "v2.observability_pipeline_aggregate_processor_type" => "ObservabilityPipelineAggregateProcessorType", "v2.observability_pipeline_amazon_data_firehose_source" => "ObservabilityPipelineAmazonDataFirehoseSource", "v2.observability_pipeline_amazon_data_firehose_source_type" => "ObservabilityPipelineAmazonDataFirehoseSourceType", "v2.observability_pipeline_amazon_open_search_destination" => "ObservabilityPipelineAmazonOpenSearchDestination", @@ -4539,6 +4544,9 @@ def overrides "v2.observability_pipeline_rename_fields_processor" => "ObservabilityPipelineRenameFieldsProcessor", "v2.observability_pipeline_rename_fields_processor_field" => "ObservabilityPipelineRenameFieldsProcessorField", "v2.observability_pipeline_rename_fields_processor_type" => "ObservabilityPipelineRenameFieldsProcessorType", + "v2.observability_pipeline_rename_metric_tags_processor" => "ObservabilityPipelineRenameMetricTagsProcessor", + "v2.observability_pipeline_rename_metric_tags_processor_tag" => "ObservabilityPipelineRenameMetricTagsProcessorTag", + "v2.observability_pipeline_rename_metric_tags_processor_type" => "ObservabilityPipelineRenameMetricTagsProcessorType", "v2.observability_pipeline_rsyslog_destination" => "ObservabilityPipelineRsyslogDestination", "v2.observability_pipeline_rsyslog_destination_type" => "ObservabilityPipelineRsyslogDestinationType", "v2.observability_pipeline_rsyslog_source" => "ObservabilityPipelineRsyslogSource", @@ -4628,6 +4636,13 @@ def overrides "v2.observability_pipeline_syslog_ng_source" => "ObservabilityPipelineSyslogNgSource", "v2.observability_pipeline_syslog_ng_source_type" => "ObservabilityPipelineSyslogNgSourceType", "v2.observability_pipeline_syslog_source_mode" => "ObservabilityPipelineSyslogSourceMode", + "v2.observability_pipeline_tag_cardinality_limit_processor" => "ObservabilityPipelineTagCardinalityLimitProcessor", + "v2.observability_pipeline_tag_cardinality_limit_processor_action" => "ObservabilityPipelineTagCardinalityLimitProcessorAction", + "v2.observability_pipeline_tag_cardinality_limit_processor_per_metric_limit" => "ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit", + "v2.observability_pipeline_tag_cardinality_limit_processor_per_metric_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode", + "v2.observability_pipeline_tag_cardinality_limit_processor_per_tag_limit" => "ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit", + "v2.observability_pipeline_tag_cardinality_limit_processor_per_tag_mode" => "ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode", + "v2.observability_pipeline_tag_cardinality_limit_processor_type" => "ObservabilityPipelineTagCardinalityLimitProcessorType", "v2.observability_pipeline_throttle_processor" => "ObservabilityPipelineThrottleProcessor", "v2.observability_pipeline_throttle_processor_type" => "ObservabilityPipelineThrottleProcessorType", "v2.observability_pipeline_tls" => "ObservabilityPipelineTls", diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor.rb new file mode 100644 index 000000000000..e1aa2af1af3c --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor.rb @@ -0,0 +1,225 @@ +=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 `add_metric_tags` processor adds static tags to metrics. + # + # **Supported pipeline types:** metrics + class ObservabilityPipelineAddMetricTagsProcessor + include BaseGenericModel + + # The display name for a component. + attr_accessor :display_name + + # Indicates whether the processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which metrics this processor targets. + attr_reader :include + + # A list of static tags (key-value pairs) added to each metric processed by this component. + attr_reader :tags + + # The processor type. The value must be `add_metric_tags`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'tags' => :'tags', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'tags' => :'Array', + :'type' => :'ObservabilityPipelineAddMetricTagsProcessorType' + } + 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::ObservabilityPipelineAddMetricTagsProcessor` 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @tags.nil? + return false if @tags.length > 15 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + if tags.length > 15 + fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 15.' + end + @tags = tags + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + tags == o.tags && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, enabled, id, include, tags, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor_type.rb new file mode 100644 index 000000000000..0c46afaf8fd5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_add_metric_tags_processor_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 processor type. The value must be `add_metric_tags`. + class ObservabilityPipelineAddMetricTagsProcessorType + include BaseEnumModel + + ADD_METRIC_TAGS = "add_metric_tags".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor.rb new file mode 100644 index 000000000000..97700d98343f --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor.rb @@ -0,0 +1,248 @@ +=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 `aggregate` processor combines metrics that share the same name and tags into a single metric over a configurable interval. + # + # **Supported pipeline types:** metrics + class ObservabilityPipelineAggregateProcessor + include BaseGenericModel + + # The display name for a component. + attr_accessor :display_name + + # Indicates whether the processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which metrics this processor targets. + attr_reader :include + + # The interval, in seconds, over which metrics are aggregated. + attr_reader :interval_secs + + # The aggregation mode applied to metrics that share the same name and tags within the interval. + attr_reader :mode + + # The processor type. The value must be `aggregate`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'interval_secs' => :'interval_secs', + :'mode' => :'mode', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'interval_secs' => :'Integer', + :'mode' => :'ObservabilityPipelineAggregateProcessorMode', + :'type' => :'ObservabilityPipelineAggregateProcessorType' + } + 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::ObservabilityPipelineAggregateProcessor` 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'interval_secs') + self.interval_secs = attributes[:'interval_secs'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @interval_secs.nil? + return false if @interval_secs > 60 + return false if @interval_secs < 1 + return false if @mode.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param interval_secs [Object] Object to be assigned + # @!visibility private + def interval_secs=(interval_secs) + if interval_secs.nil? + fail ArgumentError, 'invalid value for "interval_secs", interval_secs cannot be nil.' + end + if interval_secs > 60 + fail ArgumentError, 'invalid value for "interval_secs", must be smaller than or equal to 60.' + end + if interval_secs < 1 + fail ArgumentError, 'invalid value for "interval_secs", must be greater than or equal to 1.' + end + @interval_secs = interval_secs + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + interval_secs == o.interval_secs && + mode == o.mode && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, enabled, id, include, interval_secs, mode, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_mode.rb new file mode 100644 index 000000000000..e48067f12fd2 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_mode.rb @@ -0,0 +1,32 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The aggregation mode applied to metrics that share the same name and tags within the interval. + class ObservabilityPipelineAggregateProcessorMode + include BaseEnumModel + + AUTO = "auto".freeze + SUM = "sum".freeze + LATEST = "latest".freeze + COUNT = "count".freeze + MAX = "max".freeze + MIN = "min".freeze + MEAN = "mean".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_type.rb new file mode 100644 index 000000000000..155838bd1c11 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_aggregate_processor_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 processor type. The value must be `aggregate`. + class ObservabilityPipelineAggregateProcessorType + include BaseEnumModel + + AGGREGATE = "aggregate".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb b/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb index 9c6c290c3c53..402c3e6e483b 100644 --- a/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb +++ b/lib/datadog_api_client/v2/models/observability_pipeline_config_processor_item.rb @@ -47,7 +47,11 @@ def openapi_one_of :'ObservabilityPipelineSensitiveDataScannerProcessor', :'ObservabilityPipelineSplitArrayProcessor', :'ObservabilityPipelineThrottleProcessor', - :'ObservabilityPipelineMetricTagsProcessor' + :'ObservabilityPipelineAddMetricTagsProcessor', + :'ObservabilityPipelineAggregateProcessor', + :'ObservabilityPipelineMetricTagsProcessor', + :'ObservabilityPipelineRenameMetricTagsProcessor', + :'ObservabilityPipelineTagCardinalityLimitProcessor' ] end # Builds the object diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor.rb new file mode 100644 index 000000000000..af64e789b2b5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor.rb @@ -0,0 +1,225 @@ +=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 `rename_metric_tags` processor changes the keys of tags on metrics. + # + # **Supported pipeline types:** metrics + class ObservabilityPipelineRenameMetricTagsProcessor + include BaseGenericModel + + # The display name for a component. + attr_accessor :display_name + + # Indicates whether the processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which metrics this processor targets. + attr_reader :include + + # A list of rename rules specifying which tag keys to rename on each metric. + attr_reader :tags + + # The processor type. The value must be `rename_metric_tags`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'tags' => :'tags', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'tags' => :'Array', + :'type' => :'ObservabilityPipelineRenameMetricTagsProcessorType' + } + 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::ObservabilityPipelineRenameMetricTagsProcessor` 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'tags') + if (value = attributes[:'tags']).is_a?(Array) + self.tags = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @tags.nil? + return false if @tags.length > 15 + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param tags [Object] Object to be assigned + # @!visibility private + def tags=(tags) + if tags.nil? + fail ArgumentError, 'invalid value for "tags", tags cannot be nil.' + end + if tags.length > 15 + fail ArgumentError, 'invalid value for "tags", number of items must be less than or equal to 15.' + end + @tags = tags + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + tags == o.tags && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, enabled, id, include, tags, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_tag.rb b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_tag.rb new file mode 100644 index 000000000000..01e4f03e8a06 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_tag.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Defines how to rename a tag on metric events. + class ObservabilityPipelineRenameMetricTagsProcessorTag + include BaseGenericModel + + # The new tag key to assign in place of the original. + attr_reader :rename_to + + # The original tag key on the metric event. + attr_reader :tag + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'rename_to' => :'rename_to', + :'tag' => :'tag' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'rename_to' => :'String', + :'tag' => :'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::ObservabilityPipelineRenameMetricTagsProcessorTag` 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?(:'rename_to') + self.rename_to = attributes[:'rename_to'] + end + + if attributes.key?(:'tag') + self.tag = attributes[:'tag'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @rename_to.nil? + return false if @tag.nil? + true + end + + # Custom attribute writer method with validation + # @param rename_to [Object] Object to be assigned + # @!visibility private + def rename_to=(rename_to) + if rename_to.nil? + fail ArgumentError, 'invalid value for "rename_to", rename_to cannot be nil.' + end + @rename_to = rename_to + end + + # Custom attribute writer method with validation + # @param tag [Object] Object to be assigned + # @!visibility private + def tag=(tag) + if tag.nil? + fail ArgumentError, 'invalid value for "tag", tag cannot be nil.' + end + @tag = tag + 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 && + rename_to == o.rename_to && + tag == o.tag && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [rename_to, tag, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_type.rb new file mode 100644 index 000000000000..6d7b9246fee0 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_rename_metric_tags_processor_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 processor type. The value must be `rename_metric_tags`. + class ObservabilityPipelineRenameMetricTagsProcessorType + include BaseEnumModel + + RENAME_METRIC_TAGS = "rename_metric_tags".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb new file mode 100644 index 000000000000..1b38d76515bb --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor.rb @@ -0,0 +1,271 @@ +=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 `tag_cardinality_limit` processor caps the number of distinct tag value combinations on metrics, dropping tags or events once the limit is exceeded. + # + # **Supported pipeline types:** metrics + class ObservabilityPipelineTagCardinalityLimitProcessor + include BaseGenericModel + + # The display name for a component. + attr_accessor :display_name + + # Indicates whether the processor is enabled. + attr_reader :enabled + + # The unique identifier for this component. Used in other parts of the pipeline to reference this component (for example, as the `input` to downstream components). + attr_reader :id + + # A Datadog search query used to determine which metrics this processor targets. + attr_reader :include + + # The action to take when the cardinality limit is exceeded. + attr_reader :limit_exceeded_action + + # A list of per-metric cardinality overrides that take precedence over the default `value_limit`. + attr_reader :per_metric_limits + + # The processor type. The value must be `tag_cardinality_limit`. + attr_reader :type + + # The default maximum number of distinct tag value combinations allowed per metric. + attr_reader :value_limit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'display_name' => :'display_name', + :'enabled' => :'enabled', + :'id' => :'id', + :'include' => :'include', + :'limit_exceeded_action' => :'limit_exceeded_action', + :'per_metric_limits' => :'per_metric_limits', + :'type' => :'type', + :'value_limit' => :'value_limit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'display_name' => :'String', + :'enabled' => :'Boolean', + :'id' => :'String', + :'include' => :'String', + :'limit_exceeded_action' => :'ObservabilityPipelineTagCardinalityLimitProcessorAction', + :'per_metric_limits' => :'Array', + :'type' => :'ObservabilityPipelineTagCardinalityLimitProcessorType', + :'value_limit' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ObservabilityPipelineTagCardinalityLimitProcessor` 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?(:'display_name') + self.display_name = attributes[:'display_name'] + end + + if attributes.key?(:'enabled') + self.enabled = attributes[:'enabled'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'include') + self.include = attributes[:'include'] + end + + if attributes.key?(:'limit_exceeded_action') + self.limit_exceeded_action = attributes[:'limit_exceeded_action'] + end + + if attributes.key?(:'per_metric_limits') + if (value = attributes[:'per_metric_limits']).is_a?(Array) + self.per_metric_limits = value + end + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + + if attributes.key?(:'value_limit') + self.value_limit = attributes[:'value_limit'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @enabled.nil? + return false if @id.nil? + return false if @include.nil? + return false if @limit_exceeded_action.nil? + return false if !@per_metric_limits.nil? && @per_metric_limits.length > 100 + return false if @type.nil? + return false if @value_limit.nil? + return false if @value_limit > 1000000 + return false if @value_limit < 0 + true + end + + # Custom attribute writer method with validation + # @param enabled [Object] Object to be assigned + # @!visibility private + def enabled=(enabled) + if enabled.nil? + fail ArgumentError, 'invalid value for "enabled", enabled cannot be nil.' + end + @enabled = enabled + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param include [Object] Object to be assigned + # @!visibility private + def include=(include) + if include.nil? + fail ArgumentError, 'invalid value for "include", include cannot be nil.' + end + @include = include + end + + # Custom attribute writer method with validation + # @param limit_exceeded_action [Object] Object to be assigned + # @!visibility private + def limit_exceeded_action=(limit_exceeded_action) + if limit_exceeded_action.nil? + fail ArgumentError, 'invalid value for "limit_exceeded_action", limit_exceeded_action cannot be nil.' + end + @limit_exceeded_action = limit_exceeded_action + end + + # Custom attribute writer method with validation + # @param per_metric_limits [Object] Object to be assigned + # @!visibility private + def per_metric_limits=(per_metric_limits) + if !per_metric_limits.nil? && per_metric_limits.length > 100 + fail ArgumentError, 'invalid value for "per_metric_limits", number of items must be less than or equal to 100.' + end + @per_metric_limits = per_metric_limits + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Custom attribute writer method with validation + # @param value_limit [Object] Object to be assigned + # @!visibility private + def value_limit=(value_limit) + if value_limit.nil? + fail ArgumentError, 'invalid value for "value_limit", value_limit cannot be nil.' + end + if value_limit > 1000000 + fail ArgumentError, 'invalid value for "value_limit", must be smaller than or equal to 1000000.' + end + if value_limit < 0 + fail ArgumentError, 'invalid value for "value_limit", must be greater than or equal to 0.' + end + @value_limit = value_limit + 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 && + display_name == o.display_name && + enabled == o.enabled && + id == o.id && + include == o.include && + limit_exceeded_action == o.limit_exceeded_action && + per_metric_limits == o.per_metric_limits && + type == o.type && + value_limit == o.value_limit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [display_name, enabled, id, include, limit_exceeded_action, per_metric_limits, type, value_limit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_action.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_action.rb new file mode 100644 index 000000000000..ba243acf75a9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_action.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 action to take when the cardinality limit is exceeded. + class ObservabilityPipelineTagCardinalityLimitProcessorAction + include BaseEnumModel + + DROP_TAG = "drop_tag".freeze + DROP_EVENT = "drop_event".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb new file mode 100644 index 000000000000..d6147df8b675 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_limit.rb @@ -0,0 +1,202 @@ +=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 cardinality override applied to a specific metric. + class ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit + include BaseGenericModel + + # The action to take when the cardinality limit is exceeded. + attr_accessor :limit_exceeded_action + + # The name of the metric this override applies to. + attr_reader :metric_name + + # How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. + attr_reader :mode + + # A list of per-tag cardinality overrides that apply within this metric. Must be omitted when `mode` is `excluded`. + attr_reader :per_tag_limits + + # The maximum number of distinct tag value combinations allowed for this metric. Required when `mode` is `tracked`. Must be omitted when `mode` is `excluded`. + attr_reader :value_limit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'limit_exceeded_action' => :'limit_exceeded_action', + :'metric_name' => :'metric_name', + :'mode' => :'mode', + :'per_tag_limits' => :'per_tag_limits', + :'value_limit' => :'value_limit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'limit_exceeded_action' => :'ObservabilityPipelineTagCardinalityLimitProcessorAction', + :'metric_name' => :'String', + :'mode' => :'ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode', + :'per_tag_limits' => :'Array', + :'value_limit' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ObservabilityPipelineTagCardinalityLimitProcessorPerMetricLimit` 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?(:'limit_exceeded_action') + self.limit_exceeded_action = attributes[:'limit_exceeded_action'] + end + + if attributes.key?(:'metric_name') + self.metric_name = attributes[:'metric_name'] + end + + if attributes.key?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'per_tag_limits') + if (value = attributes[:'per_tag_limits']).is_a?(Array) + self.per_tag_limits = value + end + end + + if attributes.key?(:'value_limit') + self.value_limit = attributes[:'value_limit'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @metric_name.nil? + return false if @mode.nil? + return false if !@per_tag_limits.nil? && @per_tag_limits.length > 50 + return false if !@value_limit.nil? && @value_limit > 1000000 + return false if !@value_limit.nil? && @value_limit < 0 + true + end + + # Custom attribute writer method with validation + # @param metric_name [Object] Object to be assigned + # @!visibility private + def metric_name=(metric_name) + if metric_name.nil? + fail ArgumentError, 'invalid value for "metric_name", metric_name cannot be nil.' + end + @metric_name = metric_name + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + end + + # Custom attribute writer method with validation + # @param per_tag_limits [Object] Object to be assigned + # @!visibility private + def per_tag_limits=(per_tag_limits) + if !per_tag_limits.nil? && per_tag_limits.length > 50 + fail ArgumentError, 'invalid value for "per_tag_limits", number of items must be less than or equal to 50.' + end + @per_tag_limits = per_tag_limits + end + + # Custom attribute writer method with validation + # @param value_limit [Object] Object to be assigned + # @!visibility private + def value_limit=(value_limit) + if !value_limit.nil? && value_limit > 1000000 + fail ArgumentError, 'invalid value for "value_limit", must be smaller than or equal to 1000000.' + end + if !value_limit.nil? && value_limit < 0 + fail ArgumentError, 'invalid value for "value_limit", must be greater than or equal to 0.' + end + @value_limit = value_limit + 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 && + limit_exceeded_action == o.limit_exceeded_action && + metric_name == o.metric_name && + mode == o.mode && + per_tag_limits == o.per_tag_limits && + value_limit == o.value_limit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [limit_exceeded_action, metric_name, mode, per_tag_limits, value_limit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.rb new file mode 100644 index 000000000000..0a73d35dbc7e --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_metric_mode.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 + # How the per-metric override is applied. `tracked` enforces a custom limit; `excluded` skips the metric entirely. + class ObservabilityPipelineTagCardinalityLimitProcessorPerMetricMode + include BaseEnumModel + + TRACKED = "tracked".freeze + EXCLUDED = "excluded".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb new file mode 100644 index 000000000000..32ac13afa297 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_limit.rb @@ -0,0 +1,169 @@ +=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 cardinality override for a specific tag key within a per-metric limit. + class ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit + include BaseGenericModel + + # How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + attr_reader :mode + + # The tag key this override applies to. + attr_reader :tag_key + + # The maximum number of distinct values allowed for this tag. Required when `mode` is `limit_override`. Must be omitted when `mode` is `excluded`. + attr_reader :value_limit + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'mode' => :'mode', + :'tag_key' => :'tag_key', + :'value_limit' => :'value_limit' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'mode' => :'ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode', + :'tag_key' => :'String', + :'value_limit' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::ObservabilityPipelineTagCardinalityLimitProcessorPerTagLimit` 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?(:'mode') + self.mode = attributes[:'mode'] + end + + if attributes.key?(:'tag_key') + self.tag_key = attributes[:'tag_key'] + end + + if attributes.key?(:'value_limit') + self.value_limit = attributes[:'value_limit'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @mode.nil? + return false if @tag_key.nil? + return false if !@value_limit.nil? && @value_limit > 1000000 + return false if !@value_limit.nil? && @value_limit < 0 + true + end + + # Custom attribute writer method with validation + # @param mode [Object] Object to be assigned + # @!visibility private + def mode=(mode) + if mode.nil? + fail ArgumentError, 'invalid value for "mode", mode cannot be nil.' + end + @mode = mode + end + + # Custom attribute writer method with validation + # @param tag_key [Object] Object to be assigned + # @!visibility private + def tag_key=(tag_key) + if tag_key.nil? + fail ArgumentError, 'invalid value for "tag_key", tag_key cannot be nil.' + end + @tag_key = tag_key + end + + # Custom attribute writer method with validation + # @param value_limit [Object] Object to be assigned + # @!visibility private + def value_limit=(value_limit) + if !value_limit.nil? && value_limit > 1000000 + fail ArgumentError, 'invalid value for "value_limit", must be smaller than or equal to 1000000.' + end + if !value_limit.nil? && value_limit < 0 + fail ArgumentError, 'invalid value for "value_limit", must be greater than or equal to 0.' + end + @value_limit = value_limit + 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 && + mode == o.mode && + tag_key == o.tag_key && + value_limit == o.value_limit && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [mode, tag_key, value_limit, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.rb new file mode 100644 index 000000000000..4e2dd13f7af9 --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_per_tag_mode.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 + # How the per-tag override is applied. `limit_override` enforces a custom limit on the tag; `excluded` skips the tag from cardinality tracking. + class ObservabilityPipelineTagCardinalityLimitProcessorPerTagMode + include BaseEnumModel + + LIMIT_OVERRIDE = "limit_override".freeze + EXCLUDED = "excluded".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_type.rb b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_type.rb new file mode 100644 index 000000000000..786ad244888b --- /dev/null +++ b/lib/datadog_api_client/v2/models/observability_pipeline_tag_cardinality_limit_processor_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 processor type. The value must be `tag_cardinality_limit`. + class ObservabilityPipelineTagCardinalityLimitProcessorType + include BaseEnumModel + + TAG_CARDINALITY_LIMIT = "tag_cardinality_limit".freeze + end +end From f3bb71dc1a62228e1ee6ac4eb2458f92d142a423 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 18:04:11 +0000 Subject: [PATCH 2/5] Rename Tiers for Org Group Policies and Remove Include Memberships Support (#3373) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 86 ++--------- .../v2/org-groups/CreateOrgGroupPolicy.rb | 2 +- .../v2/org-groups/UpdateOrgGroupPolicy.rb | 2 +- features/scenarios_model_mapping.rb | 1 - features/v2/org_groups.feature | 12 +- lib/datadog_api_client/inflector.rb | 4 - .../v2/api/org_groups_api.rb | 2 - .../v2/models/org_group_data.rb | 12 +- .../v2/models/org_group_include_option.rb | 26 ---- .../v2/models/org_group_list_response.rb | 14 +- .../org_group_membership_relationship_data.rb | 144 ------------------ .../org_group_memberships_relationship.rb | 125 --------------- .../v2/models/org_group_policy_attributes.rb | 2 +- .../org_group_policy_create_attributes.rb | 2 +- .../org_group_policy_enforcement_tier.rb | 6 +- .../org_group_policy_update_attributes.rb | 2 +- .../v2/models/org_group_relationships.rb | 105 ------------- 17 files changed, 29 insertions(+), 518 deletions(-) delete mode 100644 lib/datadog_api_client/v2/models/org_group_include_option.rb delete mode 100644 lib/datadog_api_client/v2/models/org_group_membership_relationship_data.rb delete mode 100644 lib/datadog_api_client/v2/models/org_group_memberships_relationship.rb delete mode 100644 lib/datadog_api_client/v2/models/org_group_relationships.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 598e9c0987bf..60ae5f285781 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -1051,20 +1051,6 @@ components: example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" format: uuid type: string - OrgGroupInclude: - description: >- - List of related resources to include. - explode: false - in: query - name: include - required: false - schema: - example: - - memberships - items: - $ref: "#/components/schemas/OrgGroupIncludeOption" - type: array - style: form OrgGroupMembershipFilterOrgGroupId: description: Filter memberships by org group ID. Required when `filter[org_uuid]` is not provided. in: query @@ -59532,8 +59518,6 @@ components: example: "a1b2c3d4-e5f6-7890-abcd-ef0123456789" format: uuid type: string - relationships: - $ref: "#/components/schemas/OrgGroupRelationships" type: $ref: "#/components/schemas/OrgGroupType" required: @@ -59541,13 +59525,6 @@ components: - type - attributes type: object - OrgGroupIncludeOption: - description: Allowed include options for org group endpoints. - enum: - - memberships - type: string - x-enum-varnames: - - MEMBERSHIPS OrgGroupListResponse: description: Response containing a list of org groups. properties: @@ -59556,11 +59533,6 @@ components: items: $ref: "#/components/schemas/OrgGroupData" type: array - included: - description: Related resources included in the response when requested with the `include` parameter. - items: - $ref: "#/components/schemas/OrgGroupMembershipData" - type: array links: $ref: "#/components/schemas/OrgGroupPaginationLinks" meta: @@ -59687,20 +59659,6 @@ components: required: - data type: object - OrgGroupMembershipRelationshipData: - description: A reference to an org group membership. - properties: - id: - description: The ID of the membership. - example: "f1e2d3c4-b5a6-7890-1234-567890abcdef" - format: uuid - type: string - type: - $ref: "#/components/schemas/OrgGroupMembershipType" - required: - - id - - type - type: object OrgGroupMembershipRelationships: description: Relationships of an org group membership. properties: @@ -59771,17 +59729,6 @@ components: required: - data type: object - OrgGroupMembershipsRelationship: - description: Relationship to org group memberships. - properties: - data: - description: An array of membership relationship references. - items: - $ref: "#/components/schemas/OrgGroupMembershipRelationshipData" - type: array - required: - - data - type: object OrgGroupPaginationLinks: description: Pagination links for navigating between pages of an org group list response. properties: @@ -60015,18 +59962,18 @@ components: - attributes type: object OrgGroupPolicyEnforcementTier: - default: DEFAULT + default: OVERRIDE_ALLOWED description: >- - The enforcement tier of the policy. `DEFAULT` means the policy is set but member orgs may mutate it. `ENFORCE` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. + The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. enum: - - DEFAULT - - ENFORCE + - OVERRIDE_ALLOWED + - GROUP_MANAGED - DELEGATE - example: DEFAULT + example: OVERRIDE_ALLOWED type: string x-enum-varnames: - - DEFAULT - - ENFORCE + - OVERRIDE_ALLOWED + - GROUP_MANAGED - DELEGATE OrgGroupPolicyListResponse: description: Response containing a list of org group policies. @@ -60367,12 +60314,6 @@ components: - id - type type: object - OrgGroupRelationships: - description: Relationships of an org group. - properties: - memberships: - $ref: "#/components/schemas/OrgGroupMembershipsRelationship" - type: object OrgGroupResponse: description: Response containing a single org group. properties: @@ -134194,7 +134135,7 @@ paths: - attributes: content: value: "UTC" - enforcement_tier: "DEFAULT" + enforcement_tier: "OVERRIDE_ALLOWED" modified_at: "2024-01-15T10:30:00Z" policy_name: "monitor_timezone" policy_type: "org_config" @@ -134266,7 +134207,7 @@ paths: attributes: content: value: "UTC" - enforcement_tier: "DEFAULT" + enforcement_tier: "OVERRIDE_ALLOWED" policy_name: "monitor_timezone" policy_type: "org_config" relationships: @@ -134289,7 +134230,7 @@ paths: attributes: content: value: "UTC" - enforcement_tier: "DEFAULT" + enforcement_tier: "OVERRIDE_ALLOWED" modified_at: "2024-01-15T10:30:00Z" policy_name: "monitor_timezone" policy_type: "org_config" @@ -134398,7 +134339,7 @@ paths: attributes: content: value: "UTC" - enforcement_tier: "DEFAULT" + enforcement_tier: "OVERRIDE_ALLOWED" modified_at: "2024-01-15T10:30:00Z" policy_name: "monitor_timezone" policy_type: "org_config" @@ -134462,7 +134403,7 @@ paths: attributes: content: value: "US/Eastern" - enforcement_tier: "ENFORCE" + enforcement_tier: "GROUP_MANAGED" id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789" type: org_group_policies schema: @@ -134479,7 +134420,7 @@ paths: attributes: content: value: "US/Eastern" - enforcement_tier: "ENFORCE" + enforcement_tier: "GROUP_MANAGED" modified_at: "2024-01-16T14:00:00Z" policy_name: "monitor_timezone" policy_type: "org_config" @@ -134946,7 +134887,6 @@ paths: - $ref: "#/components/parameters/OrgGroupPageNumber" - $ref: "#/components/parameters/OrgGroupPageSize" - $ref: "#/components/parameters/OrgGroupSort" - - $ref: "#/components/parameters/OrgGroupInclude" responses: "200": content: diff --git a/examples/v2/org-groups/CreateOrgGroupPolicy.rb b/examples/v2/org-groups/CreateOrgGroupPolicy.rb index f39901d82005..095a7f55df13 100644 --- a/examples/v2/org-groups/CreateOrgGroupPolicy.rb +++ b/examples/v2/org-groups/CreateOrgGroupPolicy.rb @@ -12,7 +12,7 @@ content: { "value": "UTC", }, - enforcement_tier: DatadogAPIClient::V2::OrgGroupPolicyEnforcementTier::DEFAULT, + enforcement_tier: DatadogAPIClient::V2::OrgGroupPolicyEnforcementTier::OVERRIDE_ALLOWED, policy_name: "monitor_timezone", policy_type: DatadogAPIClient::V2::OrgGroupPolicyPolicyType::ORG_CONFIG, }), diff --git a/examples/v2/org-groups/UpdateOrgGroupPolicy.rb b/examples/v2/org-groups/UpdateOrgGroupPolicy.rb index 12c658ee0b7f..c2e69cd07832 100644 --- a/examples/v2/org-groups/UpdateOrgGroupPolicy.rb +++ b/examples/v2/org-groups/UpdateOrgGroupPolicy.rb @@ -12,7 +12,7 @@ content: { "value": "UTC", }, - enforcement_tier: DatadogAPIClient::V2::OrgGroupPolicyEnforcementTier::DEFAULT, + enforcement_tier: DatadogAPIClient::V2::OrgGroupPolicyEnforcementTier::OVERRIDE_ALLOWED, }), id: "1a2b3c4d-5e6f-7890-abcd-ef0123456789", type: DatadogAPIClient::V2::OrgGroupPolicyType::ORG_GROUP_POLICIES, diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 67ed43751475..89ac9711f850 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -4008,7 +4008,6 @@ "page_number" => "Integer", "page_size" => "Integer", "sort" => "OrgGroupSortOption", - "include" => "Array", }, "v2.CreateOrgGroup" => { "body" => "OrgGroupCreateRequest", diff --git a/features/v2/org_groups.feature b/features/v2/org_groups.feature index b8c5fe1b61d1..58065ea87fc7 100644 --- a/features/v2/org_groups.feature +++ b/features/v2/org_groups.feature @@ -60,7 +60,7 @@ Feature: Org Groups Scenario: Create an org group policy returns "Bad Request" response Given operation "CreateOrgGroupPolicy" enabled And new "CreateOrgGroupPolicy" request - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "OVERRIDE_ALLOWED", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} When the request is sent Then the response status is 400 Bad Request @@ -68,7 +68,7 @@ Feature: Org Groups Scenario: Create an org group policy returns "Conflict" response Given operation "CreateOrgGroupPolicy" enabled And new "CreateOrgGroupPolicy" request - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "OVERRIDE_ALLOWED", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} When the request is sent Then the response status is 409 Conflict @@ -76,7 +76,7 @@ Feature: Org Groups Scenario: Create an org group policy returns "Created" response Given operation "CreateOrgGroupPolicy" enabled And new "CreateOrgGroupPolicy" request - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "OVERRIDE_ALLOWED", "policy_name": "monitor_timezone", "policy_type": "org_config"}, "relationships": {"org_group": {"data": {"id": "a1b2c3d4-e5f6-7890-abcd-ef0123456789", "type": "org_groups"}}}, "type": "org_group_policies"}} When the request is sent Then the response status is 201 Created @@ -398,7 +398,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicy" enabled And new "UpdateOrgGroupPolicy" request And request contains "org_group_policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "OVERRIDE_ALLOWED"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} When the request is sent Then the response status is 400 Bad Request @@ -407,7 +407,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicy" enabled And new "UpdateOrgGroupPolicy" request And request contains "org_group_policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "OVERRIDE_ALLOWED"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} When the request is sent Then the response status is 404 Not Found @@ -416,7 +416,7 @@ Feature: Org Groups Given operation "UpdateOrgGroupPolicy" enabled And new "UpdateOrgGroupPolicy" request And request contains "org_group_policy_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "DEFAULT"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} + And body with value {"data": {"attributes": {"content": {"value": "UTC"}, "enforcement_tier": "OVERRIDE_ALLOWED"}, "id": "1a2b3c4d-5e6f-7890-abcd-ef0123456789", "type": "org_group_policies"}} When the request is sent Then the response status is 200 OK diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 54fa0f473384..cbdb4303667a 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -4751,7 +4751,6 @@ def overrides "v2.org_group_create_data" => "OrgGroupCreateData", "v2.org_group_create_request" => "OrgGroupCreateRequest", "v2.org_group_data" => "OrgGroupData", - "v2.org_group_include_option" => "OrgGroupIncludeOption", "v2.org_group_list_response" => "OrgGroupListResponse", "v2.org_group_membership_attributes" => "OrgGroupMembershipAttributes", "v2.org_group_membership_bulk_update_attributes" => "OrgGroupMembershipBulkUpdateAttributes", @@ -4761,11 +4760,9 @@ def overrides "v2.org_group_membership_bulk_update_type" => "OrgGroupMembershipBulkUpdateType", "v2.org_group_membership_data" => "OrgGroupMembershipData", "v2.org_group_membership_list_response" => "OrgGroupMembershipListResponse", - "v2.org_group_membership_relationship_data" => "OrgGroupMembershipRelationshipData", "v2.org_group_membership_relationships" => "OrgGroupMembershipRelationships", "v2.org_group_membership_response" => "OrgGroupMembershipResponse", "v2.org_group_membership_sort_option" => "OrgGroupMembershipSortOption", - "v2.org_group_memberships_relationship" => "OrgGroupMembershipsRelationship", "v2.org_group_membership_type" => "OrgGroupMembershipType", "v2.org_group_membership_update_data" => "OrgGroupMembershipUpdateData", "v2.org_group_membership_update_relationships" => "OrgGroupMembershipUpdateRelationships", @@ -4809,7 +4806,6 @@ def overrides "v2.org_group_policy_update_attributes" => "OrgGroupPolicyUpdateAttributes", "v2.org_group_policy_update_data" => "OrgGroupPolicyUpdateData", "v2.org_group_policy_update_request" => "OrgGroupPolicyUpdateRequest", - "v2.org_group_relationships" => "OrgGroupRelationships", "v2.org_group_relationship_to_one" => "OrgGroupRelationshipToOne", "v2.org_group_relationship_to_one_data" => "OrgGroupRelationshipToOneData", "v2.org_group_response" => "OrgGroupResponse", diff --git a/lib/datadog_api_client/v2/api/org_groups_api.rb b/lib/datadog_api_client/v2/api/org_groups_api.rb index b413a33ecf84..9e2eb61ee9fa 100644 --- a/lib/datadog_api_client/v2/api/org_groups_api.rb +++ b/lib/datadog_api_client/v2/api/org_groups_api.rb @@ -1169,7 +1169,6 @@ def list_org_groups(opts = {}) # @option opts [Integer] :page_number The page number to return. # @option opts [Integer] :page_size The number of items per page. Maximum is 1000. # @option opts [OrgGroupSortOption] :sort Field to sort org groups by. Supported values: `name`, `uuid`, `-name`, `-uuid`. Defaults to `uuid`. - # @option opts [Array] :include List of related resources to include. # @return [Array<(OrgGroupListResponse, Integer, Hash)>] OrgGroupListResponse data, response status code and response headers def list_org_groups_with_http_info(opts = {}) unstable_enabled = @api_client.config.unstable_operations["v2.list_org_groups".to_sym] @@ -1203,7 +1202,6 @@ def list_org_groups_with_http_info(opts = {}) query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil? query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? - query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil? # header parameters header_params = opts[:header_params] || {} diff --git a/lib/datadog_api_client/v2/models/org_group_data.rb b/lib/datadog_api_client/v2/models/org_group_data.rb index 433f78988a82..92f436426ced 100644 --- a/lib/datadog_api_client/v2/models/org_group_data.rb +++ b/lib/datadog_api_client/v2/models/org_group_data.rb @@ -27,9 +27,6 @@ class OrgGroupData # The ID of the org group. attr_reader :id - # Relationships of an org group. - attr_accessor :relationships - # Org groups resource type. attr_reader :type @@ -41,7 +38,6 @@ def self.attribute_map { :'attributes' => :'attributes', :'id' => :'id', - :'relationships' => :'relationships', :'type' => :'type' } end @@ -52,7 +48,6 @@ def self.openapi_types { :'attributes' => :'OrgGroupAttributes', :'id' => :'UUID', - :'relationships' => :'OrgGroupRelationships', :'type' => :'OrgGroupType' } end @@ -83,10 +78,6 @@ def initialize(attributes = {}) self.id = attributes[:'id'] end - if attributes.key?(:'relationships') - self.relationships = attributes[:'relationships'] - end - if attributes.key?(:'type') self.type = attributes[:'type'] end @@ -160,7 +151,6 @@ def ==(o) self.class == o.class && attributes == o.attributes && id == o.id && - relationships == o.relationships && type == o.type && additional_properties == o.additional_properties end @@ -169,7 +159,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [attributes, id, relationships, type, additional_properties].hash + [attributes, id, type, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/org_group_include_option.rb b/lib/datadog_api_client/v2/models/org_group_include_option.rb deleted file mode 100644 index 520bd1864b4f..000000000000 --- a/lib/datadog_api_client/v2/models/org_group_include_option.rb +++ /dev/null @@ -1,26 +0,0 @@ -=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 - # Allowed include options for org group endpoints. - class OrgGroupIncludeOption - include BaseEnumModel - - MEMBERSHIPS = "memberships".freeze - end -end diff --git a/lib/datadog_api_client/v2/models/org_group_list_response.rb b/lib/datadog_api_client/v2/models/org_group_list_response.rb index ca97b20718df..3b2621ba3456 100644 --- a/lib/datadog_api_client/v2/models/org_group_list_response.rb +++ b/lib/datadog_api_client/v2/models/org_group_list_response.rb @@ -24,9 +24,6 @@ class OrgGroupListResponse # An array of org groups. attr_reader :data - # Related resources included in the response when requested with the `include` parameter. - attr_accessor :included - # Pagination links for navigating between pages of an org group list response. attr_accessor :links @@ -40,7 +37,6 @@ class OrgGroupListResponse def self.attribute_map { :'data' => :'data', - :'included' => :'included', :'links' => :'links', :'meta' => :'meta' } @@ -51,7 +47,6 @@ def self.attribute_map def self.openapi_types { :'data' => :'Array', - :'included' => :'Array', :'links' => :'OrgGroupPaginationLinks', :'meta' => :'OrgGroupPaginationMeta' } @@ -81,12 +76,6 @@ def initialize(attributes = {}) end end - if attributes.key?(:'included') - if (value = attributes[:'included']).is_a?(Array) - self.included = value - end - end - if attributes.key?(:'links') self.links = attributes[:'links'] end @@ -141,7 +130,6 @@ def ==(o) return true if self.equal?(o) self.class == o.class && data == o.data && - included == o.included && links == o.links && meta == o.meta && additional_properties == o.additional_properties @@ -151,7 +139,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [data, included, links, meta, additional_properties].hash + [data, links, meta, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v2/models/org_group_membership_relationship_data.rb b/lib/datadog_api_client/v2/models/org_group_membership_relationship_data.rb deleted file mode 100644 index 1c8d8829412a..000000000000 --- a/lib/datadog_api_client/v2/models/org_group_membership_relationship_data.rb +++ /dev/null @@ -1,144 +0,0 @@ -=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 reference to an org group membership. - class OrgGroupMembershipRelationshipData - include BaseGenericModel - - # The ID of the membership. - attr_reader :id - - # Org group memberships resource type. - attr_reader :type - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'id' => :'id', - :'type' => :'type' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'id' => :'UUID', - :'type' => :'OrgGroupMembershipType' - } - 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::OrgGroupMembershipRelationshipData` 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?(:'id') - self.id = attributes[:'id'] - end - - if attributes.key?(:'type') - self.type = attributes[:'type'] - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @id.nil? - return false if @type.nil? - true - end - - # Custom attribute writer method with validation - # @param id [Object] Object to be assigned - # @!visibility private - def id=(id) - if id.nil? - fail ArgumentError, 'invalid value for "id", id cannot be nil.' - end - @id = id - end - - # Custom attribute writer method with validation - # @param type [Object] Object to be assigned - # @!visibility private - def type=(type) - if type.nil? - fail ArgumentError, 'invalid value for "type", type cannot be nil.' - end - @type = type - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - 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 - [id, type, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/org_group_memberships_relationship.rb b/lib/datadog_api_client/v2/models/org_group_memberships_relationship.rb deleted file mode 100644 index 12ac8d57568d..000000000000 --- a/lib/datadog_api_client/v2/models/org_group_memberships_relationship.rb +++ /dev/null @@ -1,125 +0,0 @@ -=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 - # Relationship to org group memberships. - class OrgGroupMembershipsRelationship - include BaseGenericModel - - # An array of membership relationship references. - attr_reader :data - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'data' => :'data' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'data' => :'Array' - } - end - - # Initializes the object - # @param attributes [Hash] Model attributes in the form of hash - # @!visibility private - def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::OrgGroupMembershipsRelationship` initialize method" - end - - self.additional_properties = {} - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - self.additional_properties[k.to_sym] = v - else - h[k.to_sym] = v - end - } - - if attributes.key?(:'data') - if (value = attributes[:'data']).is_a?(Array) - self.data = value - end - end - end - - # Check to see if the all the properties in the model are valid - # @return true if the model is valid - # @!visibility private - def valid? - return false if @data.nil? - true - end - - # Custom attribute writer method with validation - # @param data [Object] Object to be assigned - # @!visibility private - def data=(data) - if data.nil? - fail ArgumentError, 'invalid value for "data", data cannot be nil.' - end - @data = data - end - - # Returns the object in the form of hash, with additionalProperties support. - # @return [Hash] Returns the object in the form of hash - # @!visibility private - def to_hash - hash = {} - self.class.attribute_map.each_pair do |attr, param| - value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - - hash[param] = _to_hash(value) - end - self.additional_properties.each_pair do |attr, value| - hash[attr] = value - end - hash - end - - # Checks equality by comparing each attribute. - # @param o [Object] Object to be compared - # @!visibility private - def ==(o) - return true if self.equal?(o) - self.class == o.class && - data == o.data && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [data, additional_properties].hash - end - end -end diff --git a/lib/datadog_api_client/v2/models/org_group_policy_attributes.rb b/lib/datadog_api_client/v2/models/org_group_policy_attributes.rb index 5e2e80bc59ae..546b80b5c8c2 100644 --- a/lib/datadog_api_client/v2/models/org_group_policy_attributes.rb +++ b/lib/datadog_api_client/v2/models/org_group_policy_attributes.rb @@ -24,7 +24,7 @@ class OrgGroupPolicyAttributes # The policy content as key-value pairs. attr_accessor :content - # The enforcement tier of the policy. `DEFAULT` means the policy is set but member orgs may mutate it. `ENFORCE` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. + # The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. attr_reader :enforcement_tier # Timestamp when the policy was last modified. diff --git a/lib/datadog_api_client/v2/models/org_group_policy_create_attributes.rb b/lib/datadog_api_client/v2/models/org_group_policy_create_attributes.rb index 67ed3baa68df..fa344aec210e 100644 --- a/lib/datadog_api_client/v2/models/org_group_policy_create_attributes.rb +++ b/lib/datadog_api_client/v2/models/org_group_policy_create_attributes.rb @@ -24,7 +24,7 @@ class OrgGroupPolicyCreateAttributes # The policy content as key-value pairs. attr_reader :content - # The enforcement tier of the policy. `DEFAULT` means the policy is set but member orgs may mutate it. `ENFORCE` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. + # The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. attr_accessor :enforcement_tier # The name of the policy. diff --git a/lib/datadog_api_client/v2/models/org_group_policy_enforcement_tier.rb b/lib/datadog_api_client/v2/models/org_group_policy_enforcement_tier.rb index b9bdbc49997e..4ae4778978d6 100644 --- a/lib/datadog_api_client/v2/models/org_group_policy_enforcement_tier.rb +++ b/lib/datadog_api_client/v2/models/org_group_policy_enforcement_tier.rb @@ -17,12 +17,12 @@ require 'time' module DatadogAPIClient::V2 - # The enforcement tier of the policy. `DEFAULT` means the policy is set but member orgs may mutate it. `ENFORCE` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. + # The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. class OrgGroupPolicyEnforcementTier include BaseEnumModel - DEFAULT = "DEFAULT".freeze - ENFORCE = "ENFORCE".freeze + OVERRIDE_ALLOWED = "OVERRIDE_ALLOWED".freeze + GROUP_MANAGED = "GROUP_MANAGED".freeze DELEGATE = "DELEGATE".freeze end end diff --git a/lib/datadog_api_client/v2/models/org_group_policy_update_attributes.rb b/lib/datadog_api_client/v2/models/org_group_policy_update_attributes.rb index 9ec9b8cc9b3e..17f68d52e33b 100644 --- a/lib/datadog_api_client/v2/models/org_group_policy_update_attributes.rb +++ b/lib/datadog_api_client/v2/models/org_group_policy_update_attributes.rb @@ -24,7 +24,7 @@ class OrgGroupPolicyUpdateAttributes # The policy content as key-value pairs. attr_accessor :content - # The enforcement tier of the policy. `DEFAULT` means the policy is set but member orgs may mutate it. `ENFORCE` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. + # The enforcement tier of the policy. `OVERRIDE_ALLOWED` means the policy is set but member orgs may mutate it. `GROUP_MANAGED` means the policy is strictly controlled and mutations are blocked for affected orgs. `DELEGATE` means each member org controls its own value. attr_accessor :enforcement_tier attr_accessor :additional_properties diff --git a/lib/datadog_api_client/v2/models/org_group_relationships.rb b/lib/datadog_api_client/v2/models/org_group_relationships.rb deleted file mode 100644 index cc8619a0d245..000000000000 --- a/lib/datadog_api_client/v2/models/org_group_relationships.rb +++ /dev/null @@ -1,105 +0,0 @@ -=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 - # Relationships of an org group. - class OrgGroupRelationships - include BaseGenericModel - - # Relationship to org group memberships. - attr_accessor :memberships - - attr_accessor :additional_properties - - # Attribute mapping from ruby-style variable name to JSON key. - # @!visibility private - def self.attribute_map - { - :'memberships' => :'memberships' - } - end - - # Attribute type mapping. - # @!visibility private - def self.openapi_types - { - :'memberships' => :'OrgGroupMembershipsRelationship' - } - 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::OrgGroupRelationships` 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?(:'memberships') - self.memberships = attributes[:'memberships'] - 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 && - memberships == o.memberships && - additional_properties == o.additional_properties - end - - # Calculates hash code according to all attributes. - # @return [Integer] Hash code - # @!visibility private - def hash - [memberships, additional_properties].hash - end - end -end From 2dcf5703c8b1e14ed3f4cf1d9137e24cae097025 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 18:36:32 +0000 Subject: [PATCH 3/5] Add critical_query / critical_recovery_query to MonitorThresholds (#3368) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v1/openapi.yaml | 12 ++++++++++ features/v1/monitors.feature | 2 +- lib/datadog_api_client/v1/api/monitors_api.rb | 4 ++++ .../v1/models/monitor_thresholds.rb | 22 ++++++++++++++++++- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index 51fe22bcea0c..25a447b57951 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -9229,11 +9229,19 @@ components: description: The monitor `CRITICAL` threshold. format: double type: number + critical_query: + description: Query evaluated as a dynamic `CRITICAL` threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview. + example: 'formula("2 * query1").rollup("avg").last("6mo")' + type: string critical_recovery: description: The monitor `CRITICAL` recovery threshold. format: double nullable: true type: number + critical_recovery_query: + description: Query evaluated as a dynamic `CRITICAL` recovery threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview. + example: 'formula("1.5 * query1").rollup("avg").last("3mo")' + type: string ok: description: The monitor `OK` threshold. format: double @@ -33700,6 +33708,10 @@ paths: - `operator`: <, <=, >, >=, ==, or != - `#`: an integer or decimal number used to set the threshold + To use a dynamic threshold on a metric monitor with a formula query, replace `#` with the `threshold` keyword + (for example, `... > threshold`) and provide the threshold as a query via `critical_query` on `options.thresholds`. + This feature is in preview. + If you are using the `_change_` or `_pct_change_` time aggregator, instead use `change_aggr(time_aggr(time_window), timeshift):space_aggr:metric{tags} [by {key}] operator #` with: diff --git a/features/v1/monitors.feature b/features/v1/monitors.feature index 73ed30421fb3..e3e5ca6c4109 100644 --- a/features/v1/monitors.feature +++ b/features/v1/monitors.feature @@ -219,7 +219,7 @@ Feature: Monitors Scenario: Edit a monitor returns "Bad Request" response Given new "UpdateMonitor" request And request contains "monitor_id" parameter from "REPLACE.ME" - And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result", "source": "filter_query"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}, "source": "filter_query"}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"} + And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_query": "formula(\"2 * query1\").rollup(\"avg\").last(\"6mo\")", "critical_recovery": null, "critical_recovery_query": "formula(\"1.5 * query1\").rollup(\"avg\").last(\"3mo\")", "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration", "name": "compute_result", "source": "filter_query"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}, "source": "filter_query"}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"} When the request is sent Then the response status is 400 Bad Request diff --git a/lib/datadog_api_client/v1/api/monitors_api.rb b/lib/datadog_api_client/v1/api/monitors_api.rb index 4b1c75210177..551358b1273a 100644 --- a/lib/datadog_api_client/v1/api/monitors_api.rb +++ b/lib/datadog_api_client/v1/api/monitors_api.rb @@ -147,6 +147,10 @@ def create_monitor(body, opts = {}) # - `operator`: <, <=, >, >=, ==, or != # - `#`: an integer or decimal number used to set the threshold # + # To use a dynamic threshold on a metric monitor with a formula query, replace `#` with the `threshold` keyword + # (for example, `... > threshold`) and provide the threshold as a query via `critical_query` on `options.thresholds`. + # This feature is in preview. + # # If you are using the `_change_` or `_pct_change_` time aggregator, instead use `change_aggr(time_aggr(time_window), # timeshift):space_aggr:metric{tags} [by {key}] operator #` with: # diff --git a/lib/datadog_api_client/v1/models/monitor_thresholds.rb b/lib/datadog_api_client/v1/models/monitor_thresholds.rb index d33d7ad2b8d0..4ec269c3753f 100644 --- a/lib/datadog_api_client/v1/models/monitor_thresholds.rb +++ b/lib/datadog_api_client/v1/models/monitor_thresholds.rb @@ -24,9 +24,15 @@ class MonitorThresholds # The monitor `CRITICAL` threshold. attr_accessor :critical + # Query evaluated as a dynamic `CRITICAL` threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview. + attr_accessor :critical_query + # The monitor `CRITICAL` recovery threshold. attr_accessor :critical_recovery + # Query evaluated as a dynamic `CRITICAL` recovery threshold. Only supported on metric monitors with a formula query and options['variables']. Cannot be combined with static thresholds. This field is in preview. + attr_accessor :critical_recovery_query + # The monitor `OK` threshold. attr_accessor :ok @@ -46,7 +52,9 @@ class MonitorThresholds def self.attribute_map { :'critical' => :'critical', + :'critical_query' => :'critical_query', :'critical_recovery' => :'critical_recovery', + :'critical_recovery_query' => :'critical_recovery_query', :'ok' => :'ok', :'unknown' => :'unknown', :'warning' => :'warning', @@ -59,7 +67,9 @@ def self.attribute_map def self.openapi_types { :'critical' => :'Float', + :'critical_query' => :'String', :'critical_recovery' => :'Float', + :'critical_recovery_query' => :'String', :'ok' => :'Float', :'unknown' => :'Float', :'warning' => :'Float', @@ -101,10 +111,18 @@ def initialize(attributes = {}) self.critical = attributes[:'critical'] end + if attributes.key?(:'critical_query') + self.critical_query = attributes[:'critical_query'] + end + if attributes.key?(:'critical_recovery') self.critical_recovery = attributes[:'critical_recovery'] end + if attributes.key?(:'critical_recovery_query') + self.critical_recovery_query = attributes[:'critical_recovery_query'] + end + if attributes.key?(:'ok') self.ok = attributes[:'ok'] end @@ -149,7 +167,9 @@ def ==(o) return true if self.equal?(o) self.class == o.class && critical == o.critical && + critical_query == o.critical_query && critical_recovery == o.critical_recovery && + critical_recovery_query == o.critical_recovery_query && ok == o.ok && unknown == o.unknown && warning == o.warning && @@ -161,7 +181,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [critical, critical_recovery, ok, unknown, warning, warning_recovery, additional_properties].hash + [critical, critical_query, critical_recovery, critical_recovery_query, ok, unknown, warning, warning_recovery, additional_properties].hash end end end From 5ed2d8dcadb9f9b8ccd11b6d5b8fa95535d2d41a Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 19:15:44 +0000 Subject: [PATCH 4/5] Add OpenAPI spec for IDP entity integration configs (#3371) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 281 ++++++++++++++++++ .../DeleteEntityIntegrationConfig.rb | 8 + .../GetEntityIntegrationConfig.rb | 8 + .../UpdateEntityIntegrationConfig.rb | 17 ++ features/scenarios_model_mapping.rb | 10 + .../v2/entity_integration_configs.feature | 77 +++++ features/v2/undo.json | 18 ++ lib/datadog_api_client/configuration.rb | 3 + lib/datadog_api_client/inflector.rb | 9 + .../v2/api/entity_integration_configs_api.rb | 250 ++++++++++++++++ .../entity_integration_config_attributes.rb | 165 ++++++++++ .../models/entity_integration_config_data.rb | 165 ++++++++++ .../entity_integration_config_request.rb | 123 ++++++++ ...y_integration_config_request_attributes.rb | 123 ++++++++ .../entity_integration_config_request_data.rb | 144 +++++++++ .../entity_integration_config_request_type.rb | 26 ++ .../entity_integration_config_response.rb | 123 ++++++++ .../models/entity_integration_config_type.rb | 26 ++ 18 files changed, 1576 insertions(+) create mode 100644 examples/v2/entity-integration-configs/DeleteEntityIntegrationConfig.rb create mode 100644 examples/v2/entity-integration-configs/GetEntityIntegrationConfig.rb create mode 100644 examples/v2/entity-integration-configs/UpdateEntityIntegrationConfig.rb create mode 100644 features/v2/entity_integration_configs.feature create mode 100644 lib/datadog_api_client/v2/api/entity_integration_configs_api.rb create mode 100644 lib/datadog_api_client/v2/models/entity_integration_config_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/entity_integration_config_data.rb create mode 100644 lib/datadog_api_client/v2/models/entity_integration_config_request.rb create mode 100644 lib/datadog_api_client/v2/models/entity_integration_config_request_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/entity_integration_config_request_data.rb create mode 100644 lib/datadog_api_client/v2/models/entity_integration_config_request_type.rb create mode 100644 lib/datadog_api_client/v2/models/entity_integration_config_response.rb create mode 100644 lib/datadog_api_client/v2/models/entity_integration_config_type.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 60ae5f285781..8c1470bc3d08 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -435,6 +435,14 @@ components: schema: example: "service:myservice" type: string + EntityIntegrationConfigID: + description: The identifier of the integration whose configuration is being managed. Supported values are `github`, `jira`, and `pagerduty`. + in: path + name: integration_id + required: true + schema: + example: github + type: string FastlyAccountID: description: Fastly Account id. in: path @@ -27185,6 +27193,103 @@ components: description: Entity. type: string type: object + EntityIntegrationConfigAttributes: + description: The organization ID, integration identifier, and integration-specific configuration payload for an entity integration configuration. + properties: + config: + $ref: "#/components/schemas/EntityIntegrationConfigPayload" + integration_id: + description: The identifier of the integration this configuration applies to (for example, `github`, `jira`, or `pagerduty`). + example: github + type: string + org_id: + description: The Datadog organization identifier that owns this configuration. + example: 1234 + format: int64 + type: integer + required: + - org_id + - integration_id + - config + type: object + EntityIntegrationConfigData: + description: JSON:API resource object for an entity integration configuration. + properties: + attributes: + $ref: "#/components/schemas/EntityIntegrationConfigAttributes" + id: + description: Unique identifier of the entity integration configuration. + example: 01HJABCD12345678ABCDEFGHIJ + type: string + type: + $ref: "#/components/schemas/EntityIntegrationConfigType" + required: + - id + - type + - attributes + type: object + EntityIntegrationConfigPayload: + additionalProperties: {} + description: Integration-specific configuration payload. The shape of this object depends on the integration identified by the path parameter. For `github`, the object must contain an `enabled_repos` array. For `jira`, it must contain an `enabled_projects` array. For `pagerduty`, it must contain an `accounts` array. + example: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + type: object + EntityIntegrationConfigRequest: + description: Request body used to create or replace the configuration for a given integration. + properties: + data: + $ref: "#/components/schemas/EntityIntegrationConfigRequestData" + required: + - data + type: object + EntityIntegrationConfigRequestAttributes: + description: Attributes used to create or update an entity integration configuration. + properties: + config: + $ref: "#/components/schemas/EntityIntegrationConfigPayload" + required: + - config + type: object + EntityIntegrationConfigRequestData: + description: JSON:API resource object used in a request to create or update an entity integration configuration. + properties: + attributes: + $ref: "#/components/schemas/EntityIntegrationConfigRequestAttributes" + type: + $ref: "#/components/schemas/EntityIntegrationConfigRequestType" + required: + - type + - attributes + type: object + EntityIntegrationConfigRequestType: + default: entity_integration_config_requests + description: JSON:API resource type for the entity integration configuration create or update request. Always `entity_integration_config_requests`. + enum: + - entity_integration_config_requests + example: entity_integration_config_requests + type: string + x-enum-varnames: + - ENTITY_INTEGRATION_CONFIG_REQUESTS + EntityIntegrationConfigResponse: + description: JSON:API document containing a single entity integration configuration resource. + properties: + data: + $ref: "#/components/schemas/EntityIntegrationConfigData" + required: + - data + type: object + EntityIntegrationConfigType: + default: entity_integration_configs + description: JSON:API resource type for an entity integration configuration. Always `entity_integration_configs`. + enum: + - entity_integration_configs + example: entity_integration_configs + type: string + x-enum-varnames: + - ENTITY_INTEGRATION_CONFIGS EntityMeta: description: Entity metadata. properties: @@ -114861,6 +114966,180 @@ paths: x-unstable: |- **Note**: This endpoint is in public beta and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/idp/entity_integrations/{integration_id}: + delete: + description: Delete the configuration stored for a given integration in the caller's organization. + operationId: DeleteEntityIntegrationConfig + parameters: + - $ref: "#/components/parameters/EntityIntegrationConfigID" + responses: + "204": + description: No Content + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Delete an entity integration configuration + tags: + - Entity Integration Configs + x-permission: + operator: OR + permissions: + - manage_integrations + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + get: + description: Retrieve the configuration currently stored for a given integration in the caller's organization. + operationId: GetEntityIntegrationConfig + parameters: + - $ref: "#/components/parameters/EntityIntegrationConfigID" + responses: + "200": + content: + application/json: + example: + data: + attributes: + config: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + integration_id: github + org_id: 1234 + id: 01HJABCD12345678ABCDEFGHIJ + type: entity_integration_configs + schema: + $ref: "#/components/schemas/EntityIntegrationConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Get an entity integration configuration + tags: + - Entity Integration Configs + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + put: + description: |- + Create or replace the configuration for a given integration in the caller's organization. The shape of `data.attributes.config` depends on the integration: + + - For `github`: `config` must contain an `enabled_repos` array of objects with `hostname`, `github_org_name`, and `repo_name`. + - For `jira`: `config` must contain an `enabled_projects` array of objects with `hostname`, `account_id`, and `project_key`. + - For `pagerduty`: `config` must contain an `accounts` array of objects with a required `enabled` boolean and an optional `subdomain` string. + operationId: UpdateEntityIntegrationConfig + parameters: + - $ref: "#/components/parameters/EntityIntegrationConfigID" + requestBody: + content: + application/json: + examples: + default: + summary: GitHub integration configuration + value: + data: + attributes: + config: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + type: entity_integration_config_requests + jira: + summary: Jira integration configuration + value: + data: + attributes: + config: + enabled_projects: + - account_id: "123456789" + hostname: mycompany.atlassian.net + project_key: AAA + type: entity_integration_config_requests + pagerduty: + summary: PagerDuty integration configuration + value: + data: + attributes: + config: + accounts: + - enabled: true + subdomain: mycompany + type: entity_integration_config_requests + schema: + $ref: "#/components/schemas/EntityIntegrationConfigRequest" + required: true + responses: + "200": + content: + application/json: + example: + data: + attributes: + config: + enabled_repos: + - github_org_name: myorg + hostname: github.com + repo_name: myrepo + integration_id: github + org_id: 1234 + id: 01HJABCD12345678ABCDEFGHIJ + type: entity_integration_configs + schema: + $ref: "#/components/schemas/EntityIntegrationConfigResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "403": + $ref: "#/components/responses/NotAuthorizedResponse" + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + summary: Create or update entity integration configuration + tags: + - Entity Integration Configs + x-codegen-request-body-name: body + x-permission: + operator: OR + permissions: + - integrations_read + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/incidents: get: description: >- @@ -162239,6 +162518,8 @@ tags: scopes from alerting. Downtime settings, which can be scheduled with start and end times, prevent all alerting related to specified Datadog tags. name: Downtimes + - description: Manage per-integration configurations for the Internal Developer Portal (IDP). These configurations control which external resources (for example, GitHub repositories, Jira projects, or PagerDuty services) are synced as entities into the Software Catalog. + name: Entity Integration Configs - description: Retrieves security risk scores for entities in your organization. name: Entity Risk Scores - description: View and manage issues within Error Tracking. See the [Error Tracking page](https://docs.datadoghq.com/error_tracking/) for more information. diff --git a/examples/v2/entity-integration-configs/DeleteEntityIntegrationConfig.rb b/examples/v2/entity-integration-configs/DeleteEntityIntegrationConfig.rb new file mode 100644 index 000000000000..fb0f5c3d623e --- /dev/null +++ b/examples/v2/entity-integration-configs/DeleteEntityIntegrationConfig.rb @@ -0,0 +1,8 @@ +# Delete an entity integration configuration returns "No Content" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.delete_entity_integration_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::EntityIntegrationConfigsAPI.new +api_instance.delete_entity_integration_config("github") diff --git a/examples/v2/entity-integration-configs/GetEntityIntegrationConfig.rb b/examples/v2/entity-integration-configs/GetEntityIntegrationConfig.rb new file mode 100644 index 000000000000..6fc7d3661b08 --- /dev/null +++ b/examples/v2/entity-integration-configs/GetEntityIntegrationConfig.rb @@ -0,0 +1,8 @@ +# Get an entity integration configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_entity_integration_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::EntityIntegrationConfigsAPI.new +p api_instance.get_entity_integration_config("github") diff --git a/examples/v2/entity-integration-configs/UpdateEntityIntegrationConfig.rb b/examples/v2/entity-integration-configs/UpdateEntityIntegrationConfig.rb new file mode 100644 index 000000000000..9a6b38799038 --- /dev/null +++ b/examples/v2/entity-integration-configs/UpdateEntityIntegrationConfig.rb @@ -0,0 +1,17 @@ +# Create or update entity integration configuration returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.update_entity_integration_config".to_sym] = true +end +api_instance = DatadogAPIClient::V2::EntityIntegrationConfigsAPI.new + +body = DatadogAPIClient::V2::EntityIntegrationConfigRequest.new({ + data: DatadogAPIClient::V2::EntityIntegrationConfigRequestData.new({ + attributes: DatadogAPIClient::V2::EntityIntegrationConfigRequestAttributes.new({ + config: DatadogAPIClient::V2::EntityIntegrationConfigPayload.new({}), + }), + type: DatadogAPIClient::V2::EntityIntegrationConfigRequestType::ENTITY_INTEGRATION_CONFIG_REQUESTS, + }), +}) +p api_instance.update_entity_integration_config("github", body) diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 89ac9711f850..266953ad6e1f 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -2960,6 +2960,16 @@ "v2.CreateHamrOrgConnection" => { "body" => "HamrOrgConnectionRequest", }, + "v2.DeleteEntityIntegrationConfig" => { + "integration_id" => "String", + }, + "v2.GetEntityIntegrationConfig" => { + "integration_id" => "String", + }, + "v2.UpdateEntityIntegrationConfig" => { + "integration_id" => "String", + "body" => "EntityIntegrationConfigRequest", + }, "v2.ListIncidents" => { "include" => "Array", "page_size" => "Integer", diff --git a/features/v2/entity_integration_configs.feature b/features/v2/entity_integration_configs.feature new file mode 100644 index 000000000000..3a672f8e40c6 --- /dev/null +++ b/features/v2/entity_integration_configs.feature @@ -0,0 +1,77 @@ +@endpoint(entity-integration-configs) @endpoint(entity-integration-configs-v2) +Feature: Entity Integration Configs + Manage per-integration configurations for the Internal Developer Portal + (IDP). These configurations control which external resources (for example, + GitHub repositories, Jira projects, or PagerDuty services) are synced as + entities into the Software Catalog. + + Background: + Given a valid "apiKeyAuth" key in the system + And a valid "appKeyAuth" key in the system + And an instance of "EntityIntegrationConfigs" API + + @generated @skip @team:DataDog/idp + Scenario: Create or update entity integration configuration returns "Bad Request" response + Given operation "UpdateEntityIntegrationConfig" enabled + And new "UpdateEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"enabled_repos": [{"github_org_name": "myorg", "hostname": "github.com", "repo_name": "myrepo"}]}}, "type": "entity_integration_config_requests"}} + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/idp + Scenario: Create or update entity integration configuration returns "OK" response + Given operation "UpdateEntityIntegrationConfig" enabled + And new "UpdateEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + And body with value {"data": {"attributes": {"config": {"enabled_repos": [{"github_org_name": "myorg", "hostname": "github.com", "repo_name": "myrepo"}]}}, "type": "entity_integration_config_requests"}} + When the request is sent + Then the response status is 200 OK + + @generated @skip @team:DataDog/idp + Scenario: Delete an entity integration configuration returns "Bad Request" response + Given operation "DeleteEntityIntegrationConfig" enabled + And new "DeleteEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/idp + Scenario: Delete an entity integration configuration returns "No Content" response + Given operation "DeleteEntityIntegrationConfig" enabled + And new "DeleteEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 204 No Content + + @generated @skip @team:DataDog/idp + Scenario: Delete an entity integration configuration returns "Not Found" response + Given operation "DeleteEntityIntegrationConfig" enabled + And new "DeleteEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/idp + Scenario: Get an entity integration configuration returns "Bad Request" response + Given operation "GetEntityIntegrationConfig" enabled + And new "GetEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/idp + Scenario: Get an entity integration configuration returns "Not Found" response + Given operation "GetEntityIntegrationConfig" enabled + And new "GetEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/idp + Scenario: Get an entity integration configuration returns "OK" response + Given operation "GetEntityIntegrationConfig" enabled + And new "GetEntityIntegrationConfig" request + And request contains "integration_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK diff --git a/features/v2/undo.json b/features/v2/undo.json index e93351a7e237..4dd14e59ebdf 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -2550,6 +2550,24 @@ "type": "unsafe" } }, + "DeleteEntityIntegrationConfig": { + "tag": "Entity Integration Configs", + "undo": { + "type": "idempotent" + } + }, + "GetEntityIntegrationConfig": { + "tag": "Entity Integration Configs", + "undo": { + "type": "safe" + } + }, + "UpdateEntityIntegrationConfig": { + "tag": "Entity Integration Configs", + "undo": { + "type": "idempotent" + } + }, "ListIncidents": { "tag": "Incidents", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index bc3da069651c..935f0643cba5 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -398,6 +398,9 @@ def initialize "v2.update_deployment_rule": false, "v2.create_hamr_org_connection": false, "v2.get_hamr_org_connection": false, + "v2.delete_entity_integration_config": false, + "v2.get_entity_integration_config": false, + "v2.update_entity_integration_config": false, "v2.create_global_incident_handle": false, "v2.create_incident": false, "v2.create_incident_attachment": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index cbdb4303667a..d70a438d6ac7 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -2695,6 +2695,14 @@ def overrides "v2.entity_context_response_meta" => "EntityContextResponseMeta", "v2.entity_context_revision" => "EntityContextRevision", "v2.entity_data" => "EntityData", + "v2.entity_integration_config_attributes" => "EntityIntegrationConfigAttributes", + "v2.entity_integration_config_data" => "EntityIntegrationConfigData", + "v2.entity_integration_config_request" => "EntityIntegrationConfigRequest", + "v2.entity_integration_config_request_attributes" => "EntityIntegrationConfigRequestAttributes", + "v2.entity_integration_config_request_data" => "EntityIntegrationConfigRequestData", + "v2.entity_integration_config_request_type" => "EntityIntegrationConfigRequestType", + "v2.entity_integration_config_response" => "EntityIntegrationConfigResponse", + "v2.entity_integration_config_type" => "EntityIntegrationConfigType", "v2.entity_meta" => "EntityMeta", "v2.entity_relationships" => "EntityRelationships", "v2.entity_response_array" => "EntityResponseArray", @@ -6920,6 +6928,7 @@ def overrides "v2.domain_allowlist_api" => "DomainAllowlistAPI", "v2.dora_metrics_api" => "DORAMetricsAPI", "v2.downtimes_api" => "DowntimesAPI", + "v2.entity_integration_configs_api" => "EntityIntegrationConfigsAPI", "v2.entity_risk_scores_api" => "EntityRiskScoresAPI", "v2.error_tracking_api" => "ErrorTrackingAPI", "v2.events_api" => "EventsAPI", diff --git a/lib/datadog_api_client/v2/api/entity_integration_configs_api.rb b/lib/datadog_api_client/v2/api/entity_integration_configs_api.rb new file mode 100644 index 000000000000..d2ee8a060b71 --- /dev/null +++ b/lib/datadog_api_client/v2/api/entity_integration_configs_api.rb @@ -0,0 +1,250 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'cgi' + +module DatadogAPIClient::V2 + class EntityIntegrationConfigsAPI + attr_accessor :api_client + + def initialize(api_client = DatadogAPIClient::APIClient.default) + @api_client = api_client + end + + # Delete an entity integration configuration. + # + # @see #delete_entity_integration_config_with_http_info + def delete_entity_integration_config(integration_id, opts = {}) + delete_entity_integration_config_with_http_info(integration_id, opts) + nil + end + + # Delete an entity integration configuration. + # + # Delete the configuration stored for a given integration in the caller's organization. + # + # @param integration_id [String] The identifier of the integration whose configuration is being managed. Supported values are `github`, `jira`, and `pagerduty`. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def delete_entity_integration_config_with_http_info(integration_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.delete_entity_integration_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.delete_entity_integration_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.delete_entity_integration_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EntityIntegrationConfigsAPI.delete_entity_integration_config ...' + end + # verify the required parameter 'integration_id' is set + if @api_client.config.client_side_validation && integration_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_id' when calling EntityIntegrationConfigsAPI.delete_entity_integration_config" + end + # resource path + local_var_path = '/api/v2/idp/entity_integrations/{integration_id}'.sub('{integration_id}', CGI.escape(integration_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(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :delete_entity_integration_config, + :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::Delete, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EntityIntegrationConfigsAPI#delete_entity_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Get an entity integration configuration. + # + # @see #get_entity_integration_config_with_http_info + def get_entity_integration_config(integration_id, opts = {}) + data, _status_code, _headers = get_entity_integration_config_with_http_info(integration_id, opts) + data + end + + # Get an entity integration configuration. + # + # Retrieve the configuration currently stored for a given integration in the caller's organization. + # + # @param integration_id [String] The identifier of the integration whose configuration is being managed. Supported values are `github`, `jira`, and `pagerduty`. + # @param opts [Hash] the optional parameters + # @return [Array<(EntityIntegrationConfigResponse, Integer, Hash)>] EntityIntegrationConfigResponse data, response status code and response headers + def get_entity_integration_config_with_http_info(integration_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_entity_integration_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_entity_integration_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_entity_integration_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EntityIntegrationConfigsAPI.get_entity_integration_config ...' + end + # verify the required parameter 'integration_id' is set + if @api_client.config.client_side_validation && integration_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_id' when calling EntityIntegrationConfigsAPI.get_entity_integration_config" + end + # resource path + local_var_path = '/api/v2/idp/entity_integrations/{integration_id}'.sub('{integration_id}', CGI.escape(integration_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] || 'EntityIntegrationConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_entity_integration_config, + :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: EntityIntegrationConfigsAPI#get_entity_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + + # Create or update entity integration configuration. + # + # @see #update_entity_integration_config_with_http_info + def update_entity_integration_config(integration_id, body, opts = {}) + data, _status_code, _headers = update_entity_integration_config_with_http_info(integration_id, body, opts) + data + end + + # Create or update entity integration configuration. + # + # Create or replace the configuration for a given integration in the caller's organization. The shape of `data.attributes.config` depends on the integration: + # + # - For `github`: `config` must contain an `enabled_repos` array of objects with `hostname`, `github_org_name`, and `repo_name`. + # - For `jira`: `config` must contain an `enabled_projects` array of objects with `hostname`, `account_id`, and `project_key`. + # - For `pagerduty`: `config` must contain an `accounts` array of objects with a required `enabled` boolean and an optional `subdomain` string. + # + # @param integration_id [String] The identifier of the integration whose configuration is being managed. Supported values are `github`, `jira`, and `pagerduty`. + # @param body [EntityIntegrationConfigRequest] + # @param opts [Hash] the optional parameters + # @return [Array<(EntityIntegrationConfigResponse, Integer, Hash)>] EntityIntegrationConfigResponse data, response status code and response headers + def update_entity_integration_config_with_http_info(integration_id, body, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.update_entity_integration_config".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.update_entity_integration_config") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.update_entity_integration_config")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: EntityIntegrationConfigsAPI.update_entity_integration_config ...' + end + # verify the required parameter 'integration_id' is set + if @api_client.config.client_side_validation && integration_id.nil? + fail ArgumentError, "Missing the required parameter 'integration_id' when calling EntityIntegrationConfigsAPI.update_entity_integration_config" + 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 EntityIntegrationConfigsAPI.update_entity_integration_config" + end + # resource path + local_var_path = '/api/v2/idp/entity_integrations/{integration_id}'.sub('{integration_id}', CGI.escape(integration_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] || 'EntityIntegrationConfigResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :update_entity_integration_config, + :header_params => header_params, + :query_params => query_params, + :form_params => form_params, + :body => post_body, + :auth_names => auth_names, + :return_type => return_type, + :api_version => "V2" + ) + + data, status_code, headers = @api_client.call_api(Net::HTTP::Put, local_var_path, new_options) + if @api_client.config.debugging + @api_client.config.logger.debug "API called: EntityIntegrationConfigsAPI#update_entity_integration_config\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_integration_config_attributes.rb b/lib/datadog_api_client/v2/models/entity_integration_config_attributes.rb new file mode 100644 index 000000000000..c77f1e54f2d3 --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_integration_config_attributes.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # The organization ID, integration identifier, and integration-specific configuration payload for an entity integration configuration. + class EntityIntegrationConfigAttributes + include BaseGenericModel + + # Integration-specific configuration payload. The shape of this object depends on the integration identified by the path parameter. For `github`, the object must contain an `enabled_repos` array. For `jira`, it must contain an `enabled_projects` array. For `pagerduty`, it must contain an `accounts` array. + attr_reader :config + + # The identifier of the integration this configuration applies to (for example, `github`, `jira`, or `pagerduty`). + attr_reader :integration_id + + # The Datadog organization identifier that owns this configuration. + attr_reader :org_id + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'config' => :'config', + :'integration_id' => :'integration_id', + :'org_id' => :'org_id' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'config' => :'Hash', + :'integration_id' => :'String', + :'org_id' => :'Integer' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EntityIntegrationConfigAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'config') + self.config = attributes[:'config'] + end + + if attributes.key?(:'integration_id') + self.integration_id = attributes[:'integration_id'] + end + + if attributes.key?(:'org_id') + self.org_id = attributes[:'org_id'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @config.nil? + return false if @integration_id.nil? + return false if @org_id.nil? + true + end + + # Custom attribute writer method with validation + # @param config [Object] Object to be assigned + # @!visibility private + def config=(config) + if config.nil? + fail ArgumentError, 'invalid value for "config", config cannot be nil.' + end + @config = config + end + + # Custom attribute writer method with validation + # @param integration_id [Object] Object to be assigned + # @!visibility private + def integration_id=(integration_id) + if integration_id.nil? + fail ArgumentError, 'invalid value for "integration_id", integration_id cannot be nil.' + end + @integration_id = integration_id + end + + # Custom attribute writer method with validation + # @param org_id [Object] Object to be assigned + # @!visibility private + def org_id=(org_id) + if org_id.nil? + fail ArgumentError, 'invalid value for "org_id", org_id cannot be nil.' + end + @org_id = org_id + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + config == o.config && + integration_id == o.integration_id && + org_id == o.org_id && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [config, integration_id, org_id, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_integration_config_data.rb b/lib/datadog_api_client/v2/models/entity_integration_config_data.rb new file mode 100644 index 000000000000..9193037b9d8d --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_integration_config_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API resource object for an entity integration configuration. + class EntityIntegrationConfigData + include BaseGenericModel + + # The organization ID, integration identifier, and integration-specific configuration payload for an entity integration configuration. + attr_reader :attributes + + # Unique identifier of the entity integration configuration. + attr_reader :id + + # JSON:API resource type for an entity integration configuration. Always `entity_integration_configs`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'EntityIntegrationConfigAttributes', + :'id' => :'String', + :'type' => :'EntityIntegrationConfigType' + } + 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::EntityIntegrationConfigData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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/entity_integration_config_request.rb b/lib/datadog_api_client/v2/models/entity_integration_config_request.rb new file mode 100644 index 000000000000..08c07db7f6da --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_integration_config_request.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Request body used to create or replace the configuration for a given integration. + class EntityIntegrationConfigRequest + include BaseGenericModel + + # JSON:API resource object used in a request to create or update an entity integration configuration. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'EntityIntegrationConfigRequestData' + } + 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::EntityIntegrationConfigRequest` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_integration_config_request_attributes.rb b/lib/datadog_api_client/v2/models/entity_integration_config_request_attributes.rb new file mode 100644 index 000000000000..baaf4752f76a --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_integration_config_request_attributes.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes used to create or update an entity integration configuration. + class EntityIntegrationConfigRequestAttributes + include BaseGenericModel + + # Integration-specific configuration payload. The shape of this object depends on the integration identified by the path parameter. For `github`, the object must contain an `enabled_repos` array. For `jira`, it must contain an `enabled_projects` array. For `pagerduty`, it must contain an `accounts` array. + attr_reader :config + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'config' => :'config' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'config' => :'Hash' + } + 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::EntityIntegrationConfigRequestAttributes` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'config') + self.config = attributes[:'config'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @config.nil? + true + end + + # Custom attribute writer method with validation + # @param config [Object] Object to be assigned + # @!visibility private + def config=(config) + if config.nil? + fail ArgumentError, 'invalid value for "config", config cannot be nil.' + end + @config = config + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + config == o.config && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [config, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_integration_config_request_data.rb b/lib/datadog_api_client/v2/models/entity_integration_config_request_data.rb new file mode 100644 index 000000000000..50a454e610e5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_integration_config_request_data.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API resource object used in a request to create or update an entity integration configuration. + class EntityIntegrationConfigRequestData + include BaseGenericModel + + # Attributes used to create or update an entity integration configuration. + attr_reader :attributes + + # JSON:API resource type for the entity integration configuration create or update request. Always `entity_integration_config_requests`. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'EntityIntegrationConfigRequestAttributes', + :'type' => :'EntityIntegrationConfigRequestType' + } + 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::EntityIntegrationConfigRequestData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + type == o.type && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [attributes, type, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_integration_config_request_type.rb b/lib/datadog_api_client/v2/models/entity_integration_config_request_type.rb new file mode 100644 index 000000000000..a9a6c7cb2220 --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_integration_config_request_type.rb @@ -0,0 +1,26 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API resource type for the entity integration configuration create or update request. Always `entity_integration_config_requests`. + class EntityIntegrationConfigRequestType + include BaseEnumModel + + ENTITY_INTEGRATION_CONFIG_REQUESTS = "entity_integration_config_requests".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/entity_integration_config_response.rb b/lib/datadog_api_client/v2/models/entity_integration_config_response.rb new file mode 100644 index 000000000000..8c50f5aed0d4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_integration_config_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # JSON:API document containing a single entity integration configuration resource. + class EntityIntegrationConfigResponse + include BaseGenericModel + + # JSON:API resource object for an entity integration configuration. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'EntityIntegrationConfigData' + } + 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::EntityIntegrationConfigResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/entity_integration_config_type.rb b/lib/datadog_api_client/v2/models/entity_integration_config_type.rb new file mode 100644 index 000000000000..c5b21627ecdf --- /dev/null +++ b/lib/datadog_api_client/v2/models/entity_integration_config_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 + # JSON:API resource type for an entity integration configuration. Always `entity_integration_configs`. + class EntityIntegrationConfigType + include BaseEnumModel + + ENTITY_INTEGRATION_CONFIGS = "entity_integration_configs".freeze + end +end From f2ec0eef24e2335171d0ea6b68a296ef4d553584 Mon Sep 17 00:00:00 2001 From: "api-clients-generation-pipeline[bot]" <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 19:49:43 +0000 Subject: [PATCH 5/5] Add OpenAPI for LLM Observability dataset draft state and versions (#3374) Co-authored-by: ci.datadog-api-spec --- .generator/schemas/v2/openapi.yaml | 439 ++++++++++++++++++ .../GetLLMObsDatasetDraftState.rb | 8 + .../ListLLMObsDatasetVersions.rb | 8 + .../LockLLMObsDatasetDraftState.rb | 8 + .../UnlockLLMObsDatasetDraftState.rb | 8 + features/scenarios_model_mapping.rb | 16 + features/v2/llm_observability.feature | 108 +++++ features/v2/undo.json | 24 + lib/datadog_api_client/configuration.rb | 4 + lib/datadog_api_client/inflector.rb | 9 + .../v2/api/llm_observability_api.rb | 304 ++++++++++++ .../llm_obs_dataset_draft_state_data.rb | 165 +++++++ ...obs_dataset_draft_state_data_attributes.rb | 144 ++++++ .../llm_obs_dataset_draft_state_response.rb | 123 +++++ .../llm_obs_dataset_draft_state_type.rb | 26 ++ .../llm_obs_dataset_draft_state_user.rb | 163 +++++++ .../v2/models/llm_obs_dataset_version_data.rb | 165 +++++++ ...llm_obs_dataset_version_data_attributes.rb | 166 +++++++ .../v2/models/llm_obs_dataset_version_type.rb | 26 ++ .../llm_obs_dataset_versions_response.rb | 125 +++++ 20 files changed, 2039 insertions(+) create mode 100644 examples/v2/llm-observability/GetLLMObsDatasetDraftState.rb create mode 100644 examples/v2/llm-observability/ListLLMObsDatasetVersions.rb create mode 100644 examples/v2/llm-observability/LockLLMObsDatasetDraftState.rb create mode 100644 examples/v2/llm-observability/UnlockLLMObsDatasetDraftState.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_response.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_type.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_user.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_version_data.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_version_data_attributes.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_version_type.rb create mode 100644 lib/datadog_api_client/v2/models/llm_obs_dataset_versions_response.rb diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 8c1470bc3d08..3bd4dc4902da 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -43216,6 +43216,78 @@ components: - type - attributes type: object + LLMObsDatasetDraftStateData: + description: Data object for an LLM Observability dataset draft state. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetDraftStateDataAttributes" + id: + description: Unique identifier of the dataset draft state. Matches the dataset ID. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetDraftStateType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetDraftStateDataAttributes: + description: Attributes of an LLM Observability dataset draft state. + properties: + drafting_since: + description: Timestamp when the dataset draft session started. + example: "2024-01-15T10:30:00Z" + format: date-time + type: string + user: + $ref: "#/components/schemas/LLMObsDatasetDraftStateUser" + required: + - user + - drafting_since + type: object + LLMObsDatasetDraftStateResponse: + description: Response containing the draft state of an LLM Observability dataset. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetDraftStateData" + required: + - data + type: object + LLMObsDatasetDraftStateType: + description: Resource type of an LLM Observability dataset draft state. + enum: + - draft_state_data + example: draft_state_data + type: string + x-enum-varnames: + - DRAFT_STATE_DATA + LLMObsDatasetDraftStateUser: + description: User information associated with a dataset draft state. + properties: + email: + description: Email address of the user. + example: "jane.doe@example.com" + type: string + handle: + description: Handle of the user. + example: "jane.doe@example.com" + type: string + icon: + description: Icon for the user. + example: "" + type: string + id: + description: Unique identifier of the user holding the draft lock. + example: "00000000-0000-0000-0000-000000000010" + type: string + name: + description: Display name of the user. + example: "Jane Doe" + type: string + required: + - id + type: object LLMObsDatasetRecordDataResponse: description: A single LLM Observability dataset record. properties: @@ -43442,6 +43514,67 @@ components: required: - data type: object + LLMObsDatasetVersionData: + description: Data object for an LLM Observability dataset version. + properties: + attributes: + $ref: "#/components/schemas/LLMObsDatasetVersionDataAttributes" + id: + description: Unique identifier of the dataset version. + example: "3fd6b5e0-8910-4b1c-a7d0-5b84de329012" + type: string + type: + $ref: "#/components/schemas/LLMObsDatasetVersionType" + required: + - id + - type + - attributes + type: object + LLMObsDatasetVersionDataAttributes: + description: Attributes of an LLM Observability dataset version. + properties: + dataset_id: + description: Unique identifier of the dataset this version belongs to. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + type: string + last_used: + description: Timestamp when this dataset version was last referenced. Null if the version has never been used. + example: "2024-01-15T10:30:00Z" + format: date-time + nullable: true + type: string + version_number: + description: Sequential version number for this dataset version. + example: 1 + format: int32 + maximum: 2147483647 + type: integer + required: + - dataset_id + - version_number + - last_used + type: object + LLMObsDatasetVersionType: + description: Resource type of an LLM Observability dataset version. + enum: + - dataset_version + example: dataset_version + type: string + x-enum-varnames: + - DATASET_VERSION + LLMObsDatasetVersionsResponse: + description: Response containing the active versions of an LLM Observability dataset. + properties: + data: + $ref: "#/components/schemas/LLMObsDatasetVersionsResponseData" + required: + - data + type: object + LLMObsDatasetVersionsResponseData: + description: List of dataset versions. + items: + $ref: "#/components/schemas/LLMObsDatasetVersionData" + type: array LLMObsDatasetsResponse: description: Response containing a list of LLM Observability datasets. properties: @@ -125401,6 +125534,229 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state: + get: + description: Retrieve the draft state of a dataset, including whether it is currently locked for editing and which user holds the lock. + operationId: GetLLMObsDatasetDraftState + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + drafting_since: "2024-01-15T10:30:00Z" + user: + email: jane.doe@example.com + handle: jane.doe@example.com + id: 00000000-0000-0000-0000-000000000010 + name: Jane Doe + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: draft_state_data + schema: + $ref: "#/components/schemas/LLMObsDatasetDraftStateResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Get LLM Observability dataset draft state + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state/lock: + patch: + description: Acquire the draft lock on a dataset for the calling user. The lock prevents other users from concurrently editing the dataset draft. + operationId: LockLLMObsDatasetDraftState + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + attributes: + drafting_since: "2024-01-15T10:30:00Z" + user: + email: jane.doe@example.com + handle: jane.doe@example.com + id: 00000000-0000-0000-0000-000000000010 + name: Jane Doe + id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + type: draft_state_data + schema: + $ref: "#/components/schemas/LLMObsDatasetDraftStateResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Lock LLM Observability dataset draft state + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state/unlock: + patch: + description: Release the draft lock on a dataset held by the calling user, allowing other users to edit the dataset draft. + operationId: UnlockLLMObsDatasetDraftState + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + responses: + "200": + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: Unlock LLM Observability dataset draft state + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/records: get: description: List all records in an LLM Observability dataset, sorted by creation date, newest first. @@ -125711,6 +126067,89 @@ paths: x-unstable: |- **Note**: This endpoint is in preview and is subject to change. If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + /api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/versions: + get: + description: List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. + operationId: ListLLMObsDatasetVersions + parameters: + - description: The ID of the LLM Observability project. + example: "a33671aa-24fd-4dcd-9b33-a8ec7dde7751" + in: path + name: project_id + required: true + schema: + type: string + - description: The ID of the LLM Observability dataset. + example: "9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d" + in: path + name: dataset_id + required: true + schema: + type: string + responses: + "200": + content: + application/json: + examples: + default: + value: + data: + - attributes: + dataset_id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + last_used: "2024-01-15T10:30:00Z" + version_number: 1 + id: 3fd6b5e0-8910-4b1c-a7d0-5b84de329012 + type: dataset_version + - attributes: + dataset_id: 9f64e5c7-dc5a-45c8-a17c-1b85f0bec97d + last_used: "2024-02-20T14:45:00Z" + version_number: 2 + id: 4ee7c6f1-9a01-5c2d-b8e1-6c95ef43a123 + type: dataset_version + schema: + $ref: "#/components/schemas/LLMObsDatasetVersionsResponse" + description: OK + "400": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Bad Request + "401": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Unauthorized + "403": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Forbidden + "404": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Not Found + "429": + $ref: "#/components/responses/TooManyRequestsResponse" + "500": + content: + application/json: + schema: + $ref: "#/components/schemas/JSONAPIErrorResponse" + description: Internal Server Error + security: + - apiKeyAuth: [] + appKeyAuth: [] + summary: List LLM Observability dataset versions + tags: + - LLM Observability + x-unstable: |- + **Note**: This endpoint is in preview and is subject to change. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). /api/v2/llm-obs/v3/experiments/{experiment_id}/events: get: description: Retrieve spans and experiment-level summary metrics for a given experiment with cursor-based pagination. diff --git a/examples/v2/llm-observability/GetLLMObsDatasetDraftState.rb b/examples/v2/llm-observability/GetLLMObsDatasetDraftState.rb new file mode 100644 index 000000000000..d29bf89eab35 --- /dev/null +++ b/examples/v2/llm-observability/GetLLMObsDatasetDraftState.rb @@ -0,0 +1,8 @@ +# Get LLM Observability dataset draft state returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.get_llm_obs_dataset_draft_state".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.get_llm_obs_dataset_draft_state("project_id", "dataset_id") diff --git a/examples/v2/llm-observability/ListLLMObsDatasetVersions.rb b/examples/v2/llm-observability/ListLLMObsDatasetVersions.rb new file mode 100644 index 000000000000..dd608de96e4a --- /dev/null +++ b/examples/v2/llm-observability/ListLLMObsDatasetVersions.rb @@ -0,0 +1,8 @@ +# List LLM Observability dataset versions returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.list_llm_obs_dataset_versions".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.list_llm_obs_dataset_versions("project_id", "dataset_id") diff --git a/examples/v2/llm-observability/LockLLMObsDatasetDraftState.rb b/examples/v2/llm-observability/LockLLMObsDatasetDraftState.rb new file mode 100644 index 000000000000..2857210dce43 --- /dev/null +++ b/examples/v2/llm-observability/LockLLMObsDatasetDraftState.rb @@ -0,0 +1,8 @@ +# Lock LLM Observability dataset draft state returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.lock_llm_obs_dataset_draft_state".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.lock_llm_obs_dataset_draft_state("project_id", "dataset_id") diff --git a/examples/v2/llm-observability/UnlockLLMObsDatasetDraftState.rb b/examples/v2/llm-observability/UnlockLLMObsDatasetDraftState.rb new file mode 100644 index 000000000000..20e0c6f44b32 --- /dev/null +++ b/examples/v2/llm-observability/UnlockLLMObsDatasetDraftState.rb @@ -0,0 +1,8 @@ +# Unlock LLM Observability dataset draft state returns "OK" response + +require "datadog_api_client" +DatadogAPIClient.configure do |config| + config.unstable_operations["v2.unlock_llm_obs_dataset_draft_state".to_sym] = true +end +api_instance = DatadogAPIClient::V2::LLMObservabilityAPI.new +p api_instance.unlock_llm_obs_dataset_draft_state("project_id", "dataset_id") diff --git a/features/scenarios_model_mapping.rb b/features/scenarios_model_mapping.rb index 266953ad6e1f..027e14e188a3 100644 --- a/features/scenarios_model_mapping.rb +++ b/features/scenarios_model_mapping.rb @@ -1054,6 +1054,18 @@ "dataset_id" => "String", "body" => "LLMObsDatasetUpdateRequest", }, + "v2.GetLLMObsDatasetDraftState" => { + "project_id" => "String", + "dataset_id" => "String", + }, + "v2.LockLLMObsDatasetDraftState" => { + "project_id" => "String", + "dataset_id" => "String", + }, + "v2.UnlockLLMObsDatasetDraftState" => { + "project_id" => "String", + "dataset_id" => "String", + }, "v2.ListLLMObsDatasetRecords" => { "project_id" => "String", "dataset_id" => "String", @@ -1076,6 +1088,10 @@ "dataset_id" => "String", "body" => "LLMObsDeleteDatasetRecordsRequest", }, + "v2.ListLLMObsDatasetVersions" => { + "project_id" => "String", + "dataset_id" => "String", + }, "v2.ListLLMObsExperimentEvents" => { "experiment_id" => "String", "page_limit" => "Integer", diff --git a/features/v2/llm_observability.feature b/features/v2/llm_observability.feature index d21a1f8048c5..63b64631db28 100644 --- a/features/v2/llm_observability.feature +++ b/features/v2/llm_observability.feature @@ -417,6 +417,33 @@ Feature: LLM Observability When the request is sent Then the response status is 404 Not Found + @generated @skip @team:DataDog/ml-observability + Scenario: Get LLM Observability dataset draft state returns "Bad Request" response + Given operation "GetLLMObsDatasetDraftState" enabled + And new "GetLLMObsDatasetDraftState" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Get LLM Observability dataset draft state returns "Not Found" response + Given operation "GetLLMObsDatasetDraftState" enabled + And new "GetLLMObsDatasetDraftState" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Get LLM Observability dataset draft state returns "OK" response + Given operation "GetLLMObsDatasetDraftState" enabled + And new "GetLLMObsDatasetDraftState" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Get a custom evaluator configuration returns "Bad Request" response Given operation "GetLLMObsCustomEvalConfig" enabled @@ -538,6 +565,33 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability dataset versions returns "Bad Request" response + Given operation "ListLLMObsDatasetVersions" enabled + And new "ListLLMObsDatasetVersions" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability dataset versions returns "Not Found" response + Given operation "ListLLMObsDatasetVersions" enabled + And new "ListLLMObsDatasetVersions" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: List LLM Observability dataset versions returns "OK" response + Given operation "ListLLMObsDatasetVersions" enabled + And new "ListLLMObsDatasetVersions" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: List LLM Observability datasets returns "Bad Request" response Given operation "ListLLMObsDatasets" enabled @@ -662,6 +716,33 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Lock LLM Observability dataset draft state returns "Bad Request" response + Given operation "LockLLMObsDatasetDraftState" enabled + And new "LockLLMObsDatasetDraftState" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Lock LLM Observability dataset draft state returns "Not Found" response + Given operation "LockLLMObsDatasetDraftState" enabled + And new "LockLLMObsDatasetDraftState" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Lock LLM Observability dataset draft state returns "OK" response + Given operation "LockLLMObsDatasetDraftState" enabled + And new "LockLLMObsDatasetDraftState" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Push events for an LLM Observability experiment returns "Accepted" response Given operation "CreateLLMObsExperimentEvents" enabled @@ -765,6 +846,33 @@ Feature: LLM Observability When the request is sent Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability + Scenario: Unlock LLM Observability dataset draft state returns "Bad Request" response + Given operation "UnlockLLMObsDatasetDraftState" enabled + And new "UnlockLLMObsDatasetDraftState" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 400 Bad Request + + @generated @skip @team:DataDog/ml-observability + Scenario: Unlock LLM Observability dataset draft state returns "Not Found" response + Given operation "UnlockLLMObsDatasetDraftState" enabled + And new "UnlockLLMObsDatasetDraftState" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + + @generated @skip @team:DataDog/ml-observability + Scenario: Unlock LLM Observability dataset draft state returns "OK" response + Given operation "UnlockLLMObsDatasetDraftState" enabled + And new "UnlockLLMObsDatasetDraftState" request + And request contains "project_id" parameter from "REPLACE.ME" + And request contains "dataset_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 200 OK + @generated @skip @team:DataDog/ml-observability Scenario: Update LLM Observability dataset records returns "Bad Request" response Given operation "UpdateLLMObsDatasetRecords" enabled diff --git a/features/v2/undo.json b/features/v2/undo.json index 4dd14e59ebdf..c22b14729810 100644 --- a/features/v2/undo.json +++ b/features/v2/undo.json @@ -3943,6 +3943,24 @@ "type": "idempotent" } }, + "GetLLMObsDatasetDraftState": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, + "LockLLMObsDatasetDraftState": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, + "UnlockLLMObsDatasetDraftState": { + "tag": "LLM Observability", + "undo": { + "type": "idempotent" + } + }, "ListLLMObsDatasetRecords": { "tag": "LLM Observability", "undo": { @@ -3980,6 +3998,12 @@ "type": "unsafe" } }, + "ListLLMObsDatasetVersions": { + "tag": "LLM Observability", + "undo": { + "type": "safe" + } + }, "ListLLMObsExperimentEvents": { "tag": "LLM Observability", "undo": { diff --git a/lib/datadog_api_client/configuration.rb b/lib/datadog_api_client/configuration.rb index 935f0643cba5..36612d69b27a 100644 --- a/lib/datadog_api_client/configuration.rb +++ b/lib/datadog_api_client/configuration.rb @@ -228,18 +228,22 @@ def initialize "v2.get_llm_obs_annotated_interactions_by_trace_i_ds": false, "v2.get_llm_obs_annotation_queue_label_schema": false, "v2.get_llm_obs_custom_eval_config": false, + "v2.get_llm_obs_dataset_draft_state": false, "v2.list_llm_obs_annotation_queues": false, "v2.list_llm_obs_dataset_records": false, "v2.list_llm_obs_datasets": false, + "v2.list_llm_obs_dataset_versions": false, "v2.list_llm_obs_experiment_events": false, "v2.list_llm_obs_experiments": false, "v2.list_llm_obs_integration_accounts": false, "v2.list_llm_obs_integration_models": false, "v2.list_llm_obs_projects": false, "v2.list_llm_obs_spans": false, + "v2.lock_llm_obs_dataset_draft_state": false, "v2.search_llm_obs_experimentation": false, "v2.search_llm_obs_spans": false, "v2.simple_search_llm_obs_experimentation": false, + "v2.unlock_llm_obs_dataset_draft_state": false, "v2.update_llm_obs_annotation_queue": false, "v2.update_llm_obs_annotation_queue_label_schema": false, "v2.update_llm_obs_custom_eval_config": false, diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index d70a438d6ac7..c18b7bd45b71 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -3796,6 +3796,11 @@ def overrides "v2.llm_obs_dataset_data_attributes_response" => "LLMObsDatasetDataAttributesResponse", "v2.llm_obs_dataset_data_request" => "LLMObsDatasetDataRequest", "v2.llm_obs_dataset_data_response" => "LLMObsDatasetDataResponse", + "v2.llm_obs_dataset_draft_state_data" => "LLMObsDatasetDraftStateData", + "v2.llm_obs_dataset_draft_state_data_attributes" => "LLMObsDatasetDraftStateDataAttributes", + "v2.llm_obs_dataset_draft_state_response" => "LLMObsDatasetDraftStateResponse", + "v2.llm_obs_dataset_draft_state_type" => "LLMObsDatasetDraftStateType", + "v2.llm_obs_dataset_draft_state_user" => "LLMObsDatasetDraftStateUser", "v2.llm_obs_dataset_record_data_response" => "LLMObsDatasetRecordDataResponse", "v2.llm_obs_dataset_record_item" => "LLMObsDatasetRecordItem", "v2.llm_obs_dataset_records_data_attributes_request" => "LLMObsDatasetRecordsDataAttributesRequest", @@ -3815,6 +3820,10 @@ def overrides "v2.llm_obs_dataset_update_data_attributes_request" => "LLMObsDatasetUpdateDataAttributesRequest", "v2.llm_obs_dataset_update_data_request" => "LLMObsDatasetUpdateDataRequest", "v2.llm_obs_dataset_update_request" => "LLMObsDatasetUpdateRequest", + "v2.llm_obs_dataset_version_data" => "LLMObsDatasetVersionData", + "v2.llm_obs_dataset_version_data_attributes" => "LLMObsDatasetVersionDataAttributes", + "v2.llm_obs_dataset_versions_response" => "LLMObsDatasetVersionsResponse", + "v2.llm_obs_dataset_version_type" => "LLMObsDatasetVersionType", "v2.llm_obs_delete_annotation_queue_interactions_data_attributes_request" => "LLMObsDeleteAnnotationQueueInteractionsDataAttributesRequest", "v2.llm_obs_delete_annotation_queue_interactions_data_request" => "LLMObsDeleteAnnotationQueueInteractionsDataRequest", "v2.llm_obs_delete_annotation_queue_interactions_request" => "LLMObsDeleteAnnotationQueueInteractionsRequest", diff --git a/lib/datadog_api_client/v2/api/llm_observability_api.rb b/lib/datadog_api_client/v2/api/llm_observability_api.rb index b6e0f54ee607..64031b0dcacc 100644 --- a/lib/datadog_api_client/v2/api/llm_observability_api.rb +++ b/lib/datadog_api_client/v2/api/llm_observability_api.rb @@ -1637,6 +1637,82 @@ def get_llm_obs_custom_eval_config_with_http_info(eval_name, opts = {}) return data, status_code, headers end + # Get LLM Observability dataset draft state. + # + # @see #get_llm_obs_dataset_draft_state_with_http_info + def get_llm_obs_dataset_draft_state(project_id, dataset_id, opts = {}) + data, _status_code, _headers = get_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts) + data + end + + # Get LLM Observability dataset draft state. + # + # Retrieve the draft state of a dataset, including whether it is currently locked for editing and which user holds the lock. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDatasetDraftStateResponse, Integer, Hash)>] LLMObsDatasetDraftStateResponse data, response status code and response headers + def get_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.get_llm_obs_dataset_draft_state".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.get_llm_obs_dataset_draft_state") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.get_llm_obs_dataset_draft_state")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.get_llm_obs_dataset_draft_state ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.get_llm_obs_dataset_draft_state" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.get_llm_obs_dataset_draft_state" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_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] || 'LLMObsDatasetDraftStateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :get_llm_obs_dataset_draft_state, + :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: LLMObservabilityAPI#get_llm_obs_dataset_draft_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List LLM Observability annotation queues. # # @see #list_llm_obs_annotation_queues_with_http_info @@ -1870,6 +1946,82 @@ def list_llm_obs_datasets_with_http_info(project_id, opts = {}) return data, status_code, headers end + # List LLM Observability dataset versions. + # + # @see #list_llm_obs_dataset_versions_with_http_info + def list_llm_obs_dataset_versions(project_id, dataset_id, opts = {}) + data, _status_code, _headers = list_llm_obs_dataset_versions_with_http_info(project_id, dataset_id, opts) + data + end + + # List LLM Observability dataset versions. + # + # List the active versions of a dataset. A version is created each time a dataset is referenced by an experiment run. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDatasetVersionsResponse, Integer, Hash)>] LLMObsDatasetVersionsResponse data, response status code and response headers + def list_llm_obs_dataset_versions_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.list_llm_obs_dataset_versions".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.list_llm_obs_dataset_versions") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.list_llm_obs_dataset_versions")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.list_llm_obs_dataset_versions ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.list_llm_obs_dataset_versions" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.list_llm_obs_dataset_versions" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/versions'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_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] || 'LLMObsDatasetVersionsResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :list_llm_obs_dataset_versions, + :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: LLMObservabilityAPI#list_llm_obs_dataset_versions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # List events for an LLM Observability experiment. # # @see #list_llm_obs_experiment_events_with_http_info @@ -2342,6 +2494,82 @@ def list_llm_obs_spans_with_http_info(opts = {}) return data, status_code, headers end + # Lock LLM Observability dataset draft state. + # + # @see #lock_llm_obs_dataset_draft_state_with_http_info + def lock_llm_obs_dataset_draft_state(project_id, dataset_id, opts = {}) + data, _status_code, _headers = lock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts) + data + end + + # Lock LLM Observability dataset draft state. + # + # Acquire the draft lock on a dataset for the calling user. The lock prevents other users from concurrently editing the dataset draft. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param opts [Hash] the optional parameters + # @return [Array<(LLMObsDatasetDraftStateResponse, Integer, Hash)>] LLMObsDatasetDraftStateResponse data, response status code and response headers + def lock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.lock_llm_obs_dataset_draft_state".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.lock_llm_obs_dataset_draft_state") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.lock_llm_obs_dataset_draft_state")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.lock_llm_obs_dataset_draft_state ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.lock_llm_obs_dataset_draft_state" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.lock_llm_obs_dataset_draft_state" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state/lock'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_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] || 'LLMObsDatasetDraftStateResponse' + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :lock_llm_obs_dataset_draft_state, + :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: LLMObservabilityAPI#lock_llm_obs_dataset_draft_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Search LLM Observability experimentation entities. # # @see #search_llm_obs_experimentation_with_http_info @@ -2568,6 +2796,82 @@ def simple_search_llm_obs_experimentation_with_http_info(body, opts = {}) return data, status_code, headers end + # Unlock LLM Observability dataset draft state. + # + # @see #unlock_llm_obs_dataset_draft_state_with_http_info + def unlock_llm_obs_dataset_draft_state(project_id, dataset_id, opts = {}) + unlock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts) + nil + end + + # Unlock LLM Observability dataset draft state. + # + # Release the draft lock on a dataset held by the calling user, allowing other users to edit the dataset draft. + # + # @param project_id [String] The ID of the LLM Observability project. + # @param dataset_id [String] The ID of the LLM Observability dataset. + # @param opts [Hash] the optional parameters + # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers + def unlock_llm_obs_dataset_draft_state_with_http_info(project_id, dataset_id, opts = {}) + unstable_enabled = @api_client.config.unstable_operations["v2.unlock_llm_obs_dataset_draft_state".to_sym] + if unstable_enabled + @api_client.config.logger.warn format("Using unstable operation '%s'", "v2.unlock_llm_obs_dataset_draft_state") + else + raise DatadogAPIClient::APIError.new(message: format("Unstable operation '%s' is disabled", "v2.unlock_llm_obs_dataset_draft_state")) + end + + if @api_client.config.debugging + @api_client.config.logger.debug 'Calling API: LLMObservabilityAPI.unlock_llm_obs_dataset_draft_state ...' + end + # verify the required parameter 'project_id' is set + if @api_client.config.client_side_validation && project_id.nil? + fail ArgumentError, "Missing the required parameter 'project_id' when calling LLMObservabilityAPI.unlock_llm_obs_dataset_draft_state" + end + # verify the required parameter 'dataset_id' is set + if @api_client.config.client_side_validation && dataset_id.nil? + fail ArgumentError, "Missing the required parameter 'dataset_id' when calling LLMObservabilityAPI.unlock_llm_obs_dataset_draft_state" + end + # resource path + local_var_path = '/api/v2/llm-obs/v1/{project_id}/datasets/{dataset_id}/draft_state/unlock'.sub('{project_id}', CGI.escape(project_id.to_s).gsub('%2F', '/')).sub('{dataset_id}', CGI.escape(dataset_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(['*/*']) + + # form parameters + form_params = opts[:form_params] || {} + + # http body (model) + post_body = opts[:debug_body] + + # return_type + return_type = opts[:debug_return_type] + + # auth_names + auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth] + + new_options = opts.merge( + :operation => :unlock_llm_obs_dataset_draft_state, + :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: LLMObservabilityAPI#unlock_llm_obs_dataset_draft_state\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" + end + return data, status_code, headers + end + # Update an LLM Observability annotation queue. # # @see #update_llm_obs_annotation_queue_with_http_info diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data.rb new file mode 100644 index 000000000000..71b925e6c19c --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for an LLM Observability dataset draft state. + class LLMObsDatasetDraftStateData + include BaseGenericModel + + # Attributes of an LLM Observability dataset draft state. + attr_reader :attributes + + # Unique identifier of the dataset draft state. Matches the dataset ID. + attr_reader :id + + # Resource type of an LLM Observability dataset draft state. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsDatasetDraftStateDataAttributes', + :'id' => :'String', + :'type' => :'LLMObsDatasetDraftStateType' + } + 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::LLMObsDatasetDraftStateData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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/llm_obs_dataset_draft_state_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data_attributes.rb new file mode 100644 index 000000000000..b6973ca4ff60 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_data_attributes.rb @@ -0,0 +1,144 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Attributes of an LLM Observability dataset draft state. + class LLMObsDatasetDraftStateDataAttributes + include BaseGenericModel + + # Timestamp when the dataset draft session started. + attr_reader :drafting_since + + # User information associated with a dataset draft state. + attr_reader :user + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'drafting_since' => :'drafting_since', + :'user' => :'user' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'drafting_since' => :'Time', + :'user' => :'LLMObsDatasetDraftStateUser' + } + 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::LLMObsDatasetDraftStateDataAttributes` 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?(:'drafting_since') + self.drafting_since = attributes[:'drafting_since'] + end + + if attributes.key?(:'user') + self.user = attributes[:'user'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @drafting_since.nil? + return false if @user.nil? + true + end + + # Custom attribute writer method with validation + # @param drafting_since [Object] Object to be assigned + # @!visibility private + def drafting_since=(drafting_since) + if drafting_since.nil? + fail ArgumentError, 'invalid value for "drafting_since", drafting_since cannot be nil.' + end + @drafting_since = drafting_since + end + + # Custom attribute writer method with validation + # @param user [Object] Object to be assigned + # @!visibility private + def user=(user) + if user.nil? + fail ArgumentError, 'invalid value for "user", user cannot be nil.' + end + @user = user + 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 && + drafting_since == o.drafting_since && + user == o.user && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [drafting_since, user, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_response.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_response.rb new file mode 100644 index 000000000000..145d689044b6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_response.rb @@ -0,0 +1,123 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Response containing the draft state of an LLM Observability dataset. + class LLMObsDatasetDraftStateResponse + include BaseGenericModel + + # Data object for an LLM Observability dataset draft state. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'LLMObsDatasetDraftStateData' + } + 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::LLMObsDatasetDraftStateResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + self.data = attributes[:'data'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_type.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_type.rb new file mode 100644 index 000000000000..97ce4ee4e2d5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_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 + # Resource type of an LLM Observability dataset draft state. + class LLMObsDatasetDraftStateType + include BaseEnumModel + + DRAFT_STATE_DATA = "draft_state_data".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_user.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_user.rb new file mode 100644 index 000000000000..6b3b133809f4 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_draft_state_user.rb @@ -0,0 +1,163 @@ +=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 + # User information associated with a dataset draft state. + class LLMObsDatasetDraftStateUser + include BaseGenericModel + + # Email address of the user. + attr_accessor :email + + # Handle of the user. + attr_accessor :handle + + # Icon for the user. + attr_accessor :icon + + # Unique identifier of the user holding the draft lock. + attr_reader :id + + # Display name of the user. + attr_accessor :name + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'email' => :'email', + :'handle' => :'handle', + :'icon' => :'icon', + :'id' => :'id', + :'name' => :'name' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'email' => :'String', + :'handle' => :'String', + :'icon' => :'String', + :'id' => :'String', + :'name' => :'String' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetDraftStateUser` 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?(:'email') + self.email = attributes[:'email'] + end + + if attributes.key?(:'handle') + self.handle = attributes[:'handle'] + end + + if attributes.key?(:'icon') + self.icon = attributes[:'icon'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @id.nil? + true + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # 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 && + email == o.email && + handle == o.handle && + icon == o.icon && + id == o.id && + name == o.name && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [email, handle, icon, id, name, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data.rb new file mode 100644 index 000000000000..4c42260a82c6 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V2 Collection + +#Collection of all Datadog Public endpoints. + +The version of the OpenAPI document: 1.0 +Contact: support@datadoghq.com +Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator + + Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + This product includes software developed at Datadog (https://www.datadoghq.com/). + Copyright 2020-Present Datadog, Inc. + +=end + +require 'date' +require 'time' + +module DatadogAPIClient::V2 + # Data object for an LLM Observability dataset version. + class LLMObsDatasetVersionData + include BaseGenericModel + + # Attributes of an LLM Observability dataset version. + attr_reader :attributes + + # Unique identifier of the dataset version. + attr_reader :id + + # Resource type of an LLM Observability dataset version. + attr_reader :type + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'attributes' => :'attributes', + :'id' => :'id', + :'type' => :'type' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'attributes' => :'LLMObsDatasetVersionDataAttributes', + :'id' => :'String', + :'type' => :'LLMObsDatasetVersionType' + } + 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::LLMObsDatasetVersionData` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'attributes') + self.attributes = attributes[:'attributes'] + end + + if attributes.key?(:'id') + self.id = attributes[:'id'] + end + + if attributes.key?(:'type') + self.type = attributes[:'type'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @attributes.nil? + return false if @id.nil? + return false if @type.nil? + true + end + + # Custom attribute writer method with validation + # @param attributes [Object] Object to be assigned + # @!visibility private + def attributes=(attributes) + if attributes.nil? + fail ArgumentError, 'invalid value for "attributes", attributes cannot be nil.' + end + @attributes = attributes + end + + # Custom attribute writer method with validation + # @param id [Object] Object to be assigned + # @!visibility private + def id=(id) + if id.nil? + fail ArgumentError, 'invalid value for "id", id cannot be nil.' + end + @id = id + end + + # Custom attribute writer method with validation + # @param type [Object] Object to be assigned + # @!visibility private + def type=(type) + if type.nil? + fail ArgumentError, 'invalid value for "type", type cannot be nil.' + end + @type = type + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + attributes == o.attributes && + 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/llm_obs_dataset_version_data_attributes.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data_attributes.rb new file mode 100644 index 000000000000..f45ae7dd8ed5 --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_data_attributes.rb @@ -0,0 +1,166 @@ +=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 + # Attributes of an LLM Observability dataset version. + class LLMObsDatasetVersionDataAttributes + include BaseGenericModel + + # Unique identifier of the dataset this version belongs to. + attr_reader :dataset_id + + # Timestamp when this dataset version was last referenced. Null if the version has never been used. + attr_accessor :last_used + + # Sequential version number for this dataset version. + attr_reader :version_number + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'dataset_id' => :'dataset_id', + :'last_used' => :'last_used', + :'version_number' => :'version_number' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'dataset_id' => :'String', + :'last_used' => :'Time', + :'version_number' => :'Integer' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'last_used', + ]) + 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::LLMObsDatasetVersionDataAttributes` 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?(:'dataset_id') + self.dataset_id = attributes[:'dataset_id'] + end + + if attributes.key?(:'last_used') + self.last_used = attributes[:'last_used'] + end + + if attributes.key?(:'version_number') + self.version_number = attributes[:'version_number'] + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @dataset_id.nil? + return false if @version_number.nil? + return false if @version_number > 2147483647 + true + end + + # Custom attribute writer method with validation + # @param dataset_id [Object] Object to be assigned + # @!visibility private + def dataset_id=(dataset_id) + if dataset_id.nil? + fail ArgumentError, 'invalid value for "dataset_id", dataset_id cannot be nil.' + end + @dataset_id = dataset_id + end + + # Custom attribute writer method with validation + # @param version_number [Object] Object to be assigned + # @!visibility private + def version_number=(version_number) + if version_number.nil? + fail ArgumentError, 'invalid value for "version_number", version_number cannot be nil.' + end + if version_number > 2147483647 + fail ArgumentError, 'invalid value for "version_number", must be smaller than or equal to 2147483647.' + end + @version_number = version_number + 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 && + dataset_id == o.dataset_id && + last_used == o.last_used && + version_number == o.version_number && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [dataset_id, last_used, version_number, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_version_type.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_type.rb new file mode 100644 index 000000000000..f3f7baa282da --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_version_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 + # Resource type of an LLM Observability dataset version. + class LLMObsDatasetVersionType + include BaseEnumModel + + DATASET_VERSION = "dataset_version".freeze + end +end diff --git a/lib/datadog_api_client/v2/models/llm_obs_dataset_versions_response.rb b/lib/datadog_api_client/v2/models/llm_obs_dataset_versions_response.rb new file mode 100644 index 000000000000..45b1a9399e3b --- /dev/null +++ b/lib/datadog_api_client/v2/models/llm_obs_dataset_versions_response.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 containing the active versions of an LLM Observability dataset. + class LLMObsDatasetVersionsResponse + include BaseGenericModel + + # List of dataset versions. + attr_reader :data + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'data' => :'data' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'data' => :'Array' + } + end + + # Initializes the object + # @param attributes [Hash] Model attributes in the form of hash + # @!visibility private + def initialize(attributes = {}) + if (!attributes.is_a?(Hash)) + fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::LLMObsDatasetVersionsResponse` initialize method" + end + + self.additional_properties = {} + # check to see if the attribute exists and convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| + if (!self.class.attribute_map.key?(k.to_sym)) + self.additional_properties[k.to_sym] = v + else + h[k.to_sym] = v + end + } + + if attributes.key?(:'data') + if (value = attributes[:'data']).is_a?(Array) + self.data = value + end + end + end + + # Check to see if the all the properties in the model are valid + # @return true if the model is valid + # @!visibility private + def valid? + return false if @data.nil? + true + end + + # Custom attribute writer method with validation + # @param data [Object] Object to be assigned + # @!visibility private + def data=(data) + if data.nil? + fail ArgumentError, 'invalid value for "data", data cannot be nil.' + end + @data = data + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + data == o.data && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [data, additional_properties].hash + end + end +end