forked from DataDog/datadog-api-client-go
/
model_usage_attribution_sort.go
148 lines (129 loc) · 5.15 KB
/
model_usage_attribution_sort.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/*
* 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.
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package datadog
import (
"encoding/json"
"fmt"
)
// UsageAttributionSort The field to sort by.
type UsageAttributionSort string
// List of UsageAttributionSort
const (
USAGEATTRIBUTIONSORT_API_PERCENTAGE UsageAttributionSort = "api_percentage"
USAGEATTRIBUTIONSORT_SNMP_USAGE UsageAttributionSort = "snmp_usage"
USAGEATTRIBUTIONSORT_APM_HOST_USAGE UsageAttributionSort = "apm_host_usage"
USAGEATTRIBUTIONSORT_API_USAGE UsageAttributionSort = "api_usage"
USAGEATTRIBUTIONSORT_CONTAINER_USAGE UsageAttributionSort = "container_usage"
USAGEATTRIBUTIONSORT_CUSTOM_TIMESERIES_PERCENTAGE UsageAttributionSort = "custom_timeseries_percentage"
USAGEATTRIBUTIONSORT_CONTAINER_PERCENTAGE UsageAttributionSort = "container_percentage"
USAGEATTRIBUTIONSORT_APM_HOST_PERCENTAGE UsageAttributionSort = "apm_host_percentage"
USAGEATTRIBUTIONSORT_NPM_HOST_PERCENTAGE UsageAttributionSort = "npm_host_percentage"
USAGEATTRIBUTIONSORT_BROWSER_PERCENTAGE UsageAttributionSort = "browser_percentage"
USAGEATTRIBUTIONSORT_BROWSER_USAGE UsageAttributionSort = "browser_usage"
USAGEATTRIBUTIONSORT_INFRA_HOST_PERCENTAGE UsageAttributionSort = "infra_host_percentage"
USAGEATTRIBUTIONSORT_SNMP_PERCENTAGE UsageAttributionSort = "snmp_percentage"
USAGEATTRIBUTIONSORT_NPM_HOST_USAGE UsageAttributionSort = "npm_host_usage"
USAGEATTRIBUTIONSORT_INFRA_HOST_USAGE UsageAttributionSort = "infra_host_usage"
USAGEATTRIBUTIONSORT_CUSTOM_TIMESERIES_USAGE UsageAttributionSort = "custom_timeseries_usage"
USAGEATTRIBUTIONSORT_LAMBDA_FUNCTIONS_USAGE UsageAttributionSort = "lambda_functions_usage"
USAGEATTRIBUTIONSORT_LAMBDA_FUNCTIONS_PERCENTAGE UsageAttributionSort = "lambda_functions_percentage"
USAGEATTRIBUTIONSORT_LAMBDA_INVOCATIONS_USAGE UsageAttributionSort = "lambda_invocations_usage"
USAGEATTRIBUTIONSORT_LAMBDA_INVOCATIONS_PERCENTAGE UsageAttributionSort = "lambda_invocations_percentage"
USAGEATTRIBUTIONSORT_LAMBDA_USAGE UsageAttributionSort = "lambda_usage"
USAGEATTRIBUTIONSORT_LAMBDA_PERCENTAGE UsageAttributionSort = "lambda_percentage"
)
var allowedUsageAttributionSortEnumValues = []UsageAttributionSort{
"api_percentage",
"snmp_usage",
"apm_host_usage",
"api_usage",
"container_usage",
"custom_timeseries_percentage",
"container_percentage",
"apm_host_percentage",
"npm_host_percentage",
"browser_percentage",
"browser_usage",
"infra_host_percentage",
"snmp_percentage",
"npm_host_usage",
"infra_host_usage",
"custom_timeseries_usage",
"lambda_functions_usage",
"lambda_functions_percentage",
"lambda_invocations_usage",
"lambda_invocations_percentage",
"lambda_usage",
"lambda_percentage",
}
func (w *UsageAttributionSort) GetAllowedValues() []UsageAttributionSort {
return allowedUsageAttributionSortEnumValues
}
func (v *UsageAttributionSort) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
ev, err := NewUsageAttributionSortFromValue(value)
if err != nil {
return err
}
*v = *ev
return nil
}
// NewUsageAttributionSortFromValue returns a pointer to a valid UsageAttributionSort
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewUsageAttributionSortFromValue(v string) (*UsageAttributionSort, error) {
ev := UsageAttributionSort(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for UsageAttributionSort: valid values are %v", v, allowedUsageAttributionSortEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v UsageAttributionSort) IsValid() bool {
for _, existing := range allowedUsageAttributionSortEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to UsageAttributionSort value
func (v UsageAttributionSort) Ptr() *UsageAttributionSort {
return &v
}
type NullableUsageAttributionSort struct {
value *UsageAttributionSort
isSet bool
}
func (v NullableUsageAttributionSort) Get() *UsageAttributionSort {
return v.value
}
func (v *NullableUsageAttributionSort) Set(val *UsageAttributionSort) {
v.value = val
v.isSet = true
}
func (v NullableUsageAttributionSort) IsSet() bool {
return v.isSet
}
func (v *NullableUsageAttributionSort) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUsageAttributionSort(val *UsageAttributionSort) *NullableUsageAttributionSort {
return &NullableUsageAttributionSort{value: val, isSet: true}
}
func (v NullableUsageAttributionSort) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUsageAttributionSort) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}