Skip to content

Commit 4099bc4

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 764de5f0 of spec repo (#2991)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 0d5c8a8 commit 4099bc4

12 files changed

Lines changed: 424 additions & 54 deletions

.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-03-20 15:01:17.962103",
8-
"spec_repo_commit": "0f5c928e"
7+
"regenerated": "2025-03-24 14:58:34.113205",
8+
"spec_repo_commit": "764de5f0"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2025-03-20 15:01:17.977698",
13-
"spec_repo_commit": "0f5c928e"
12+
"regenerated": "2025-03-24 14:58:34.130122",
13+
"spec_repo_commit": "764de5f0"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11936,9 +11936,15 @@ components:
1193611936
description: Incident ID.
1193711937
type: string
1193811938
type:
11939-
description: Incident description.
11940-
type: string
11939+
$ref: '#/components/schemas/EntityResponseIncludedIncidentType'
1194111940
type: object
11941+
EntityResponseIncludedIncidentType:
11942+
description: Incident description.
11943+
enum:
11944+
- incident
11945+
type: string
11946+
x-enum-varnames:
11947+
- INCIDENT
1194211948
EntityResponseIncludedOncall:
1194311949
description: Included oncall.
1194411950
properties:
@@ -11948,9 +11954,15 @@ components:
1194811954
description: Oncall ID.
1194911955
type: string
1195011956
type:
11951-
description: Oncall type.
11952-
type: string
11957+
$ref: '#/components/schemas/EntityResponseIncludedOncallType'
1195311958
type: object
11959+
EntityResponseIncludedOncallType:
11960+
description: Oncall type.
11961+
enum:
11962+
- oncall
11963+
type: string
11964+
x-enum-varnames:
11965+
- ONCALL
1195411966
EntityResponseIncludedRawSchema:
1195511967
description: Included raw schema.
1195611968
properties:
@@ -11960,8 +11972,7 @@ components:
1196011972
description: Raw schema ID.
1196111973
type: string
1196211974
type:
11963-
description: Raw schema type.
11964-
type: string
11975+
$ref: '#/components/schemas/EntityResponseIncludedRawSchemaType'
1196511976
type: object
1196611977
EntityResponseIncludedRawSchemaAttributes:
1196711978
description: Included raw schema attributes.
@@ -11970,6 +11981,13 @@ components:
1197011981
description: Schema from user input in base64 encoding.
1197111982
type: string
1197211983
type: object
11984+
EntityResponseIncludedRawSchemaType:
11985+
description: Raw schema type.
11986+
enum:
11987+
- rawSchema
11988+
type: string
11989+
x-enum-varnames:
11990+
- RAW_SCHEMA
1197311991
EntityResponseIncludedRelatedEntity:
1197411992
description: Included related entity.
1197511993
properties:
@@ -11981,8 +11999,7 @@ components:
1198111999
meta:
1198212000
$ref: '#/components/schemas/EntityResponseIncludedRelatedEntityMeta'
1198312001
type:
11984-
description: Related entity.
11985-
type: string
12002+
$ref: '#/components/schemas/EntityResponseIncludedRelatedEntityType'
1198612003
type: object
1198712004
EntityResponseIncludedRelatedEntityAttributes:
1198812005
description: Related entity attributes.
@@ -12018,6 +12035,13 @@ components:
1201812035
description: Entity relation source.
1201912036
type: string
1202012037
type: object
12038+
EntityResponseIncludedRelatedEntityType:
12039+
description: Related entity.
12040+
enum:
12041+
- relatedEntity
12042+
type: string
12043+
x-enum-varnames:
12044+
- RELATED_ENTITY
1202112045
EntityResponseIncludedRelatedIncidentAttributes:
1202212046
description: Incident attributes.
1202312047
properties:
@@ -12075,15 +12099,21 @@ components:
1207512099
description: Entity ID.
1207612100
type: string
1207712101
type:
12078-
description: Schema type.
12079-
type: string
12102+
$ref: '#/components/schemas/EntityResponseIncludedSchemaType'
1208012103
type: object
1208112104
EntityResponseIncludedSchemaAttributes:
1208212105
description: Included schema.
1208312106
properties:
1208412107
schema:
1208512108
$ref: '#/components/schemas/EntityV3'
1208612109
type: object
12110+
EntityResponseIncludedSchemaType:
12111+
description: Schema type.
12112+
enum:
12113+
- schema
12114+
type: string
12115+
x-enum-varnames:
12116+
- SCHEMA
1208712117
EntityResponseMeta:
1208812118
description: Entity metadata.
1208912119
properties:

api/datadogV2/model_entity_response_included_incident.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type EntityResponseIncludedIncident struct {
1515
// Incident ID.
1616
Id *string `json:"id,omitempty"`
1717
// Incident description.
18-
Type *string `json:"type,omitempty"`
18+
Type *EntityResponseIncludedIncidentType `json:"type,omitempty"`
1919
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2020
UnparsedObject map[string]interface{} `json:"-"`
2121
AdditionalProperties map[string]interface{} `json:"-"`
@@ -95,17 +95,17 @@ func (o *EntityResponseIncludedIncident) SetId(v string) {
9595
}
9696

9797
// GetType returns the Type field value if set, zero value otherwise.
98-
func (o *EntityResponseIncludedIncident) GetType() string {
98+
func (o *EntityResponseIncludedIncident) GetType() EntityResponseIncludedIncidentType {
9999
if o == nil || o.Type == nil {
100-
var ret string
100+
var ret EntityResponseIncludedIncidentType
101101
return ret
102102
}
103103
return *o.Type
104104
}
105105

106106
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
107107
// and a boolean to check if the value has been set.
108-
func (o *EntityResponseIncludedIncident) GetTypeOk() (*string, bool) {
108+
func (o *EntityResponseIncludedIncident) GetTypeOk() (*EntityResponseIncludedIncidentType, bool) {
109109
if o == nil || o.Type == nil {
110110
return nil, false
111111
}
@@ -117,8 +117,8 @@ func (o *EntityResponseIncludedIncident) HasType() bool {
117117
return o != nil && o.Type != nil
118118
}
119119

120-
// SetType gets a reference to the given string and assigns it to the Type field.
121-
func (o *EntityResponseIncludedIncident) SetType(v string) {
120+
// SetType gets a reference to the given EntityResponseIncludedIncidentType and assigns it to the Type field.
121+
func (o *EntityResponseIncludedIncident) SetType(v EntityResponseIncludedIncidentType) {
122122
o.Type = &v
123123
}
124124

@@ -149,7 +149,7 @@ func (o *EntityResponseIncludedIncident) UnmarshalJSON(bytes []byte) (err error)
149149
all := struct {
150150
Attributes *EntityResponseIncludedRelatedIncidentAttributes `json:"attributes,omitempty"`
151151
Id *string `json:"id,omitempty"`
152-
Type *string `json:"type,omitempty"`
152+
Type *EntityResponseIncludedIncidentType `json:"type,omitempty"`
153153
}{}
154154
if err = datadog.Unmarshal(bytes, &all); err != nil {
155155
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -167,7 +167,11 @@ func (o *EntityResponseIncludedIncident) UnmarshalJSON(bytes []byte) (err error)
167167
}
168168
o.Attributes = all.Attributes
169169
o.Id = all.Id
170-
o.Type = all.Type
170+
if all.Type != nil && !all.Type.IsValid() {
171+
hasInvalidField = true
172+
} else {
173+
o.Type = all.Type
174+
}
171175

172176
if len(additionalProperties) > 0 {
173177
o.AdditionalProperties = additionalProperties
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// EntityResponseIncludedIncidentType Incident description.
14+
type EntityResponseIncludedIncidentType string
15+
16+
// List of EntityResponseIncludedIncidentType.
17+
const (
18+
ENTITYRESPONSEINCLUDEDINCIDENTTYPE_INCIDENT EntityResponseIncludedIncidentType = "incident"
19+
)
20+
21+
var allowedEntityResponseIncludedIncidentTypeEnumValues = []EntityResponseIncludedIncidentType{
22+
ENTITYRESPONSEINCLUDEDINCIDENTTYPE_INCIDENT,
23+
}
24+
25+
// GetAllowedValues reeturns the list of possible values.
26+
func (v *EntityResponseIncludedIncidentType) GetAllowedValues() []EntityResponseIncludedIncidentType {
27+
return allowedEntityResponseIncludedIncidentTypeEnumValues
28+
}
29+
30+
// UnmarshalJSON deserializes the given payload.
31+
func (v *EntityResponseIncludedIncidentType) UnmarshalJSON(src []byte) error {
32+
var value string
33+
err := datadog.Unmarshal(src, &value)
34+
if err != nil {
35+
return err
36+
}
37+
*v = EntityResponseIncludedIncidentType(value)
38+
return nil
39+
}
40+
41+
// NewEntityResponseIncludedIncidentTypeFromValue returns a pointer to a valid EntityResponseIncludedIncidentType
42+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
43+
func NewEntityResponseIncludedIncidentTypeFromValue(v string) (*EntityResponseIncludedIncidentType, error) {
44+
ev := EntityResponseIncludedIncidentType(v)
45+
if ev.IsValid() {
46+
return &ev, nil
47+
}
48+
return nil, fmt.Errorf("invalid value '%v' for EntityResponseIncludedIncidentType: valid values are %v", v, allowedEntityResponseIncludedIncidentTypeEnumValues)
49+
}
50+
51+
// IsValid return true if the value is valid for the enum, false otherwise.
52+
func (v EntityResponseIncludedIncidentType) IsValid() bool {
53+
for _, existing := range allowedEntityResponseIncludedIncidentTypeEnumValues {
54+
if existing == v {
55+
return true
56+
}
57+
}
58+
return false
59+
}
60+
61+
// Ptr returns reference to EntityResponseIncludedIncidentType value.
62+
func (v EntityResponseIncludedIncidentType) Ptr() *EntityResponseIncludedIncidentType {
63+
return &v
64+
}

api/datadogV2/model_entity_response_included_oncall.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type EntityResponseIncludedOncall struct {
1515
// Oncall ID.
1616
Id *string `json:"id,omitempty"`
1717
// Oncall type.
18-
Type *string `json:"type,omitempty"`
18+
Type *EntityResponseIncludedOncallType `json:"type,omitempty"`
1919
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
2020
UnparsedObject map[string]interface{} `json:"-"`
2121
AdditionalProperties map[string]interface{} `json:"-"`
@@ -95,17 +95,17 @@ func (o *EntityResponseIncludedOncall) SetId(v string) {
9595
}
9696

9797
// GetType returns the Type field value if set, zero value otherwise.
98-
func (o *EntityResponseIncludedOncall) GetType() string {
98+
func (o *EntityResponseIncludedOncall) GetType() EntityResponseIncludedOncallType {
9999
if o == nil || o.Type == nil {
100-
var ret string
100+
var ret EntityResponseIncludedOncallType
101101
return ret
102102
}
103103
return *o.Type
104104
}
105105

106106
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
107107
// and a boolean to check if the value has been set.
108-
func (o *EntityResponseIncludedOncall) GetTypeOk() (*string, bool) {
108+
func (o *EntityResponseIncludedOncall) GetTypeOk() (*EntityResponseIncludedOncallType, bool) {
109109
if o == nil || o.Type == nil {
110110
return nil, false
111111
}
@@ -117,8 +117,8 @@ func (o *EntityResponseIncludedOncall) HasType() bool {
117117
return o != nil && o.Type != nil
118118
}
119119

120-
// SetType gets a reference to the given string and assigns it to the Type field.
121-
func (o *EntityResponseIncludedOncall) SetType(v string) {
120+
// SetType gets a reference to the given EntityResponseIncludedOncallType and assigns it to the Type field.
121+
func (o *EntityResponseIncludedOncall) SetType(v EntityResponseIncludedOncallType) {
122122
o.Type = &v
123123
}
124124

@@ -149,7 +149,7 @@ func (o *EntityResponseIncludedOncall) UnmarshalJSON(bytes []byte) (err error) {
149149
all := struct {
150150
Attributes *EntityResponseIncludedRelatedOncallAttributes `json:"attributes,omitempty"`
151151
Id *string `json:"id,omitempty"`
152-
Type *string `json:"type,omitempty"`
152+
Type *EntityResponseIncludedOncallType `json:"type,omitempty"`
153153
}{}
154154
if err = datadog.Unmarshal(bytes, &all); err != nil {
155155
return datadog.Unmarshal(bytes, &o.UnparsedObject)
@@ -167,7 +167,11 @@ func (o *EntityResponseIncludedOncall) UnmarshalJSON(bytes []byte) (err error) {
167167
}
168168
o.Attributes = all.Attributes
169169
o.Id = all.Id
170-
o.Type = all.Type
170+
if all.Type != nil && !all.Type.IsValid() {
171+
hasInvalidField = true
172+
} else {
173+
o.Type = all.Type
174+
}
171175

172176
if len(additionalProperties) > 0 {
173177
o.AdditionalProperties = additionalProperties
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"fmt"
9+
10+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
11+
)
12+
13+
// EntityResponseIncludedOncallType Oncall type.
14+
type EntityResponseIncludedOncallType string
15+
16+
// List of EntityResponseIncludedOncallType.
17+
const (
18+
ENTITYRESPONSEINCLUDEDONCALLTYPE_ONCALL EntityResponseIncludedOncallType = "oncall"
19+
)
20+
21+
var allowedEntityResponseIncludedOncallTypeEnumValues = []EntityResponseIncludedOncallType{
22+
ENTITYRESPONSEINCLUDEDONCALLTYPE_ONCALL,
23+
}
24+
25+
// GetAllowedValues reeturns the list of possible values.
26+
func (v *EntityResponseIncludedOncallType) GetAllowedValues() []EntityResponseIncludedOncallType {
27+
return allowedEntityResponseIncludedOncallTypeEnumValues
28+
}
29+
30+
// UnmarshalJSON deserializes the given payload.
31+
func (v *EntityResponseIncludedOncallType) UnmarshalJSON(src []byte) error {
32+
var value string
33+
err := datadog.Unmarshal(src, &value)
34+
if err != nil {
35+
return err
36+
}
37+
*v = EntityResponseIncludedOncallType(value)
38+
return nil
39+
}
40+
41+
// NewEntityResponseIncludedOncallTypeFromValue returns a pointer to a valid EntityResponseIncludedOncallType
42+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
43+
func NewEntityResponseIncludedOncallTypeFromValue(v string) (*EntityResponseIncludedOncallType, error) {
44+
ev := EntityResponseIncludedOncallType(v)
45+
if ev.IsValid() {
46+
return &ev, nil
47+
}
48+
return nil, fmt.Errorf("invalid value '%v' for EntityResponseIncludedOncallType: valid values are %v", v, allowedEntityResponseIncludedOncallTypeEnumValues)
49+
}
50+
51+
// IsValid return true if the value is valid for the enum, false otherwise.
52+
func (v EntityResponseIncludedOncallType) IsValid() bool {
53+
for _, existing := range allowedEntityResponseIncludedOncallTypeEnumValues {
54+
if existing == v {
55+
return true
56+
}
57+
}
58+
return false
59+
}
60+
61+
// Ptr returns reference to EntityResponseIncludedOncallType value.
62+
func (v EntityResponseIncludedOncallType) Ptr() *EntityResponseIncludedOncallType {
63+
return &v
64+
}

0 commit comments

Comments
 (0)