-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 7dfcc162 of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Jan 16, 2025
1 parent
851e958
commit d00a719
Showing
10 changed files
with
567 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
api/datadogV1/model_monitor_formula_and_function_metric_aggregator.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
68 changes: 68 additions & 0 deletions
68
api/datadogV1/model_monitor_formula_and_function_metric_data_source.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
Oops, something went wrong.