-
Notifications
You must be signed in to change notification settings - Fork 54
/
model_usage_billable_summary_hour.go
401 lines (352 loc) · 12.7 KB
/
model_usage_billable_summary_hour.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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
// 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 (
"time"
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)
// UsageBillableSummaryHour Response with monthly summary of data billed by Datadog.
type UsageBillableSummaryHour struct {
// The billing plan.
BillingPlan *string `json:"billing_plan,omitempty"`
// Shows the last date of usage.
EndDate *time.Time `json:"end_date,omitempty"`
// The number of organizations.
NumOrgs *int64 `json:"num_orgs,omitempty"`
// The organization name.
OrgName *string `json:"org_name,omitempty"`
// The organization public ID.
PublicId *string `json:"public_id,omitempty"`
// Shows usage aggregation for a billing period.
RatioInMonth *float64 `json:"ratio_in_month,omitempty"`
// The region of the organization.
Region *string `json:"region,omitempty"`
// Shows the first date of usage.
StartDate *time.Time `json:"start_date,omitempty"`
// Response with aggregated usage types.
Usage *UsageBillableSummaryKeys `json:"usage,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:"-"`
AdditionalProperties map[string]interface{}
}
// NewUsageBillableSummaryHour instantiates a new UsageBillableSummaryHour object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewUsageBillableSummaryHour() *UsageBillableSummaryHour {
this := UsageBillableSummaryHour{}
return &this
}
// NewUsageBillableSummaryHourWithDefaults instantiates a new UsageBillableSummaryHour object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewUsageBillableSummaryHourWithDefaults() *UsageBillableSummaryHour {
this := UsageBillableSummaryHour{}
return &this
}
// GetBillingPlan returns the BillingPlan field value if set, zero value otherwise.
func (o *UsageBillableSummaryHour) GetBillingPlan() string {
if o == nil || o.BillingPlan == nil {
var ret string
return ret
}
return *o.BillingPlan
}
// GetBillingPlanOk returns a tuple with the BillingPlan field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageBillableSummaryHour) GetBillingPlanOk() (*string, bool) {
if o == nil || o.BillingPlan == nil {
return nil, false
}
return o.BillingPlan, true
}
// HasBillingPlan returns a boolean if a field has been set.
func (o *UsageBillableSummaryHour) HasBillingPlan() bool {
return o != nil && o.BillingPlan != nil
}
// SetBillingPlan gets a reference to the given string and assigns it to the BillingPlan field.
func (o *UsageBillableSummaryHour) SetBillingPlan(v string) {
o.BillingPlan = &v
}
// GetEndDate returns the EndDate field value if set, zero value otherwise.
func (o *UsageBillableSummaryHour) GetEndDate() time.Time {
if o == nil || o.EndDate == nil {
var ret time.Time
return ret
}
return *o.EndDate
}
// GetEndDateOk returns a tuple with the EndDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageBillableSummaryHour) GetEndDateOk() (*time.Time, bool) {
if o == nil || o.EndDate == nil {
return nil, false
}
return o.EndDate, true
}
// HasEndDate returns a boolean if a field has been set.
func (o *UsageBillableSummaryHour) HasEndDate() bool {
return o != nil && o.EndDate != nil
}
// SetEndDate gets a reference to the given time.Time and assigns it to the EndDate field.
func (o *UsageBillableSummaryHour) SetEndDate(v time.Time) {
o.EndDate = &v
}
// GetNumOrgs returns the NumOrgs field value if set, zero value otherwise.
func (o *UsageBillableSummaryHour) GetNumOrgs() int64 {
if o == nil || o.NumOrgs == nil {
var ret int64
return ret
}
return *o.NumOrgs
}
// GetNumOrgsOk returns a tuple with the NumOrgs field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageBillableSummaryHour) GetNumOrgsOk() (*int64, bool) {
if o == nil || o.NumOrgs == nil {
return nil, false
}
return o.NumOrgs, true
}
// HasNumOrgs returns a boolean if a field has been set.
func (o *UsageBillableSummaryHour) HasNumOrgs() bool {
return o != nil && o.NumOrgs != nil
}
// SetNumOrgs gets a reference to the given int64 and assigns it to the NumOrgs field.
func (o *UsageBillableSummaryHour) SetNumOrgs(v int64) {
o.NumOrgs = &v
}
// GetOrgName returns the OrgName field value if set, zero value otherwise.
func (o *UsageBillableSummaryHour) GetOrgName() string {
if o == nil || o.OrgName == nil {
var ret string
return ret
}
return *o.OrgName
}
// GetOrgNameOk returns a tuple with the OrgName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageBillableSummaryHour) GetOrgNameOk() (*string, bool) {
if o == nil || o.OrgName == nil {
return nil, false
}
return o.OrgName, true
}
// HasOrgName returns a boolean if a field has been set.
func (o *UsageBillableSummaryHour) HasOrgName() bool {
return o != nil && o.OrgName != nil
}
// SetOrgName gets a reference to the given string and assigns it to the OrgName field.
func (o *UsageBillableSummaryHour) SetOrgName(v string) {
o.OrgName = &v
}
// GetPublicId returns the PublicId field value if set, zero value otherwise.
func (o *UsageBillableSummaryHour) GetPublicId() string {
if o == nil || o.PublicId == nil {
var ret string
return ret
}
return *o.PublicId
}
// GetPublicIdOk returns a tuple with the PublicId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageBillableSummaryHour) GetPublicIdOk() (*string, bool) {
if o == nil || o.PublicId == nil {
return nil, false
}
return o.PublicId, true
}
// HasPublicId returns a boolean if a field has been set.
func (o *UsageBillableSummaryHour) HasPublicId() bool {
return o != nil && o.PublicId != nil
}
// SetPublicId gets a reference to the given string and assigns it to the PublicId field.
func (o *UsageBillableSummaryHour) SetPublicId(v string) {
o.PublicId = &v
}
// GetRatioInMonth returns the RatioInMonth field value if set, zero value otherwise.
func (o *UsageBillableSummaryHour) GetRatioInMonth() float64 {
if o == nil || o.RatioInMonth == nil {
var ret float64
return ret
}
return *o.RatioInMonth
}
// GetRatioInMonthOk returns a tuple with the RatioInMonth field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageBillableSummaryHour) GetRatioInMonthOk() (*float64, bool) {
if o == nil || o.RatioInMonth == nil {
return nil, false
}
return o.RatioInMonth, true
}
// HasRatioInMonth returns a boolean if a field has been set.
func (o *UsageBillableSummaryHour) HasRatioInMonth() bool {
return o != nil && o.RatioInMonth != nil
}
// SetRatioInMonth gets a reference to the given float64 and assigns it to the RatioInMonth field.
func (o *UsageBillableSummaryHour) SetRatioInMonth(v float64) {
o.RatioInMonth = &v
}
// GetRegion returns the Region field value if set, zero value otherwise.
func (o *UsageBillableSummaryHour) GetRegion() string {
if o == nil || o.Region == nil {
var ret string
return ret
}
return *o.Region
}
// GetRegionOk returns a tuple with the Region field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageBillableSummaryHour) GetRegionOk() (*string, bool) {
if o == nil || o.Region == nil {
return nil, false
}
return o.Region, true
}
// HasRegion returns a boolean if a field has been set.
func (o *UsageBillableSummaryHour) HasRegion() bool {
return o != nil && o.Region != nil
}
// SetRegion gets a reference to the given string and assigns it to the Region field.
func (o *UsageBillableSummaryHour) SetRegion(v string) {
o.Region = &v
}
// GetStartDate returns the StartDate field value if set, zero value otherwise.
func (o *UsageBillableSummaryHour) GetStartDate() time.Time {
if o == nil || o.StartDate == nil {
var ret time.Time
return ret
}
return *o.StartDate
}
// GetStartDateOk returns a tuple with the StartDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageBillableSummaryHour) GetStartDateOk() (*time.Time, bool) {
if o == nil || o.StartDate == nil {
return nil, false
}
return o.StartDate, true
}
// HasStartDate returns a boolean if a field has been set.
func (o *UsageBillableSummaryHour) HasStartDate() bool {
return o != nil && o.StartDate != nil
}
// SetStartDate gets a reference to the given time.Time and assigns it to the StartDate field.
func (o *UsageBillableSummaryHour) SetStartDate(v time.Time) {
o.StartDate = &v
}
// GetUsage returns the Usage field value if set, zero value otherwise.
func (o *UsageBillableSummaryHour) GetUsage() UsageBillableSummaryKeys {
if o == nil || o.Usage == nil {
var ret UsageBillableSummaryKeys
return ret
}
return *o.Usage
}
// GetUsageOk returns a tuple with the Usage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageBillableSummaryHour) GetUsageOk() (*UsageBillableSummaryKeys, bool) {
if o == nil || o.Usage == nil {
return nil, false
}
return o.Usage, true
}
// HasUsage returns a boolean if a field has been set.
func (o *UsageBillableSummaryHour) HasUsage() bool {
return o != nil && o.Usage != nil
}
// SetUsage gets a reference to the given UsageBillableSummaryKeys and assigns it to the Usage field.
func (o *UsageBillableSummaryHour) SetUsage(v UsageBillableSummaryKeys) {
o.Usage = &v
}
// MarshalJSON serializes the struct using spec logic.
func (o UsageBillableSummaryHour) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.BillingPlan != nil {
toSerialize["billing_plan"] = o.BillingPlan
}
if o.EndDate != nil {
if o.EndDate.Nanosecond() == 0 {
toSerialize["end_date"] = o.EndDate.Format("2006-01-02T15:04:05Z07:00")
} else {
toSerialize["end_date"] = o.EndDate.Format("2006-01-02T15:04:05.000Z07:00")
}
}
if o.NumOrgs != nil {
toSerialize["num_orgs"] = o.NumOrgs
}
if o.OrgName != nil {
toSerialize["org_name"] = o.OrgName
}
if o.PublicId != nil {
toSerialize["public_id"] = o.PublicId
}
if o.RatioInMonth != nil {
toSerialize["ratio_in_month"] = o.RatioInMonth
}
if o.Region != nil {
toSerialize["region"] = o.Region
}
if o.StartDate != nil {
if o.StartDate.Nanosecond() == 0 {
toSerialize["start_date"] = o.StartDate.Format("2006-01-02T15:04:05Z07:00")
} else {
toSerialize["start_date"] = o.StartDate.Format("2006-01-02T15:04:05.000Z07:00")
}
}
if o.Usage != nil {
toSerialize["usage"] = o.Usage
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *UsageBillableSummaryHour) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
BillingPlan *string `json:"billing_plan,omitempty"`
EndDate *time.Time `json:"end_date,omitempty"`
NumOrgs *int64 `json:"num_orgs,omitempty"`
OrgName *string `json:"org_name,omitempty"`
PublicId *string `json:"public_id,omitempty"`
RatioInMonth *float64 `json:"ratio_in_month,omitempty"`
Region *string `json:"region,omitempty"`
StartDate *time.Time `json:"start_date,omitempty"`
Usage *UsageBillableSummaryKeys `json:"usage,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"billing_plan", "end_date", "num_orgs", "org_name", "public_id", "ratio_in_month", "region", "start_date", "usage"})
} else {
return err
}
hasInvalidField := false
o.BillingPlan = all.BillingPlan
o.EndDate = all.EndDate
o.NumOrgs = all.NumOrgs
o.OrgName = all.OrgName
o.PublicId = all.PublicId
o.RatioInMonth = all.RatioInMonth
o.Region = all.Region
o.StartDate = all.StartDate
if all.Usage != nil && all.Usage.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Usage = all.Usage
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
if hasInvalidField {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
return nil
}