Skip to content

Commit 2d7cf7a

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Adding Datadog Connection to Connection API (#3222)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 5da39b3 commit 2d7cf7a

12 files changed

Lines changed: 1225 additions & 6 deletions

.generated-info

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"spec_repo_commit": "dc49df4",
3-
"generated": "2025-07-18 13:58:52.566"
2+
"spec_repo_commit": "0f24b8e",
3+
"generated": "2025-07-18 16:54:43.860"
44
}

.generator/schemas/v2/openapi.yaml

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2016,11 +2016,13 @@ components:
20162016
description: The definition of `ActionConnectionIntegration` object.
20172017
oneOf:
20182018
- $ref: '#/components/schemas/AWSIntegration'
2019+
- $ref: '#/components/schemas/DatadogIntegration'
20192020
- $ref: '#/components/schemas/HTTPIntegration'
20202021
ActionConnectionIntegrationUpdate:
20212022
description: The definition of `ActionConnectionIntegrationUpdate` object.
20222023
oneOf:
20232024
- $ref: '#/components/schemas/AWSIntegrationUpdate'
2025+
- $ref: '#/components/schemas/DatadogIntegrationUpdate'
20242026
- $ref: '#/components/schemas/HTTPIntegrationUpdate'
20252027
ActionQuery:
20262028
description: An action query. This query type is used to trigger an action,
@@ -12378,6 +12380,103 @@ components:
1237812380
required:
1237912381
- databaseMonitoringTrigger
1238012382
type: object
12383+
DatadogAPIKey:
12384+
description: The definition of the `DatadogAPIKey` object.
12385+
properties:
12386+
api_key:
12387+
description: The `DatadogAPIKey` `api_key`.
12388+
example: ''
12389+
type: string
12390+
app_key:
12391+
description: The `DatadogAPIKey` `app_key`.
12392+
example: ''
12393+
type: string
12394+
datacenter:
12395+
description: The `DatadogAPIKey` `datacenter`.
12396+
example: ''
12397+
type: string
12398+
subdomain:
12399+
description: Custom subdomain used for Datadog URLs generated with this
12400+
Connection. For example, if this org uses `https://acme.datadoghq.com`
12401+
to access Datadog, set this field to `acme`. If this field is omitted,
12402+
generated URLs will use the default site URL for its datacenter (see [https://docs.datadoghq.com/getting_started/site](https://docs.datadoghq.com/getting_started/site)).
12403+
type: string
12404+
type:
12405+
$ref: '#/components/schemas/DatadogAPIKeyType'
12406+
required:
12407+
- type
12408+
- datacenter
12409+
- api_key
12410+
- app_key
12411+
type: object
12412+
DatadogAPIKeyType:
12413+
description: The definition of the `DatadogAPIKey` object.
12414+
enum:
12415+
- DatadogAPIKey
12416+
example: DatadogAPIKey
12417+
type: string
12418+
x-enum-varnames:
12419+
- DATADOGAPIKEY
12420+
DatadogAPIKeyUpdate:
12421+
description: The definition of the `DatadogAPIKey` object.
12422+
properties:
12423+
api_key:
12424+
description: The `DatadogAPIKeyUpdate` `api_key`.
12425+
type: string
12426+
app_key:
12427+
description: The `DatadogAPIKeyUpdate` `app_key`.
12428+
type: string
12429+
datacenter:
12430+
description: The `DatadogAPIKeyUpdate` `datacenter`.
12431+
type: string
12432+
subdomain:
12433+
description: Custom subdomain used for Datadog URLs generated with this
12434+
Connection. For example, if this org uses `https://acme.datadoghq.com`
12435+
to access Datadog, set this field to `acme`. If this field is omitted,
12436+
generated URLs will use the default site URL for its datacenter (see [https://docs.datadoghq.com/getting_started/site](https://docs.datadoghq.com/getting_started/site)).
12437+
type: string
12438+
type:
12439+
$ref: '#/components/schemas/DatadogAPIKeyType'
12440+
required:
12441+
- type
12442+
type: object
12443+
DatadogCredentials:
12444+
description: The definition of the `DatadogCredentials` object.
12445+
oneOf:
12446+
- $ref: '#/components/schemas/DatadogAPIKey'
12447+
DatadogCredentialsUpdate:
12448+
description: The definition of the `DatadogCredentialsUpdate` object.
12449+
oneOf:
12450+
- $ref: '#/components/schemas/DatadogAPIKeyUpdate'
12451+
DatadogIntegration:
12452+
description: The definition of the `DatadogIntegration` object.
12453+
properties:
12454+
credentials:
12455+
$ref: '#/components/schemas/DatadogCredentials'
12456+
type:
12457+
$ref: '#/components/schemas/DatadogIntegrationType'
12458+
required:
12459+
- type
12460+
- credentials
12461+
type: object
12462+
DatadogIntegrationType:
12463+
description: The definition of the `DatadogIntegrationType` object.
12464+
enum:
12465+
- Datadog
12466+
example: Datadog
12467+
type: string
12468+
x-enum-varnames:
12469+
- DATADOG
12470+
DatadogIntegrationUpdate:
12471+
description: The definition of the `DatadogIntegrationUpdate` object.
12472+
properties:
12473+
credentials:
12474+
$ref: '#/components/schemas/DatadogCredentialsUpdate'
12475+
type:
12476+
$ref: '#/components/schemas/DatadogIntegrationType'
12477+
required:
12478+
- type
12479+
type: object
1238112480
Dataset:
1238212481
description: Dataset object.
1238312482
properties:

api/datadogV2/model_action_connection_integration.go

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import (
1010

1111
// ActionConnectionIntegration - The definition of `ActionConnectionIntegration` object.
1212
type ActionConnectionIntegration struct {
13-
AWSIntegration *AWSIntegration
14-
HTTPIntegration *HTTPIntegration
13+
AWSIntegration *AWSIntegration
14+
DatadogIntegration *DatadogIntegration
15+
HTTPIntegration *HTTPIntegration
1516

1617
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1718
UnparsedObject interface{}
@@ -22,6 +23,11 @@ func AWSIntegrationAsActionConnectionIntegration(v *AWSIntegration) ActionConnec
2223
return ActionConnectionIntegration{AWSIntegration: v}
2324
}
2425

26+
// DatadogIntegrationAsActionConnectionIntegration is a convenience function that returns DatadogIntegration wrapped in ActionConnectionIntegration.
27+
func DatadogIntegrationAsActionConnectionIntegration(v *DatadogIntegration) ActionConnectionIntegration {
28+
return ActionConnectionIntegration{DatadogIntegration: v}
29+
}
30+
2531
// HTTPIntegrationAsActionConnectionIntegration is a convenience function that returns HTTPIntegration wrapped in ActionConnectionIntegration.
2632
func HTTPIntegrationAsActionConnectionIntegration(v *HTTPIntegration) ActionConnectionIntegration {
2733
return ActionConnectionIntegration{HTTPIntegration: v}
@@ -48,6 +54,23 @@ func (obj *ActionConnectionIntegration) UnmarshalJSON(data []byte) error {
4854
obj.AWSIntegration = nil
4955
}
5056

57+
// try to unmarshal data into DatadogIntegration
58+
err = datadog.Unmarshal(data, &obj.DatadogIntegration)
59+
if err == nil {
60+
if obj.DatadogIntegration != nil && obj.DatadogIntegration.UnparsedObject == nil {
61+
jsonDatadogIntegration, _ := datadog.Marshal(obj.DatadogIntegration)
62+
if string(jsonDatadogIntegration) == "{}" { // empty struct
63+
obj.DatadogIntegration = nil
64+
} else {
65+
match++
66+
}
67+
} else {
68+
obj.DatadogIntegration = nil
69+
}
70+
} else {
71+
obj.DatadogIntegration = nil
72+
}
73+
5174
// try to unmarshal data into HTTPIntegration
5275
err = datadog.Unmarshal(data, &obj.HTTPIntegration)
5376
if err == nil {
@@ -68,6 +91,7 @@ func (obj *ActionConnectionIntegration) UnmarshalJSON(data []byte) error {
6891
if match != 1 { // more than 1 match
6992
// reset to nil
7093
obj.AWSIntegration = nil
94+
obj.DatadogIntegration = nil
7195
obj.HTTPIntegration = nil
7296
return datadog.Unmarshal(data, &obj.UnparsedObject)
7397
}
@@ -80,6 +104,10 @@ func (obj ActionConnectionIntegration) MarshalJSON() ([]byte, error) {
80104
return datadog.Marshal(&obj.AWSIntegration)
81105
}
82106

107+
if obj.DatadogIntegration != nil {
108+
return datadog.Marshal(&obj.DatadogIntegration)
109+
}
110+
83111
if obj.HTTPIntegration != nil {
84112
return datadog.Marshal(&obj.HTTPIntegration)
85113
}
@@ -96,6 +124,10 @@ func (obj *ActionConnectionIntegration) GetActualInstance() interface{} {
96124
return obj.AWSIntegration
97125
}
98126

127+
if obj.DatadogIntegration != nil {
128+
return obj.DatadogIntegration
129+
}
130+
99131
if obj.HTTPIntegration != nil {
100132
return obj.HTTPIntegration
101133
}

api/datadogV2/model_action_connection_integration_update.go

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import (
1010

1111
// ActionConnectionIntegrationUpdate - The definition of `ActionConnectionIntegrationUpdate` object.
1212
type ActionConnectionIntegrationUpdate struct {
13-
AWSIntegrationUpdate *AWSIntegrationUpdate
14-
HTTPIntegrationUpdate *HTTPIntegrationUpdate
13+
AWSIntegrationUpdate *AWSIntegrationUpdate
14+
DatadogIntegrationUpdate *DatadogIntegrationUpdate
15+
HTTPIntegrationUpdate *HTTPIntegrationUpdate
1516

1617
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
1718
UnparsedObject interface{}
@@ -22,6 +23,11 @@ func AWSIntegrationUpdateAsActionConnectionIntegrationUpdate(v *AWSIntegrationUp
2223
return ActionConnectionIntegrationUpdate{AWSIntegrationUpdate: v}
2324
}
2425

26+
// DatadogIntegrationUpdateAsActionConnectionIntegrationUpdate is a convenience function that returns DatadogIntegrationUpdate wrapped in ActionConnectionIntegrationUpdate.
27+
func DatadogIntegrationUpdateAsActionConnectionIntegrationUpdate(v *DatadogIntegrationUpdate) ActionConnectionIntegrationUpdate {
28+
return ActionConnectionIntegrationUpdate{DatadogIntegrationUpdate: v}
29+
}
30+
2531
// HTTPIntegrationUpdateAsActionConnectionIntegrationUpdate is a convenience function that returns HTTPIntegrationUpdate wrapped in ActionConnectionIntegrationUpdate.
2632
func HTTPIntegrationUpdateAsActionConnectionIntegrationUpdate(v *HTTPIntegrationUpdate) ActionConnectionIntegrationUpdate {
2733
return ActionConnectionIntegrationUpdate{HTTPIntegrationUpdate: v}
@@ -48,6 +54,23 @@ func (obj *ActionConnectionIntegrationUpdate) UnmarshalJSON(data []byte) error {
4854
obj.AWSIntegrationUpdate = nil
4955
}
5056

57+
// try to unmarshal data into DatadogIntegrationUpdate
58+
err = datadog.Unmarshal(data, &obj.DatadogIntegrationUpdate)
59+
if err == nil {
60+
if obj.DatadogIntegrationUpdate != nil && obj.DatadogIntegrationUpdate.UnparsedObject == nil {
61+
jsonDatadogIntegrationUpdate, _ := datadog.Marshal(obj.DatadogIntegrationUpdate)
62+
if string(jsonDatadogIntegrationUpdate) == "{}" { // empty struct
63+
obj.DatadogIntegrationUpdate = nil
64+
} else {
65+
match++
66+
}
67+
} else {
68+
obj.DatadogIntegrationUpdate = nil
69+
}
70+
} else {
71+
obj.DatadogIntegrationUpdate = nil
72+
}
73+
5174
// try to unmarshal data into HTTPIntegrationUpdate
5275
err = datadog.Unmarshal(data, &obj.HTTPIntegrationUpdate)
5376
if err == nil {
@@ -68,6 +91,7 @@ func (obj *ActionConnectionIntegrationUpdate) UnmarshalJSON(data []byte) error {
6891
if match != 1 { // more than 1 match
6992
// reset to nil
7093
obj.AWSIntegrationUpdate = nil
94+
obj.DatadogIntegrationUpdate = nil
7195
obj.HTTPIntegrationUpdate = nil
7296
return datadog.Unmarshal(data, &obj.UnparsedObject)
7397
}
@@ -80,6 +104,10 @@ func (obj ActionConnectionIntegrationUpdate) MarshalJSON() ([]byte, error) {
80104
return datadog.Marshal(&obj.AWSIntegrationUpdate)
81105
}
82106

107+
if obj.DatadogIntegrationUpdate != nil {
108+
return datadog.Marshal(&obj.DatadogIntegrationUpdate)
109+
}
110+
83111
if obj.HTTPIntegrationUpdate != nil {
84112
return datadog.Marshal(&obj.HTTPIntegrationUpdate)
85113
}
@@ -96,6 +124,10 @@ func (obj *ActionConnectionIntegrationUpdate) GetActualInstance() interface{} {
96124
return obj.AWSIntegrationUpdate
97125
}
98126

127+
if obj.DatadogIntegrationUpdate != nil {
128+
return obj.DatadogIntegrationUpdate
129+
}
130+
99131
if obj.HTTPIntegrationUpdate != nil {
100132
return obj.HTTPIntegrationUpdate
101133
}

0 commit comments

Comments
 (0)