Skip to content

Commit

Permalink
Regenerate client from commit 7dfcc162 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jan 16, 2025
1 parent 851e958 commit d00a719
Show file tree
Hide file tree
Showing 10 changed files with 567 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.6",
"regenerated": "2025-01-15 18:03:16.492918",
"spec_repo_commit": "e54847a1"
"regenerated": "2025-01-16 16:38:44.085591",
"spec_repo_commit": "7dfcc162"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-01-15 18:03:16.518844",
"spec_repo_commit": "e54847a1"
"regenerated": "2025-01-16 16:38:44.103228",
"spec_repo_commit": "7dfcc162"
}
}
}
57 changes: 57 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6930,10 +6930,67 @@ components:
- SPANS
- DATABASE_QUERIES
- NETWORK
MonitorFormulaAndFunctionMetricAggregator:
description: Aggregation methods for metric queries.
enum:
- avg
- sum
- max
- min
- last
- area
- l2norm
- percentile
- stddev
example: avg
type: string
x-enum-varnames:
- AVG
- SUM
- MAX
- MIN
- LAST
- AREA
- L2NORM
- PERCENTILE
- STDDEV
MonitorFormulaAndFunctionMetricDataSource:
description: Data source for metric-based queries.
enum:
- metrics
- cloud_cost
- datadog_usage
example: metrics
type: string
x-enum-varnames:
- METRICS
- CLOUD_COST
- DATADOG_USAGE
MonitorFormulaAndFunctionMetricQueryDefinition:
description: A formula and functions metric query.
properties:
aggregator:
$ref: '#/components/schemas/MonitorFormulaAndFunctionMetricAggregator'
data_source:
$ref: '#/components/schemas/MonitorFormulaAndFunctionMetricDataSource'
name:
description: Name of the query for use in formulas.
example: cpu_usage
type: string
query:
description: The monitor query.
example: avg(last_5m):avg:system.load.1{*} > 44
type: string
required:
- name
- data_source
- query
type: object
MonitorFormulaAndFunctionQueryDefinition:
description: A formula and function query.
oneOf:
- $ref: '#/components/schemas/MonitorFormulaAndFunctionEventQueryDefinition'
- $ref: '#/components/schemas/MonitorFormulaAndFunctionMetricQueryDefinition'
MonitorGroupSearchResponse:
description: The response of a monitor group search.
example:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

package datadogV1

import (
"fmt"

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

// MonitorFormulaAndFunctionMetricAggregator Aggregation methods for metric queries.
type MonitorFormulaAndFunctionMetricAggregator string

// List of MonitorFormulaAndFunctionMetricAggregator.
const (
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_AVG MonitorFormulaAndFunctionMetricAggregator = "avg"
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_SUM MonitorFormulaAndFunctionMetricAggregator = "sum"
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_MAX MonitorFormulaAndFunctionMetricAggregator = "max"
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_MIN MonitorFormulaAndFunctionMetricAggregator = "min"
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_LAST MonitorFormulaAndFunctionMetricAggregator = "last"
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_AREA MonitorFormulaAndFunctionMetricAggregator = "area"
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_L2NORM MonitorFormulaAndFunctionMetricAggregator = "l2norm"
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_PERCENTILE MonitorFormulaAndFunctionMetricAggregator = "percentile"
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_STDDEV MonitorFormulaAndFunctionMetricAggregator = "stddev"
)

var allowedMonitorFormulaAndFunctionMetricAggregatorEnumValues = []MonitorFormulaAndFunctionMetricAggregator{
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_AVG,
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_SUM,
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_MAX,
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_MIN,
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_LAST,
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_AREA,
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_L2NORM,
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_PERCENTILE,
MONITORFORMULAANDFUNCTIONMETRICAGGREGATOR_STDDEV,
}

// GetAllowedValues reeturns the list of possible values.
func (v *MonitorFormulaAndFunctionMetricAggregator) GetAllowedValues() []MonitorFormulaAndFunctionMetricAggregator {
return allowedMonitorFormulaAndFunctionMetricAggregatorEnumValues
}

// UnmarshalJSON deserializes the given payload.
func (v *MonitorFormulaAndFunctionMetricAggregator) UnmarshalJSON(src []byte) error {
var value string
err := datadog.Unmarshal(src, &value)
if err != nil {
return err
}
*v = MonitorFormulaAndFunctionMetricAggregator(value)
return nil
}

// NewMonitorFormulaAndFunctionMetricAggregatorFromValue returns a pointer to a valid MonitorFormulaAndFunctionMetricAggregator
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
func NewMonitorFormulaAndFunctionMetricAggregatorFromValue(v string) (*MonitorFormulaAndFunctionMetricAggregator, error) {
ev := MonitorFormulaAndFunctionMetricAggregator(v)
if ev.IsValid() {
return &ev, nil
}
return nil, fmt.Errorf("invalid value '%v' for MonitorFormulaAndFunctionMetricAggregator: valid values are %v", v, allowedMonitorFormulaAndFunctionMetricAggregatorEnumValues)
}

// IsValid return true if the value is valid for the enum, false otherwise.
func (v MonitorFormulaAndFunctionMetricAggregator) IsValid() bool {
for _, existing := range allowedMonitorFormulaAndFunctionMetricAggregatorEnumValues {
if existing == v {
return true
}
}
return false
}

// Ptr returns reference to MonitorFormulaAndFunctionMetricAggregator value.
func (v MonitorFormulaAndFunctionMetricAggregator) Ptr() *MonitorFormulaAndFunctionMetricAggregator {
return &v
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

package datadogV1

import (
"fmt"

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

// MonitorFormulaAndFunctionMetricDataSource Data source for metric-based queries.
type MonitorFormulaAndFunctionMetricDataSource string

// List of MonitorFormulaAndFunctionMetricDataSource.
const (
MONITORFORMULAANDFUNCTIONMETRICDATASOURCE_METRICS MonitorFormulaAndFunctionMetricDataSource = "metrics"
MONITORFORMULAANDFUNCTIONMETRICDATASOURCE_CLOUD_COST MonitorFormulaAndFunctionMetricDataSource = "cloud_cost"
MONITORFORMULAANDFUNCTIONMETRICDATASOURCE_DATADOG_USAGE MonitorFormulaAndFunctionMetricDataSource = "datadog_usage"
)

var allowedMonitorFormulaAndFunctionMetricDataSourceEnumValues = []MonitorFormulaAndFunctionMetricDataSource{
MONITORFORMULAANDFUNCTIONMETRICDATASOURCE_METRICS,
MONITORFORMULAANDFUNCTIONMETRICDATASOURCE_CLOUD_COST,
MONITORFORMULAANDFUNCTIONMETRICDATASOURCE_DATADOG_USAGE,
}

// GetAllowedValues reeturns the list of possible values.
func (v *MonitorFormulaAndFunctionMetricDataSource) GetAllowedValues() []MonitorFormulaAndFunctionMetricDataSource {
return allowedMonitorFormulaAndFunctionMetricDataSourceEnumValues
}

// UnmarshalJSON deserializes the given payload.
func (v *MonitorFormulaAndFunctionMetricDataSource) UnmarshalJSON(src []byte) error {
var value string
err := datadog.Unmarshal(src, &value)
if err != nil {
return err
}
*v = MonitorFormulaAndFunctionMetricDataSource(value)
return nil
}

// NewMonitorFormulaAndFunctionMetricDataSourceFromValue returns a pointer to a valid MonitorFormulaAndFunctionMetricDataSource
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
func NewMonitorFormulaAndFunctionMetricDataSourceFromValue(v string) (*MonitorFormulaAndFunctionMetricDataSource, error) {
ev := MonitorFormulaAndFunctionMetricDataSource(v)
if ev.IsValid() {
return &ev, nil
}
return nil, fmt.Errorf("invalid value '%v' for MonitorFormulaAndFunctionMetricDataSource: valid values are %v", v, allowedMonitorFormulaAndFunctionMetricDataSourceEnumValues)
}

// IsValid return true if the value is valid for the enum, false otherwise.
func (v MonitorFormulaAndFunctionMetricDataSource) IsValid() bool {
for _, existing := range allowedMonitorFormulaAndFunctionMetricDataSourceEnumValues {
if existing == v {
return true
}
}
return false
}

// Ptr returns reference to MonitorFormulaAndFunctionMetricDataSource value.
func (v MonitorFormulaAndFunctionMetricDataSource) Ptr() *MonitorFormulaAndFunctionMetricDataSource {
return &v
}
Loading

0 comments on commit d00a719

Please sign in to comment.