Skip to content

Commit

Permalink
Regenerate client from commit d7b47312 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Apr 18, 2023
1 parent ec22bde commit 8dc0dfe
Show file tree
Hide file tree
Showing 1,301 changed files with 15,417 additions and 5 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2023-04-17 18:07:40.313240",
"spec_repo_commit": "25a92e6d"
"regenerated": "2023-04-18 13:00:08.011836",
"spec_repo_commit": "d7b47312"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-04-17 18:07:40.326034",
"spec_repo_commit": "25a92e6d"
"regenerated": "2023-04-18 13:00:08.024394",
"spec_repo_commit": "d7b47312"
}
}
}
7 changes: 7 additions & 0 deletions api/datadog/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,13 @@ func (v *NullableTime) UnmarshalJSON(src []byte) error {
return json.Unmarshal(src, &v.value)
}

// DeleteKeys helper method to delete keys from a map
func DeleteKeys[V any](obj map[string]V, keysToDelete *[]string) {
for _, s := range *keysToDelete {
delete(obj, s)
}
}

// ContainsUnparsedObject returns true if the given data contains an unparsed object from the API.
func ContainsUnparsedObject(i interface{}) (bool, interface{}) {
v := reflect.ValueOf(i)
Expand Down
12 changes: 12 additions & 0 deletions api/datadogV1/model_add_signal_to_incident_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package datadogV1
import (
"encoding/json"
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// AddSignalToIncidentRequest Attributes describing which incident to add the signal to.
Expand Down Expand Up @@ -166,8 +168,18 @@ func (o *AddSignalToIncidentRequest) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"add_to_signal_timeline", "incident_id", "version"})
} else {
return err
}
o.AddToSignalTimeline = all.AddToSignalTimeline
o.IncidentId = all.IncidentId
o.Version = all.Version
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_alert_graph_widget_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package datadogV1
import (
"encoding/json"
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// AlertGraphWidgetDefinition Alert graphs are timeseries graphs showing the current status of any monitor defined on your system.
Expand Down Expand Up @@ -300,6 +302,12 @@ func (o *AlertGraphWidgetDefinition) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"alert_id", "time", "title", "title_align", "title_size", "type", "viz_type"})
} else {
return err
}
if v := all.TitleAlign; v != nil && !v.IsValid() {
err = json.Unmarshal(bytes, &raw)
if err != nil {
Expand Down Expand Up @@ -338,5 +346,9 @@ func (o *AlertGraphWidgetDefinition) UnmarshalJSON(bytes []byte) (err error) {
o.TitleSize = all.TitleSize
o.Type = all.Type
o.VizType = all.VizType
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_alert_value_widget_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package datadogV1
import (
"encoding/json"
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// AlertValueWidgetDefinition Alert values are query values showing the current value of the metric in any monitor defined on your system.
Expand Down Expand Up @@ -336,6 +338,12 @@ func (o *AlertValueWidgetDefinition) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"alert_id", "precision", "text_align", "title", "title_align", "title_size", "type", "unit"})
} else {
return err
}
if v := all.TextAlign; v != nil && !v.IsValid() {
err = json.Unmarshal(bytes, &raw)
if err != nil {
Expand Down Expand Up @@ -368,5 +376,9 @@ func (o *AlertValueWidgetDefinition) UnmarshalJSON(bytes []byte) (err error) {
o.TitleSize = all.TitleSize
o.Type = all.Type
o.Unit = all.Unit
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_api_error_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package datadogV1
import (
"encoding/json"
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// APIErrorResponse Error response object.
Expand Down Expand Up @@ -98,6 +100,16 @@ func (o *APIErrorResponse) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"errors"})
} else {
return err
}
o.Errors = all.Errors
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_api_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package datadogV1

import (
"encoding/json"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// ApiKey Datadog API key.
Expand Down Expand Up @@ -195,9 +197,19 @@ func (o *ApiKey) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"created", "created_by", "key", "name"})
} else {
return err
}
o.Created = all.Created
o.CreatedBy = all.CreatedBy
o.Key = all.Key
o.Name = all.Name
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_api_key_list_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package datadogV1

import (
"encoding/json"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// ApiKeyListResponse List of API and application keys available for a given organization.
Expand Down Expand Up @@ -93,6 +95,16 @@ func (o *ApiKeyListResponse) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"api_keys"})
} else {
return err
}
o.ApiKeys = all.ApiKeys
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_api_key_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package datadogV1

import (
"encoding/json"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// ApiKeyResponse An API key with its associated metadata.
Expand Down Expand Up @@ -93,6 +95,12 @@ func (o *ApiKeyResponse) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"api_key"})
} else {
return err
}
if all.ApiKey != nil && all.ApiKey.UnparsedObject != nil && o.UnparsedObject == nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
Expand All @@ -101,5 +109,9 @@ func (o *ApiKeyResponse) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
}
o.ApiKey = all.ApiKey
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_apm_stats_query_column_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package datadogV1
import (
"encoding/json"
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// ApmStatsQueryColumnType Column properties.
Expand Down Expand Up @@ -200,6 +202,12 @@ func (o *ApmStatsQueryColumnType) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"alias", "cell_display_mode", "name", "order"})
} else {
return err
}
if v := all.CellDisplayMode; v != nil && !v.IsValid() {
err = json.Unmarshal(bytes, &raw)
if err != nil {
Expand All @@ -220,5 +228,9 @@ func (o *ApmStatsQueryColumnType) UnmarshalJSON(bytes []byte) (err error) {
o.CellDisplayMode = all.CellDisplayMode
o.Name = all.Name
o.Order = all.Order
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_apm_stats_query_definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ package datadogV1
import (
"encoding/json"
"fmt"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// ApmStatsQueryDefinition The APM stats query for table and distributions widgets.
Expand Down Expand Up @@ -294,6 +296,12 @@ func (o *ApmStatsQueryDefinition) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"columns", "env", "name", "primary_tag", "resource", "row_type", "service"})
} else {
return err
}
if v := all.RowType; !v.IsValid() {
err = json.Unmarshal(bytes, &raw)
if err != nil {
Expand All @@ -309,5 +317,9 @@ func (o *ApmStatsQueryDefinition) UnmarshalJSON(bytes []byte) (err error) {
o.Resource = all.Resource
o.RowType = all.RowType
o.Service = all.Service
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_application_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package datadogV1

import (
"encoding/json"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// ApplicationKey An application key with its associated metadata.
Expand Down Expand Up @@ -161,8 +163,18 @@ func (o *ApplicationKey) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"hash", "name", "owner"})
} else {
return err
}
o.Hash = all.Hash
o.Name = all.Name
o.Owner = all.Owner
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_application_key_list_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package datadogV1

import (
"encoding/json"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// ApplicationKeyListResponse An application key response.
Expand Down Expand Up @@ -93,6 +95,16 @@ func (o *ApplicationKeyListResponse) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"application_keys"})
} else {
return err
}
o.ApplicationKeys = all.ApplicationKeys
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
12 changes: 12 additions & 0 deletions api/datadogV1/model_application_key_response.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ package datadogV1

import (
"encoding/json"

"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// ApplicationKeyResponse An application key response.
Expand Down Expand Up @@ -93,6 +95,12 @@ func (o *ApplicationKeyResponse) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
return nil
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"application_key"})
} else {
return err
}
if all.ApplicationKey != nil && all.ApplicationKey.UnparsedObject != nil && o.UnparsedObject == nil {
err = json.Unmarshal(bytes, &raw)
if err != nil {
Expand All @@ -101,5 +109,9 @@ func (o *ApplicationKeyResponse) UnmarshalJSON(bytes []byte) (err error) {
o.UnparsedObject = raw
}
o.ApplicationKey = all.ApplicationKey
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

return nil
}
Loading

0 comments on commit 8dc0dfe

Please sign in to comment.