Skip to content

Commit 9a43533

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit fc2584f of spec repo (#3917)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent 85ed86e commit 9a43533

144 files changed

Lines changed: 8758 additions & 15 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v2/openapi.yaml

Lines changed: 590 additions & 4 deletions
Large diffs are not rendered by default.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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+
// ApmDependencyStatName The APM dependency statistic to query.
14+
type ApmDependencyStatName string
15+
16+
// List of ApmDependencyStatName.
17+
const (
18+
APMDEPENDENCYSTATNAME_AVG_DURATION ApmDependencyStatName = "avg_duration"
19+
APMDEPENDENCYSTATNAME_AVG_ROOT_DURATION ApmDependencyStatName = "avg_root_duration"
20+
APMDEPENDENCYSTATNAME_AVG_SPANS_PER_TRACE ApmDependencyStatName = "avg_spans_per_trace"
21+
APMDEPENDENCYSTATNAME_ERROR_RATE ApmDependencyStatName = "error_rate"
22+
APMDEPENDENCYSTATNAME_PCT_EXEC_TIME ApmDependencyStatName = "pct_exec_time"
23+
APMDEPENDENCYSTATNAME_PCT_OF_TRACES ApmDependencyStatName = "pct_of_traces"
24+
APMDEPENDENCYSTATNAME_TOTAL_TRACES_COUNT ApmDependencyStatName = "total_traces_count"
25+
)
26+
27+
var allowedApmDependencyStatNameEnumValues = []ApmDependencyStatName{
28+
APMDEPENDENCYSTATNAME_AVG_DURATION,
29+
APMDEPENDENCYSTATNAME_AVG_ROOT_DURATION,
30+
APMDEPENDENCYSTATNAME_AVG_SPANS_PER_TRACE,
31+
APMDEPENDENCYSTATNAME_ERROR_RATE,
32+
APMDEPENDENCYSTATNAME_PCT_EXEC_TIME,
33+
APMDEPENDENCYSTATNAME_PCT_OF_TRACES,
34+
APMDEPENDENCYSTATNAME_TOTAL_TRACES_COUNT,
35+
}
36+
37+
// GetAllowedValues reeturns the list of possible values.
38+
func (v *ApmDependencyStatName) GetAllowedValues() []ApmDependencyStatName {
39+
return allowedApmDependencyStatNameEnumValues
40+
}
41+
42+
// UnmarshalJSON deserializes the given payload.
43+
func (v *ApmDependencyStatName) UnmarshalJSON(src []byte) error {
44+
var value string
45+
err := datadog.Unmarshal(src, &value)
46+
if err != nil {
47+
return err
48+
}
49+
*v = ApmDependencyStatName(value)
50+
return nil
51+
}
52+
53+
// NewApmDependencyStatNameFromValue returns a pointer to a valid ApmDependencyStatName
54+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
55+
func NewApmDependencyStatNameFromValue(v string) (*ApmDependencyStatName, error) {
56+
ev := ApmDependencyStatName(v)
57+
if ev.IsValid() {
58+
return &ev, nil
59+
}
60+
return nil, fmt.Errorf("invalid value '%v' for ApmDependencyStatName: valid values are %v", v, allowedApmDependencyStatNameEnumValues)
61+
}
62+
63+
// IsValid return true if the value is valid for the enum, false otherwise.
64+
func (v ApmDependencyStatName) IsValid() bool {
65+
for _, existing := range allowedApmDependencyStatNameEnumValues {
66+
if existing == v {
67+
return true
68+
}
69+
}
70+
return false
71+
}
72+
73+
// Ptr returns reference to ApmDependencyStatName value.
74+
func (v ApmDependencyStatName) Ptr() *ApmDependencyStatName {
75+
return &v
76+
}
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+
// ApmDependencyStatsDataSource A data source for APM dependency statistics queries.
14+
type ApmDependencyStatsDataSource string
15+
16+
// List of ApmDependencyStatsDataSource.
17+
const (
18+
APMDEPENDENCYSTATSDATASOURCE_APM_DEPENDENCY_STATS ApmDependencyStatsDataSource = "apm_dependency_stats"
19+
)
20+
21+
var allowedApmDependencyStatsDataSourceEnumValues = []ApmDependencyStatsDataSource{
22+
APMDEPENDENCYSTATSDATASOURCE_APM_DEPENDENCY_STATS,
23+
}
24+
25+
// GetAllowedValues reeturns the list of possible values.
26+
func (v *ApmDependencyStatsDataSource) GetAllowedValues() []ApmDependencyStatsDataSource {
27+
return allowedApmDependencyStatsDataSourceEnumValues
28+
}
29+
30+
// UnmarshalJSON deserializes the given payload.
31+
func (v *ApmDependencyStatsDataSource) UnmarshalJSON(src []byte) error {
32+
var value string
33+
err := datadog.Unmarshal(src, &value)
34+
if err != nil {
35+
return err
36+
}
37+
*v = ApmDependencyStatsDataSource(value)
38+
return nil
39+
}
40+
41+
// NewApmDependencyStatsDataSourceFromValue returns a pointer to a valid ApmDependencyStatsDataSource
42+
// for the value passed as argument, or an error if the value passed is not allowed by the enum.
43+
func NewApmDependencyStatsDataSourceFromValue(v string) (*ApmDependencyStatsDataSource, error) {
44+
ev := ApmDependencyStatsDataSource(v)
45+
if ev.IsValid() {
46+
return &ev, nil
47+
}
48+
return nil, fmt.Errorf("invalid value '%v' for ApmDependencyStatsDataSource: valid values are %v", v, allowedApmDependencyStatsDataSourceEnumValues)
49+
}
50+
51+
// IsValid return true if the value is valid for the enum, false otherwise.
52+
func (v ApmDependencyStatsDataSource) IsValid() bool {
53+
for _, existing := range allowedApmDependencyStatsDataSourceEnumValues {
54+
if existing == v {
55+
return true
56+
}
57+
}
58+
return false
59+
}
60+
61+
// Ptr returns reference to ApmDependencyStatsDataSource value.
62+
func (v ApmDependencyStatsDataSource) Ptr() *ApmDependencyStatsDataSource {
63+
return &v
64+
}

0 commit comments

Comments
 (0)