-
Notifications
You must be signed in to change notification settings - Fork 0
/
listbillingusage.go
executable file
·147 lines (127 loc) · 3.7 KB
/
listbillingusage.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
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
package operations
import (
"encoding/json"
"fmt"
"github.com/speakeasy-sdks/singlestore-sample-sdk/pkg/models/shared"
"net/http"
)
// ListBillingUsageAggregateBy - The aggregate type used to group usage which includes hour, day and month. default is hour
type ListBillingUsageAggregateBy string
const (
ListBillingUsageAggregateByHour ListBillingUsageAggregateBy = "hour"
ListBillingUsageAggregateByDay ListBillingUsageAggregateBy = "day"
ListBillingUsageAggregateByMonth ListBillingUsageAggregateBy = "month"
)
func (e ListBillingUsageAggregateBy) ToPointer() *ListBillingUsageAggregateBy {
return &e
}
func (e *ListBillingUsageAggregateBy) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "hour":
fallthrough
case "day":
fallthrough
case "month":
*e = ListBillingUsageAggregateBy(v)
return nil
default:
return fmt.Errorf("invalid value for ListBillingUsageAggregateBy: %v", v)
}
}
// ListBillingUsageMetric - Metrics include ComputeCredit, StorageAvgByte. default is all
type ListBillingUsageMetric string
const (
ListBillingUsageMetricComputeCredit ListBillingUsageMetric = "ComputeCredit"
ListBillingUsageMetricStorageAvgByte ListBillingUsageMetric = "StorageAvgByte"
)
func (e ListBillingUsageMetric) ToPointer() *ListBillingUsageMetric {
return &e
}
func (e *ListBillingUsageMetric) UnmarshalJSON(data []byte) error {
var v string
if err := json.Unmarshal(data, &v); err != nil {
return err
}
switch v {
case "ComputeCredit":
fallthrough
case "StorageAvgByte":
*e = ListBillingUsageMetric(v)
return nil
default:
return fmt.Errorf("invalid value for ListBillingUsageMetric: %v", v)
}
}
type ListBillingUsageRequest struct {
// The end time for the usage interval valid UTC ISO8601 format e.g. 2023-07-30T18:30:00Z
EndTime string `queryParam:"style=form,explode=true,name=endTime"`
// The start time for the usage interval in valid UTC ISO8601 format e.g. 2023-07-30T18:30:00Z
StartTime string `queryParam:"style=form,explode=true,name=startTime"`
// The aggregate type used to group usage which includes hour, day and month. default is hour
AggregateBy *ListBillingUsageAggregateBy `queryParam:"style=form,explode=true,name=aggregateBy"`
// Metrics include ComputeCredit, StorageAvgByte. default is all
Metric *ListBillingUsageMetric `queryParam:"style=form,explode=true,name=metric"`
}
func (o *ListBillingUsageRequest) GetEndTime() string {
if o == nil {
return ""
}
return o.EndTime
}
func (o *ListBillingUsageRequest) GetStartTime() string {
if o == nil {
return ""
}
return o.StartTime
}
func (o *ListBillingUsageRequest) GetAggregateBy() *ListBillingUsageAggregateBy {
if o == nil {
return nil
}
return o.AggregateBy
}
func (o *ListBillingUsageRequest) GetMetric() *ListBillingUsageMetric {
if o == nil {
return nil
}
return o.Metric
}
type ListBillingUsageResponse struct {
// OK
BillingUsage *shared.BillingUsage
// HTTP response content type for this operation
ContentType string
// HTTP response status code for this operation
StatusCode int
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
}
func (o *ListBillingUsageResponse) GetBillingUsage() *shared.BillingUsage {
if o == nil {
return nil
}
return o.BillingUsage
}
func (o *ListBillingUsageResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}
func (o *ListBillingUsageResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}
func (o *ListBillingUsageResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}