Skip to content

Commit

Permalink
Fix logs aggregate integer facets (#1812)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Jan 5, 2023
1 parent b152244 commit 4c58cda
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 22 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-01-05 14:33:40.733254",
"spec_repo_commit": "024e9975"
"regenerated": "2023-01-05 16:38:45.470666",
"spec_repo_commit": "b786ccc6"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-01-05 14:33:40.747896",
"spec_repo_commit": "024e9975"
"regenerated": "2023-01-05 16:38:45.482448",
"spec_repo_commit": "b786ccc6"
}
}
}
11 changes: 0 additions & 11 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1434,11 +1434,6 @@ components:
by:
additionalProperties:
description: The values for each group-by.
oneOf:
- type: string
- format: double
type: number
- type: boolean
description: The key-value pairs for each group-by.
example:
'@ci.provider.name': gitlab
Expand Down Expand Up @@ -1691,11 +1686,6 @@ components:
by:
additionalProperties:
description: The values for each group-by.
oneOf:
- type: string
- format: double
type: number
- type: boolean
description: The key-value pairs for each group-by.
example:
'@test.service': web-ui-tests
Expand Down Expand Up @@ -4680,7 +4670,6 @@ components:
by:
additionalProperties:
description: The values for each group by
type: string
description: The key, value pairs for each group by
example:
'@state': success
Expand Down
14 changes: 7 additions & 7 deletions api/datadogV2/model_logs_aggregate_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
// LogsAggregateBucket A bucket values
type LogsAggregateBucket struct {
// The key, value pairs for each group by
By map[string]string `json:"by,omitempty"`
By map[string]interface{} `json:"by,omitempty"`
// A map of the metric name -> value for regular compute or list of values for a timeseries
Computes map[string]LogsAggregateBucketValue `json:"computes,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand All @@ -37,17 +37,17 @@ func NewLogsAggregateBucketWithDefaults() *LogsAggregateBucket {
}

// GetBy returns the By field value if set, zero value otherwise.
func (o *LogsAggregateBucket) GetBy() map[string]string {
func (o *LogsAggregateBucket) GetBy() map[string]interface{} {
if o == nil || o.By == nil {
var ret map[string]string
var ret map[string]interface{}
return ret
}
return o.By
}

// GetByOk returns a tuple with the By field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *LogsAggregateBucket) GetByOk() (*map[string]string, bool) {
func (o *LogsAggregateBucket) GetByOk() (*map[string]interface{}, bool) {
if o == nil || o.By == nil {
return nil, false
}
Expand All @@ -59,8 +59,8 @@ func (o *LogsAggregateBucket) HasBy() bool {
return o != nil && o.By != nil
}

// SetBy gets a reference to the given map[string]string and assigns it to the By field.
func (o *LogsAggregateBucket) SetBy(v map[string]string) {
// SetBy gets a reference to the given map[string]interface{} and assigns it to the By field.
func (o *LogsAggregateBucket) SetBy(v map[string]interface{}) {
o.By = v
}

Expand Down Expand Up @@ -115,7 +115,7 @@ func (o LogsAggregateBucket) MarshalJSON() ([]byte, error) {
func (o *LogsAggregateBucket) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
By map[string]string `json:"by,omitempty"`
By map[string]interface{} `json:"by,omitempty"`
Computes map[string]LogsAggregateBucketValue `json:"computes,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
Expand Down

0 comments on commit 4c58cda

Please sign in to comment.