Skip to content

Commit a6cad31

Browse files
author
ci.datadog-api-spec
committed
Regenerate client from commit d6014add of spec repo
1 parent 3515e33 commit a6cad31

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-31 15:03:08.670889",
8-
"spec_repo_commit": "b01f90f4"
7+
"regenerated": "2025-02-03 15:47:59.399270",
8+
"spec_repo_commit": "d6014add"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-01-31 15:03:08.686755",
13-
"spec_repo_commit": "b01f90f4"
12+
"regenerated": "2025-02-03 15:47:59.415140",
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.

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)