Skip to content

Commit 8870ca4

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit 7a9a548d of spec repo
1 parent cb2d556 commit 8870ca4

10 files changed

+1254
-4
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-29 14:55:54.541634",
8-
"spec_repo_commit": "14f5d952"
7+
"regenerated": "2025-01-30 22:38:47.692948",
8+
"spec_repo_commit": "7a9a548d"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-29 14:55:54.557559",
13-
"spec_repo_commit": "14f5d952"
12+
"regenerated": "2025-01-30 22:38:47.708937",
13+
"spec_repo_commit": "7a9a548d"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

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

api/datadogV2/model_entity_v3.go

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ type EntityV3 struct {
1414
EntityV3Datastore *EntityV3Datastore
1515
EntityV3Queue *EntityV3Queue
1616
EntityV3System *EntityV3System
17+
EntityV3API *EntityV3API
1718

1819
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1920
UnparsedObject interface{}
@@ -39,6 +40,11 @@ func EntityV3SystemAsEntityV3(v *EntityV3System) EntityV3 {
3940
return EntityV3{EntityV3System: v}
4041
}
4142

43+
// EntityV3APIAsEntityV3 is a convenience function that returns EntityV3API wrapped in EntityV3.
44+
func EntityV3APIAsEntityV3(v *EntityV3API) EntityV3 {
45+
return EntityV3{EntityV3API: v}
46+
}
47+
4248
// UnmarshalJSON turns data into one of the pointers in the struct.
4349
func (obj *EntityV3) UnmarshalJSON(data []byte) error {
4450
var err error
@@ -111,12 +117,30 @@ func (obj *EntityV3) UnmarshalJSON(data []byte) error {
111117
obj.EntityV3System = nil
112118
}
113119

120+
// try to unmarshal data into EntityV3API
121+
err = datadog.Unmarshal(data, &obj.EntityV3API)
122+
if err == nil {
123+
if obj.EntityV3API != nil && obj.EntityV3API.UnparsedObject == nil {
124+
jsonEntityV3API, _ := datadog.Marshal(obj.EntityV3API)
125+
if string(jsonEntityV3API) == "{}" { // empty struct
126+
obj.EntityV3API = nil
127+
} else {
128+
match++
129+
}
130+
} else {
131+
obj.EntityV3API = nil
132+
}
133+
} else {
134+
obj.EntityV3API = nil
135+
}
136+
114137
if match != 1 { // more than 1 match
115138
// reset to nil
116139
obj.EntityV3Service = nil
117140
obj.EntityV3Datastore = nil
118141
obj.EntityV3Queue = nil
119142
obj.EntityV3System = nil
143+
obj.EntityV3API = nil
120144
return datadog.Unmarshal(data, &obj.UnparsedObject)
121145
}
122146
return nil // exactly one match
@@ -140,6 +164,10 @@ func (obj EntityV3) MarshalJSON() ([]byte, error) {
140164
return datadog.Marshal(&obj.EntityV3System)
141165
}
142166

167+
if obj.EntityV3API != nil {
168+
return datadog.Marshal(&obj.EntityV3API)
169+
}
170+
143171
if obj.UnparsedObject != nil {
144172
return datadog.Marshal(obj.UnparsedObject)
145173
}
@@ -164,6 +192,10 @@ func (obj *EntityV3) GetActualInstance() interface{} {
164192
return obj.EntityV3System
165193
}
166194

195+
if obj.EntityV3API != nil {
196+
return obj.EntityV3API
197+
}
198+
167199
// all schemas are nil
168200
return nil
169201
}

0 commit comments

Comments
 (0)