From 84949121b251fd13d294c3b64e7761a56e87d67d Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Tue, 24 Feb 2026 17:31:03 +0000 Subject: [PATCH] Regenerate client from commit 763f869 of spec repo --- .generator/schemas/v1/openapi.yaml | 63 +++++++ features/v1/notebooks.feature | 8 +- lib/datadog_api_client/inflector.rb | 1 + .../models/notebook_create_data_attributes.rb | 14 +- .../v1/models/notebook_template_variable.rb | 165 ++++++++++++++++++ .../models/notebook_update_data_attributes.rb | 14 +- .../notebooks_response_data_attributes.rb | 14 +- 7 files changed, 272 insertions(+), 7 deletions(-) create mode 100644 lib/datadog_api_client/v1/models/notebook_template_variable.rb diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index bf2effce6326..82c52f0447da 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -10354,6 +10354,16 @@ components: type: string status: $ref: '#/components/schemas/NotebookStatus' + template_variables: + description: List of template variables for this notebook. + example: + - available_values: [] + default: '*' + name: host + prefix: host + items: + $ref: '#/components/schemas/NotebookTemplateVariable' + type: array time: $ref: '#/components/schemas/NotebookGlobalTime' required: @@ -10657,6 +10667,39 @@ components: type: string x-enum-varnames: - PUBLISHED + NotebookTemplateVariable: + description: Template variable for a notebook. + properties: + available_values: + description: The list of values that the template variable drop-down is + limited to. + example: + - my-host + - host1 + - host2 + items: + description: Template variable value. + type: string + nullable: true + type: array + default: + description: The default value for the template variable. + example: '*' + nullable: true + type: string + name: + description: The name of the variable. + example: host + type: string + prefix: + description: The tag prefix associated with the variable. Only tags with + this prefix appear in the variable drop-down. + example: host + nullable: true + type: string + required: + - name + type: object NotebookTimeseriesCellAttributes: description: The attributes of a notebook `timeseries` cell. properties: @@ -10760,6 +10803,16 @@ components: type: string status: $ref: '#/components/schemas/NotebookStatus' + template_variables: + description: List of template variables for this notebook. + example: + - available_values: [] + default: '*' + name: host + prefix: host + items: + $ref: '#/components/schemas/NotebookTemplateVariable' + type: array time: $ref: '#/components/schemas/NotebookGlobalTime' required: @@ -10836,6 +10889,16 @@ components: type: string status: $ref: '#/components/schemas/NotebookStatus' + template_variables: + description: List of template variables for this notebook. + example: + - available_values: [] + default: '*' + name: host + prefix: host + items: + $ref: '#/components/schemas/NotebookTemplateVariable' + type: array time: $ref: '#/components/schemas/NotebookGlobalTime' required: diff --git a/features/v1/notebooks.feature b/features/v1/notebooks.feature index 3ff8343c9b19..6c361af0d67c 100644 --- a/features/v1/notebooks.feature +++ b/features/v1/notebooks.feature @@ -13,7 +13,7 @@ Feature: Notebooks @generated @skip @team:DataDog/notebooks Scenario: Create a notebook returns "Bad Request" response Given new "CreateNotebook" request - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 400 Bad Request @@ -98,7 +98,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Bad Request" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 400 Bad Request @@ -106,7 +106,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Conflict" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 409 Conflict @@ -114,7 +114,7 @@ Feature: Notebooks Scenario: Update a notebook returns "Not Found" response Given new "UpdateNotebook" request And request contains "notebook_id" parameter from "REPLACE.ME" - And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "time": {"live_span": "1h"}}, "type": "notebooks"}} + And body with value {"data": {"attributes": {"cells": [{"attributes": {"definition": {"text": "## Some test markdown\n\n```\nvar x, y;\nx = 5;\ny = 6;\n```", "type": "markdown"}}, "id": "bzbycoya", "type": "notebook_cells"}, {"attributes": {"definition": {"requests": [{"display_type": "line", "q": "avg:system.load.1{*}", "style": {"line_type": "solid", "line_width": "normal", "palette": "dog_classic"}}], "show_legend": true, "type": "timeseries", "yaxis": {"scale": "linear"}}, "graph_size": "m", "split_by": {"keys": [], "tags": []}, "time": null}, "id": "9k6bc6xc", "type": "notebook_cells"}], "metadata": {"is_template": false, "take_snapshots": false, "type": "investigation"}, "name": "Example Notebook", "status": "published", "template_variables": [{"available_values": [], "default": "*", "name": "host", "prefix": "host"}], "time": {"live_span": "1h"}}, "type": "notebooks"}} When the request is sent Then the response status is 404 Not Found diff --git a/lib/datadog_api_client/inflector.rb b/lib/datadog_api_client/inflector.rb index 938494f8610d..e441b7155eb8 100644 --- a/lib/datadog_api_client/inflector.rb +++ b/lib/datadog_api_client/inflector.rb @@ -421,6 +421,7 @@ def overrides "v1.notebooks_response_meta" => "NotebooksResponseMeta", "v1.notebooks_response_page" => "NotebooksResponsePage", "v1.notebook_status" => "NotebookStatus", + "v1.notebook_template_variable" => "NotebookTemplateVariable", "v1.notebook_timeseries_cell_attributes" => "NotebookTimeseriesCellAttributes", "v1.notebook_toplist_cell_attributes" => "NotebookToplistCellAttributes", "v1.notebook_update_cell" => "NotebookUpdateCell", diff --git a/lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb b/lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb index c542cd2793fd..1996eecc61f7 100644 --- a/lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb +++ b/lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb @@ -33,6 +33,9 @@ class NotebookCreateDataAttributes # Publication status of the notebook. For now, always "published". attr_accessor :status + # List of template variables for this notebook. + attr_accessor :template_variables + # Notebook global timeframe. attr_reader :time @@ -46,6 +49,7 @@ def self.attribute_map :'metadata' => :'metadata', :'name' => :'name', :'status' => :'status', + :'template_variables' => :'template_variables', :'time' => :'time' } end @@ -58,6 +62,7 @@ def self.openapi_types :'metadata' => :'NotebookMetadata', :'name' => :'String', :'status' => :'NotebookStatus', + :'template_variables' => :'Array', :'time' => :'NotebookGlobalTime' } end @@ -98,6 +103,12 @@ def initialize(attributes = {}) self.status = attributes[:'status'] end + if attributes.key?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + if attributes.key?(:'time') self.time = attributes[:'time'] end @@ -181,6 +192,7 @@ def ==(o) metadata == o.metadata && name == o.name && status == o.status && + template_variables == o.template_variables && time == o.time && additional_properties == o.additional_properties end @@ -189,7 +201,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [cells, metadata, name, status, time, additional_properties].hash + [cells, metadata, name, status, template_variables, time, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/notebook_template_variable.rb b/lib/datadog_api_client/v1/models/notebook_template_variable.rb new file mode 100644 index 000000000000..811fc18b8df3 --- /dev/null +++ b/lib/datadog_api_client/v1/models/notebook_template_variable.rb @@ -0,0 +1,165 @@ +=begin +#Datadog API V1 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::V1 + # Template variable for a notebook. + class NotebookTemplateVariable + include BaseGenericModel + + # The list of values that the template variable drop-down is limited to. + attr_accessor :available_values + + # The default value for the template variable. + attr_accessor :default + + # The name of the variable. + attr_reader :name + + # The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down. + attr_accessor :prefix + + attr_accessor :additional_properties + + # Attribute mapping from ruby-style variable name to JSON key. + # @!visibility private + def self.attribute_map + { + :'available_values' => :'available_values', + :'default' => :'default', + :'name' => :'name', + :'prefix' => :'prefix' + } + end + + # Attribute type mapping. + # @!visibility private + def self.openapi_types + { + :'available_values' => :'Array', + :'default' => :'String', + :'name' => :'String', + :'prefix' => :'String' + } + end + + # List of attributes with nullable: true + # @!visibility private + def self.openapi_nullable + Set.new([ + :'available_values', + :'default', + :'prefix', + ]) + 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::V1::NotebookTemplateVariable` 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?(:'available_values') + if (value = attributes[:'available_values']).is_a?(Array) + self.available_values = value + end + end + + if attributes.key?(:'default') + self.default = attributes[:'default'] + end + + if attributes.key?(:'name') + self.name = attributes[:'name'] + end + + if attributes.key?(:'prefix') + self.prefix = attributes[:'prefix'] + 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 @name.nil? + true + end + + # Custom attribute writer method with validation + # @param name [Object] Object to be assigned + # @!visibility private + def name=(name) + if name.nil? + fail ArgumentError, 'invalid value for "name", name cannot be nil.' + end + @name = name + end + + # Returns the object in the form of hash, with additionalProperties support. + # @return [Hash] Returns the object in the form of hash + # @!visibility private + def to_hash + hash = {} + self.class.attribute_map.each_pair do |attr, param| + value = self.send(attr) + if value.nil? + is_nullable = self.class.openapi_nullable.include?(attr) + next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) + end + + hash[param] = _to_hash(value) + end + self.additional_properties.each_pair do |attr, value| + hash[attr] = value + end + hash + end + + # Checks equality by comparing each attribute. + # @param o [Object] Object to be compared + # @!visibility private + def ==(o) + return true if self.equal?(o) + self.class == o.class && + available_values == o.available_values && + default == o.default && + name == o.name && + prefix == o.prefix && + additional_properties == o.additional_properties + end + + # Calculates hash code according to all attributes. + # @return [Integer] Hash code + # @!visibility private + def hash + [available_values, default, name, prefix, additional_properties].hash + end + end +end diff --git a/lib/datadog_api_client/v1/models/notebook_update_data_attributes.rb b/lib/datadog_api_client/v1/models/notebook_update_data_attributes.rb index 179cbdabf070..2e2499f13ab5 100644 --- a/lib/datadog_api_client/v1/models/notebook_update_data_attributes.rb +++ b/lib/datadog_api_client/v1/models/notebook_update_data_attributes.rb @@ -33,6 +33,9 @@ class NotebookUpdateDataAttributes # Publication status of the notebook. For now, always "published". attr_accessor :status + # List of template variables for this notebook. + attr_accessor :template_variables + # Notebook global timeframe. attr_reader :time @@ -46,6 +49,7 @@ def self.attribute_map :'metadata' => :'metadata', :'name' => :'name', :'status' => :'status', + :'template_variables' => :'template_variables', :'time' => :'time' } end @@ -58,6 +62,7 @@ def self.openapi_types :'metadata' => :'NotebookMetadata', :'name' => :'String', :'status' => :'NotebookStatus', + :'template_variables' => :'Array', :'time' => :'NotebookGlobalTime' } end @@ -98,6 +103,12 @@ def initialize(attributes = {}) self.status = attributes[:'status'] end + if attributes.key?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + if attributes.key?(:'time') self.time = attributes[:'time'] end @@ -181,6 +192,7 @@ def ==(o) metadata == o.metadata && name == o.name && status == o.status && + template_variables == o.template_variables && time == o.time && additional_properties == o.additional_properties end @@ -189,7 +201,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [cells, metadata, name, status, time, additional_properties].hash + [cells, metadata, name, status, template_variables, time, additional_properties].hash end end end diff --git a/lib/datadog_api_client/v1/models/notebooks_response_data_attributes.rb b/lib/datadog_api_client/v1/models/notebooks_response_data_attributes.rb index 8e361561671e..4e210c7e1f08 100644 --- a/lib/datadog_api_client/v1/models/notebooks_response_data_attributes.rb +++ b/lib/datadog_api_client/v1/models/notebooks_response_data_attributes.rb @@ -42,6 +42,9 @@ class NotebooksResponseDataAttributes # Publication status of the notebook. For now, always "published". attr_accessor :status + # List of template variables for this notebook. + attr_accessor :template_variables + # Notebook global timeframe. attr_accessor :time @@ -58,6 +61,7 @@ def self.attribute_map :'modified' => :'modified', :'name' => :'name', :'status' => :'status', + :'template_variables' => :'template_variables', :'time' => :'time' } end @@ -73,6 +77,7 @@ def self.openapi_types :'modified' => :'Time', :'name' => :'String', :'status' => :'NotebookStatus', + :'template_variables' => :'Array', :'time' => :'NotebookGlobalTime' } end @@ -125,6 +130,12 @@ def initialize(attributes = {}) self.status = attributes[:'status'] end + if attributes.key?(:'template_variables') + if (value = attributes[:'template_variables']).is_a?(Array) + self.template_variables = value + end + end + if attributes.key?(:'time') self.time = attributes[:'time'] end @@ -189,6 +200,7 @@ def ==(o) modified == o.modified && name == o.name && status == o.status && + template_variables == o.template_variables && time == o.time && additional_properties == o.additional_properties end @@ -197,7 +209,7 @@ def ==(o) # @return [Integer] Hash code # @!visibility private def hash - [author, cells, created, metadata, modified, name, status, time, additional_properties].hash + [author, cells, created, metadata, modified, name, status, template_variables, time, additional_properties].hash end end end