Skip to content

Commit 8494912

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 763f869 of spec repo
1 parent 9303913 commit 8494912

7 files changed

Lines changed: 272 additions & 7 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10354,6 +10354,16 @@ components:
1035410354
type: string
1035510355
status:
1035610356
$ref: '#/components/schemas/NotebookStatus'
10357+
template_variables:
10358+
description: List of template variables for this notebook.
10359+
example:
10360+
- available_values: []
10361+
default: '*'
10362+
name: host
10363+
prefix: host
10364+
items:
10365+
$ref: '#/components/schemas/NotebookTemplateVariable'
10366+
type: array
1035710367
time:
1035810368
$ref: '#/components/schemas/NotebookGlobalTime'
1035910369
required:
@@ -10657,6 +10667,39 @@ components:
1065710667
type: string
1065810668
x-enum-varnames:
1065910669
- PUBLISHED
10670+
NotebookTemplateVariable:
10671+
description: Template variable for a notebook.
10672+
properties:
10673+
available_values:
10674+
description: The list of values that the template variable drop-down is
10675+
limited to.
10676+
example:
10677+
- my-host
10678+
- host1
10679+
- host2
10680+
items:
10681+
description: Template variable value.
10682+
type: string
10683+
nullable: true
10684+
type: array
10685+
default:
10686+
description: The default value for the template variable.
10687+
example: '*'
10688+
nullable: true
10689+
type: string
10690+
name:
10691+
description: The name of the variable.
10692+
example: host
10693+
type: string
10694+
prefix:
10695+
description: The tag prefix associated with the variable. Only tags with
10696+
this prefix appear in the variable drop-down.
10697+
example: host
10698+
nullable: true
10699+
type: string
10700+
required:
10701+
- name
10702+
type: object
1066010703
NotebookTimeseriesCellAttributes:
1066110704
description: The attributes of a notebook `timeseries` cell.
1066210705
properties:
@@ -10760,6 +10803,16 @@ components:
1076010803
type: string
1076110804
status:
1076210805
$ref: '#/components/schemas/NotebookStatus'
10806+
template_variables:
10807+
description: List of template variables for this notebook.
10808+
example:
10809+
- available_values: []
10810+
default: '*'
10811+
name: host
10812+
prefix: host
10813+
items:
10814+
$ref: '#/components/schemas/NotebookTemplateVariable'
10815+
type: array
1076310816
time:
1076410817
$ref: '#/components/schemas/NotebookGlobalTime'
1076510818
required:
@@ -10836,6 +10889,16 @@ components:
1083610889
type: string
1083710890
status:
1083810891
$ref: '#/components/schemas/NotebookStatus'
10892+
template_variables:
10893+
description: List of template variables for this notebook.
10894+
example:
10895+
- available_values: []
10896+
default: '*'
10897+
name: host
10898+
prefix: host
10899+
items:
10900+
$ref: '#/components/schemas/NotebookTemplateVariable'
10901+
type: array
1083910902
time:
1084010903
$ref: '#/components/schemas/NotebookGlobalTime'
1084110904
required:

features/v1/notebooks.feature

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Feature: Notebooks
1313
@generated @skip @team:DataDog/notebooks
1414
Scenario: Create a notebook returns "Bad Request" response
1515
Given new "CreateNotebook" request
16-
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"}}
16+
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"}}
1717
When the request is sent
1818
Then the response status is 400 Bad Request
1919

@@ -98,23 +98,23 @@ Feature: Notebooks
9898
Scenario: Update a notebook returns "Bad Request" response
9999
Given new "UpdateNotebook" request
100100
And request contains "notebook_id" parameter from "REPLACE.ME"
101-
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"}}
101+
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"}}
102102
When the request is sent
103103
Then the response status is 400 Bad Request
104104

105105
@generated @skip @team:DataDog/notebooks
106106
Scenario: Update a notebook returns "Conflict" response
107107
Given new "UpdateNotebook" request
108108
And request contains "notebook_id" parameter from "REPLACE.ME"
109-
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"}}
109+
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"}}
110110
When the request is sent
111111
Then the response status is 409 Conflict
112112

113113
@generated @skip @team:DataDog/notebooks
114114
Scenario: Update a notebook returns "Not Found" response
115115
Given new "UpdateNotebook" request
116116
And request contains "notebook_id" parameter from "REPLACE.ME"
117-
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"}}
117+
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"}}
118118
When the request is sent
119119
Then the response status is 404 Not Found
120120

lib/datadog_api_client/inflector.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,7 @@ def overrides
421421
"v1.notebooks_response_meta" => "NotebooksResponseMeta",
422422
"v1.notebooks_response_page" => "NotebooksResponsePage",
423423
"v1.notebook_status" => "NotebookStatus",
424+
"v1.notebook_template_variable" => "NotebookTemplateVariable",
424425
"v1.notebook_timeseries_cell_attributes" => "NotebookTimeseriesCellAttributes",
425426
"v1.notebook_toplist_cell_attributes" => "NotebookToplistCellAttributes",
426427
"v1.notebook_update_cell" => "NotebookUpdateCell",

lib/datadog_api_client/v1/models/notebook_create_data_attributes.rb

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class NotebookCreateDataAttributes
3333
# Publication status of the notebook. For now, always "published".
3434
attr_accessor :status
3535

36+
# List of template variables for this notebook.
37+
attr_accessor :template_variables
38+
3639
# Notebook global timeframe.
3740
attr_reader :time
3841

@@ -46,6 +49,7 @@ def self.attribute_map
4649
:'metadata' => :'metadata',
4750
:'name' => :'name',
4851
:'status' => :'status',
52+
:'template_variables' => :'template_variables',
4953
:'time' => :'time'
5054
}
5155
end
@@ -58,6 +62,7 @@ def self.openapi_types
5862
:'metadata' => :'NotebookMetadata',
5963
:'name' => :'String',
6064
:'status' => :'NotebookStatus',
65+
:'template_variables' => :'Array<NotebookTemplateVariable>',
6166
:'time' => :'NotebookGlobalTime'
6267
}
6368
end
@@ -98,6 +103,12 @@ def initialize(attributes = {})
98103
self.status = attributes[:'status']
99104
end
100105

106+
if attributes.key?(:'template_variables')
107+
if (value = attributes[:'template_variables']).is_a?(Array)
108+
self.template_variables = value
109+
end
110+
end
111+
101112
if attributes.key?(:'time')
102113
self.time = attributes[:'time']
103114
end
@@ -181,6 +192,7 @@ def ==(o)
181192
metadata == o.metadata &&
182193
name == o.name &&
183194
status == o.status &&
195+
template_variables == o.template_variables &&
184196
time == o.time &&
185197
additional_properties == o.additional_properties
186198
end
@@ -189,7 +201,7 @@ def ==(o)
189201
# @return [Integer] Hash code
190202
# @!visibility private
191203
def hash
192-
[cells, metadata, name, status, time, additional_properties].hash
204+
[cells, metadata, name, status, template_variables, time, additional_properties].hash
193205
end
194206
end
195207
end
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
=begin
2+
#Datadog API V1 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
Contact: support@datadoghq.com
8+
Generated by: https://github.com/DataDog/datadog-api-client-ruby/tree/master/.generator
9+
10+
Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
11+
This product includes software developed at Datadog (https://www.datadoghq.com/).
12+
Copyright 2020-Present Datadog, Inc.
13+
14+
=end
15+
16+
require 'date'
17+
require 'time'
18+
19+
module DatadogAPIClient::V1
20+
# Template variable for a notebook.
21+
class NotebookTemplateVariable
22+
include BaseGenericModel
23+
24+
# The list of values that the template variable drop-down is limited to.
25+
attr_accessor :available_values
26+
27+
# The default value for the template variable.
28+
attr_accessor :default
29+
30+
# The name of the variable.
31+
attr_reader :name
32+
33+
# The tag prefix associated with the variable. Only tags with this prefix appear in the variable drop-down.
34+
attr_accessor :prefix
35+
36+
attr_accessor :additional_properties
37+
38+
# Attribute mapping from ruby-style variable name to JSON key.
39+
# @!visibility private
40+
def self.attribute_map
41+
{
42+
:'available_values' => :'available_values',
43+
:'default' => :'default',
44+
:'name' => :'name',
45+
:'prefix' => :'prefix'
46+
}
47+
end
48+
49+
# Attribute type mapping.
50+
# @!visibility private
51+
def self.openapi_types
52+
{
53+
:'available_values' => :'Array<String>',
54+
:'default' => :'String',
55+
:'name' => :'String',
56+
:'prefix' => :'String'
57+
}
58+
end
59+
60+
# List of attributes with nullable: true
61+
# @!visibility private
62+
def self.openapi_nullable
63+
Set.new([
64+
:'available_values',
65+
:'default',
66+
:'prefix',
67+
])
68+
end
69+
70+
# Initializes the object
71+
# @param attributes [Hash] Model attributes in the form of hash
72+
# @!visibility private
73+
def initialize(attributes = {})
74+
if (!attributes.is_a?(Hash))
75+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::NotebookTemplateVariable` initialize method"
76+
end
77+
78+
self.additional_properties = {}
79+
# check to see if the attribute exists and convert string to symbol for hash key
80+
attributes = attributes.each_with_object({}) { |(k, v), h|
81+
if (!self.class.attribute_map.key?(k.to_sym))
82+
self.additional_properties[k.to_sym] = v
83+
else
84+
h[k.to_sym] = v
85+
end
86+
}
87+
88+
if attributes.key?(:'available_values')
89+
if (value = attributes[:'available_values']).is_a?(Array)
90+
self.available_values = value
91+
end
92+
end
93+
94+
if attributes.key?(:'default')
95+
self.default = attributes[:'default']
96+
end
97+
98+
if attributes.key?(:'name')
99+
self.name = attributes[:'name']
100+
end
101+
102+
if attributes.key?(:'prefix')
103+
self.prefix = attributes[:'prefix']
104+
end
105+
end
106+
107+
# Check to see if the all the properties in the model are valid
108+
# @return true if the model is valid
109+
# @!visibility private
110+
def valid?
111+
return false if @name.nil?
112+
true
113+
end
114+
115+
# Custom attribute writer method with validation
116+
# @param name [Object] Object to be assigned
117+
# @!visibility private
118+
def name=(name)
119+
if name.nil?
120+
fail ArgumentError, 'invalid value for "name", name cannot be nil.'
121+
end
122+
@name = name
123+
end
124+
125+
# Returns the object in the form of hash, with additionalProperties support.
126+
# @return [Hash] Returns the object in the form of hash
127+
# @!visibility private
128+
def to_hash
129+
hash = {}
130+
self.class.attribute_map.each_pair do |attr, param|
131+
value = self.send(attr)
132+
if value.nil?
133+
is_nullable = self.class.openapi_nullable.include?(attr)
134+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
135+
end
136+
137+
hash[param] = _to_hash(value)
138+
end
139+
self.additional_properties.each_pair do |attr, value|
140+
hash[attr] = value
141+
end
142+
hash
143+
end
144+
145+
# Checks equality by comparing each attribute.
146+
# @param o [Object] Object to be compared
147+
# @!visibility private
148+
def ==(o)
149+
return true if self.equal?(o)
150+
self.class == o.class &&
151+
available_values == o.available_values &&
152+
default == o.default &&
153+
name == o.name &&
154+
prefix == o.prefix &&
155+
additional_properties == o.additional_properties
156+
end
157+
158+
# Calculates hash code according to all attributes.
159+
# @return [Integer] Hash code
160+
# @!visibility private
161+
def hash
162+
[available_values, default, name, prefix, additional_properties].hash
163+
end
164+
end
165+
end

0 commit comments

Comments
 (0)