Skip to content

Commit a92670a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add support for Entity kind API (#2222)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 608f714 commit a92670a

File tree

10 files changed

+748
-5
lines changed

10 files changed

+748
-5
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2025-01-31 15:03:07.870119",
8-
"spec_repo_commit": "b01f90f4"
7+
"regenerated": "2025-02-03 15:47:57.210440",
8+
"spec_repo_commit": "d6014add"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-31 15:03:07.885209",
13-
"spec_repo_commit": "b01f90f4"
12+
"regenerated": "2025-02-03 15:47:57.226212",
13+
"spec_repo_commit": "d6014add"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10524,6 +10524,99 @@ components:
1052410524
- $ref: '#/components/schemas/EntityV3Datastore'
1052510525
- $ref: '#/components/schemas/EntityV3Queue'
1052610526
- $ref: '#/components/schemas/EntityV3System'
10527+
- $ref: '#/components/schemas/EntityV3API'
10528+
EntityV3API:
10529+
additionalProperties: false
10530+
description: Schema for API entities.
10531+
properties:
10532+
apiVersion:
10533+
$ref: '#/components/schemas/EntityV3APIVersion'
10534+
datadog:
10535+
$ref: '#/components/schemas/EntityV3APIDatadog'
10536+
extensions:
10537+
additionalProperties: {}
10538+
description: Custom extensions. This is the free-formed field to send client-side
10539+
metadata. No Datadog features are affected by this field.
10540+
type: object
10541+
integrations:
10542+
$ref: '#/components/schemas/EntityV3Integrations'
10543+
kind:
10544+
$ref: '#/components/schemas/EntityV3APIKind'
10545+
metadata:
10546+
$ref: '#/components/schemas/EntityV3Metadata'
10547+
spec:
10548+
$ref: '#/components/schemas/EntityV3APISpec'
10549+
required:
10550+
- apiVersion
10551+
- kind
10552+
- metadata
10553+
type: object
10554+
EntityV3APIDatadog:
10555+
additionalProperties: false
10556+
description: Datadog product integrations for the API entity.
10557+
properties:
10558+
codeLocations:
10559+
$ref: '#/components/schemas/EntityV3DatadogCodeLocations'
10560+
events:
10561+
$ref: '#/components/schemas/EntityV3DatadogEvents'
10562+
logs:
10563+
$ref: '#/components/schemas/EntityV3DatadogLogs'
10564+
performanceData:
10565+
$ref: '#/components/schemas/EntityV3DatadogPerformance'
10566+
pipelines:
10567+
$ref: '#/components/schemas/EntityV3DatadogPipelines'
10568+
type: object
10569+
EntityV3APIKind:
10570+
description: The definition of Entity V3 API Kind object.
10571+
enum:
10572+
- api
10573+
example: api
10574+
type: string
10575+
x-enum-varnames:
10576+
- API
10577+
EntityV3APISpec:
10578+
additionalProperties: false
10579+
description: The definition of Entity V3 API Spec object.
10580+
properties:
10581+
implementedBy:
10582+
description: Services which implemented the API.
10583+
items:
10584+
type: string
10585+
type: array
10586+
interface:
10587+
$ref: '#/components/schemas/EntityV3APISpecInterface'
10588+
lifecycle:
10589+
description: The lifecycle state of the component.
10590+
minLength: 1
10591+
type: string
10592+
tier:
10593+
description: The importance of the component.
10594+
minLength: 1
10595+
type: string
10596+
type:
10597+
description: The type of API.
10598+
type: string
10599+
type: object
10600+
EntityV3APISpecInterface:
10601+
additionalProperties: false
10602+
description: The API definition.
10603+
oneOf:
10604+
- $ref: '#/components/schemas/EntityV3APISpecInterfaceFileRef'
10605+
- $ref: '#/components/schemas/EntityV3APISpecInterfaceDefinition'
10606+
EntityV3APISpecInterfaceDefinition:
10607+
additionalProperties: false
10608+
description: The definition of `EntityV3APISpecInterfaceDefinition` object.
10609+
properties:
10610+
definition:
10611+
description: The API definition.
10612+
type: object
10613+
EntityV3APISpecInterfaceFileRef:
10614+
additionalProperties: false
10615+
description: The definition of `EntityV3APISpecInterfaceFileRef` object.
10616+
properties:
10617+
fileRef:
10618+
description: The reference to the API definition file.
10619+
type: string
1052710620
EntityV3APIVersion:
1052810621
description: The schema version of entity type. The field is known as schema-version
1052910622
in the previous version.

lib/datadog_api_client/inflector.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1513,6 +1513,12 @@ def overrides
15131513
"v2.entity_to_related_entities" => "EntityToRelatedEntities",
15141514
"v2.entity_to_schema" => "EntityToSchema",
15151515
"v2.entity_v3" => "EntityV3",
1516+
"v2.entity_v3_api" => "EntityV3API",
1517+
"v2.entity_v3_api_datadog" => "EntityV3APIDatadog",
1518+
"v2.entity_v3_api_kind" => "EntityV3APIKind",
1519+
"v2.entity_v3_api_spec" => "EntityV3APISpec",
1520+
"v2.entity_v3_api_spec_interface_definition" => "EntityV3APISpecInterfaceDefinition",
1521+
"v2.entity_v3_api_spec_interface_file_ref" => "EntityV3APISpecInterfaceFileRef",
15161522
"v2.entity_v3_api_version" => "EntityV3APIVersion",
15171523
"v2.entity_v3_datadog_code_location_item" => "EntityV3DatadogCodeLocationItem",
15181524
"v2.entity_v3_datadog_event_item" => "EntityV3DatadogEventItem",

lib/datadog_api_client/v2/models/entity_v3.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ def openapi_one_of
2929
:'EntityV3Service',
3030
:'EntityV3Datastore',
3131
:'EntityV3Queue',
32-
:'EntityV3System'
32+
:'EntityV3System',
33+
:'EntityV3API'
3334
]
3435
end
3536
# Builds the object
Lines changed: 180 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,180 @@
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+
# Schema for API entities.
21+
class EntityV3API
22+
include BaseGenericModel
23+
24+
# The schema version of entity type. The field is known as schema-version in the previous version.
25+
attr_reader :api_version
26+
27+
# Datadog product integrations for the API entity.
28+
attr_accessor :datadog
29+
30+
# Custom extensions. This is the free-formed field to send client-side metadata. No Datadog features are affected by this field.
31+
attr_accessor :extensions
32+
33+
# A base schema for defining third-party integrations.
34+
attr_accessor :integrations
35+
36+
# The definition of Entity V3 API Kind object.
37+
attr_reader :kind
38+
39+
# The definition of Entity V3 Metadata object.
40+
attr_reader :metadata
41+
42+
# The definition of Entity V3 API Spec object.
43+
attr_accessor :spec
44+
45+
# Attribute mapping from ruby-style variable name to JSON key.
46+
# @!visibility private
47+
def self.attribute_map
48+
{
49+
:'api_version' => :'apiVersion',
50+
:'datadog' => :'datadog',
51+
:'extensions' => :'extensions',
52+
:'integrations' => :'integrations',
53+
:'kind' => :'kind',
54+
:'metadata' => :'metadata',
55+
:'spec' => :'spec'
56+
}
57+
end
58+
59+
# Attribute type mapping.
60+
# @!visibility private
61+
def self.openapi_types
62+
{
63+
:'api_version' => :'EntityV3APIVersion',
64+
:'datadog' => :'EntityV3APIDatadog',
65+
:'extensions' => :'Hash<String, Object>',
66+
:'integrations' => :'EntityV3Integrations',
67+
:'kind' => :'EntityV3APIKind',
68+
:'metadata' => :'EntityV3Metadata',
69+
:'spec' => :'EntityV3APISpec'
70+
}
71+
end
72+
73+
# Initializes the object
74+
# @param attributes [Hash] Model attributes in the form of hash
75+
# @!visibility private
76+
def initialize(attributes = {})
77+
if (!attributes.is_a?(Hash))
78+
fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V2::EntityV3API` initialize method"
79+
end
80+
81+
# check to see if the attribute exists and convert string to symbol for hash key
82+
attributes = attributes.each_with_object({}) { |(k, v), h|
83+
if (!self.class.attribute_map.key?(k.to_sym))
84+
fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V2::EntityV3API`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
85+
end
86+
h[k.to_sym] = v
87+
}
88+
89+
if attributes.key?(:'api_version')
90+
self.api_version = attributes[:'api_version']
91+
end
92+
93+
if attributes.key?(:'datadog')
94+
self.datadog = attributes[:'datadog']
95+
end
96+
97+
if attributes.key?(:'extensions')
98+
self.extensions = attributes[:'extensions']
99+
end
100+
101+
if attributes.key?(:'integrations')
102+
self.integrations = attributes[:'integrations']
103+
end
104+
105+
if attributes.key?(:'kind')
106+
self.kind = attributes[:'kind']
107+
end
108+
109+
if attributes.key?(:'metadata')
110+
self.metadata = attributes[:'metadata']
111+
end
112+
113+
if attributes.key?(:'spec')
114+
self.spec = attributes[:'spec']
115+
end
116+
end
117+
118+
# Check to see if the all the properties in the model are valid
119+
# @return true if the model is valid
120+
# @!visibility private
121+
def valid?
122+
return false if @api_version.nil?
123+
return false if @kind.nil?
124+
return false if @metadata.nil?
125+
true
126+
end
127+
128+
# Custom attribute writer method with validation
129+
# @param api_version [Object] Object to be assigned
130+
# @!visibility private
131+
def api_version=(api_version)
132+
if api_version.nil?
133+
fail ArgumentError, 'invalid value for "api_version", api_version cannot be nil.'
134+
end
135+
@api_version = api_version
136+
end
137+
138+
# Custom attribute writer method with validation
139+
# @param kind [Object] Object to be assigned
140+
# @!visibility private
141+
def kind=(kind)
142+
if kind.nil?
143+
fail ArgumentError, 'invalid value for "kind", kind cannot be nil.'
144+
end
145+
@kind = kind
146+
end
147+
148+
# Custom attribute writer method with validation
149+
# @param metadata [Object] Object to be assigned
150+
# @!visibility private
151+
def metadata=(metadata)
152+
if metadata.nil?
153+
fail ArgumentError, 'invalid value for "metadata", metadata cannot be nil.'
154+
end
155+
@metadata = metadata
156+
end
157+
158+
# Checks equality by comparing each attribute.
159+
# @param o [Object] Object to be compared
160+
# @!visibility private
161+
def ==(o)
162+
return true if self.equal?(o)
163+
self.class == o.class &&
164+
api_version == o.api_version &&
165+
datadog == o.datadog &&
166+
extensions == o.extensions &&
167+
integrations == o.integrations &&
168+
kind == o.kind &&
169+
metadata == o.metadata &&
170+
spec == o.spec
171+
end
172+
173+
# Calculates hash code according to all attributes.
174+
# @return [Integer] Hash code
175+
# @!visibility private
176+
def hash
177+
[api_version, datadog, extensions, integrations, kind, metadata, spec].hash
178+
end
179+
end
180+
end

0 commit comments

Comments
 (0)