Skip to content

Commit c294823

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d97ad07 of spec repo
1 parent d4c13bf commit c294823

15 files changed

+1160
-214
lines changed

.generator/schemas/v2/openapi.yaml

Lines changed: 269 additions & 179 deletions
Large diffs are not rendered by default.

examples/v2/reference-tables/UpsertRows.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
DatadogAPIClient::V2::BatchUpsertRowsRequestData.new({
99
attributes: DatadogAPIClient::V2::BatchUpsertRowsRequestDataAttributes.new({
1010
values: {
11-
example_key_value: "primary_key_value", name: "row_name",
11+
age: 25, example_key_value: "primary_key_value", name: "row_name",
1212
},
1313
}),
1414
id: "primary_key_value",

features/v2/reference_tables.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,22 +148,22 @@ Feature: Reference Tables
148148
Scenario: Upsert rows returns "Bad Request" response
149149
Given new "UpsertRows" request
150150
And request contains "id" parameter from "REPLACE.ME"
151-
And body with value {"data": [{"attributes": {"values": {"example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]}
151+
And body with value {"data": [{"attributes": {"values": {"age": 25, "example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]}
152152
When the request is sent
153153
Then the response status is 400 Bad Request
154154

155155
@generated @skip @team:DataDog/redapl-experiences
156156
Scenario: Upsert rows returns "Not Found" response
157157
Given new "UpsertRows" request
158158
And request contains "id" parameter from "REPLACE.ME"
159-
And body with value {"data": [{"attributes": {"values": {"example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]}
159+
And body with value {"data": [{"attributes": {"values": {"age": 25, "example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]}
160160
When the request is sent
161161
Then the response status is 404 Not Found
162162

163163
@generated @skip @team:DataDog/redapl-experiences
164164
Scenario: Upsert rows returns "Rows created or updated successfully" response
165165
Given new "UpsertRows" request
166166
And request contains "id" parameter from "REPLACE.ME"
167-
And body with value {"data": [{"attributes": {"values": {"example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]}
167+
And body with value {"data": [{"attributes": {"values": {"age": 25, "example_key_value": "primary_key_value", "name": "row_name"}}, "id": "primary_key_value", "type": "row"}]}
168168
When the request is sent
169169
Then the response status is 200 Rows created or updated successfully

lib/datadog_api_client/inflector.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1333,6 +1333,7 @@ def overrides
13331333
"v2.batch_upsert_rows_request_array" => "BatchUpsertRowsRequestArray",
13341334
"v2.batch_upsert_rows_request_data" => "BatchUpsertRowsRequestData",
13351335
"v2.batch_upsert_rows_request_data_attributes" => "BatchUpsertRowsRequestDataAttributes",
1336+
"v2.batch_upsert_rows_request_data_attributes_value_row" => "BatchUpsertRowsRequestDataAttributesValueRow",
13361337
"v2.bill_config" => "BillConfig",
13371338
"v2.billing_dimensions_mapping_body_item" => "BillingDimensionsMappingBodyItem",
13381339
"v2.billing_dimensions_mapping_body_item_attributes" => "BillingDimensionsMappingBodyItemAttributes",
@@ -1985,21 +1986,27 @@ def overrides
19851986
"v2.domain_allowlist_response_data" => "DomainAllowlistResponseData",
19861987
"v2.domain_allowlist_response_data_attributes" => "DomainAllowlistResponseDataAttributes",
19871988
"v2.domain_allowlist_type" => "DomainAllowlistType",
1989+
"v2.dora_deployment_fetch_response" => "DORADeploymentFetchResponse",
1990+
"v2.dora_deployment_object" => "DORADeploymentObject",
1991+
"v2.dora_deployment_object_attributes" => "DORADeploymentObjectAttributes",
19881992
"v2.dora_deployment_request" => "DORADeploymentRequest",
19891993
"v2.dora_deployment_request_attributes" => "DORADeploymentRequestAttributes",
19901994
"v2.dora_deployment_request_data" => "DORADeploymentRequestData",
19911995
"v2.dora_deployment_response" => "DORADeploymentResponse",
19921996
"v2.dora_deployment_response_data" => "DORADeploymentResponseData",
1997+
"v2.dora_deployments_list_response" => "DORADeploymentsListResponse",
19931998
"v2.dora_deployment_type" => "DORADeploymentType",
1994-
"v2.dora_event" => "DORAEvent",
1999+
"v2.dora_failure_fetch_response" => "DORAFailureFetchResponse",
19952000
"v2.dora_failure_request" => "DORAFailureRequest",
19962001
"v2.dora_failure_request_attributes" => "DORAFailureRequestAttributes",
19972002
"v2.dora_failure_request_data" => "DORAFailureRequestData",
19982003
"v2.dora_failure_response" => "DORAFailureResponse",
19992004
"v2.dora_failure_response_data" => "DORAFailureResponseData",
2005+
"v2.dora_failures_list_response" => "DORAFailuresListResponse",
20002006
"v2.dora_failure_type" => "DORAFailureType",
2001-
"v2.dora_fetch_response" => "DORAFetchResponse",
20022007
"v2.dora_git_info" => "DORAGitInfo",
2008+
"v2.dora_incident_object" => "DORAIncidentObject",
2009+
"v2.dora_incident_object_attributes" => "DORAIncidentObjectAttributes",
20032010
"v2.dora_list_deployments_request" => "DORAListDeploymentsRequest",
20042011
"v2.dora_list_deployments_request_attributes" => "DORAListDeploymentsRequestAttributes",
20052012
"v2.dora_list_deployments_request_data" => "DORAListDeploymentsRequestData",
@@ -2008,7 +2015,6 @@ def overrides
20082015
"v2.dora_list_failures_request_attributes" => "DORAListFailuresRequestAttributes",
20092016
"v2.dora_list_failures_request_data" => "DORAListFailuresRequestData",
20102017
"v2.dora_list_failures_request_data_type" => "DORAListFailuresRequestDataType",
2011-
"v2.dora_list_response" => "DORAListResponse",
20122018
"v2.downtime_create_request" => "DowntimeCreateRequest",
20132019
"v2.downtime_create_request_attributes" => "DowntimeCreateRequestAttributes",
20142020
"v2.downtime_create_request_data" => "DowntimeCreateRequestData",

lib/datadog_api_client/v2/api/dora_metrics_api.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ def get_dora_deployment(deployment_id, opts = {})
386386
#
387387
# @param deployment_id [String] The ID of the deployment event.
388388
# @param opts [Hash] the optional parameters
389-
# @return [Array<(DORAFetchResponse, Integer, Hash)>] DORAFetchResponse data, response status code and response headers
389+
# @return [Array<(DORADeploymentFetchResponse, Integer, Hash)>] DORADeploymentFetchResponse data, response status code and response headers
390390
def get_dora_deployment_with_http_info(deployment_id, opts = {})
391391

392392
if @api_client.config.debugging
@@ -414,7 +414,7 @@ def get_dora_deployment_with_http_info(deployment_id, opts = {})
414414
post_body = opts[:debug_body]
415415

416416
# return_type
417-
return_type = opts[:debug_return_type] || 'DORAFetchResponse'
417+
return_type = opts[:debug_return_type] || 'DORADeploymentFetchResponse'
418418

419419
# auth_names
420420
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
@@ -451,7 +451,7 @@ def get_dora_failure(failure_id, opts = {})
451451
#
452452
# @param failure_id [String] The ID of the failure event.
453453
# @param opts [Hash] the optional parameters
454-
# @return [Array<(DORAFetchResponse, Integer, Hash)>] DORAFetchResponse data, response status code and response headers
454+
# @return [Array<(DORAFailureFetchResponse, Integer, Hash)>] DORAFailureFetchResponse data, response status code and response headers
455455
def get_dora_failure_with_http_info(failure_id, opts = {})
456456

457457
if @api_client.config.debugging
@@ -479,7 +479,7 @@ def get_dora_failure_with_http_info(failure_id, opts = {})
479479
post_body = opts[:debug_body]
480480

481481
# return_type
482-
return_type = opts[:debug_return_type] || 'DORAFetchResponse'
482+
return_type = opts[:debug_return_type] || 'DORAFailureFetchResponse'
483483

484484
# auth_names
485485
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
@@ -516,7 +516,7 @@ def list_dora_deployments(body, opts = {})
516516
#
517517
# @param body [DORAListDeploymentsRequest]
518518
# @param opts [Hash] the optional parameters
519-
# @return [Array<(DORAListResponse, Integer, Hash)>] DORAListResponse data, response status code and response headers
519+
# @return [Array<(DORADeploymentsListResponse, Integer, Hash)>] DORADeploymentsListResponse data, response status code and response headers
520520
def list_dora_deployments_with_http_info(body, opts = {})
521521

522522
if @api_client.config.debugging
@@ -546,7 +546,7 @@ def list_dora_deployments_with_http_info(body, opts = {})
546546
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
547547

548548
# return_type
549-
return_type = opts[:debug_return_type] || 'DORAListResponse'
549+
return_type = opts[:debug_return_type] || 'DORADeploymentsListResponse'
550550

551551
# auth_names
552552
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]
@@ -583,7 +583,7 @@ def list_dora_failures(body, opts = {})
583583
#
584584
# @param body [DORAListFailuresRequest]
585585
# @param opts [Hash] the optional parameters
586-
# @return [Array<(DORAListResponse, Integer, Hash)>] DORAListResponse data, response status code and response headers
586+
# @return [Array<(DORAFailuresListResponse, Integer, Hash)>] DORAFailuresListResponse data, response status code and response headers
587587
def list_dora_failures_with_http_info(body, opts = {})
588588

589589
if @api_client.config.debugging
@@ -613,7 +613,7 @@ def list_dora_failures_with_http_info(body, opts = {})
613613
post_body = opts[:debug_body] || @api_client.object_to_http_body(body)
614614

615615
# return_type
616-
return_type = opts[:debug_return_type] || 'DORAListResponse'
616+
return_type = opts[:debug_return_type] || 'DORAFailuresListResponse'
617617

618618
# auth_names
619619
auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth]

lib/datadog_api_client/v2/models/batch_upsert_rows_request_data_attributes.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ module DatadogAPIClient::V2
2121
class BatchUpsertRowsRequestDataAttributes
2222
include BaseGenericModel
2323

24-
# Key-value pairs representing row data, where keys are field names from the schema.
24+
# Key-value pairs representing row data, where keys are schema field names and values match the corresponding column types.
2525
attr_reader :values
2626

2727
attr_accessor :additional_properties
@@ -38,7 +38,7 @@ def self.attribute_map
3838
# @!visibility private
3939
def self.openapi_types
4040
{
41-
:'values' => :'Hash<String, Object>'
41+
:'values' => :'Hash<String, BatchUpsertRowsRequestDataAttributesValueRow>'
4242
}
4343
end
4444

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
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::V2
20+
# Value in a reference table row.
21+
module BatchUpsertRowsRequestDataAttributesValueRow
22+
class << self
23+
include BaseOneOfModel
24+
include BaseOneOfModelNoDiscriminator
25+
26+
# List of class defined in oneOf (OpenAPI v3)
27+
def openapi_one_of
28+
[
29+
:'String',
30+
:'Integer'
31+
]
32+
end
33+
# Builds the object
34+
# @param data [Mixed] Data to be matched against the list of oneOf items
35+
# @return [Object] Returns the model or the data itself
36+
def build(data)
37+
# Go through the list of oneOf items and attempt to identify the appropriate one.
38+
# Note:
39+
# - We do not attempt to check whether exactly one item matches.
40+
# - No advanced validation of types in some cases (e.g. "x: { type: string }" will happily match { x: 123 })
41+
# due to the way the deserialization is made in the base_object template (it just casts without verifying).
42+
# - TODO: scalar values are de facto behaving as if they were nullable.
43+
# - TODO: logging when debugging is set.
44+
openapi_one_of.each do |klass|
45+
begin
46+
next if klass == :AnyType # "nullable: true"
47+
typed_data = find_and_cast_into_type(klass, data)
48+
next if typed_data.respond_to?(:_unparsed) && typed_data._unparsed
49+
return typed_data if typed_data
50+
rescue # rescue all errors so we keep iterating even if the current item lookup raises
51+
end
52+
end
53+
54+
if openapi_one_of.include?(:AnyType)
55+
data
56+
else
57+
self._unparsed = true
58+
DatadogAPIClient::UnparsedObject.new(data)
59+
end
60+
end
61+
end
62+
end
63+
end
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
=begin
2+
#Datadog API V2 Collection
3+
4+
#Collection of all Datadog Public endpoints.
5+
6+
The version of the OpenAPI document: 1.0
7+
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::V2
20+
# Response for fetching a single deployment event.
21+
class DORADeploymentFetchResponse
22+
include BaseGenericModel
23+
24+
# A DORA deployment event.
25+
attr_accessor :data
26+
27+
attr_accessor :additional_properties
28+
29+
# Attribute mapping from ruby-style variable name to JSON key.
30+
# @!visibility private
31+
def self.attribute_map
32+
{
33+
:'data' => :'data'
34+
}
35+
end
36+
37+
# Attribute type mapping.
38+
# @!visibility private
39+
def self.openapi_types
40+
{
41+
:'data' => :'DORADeploymentObject'
42+
}
43+
end
44+
45+
# Initializes the object
46+
# @param attributes [Hash] Model attributes in the form of hash
47+
# @!visibility private
48+
def initialize(attributes = {})
49+
if (!attributes.is_a?(Hash))
50+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::DORADeploymentFetchResponse` initialize method"
51+
end
52+
53+
self.additional_properties = {}
54+
# check to see if the attribute exists and convert string to symbol for hash key
55+
attributes = attributes.each_with_object({}) { |(k, v), h|
56+
if (!self.class.attribute_map.key?(k.to_sym))
57+
self.additional_properties[k.to_sym] = v
58+
else
59+
h[k.to_sym] = v
60+
end
61+
}
62+
63+
if attributes.key?(:'data')
64+
self.data = attributes[:'data']
65+
end
66+
end
67+
68+
# Returns the object in the form of hash, with additionalProperties support.
69+
# @return [Hash] Returns the object in the form of hash
70+
# @!visibility private
71+
def to_hash
72+
hash = {}
73+
self.class.attribute_map.each_pair do |attr, param|
74+
value = self.send(attr)
75+
if value.nil?
76+
is_nullable = self.class.openapi_nullable.include?(attr)
77+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
78+
end
79+
80+
hash[param] = _to_hash(value)
81+
end
82+
self.additional_properties.each_pair do |attr, value|
83+
hash[attr] = value
84+
end
85+
hash
86+
end
87+
88+
# Checks equality by comparing each attribute.
89+
# @param o [Object] Object to be compared
90+
# @!visibility private
91+
def ==(o)
92+
return true if self.equal?(o)
93+
self.class == o.class &&
94+
data == o.data &&
95+
additional_properties == o.additional_properties
96+
end
97+
98+
# Calculates hash code according to all attributes.
99+
# @return [Integer] Hash code
100+
# @!visibility private
101+
def hash
102+
[data, additional_properties].hash
103+
end
104+
end
105+
end

0 commit comments

Comments
 (0)