-
Notifications
You must be signed in to change notification settings - Fork 52
/
model_usage_rum_sessions_hour.go
443 lines (386 loc) · 16.4 KB
/
model_usage_rum_sessions_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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
// 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"
)
// UsageRumSessionsHour Number of RUM Sessions recorded for each hour for a given organization.
type UsageRumSessionsHour struct {
// The hour for the usage.
Hour *time.Time `json:"hour,omitempty"`
// The organization name.
OrgName *string `json:"org_name,omitempty"`
// The organization public ID.
PublicId *string `json:"public_id,omitempty"`
// Contains the number of RUM Replay Sessions (data available beginning November 1, 2021).
ReplaySessionCount *int64 `json:"replay_session_count,omitempty"`
// Contains the number of browser RUM Lite Sessions.
SessionCount datadog.NullableInt64 `json:"session_count,omitempty"`
// Contains the number of mobile RUM Sessions on Android (data available beginning December 1, 2020).
SessionCountAndroid datadog.NullableInt64 `json:"session_count_android,omitempty"`
// Contains the number of mobile RUM Sessions on Flutter (data available beginning March 1, 2023).
SessionCountFlutter datadog.NullableInt64 `json:"session_count_flutter,omitempty"`
// Contains the number of mobile RUM Sessions on iOS (data available beginning December 1, 2020).
SessionCountIos datadog.NullableInt64 `json:"session_count_ios,omitempty"`
// Contains the number of mobile RUM Sessions on React Native (data available beginning May 1, 2022).
SessionCountReactnative datadog.NullableInt64 `json:"session_count_reactnative,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{}
}
// NewUsageRumSessionsHour instantiates a new UsageRumSessionsHour 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 NewUsageRumSessionsHour() *UsageRumSessionsHour {
this := UsageRumSessionsHour{}
return &this
}
// NewUsageRumSessionsHourWithDefaults instantiates a new UsageRumSessionsHour 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 NewUsageRumSessionsHourWithDefaults() *UsageRumSessionsHour {
this := UsageRumSessionsHour{}
return &this
}
// GetHour returns the Hour field value if set, zero value otherwise.
func (o *UsageRumSessionsHour) GetHour() time.Time {
if o == nil || o.Hour == nil {
var ret time.Time
return ret
}
return *o.Hour
}
// GetHourOk returns a tuple with the Hour field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageRumSessionsHour) GetHourOk() (*time.Time, bool) {
if o == nil || o.Hour == nil {
return nil, false
}
return o.Hour, true
}
// HasHour returns a boolean if a field has been set.
func (o *UsageRumSessionsHour) HasHour() bool {
return o != nil && o.Hour != nil
}
// SetHour gets a reference to the given time.Time and assigns it to the Hour field.
func (o *UsageRumSessionsHour) SetHour(v time.Time) {
o.Hour = &v
}
// GetOrgName returns the OrgName field value if set, zero value otherwise.
func (o *UsageRumSessionsHour) 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 *UsageRumSessionsHour) 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 *UsageRumSessionsHour) 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 *UsageRumSessionsHour) SetOrgName(v string) {
o.OrgName = &v
}
// GetPublicId returns the PublicId field value if set, zero value otherwise.
func (o *UsageRumSessionsHour) 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 *UsageRumSessionsHour) 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 *UsageRumSessionsHour) 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 *UsageRumSessionsHour) SetPublicId(v string) {
o.PublicId = &v
}
// GetReplaySessionCount returns the ReplaySessionCount field value if set, zero value otherwise.
func (o *UsageRumSessionsHour) GetReplaySessionCount() int64 {
if o == nil || o.ReplaySessionCount == nil {
var ret int64
return ret
}
return *o.ReplaySessionCount
}
// GetReplaySessionCountOk returns a tuple with the ReplaySessionCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UsageRumSessionsHour) GetReplaySessionCountOk() (*int64, bool) {
if o == nil || o.ReplaySessionCount == nil {
return nil, false
}
return o.ReplaySessionCount, true
}
// HasReplaySessionCount returns a boolean if a field has been set.
func (o *UsageRumSessionsHour) HasReplaySessionCount() bool {
return o != nil && o.ReplaySessionCount != nil
}
// SetReplaySessionCount gets a reference to the given int64 and assigns it to the ReplaySessionCount field.
func (o *UsageRumSessionsHour) SetReplaySessionCount(v int64) {
o.ReplaySessionCount = &v
}
// GetSessionCount returns the SessionCount field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UsageRumSessionsHour) GetSessionCount() int64 {
if o == nil || o.SessionCount.Get() == nil {
var ret int64
return ret
}
return *o.SessionCount.Get()
}
// GetSessionCountOk returns a tuple with the SessionCount field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
func (o *UsageRumSessionsHour) GetSessionCountOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.SessionCount.Get(), o.SessionCount.IsSet()
}
// HasSessionCount returns a boolean if a field has been set.
func (o *UsageRumSessionsHour) HasSessionCount() bool {
return o != nil && o.SessionCount.IsSet()
}
// SetSessionCount gets a reference to the given datadog.NullableInt64 and assigns it to the SessionCount field.
func (o *UsageRumSessionsHour) SetSessionCount(v int64) {
o.SessionCount.Set(&v)
}
// SetSessionCountNil sets the value for SessionCount to be an explicit nil.
func (o *UsageRumSessionsHour) SetSessionCountNil() {
o.SessionCount.Set(nil)
}
// UnsetSessionCount ensures that no value is present for SessionCount, not even an explicit nil.
func (o *UsageRumSessionsHour) UnsetSessionCount() {
o.SessionCount.Unset()
}
// GetSessionCountAndroid returns the SessionCountAndroid field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UsageRumSessionsHour) GetSessionCountAndroid() int64 {
if o == nil || o.SessionCountAndroid.Get() == nil {
var ret int64
return ret
}
return *o.SessionCountAndroid.Get()
}
// GetSessionCountAndroidOk returns a tuple with the SessionCountAndroid field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
func (o *UsageRumSessionsHour) GetSessionCountAndroidOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.SessionCountAndroid.Get(), o.SessionCountAndroid.IsSet()
}
// HasSessionCountAndroid returns a boolean if a field has been set.
func (o *UsageRumSessionsHour) HasSessionCountAndroid() bool {
return o != nil && o.SessionCountAndroid.IsSet()
}
// SetSessionCountAndroid gets a reference to the given datadog.NullableInt64 and assigns it to the SessionCountAndroid field.
func (o *UsageRumSessionsHour) SetSessionCountAndroid(v int64) {
o.SessionCountAndroid.Set(&v)
}
// SetSessionCountAndroidNil sets the value for SessionCountAndroid to be an explicit nil.
func (o *UsageRumSessionsHour) SetSessionCountAndroidNil() {
o.SessionCountAndroid.Set(nil)
}
// UnsetSessionCountAndroid ensures that no value is present for SessionCountAndroid, not even an explicit nil.
func (o *UsageRumSessionsHour) UnsetSessionCountAndroid() {
o.SessionCountAndroid.Unset()
}
// GetSessionCountFlutter returns the SessionCountFlutter field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UsageRumSessionsHour) GetSessionCountFlutter() int64 {
if o == nil || o.SessionCountFlutter.Get() == nil {
var ret int64
return ret
}
return *o.SessionCountFlutter.Get()
}
// GetSessionCountFlutterOk returns a tuple with the SessionCountFlutter field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
func (o *UsageRumSessionsHour) GetSessionCountFlutterOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.SessionCountFlutter.Get(), o.SessionCountFlutter.IsSet()
}
// HasSessionCountFlutter returns a boolean if a field has been set.
func (o *UsageRumSessionsHour) HasSessionCountFlutter() bool {
return o != nil && o.SessionCountFlutter.IsSet()
}
// SetSessionCountFlutter gets a reference to the given datadog.NullableInt64 and assigns it to the SessionCountFlutter field.
func (o *UsageRumSessionsHour) SetSessionCountFlutter(v int64) {
o.SessionCountFlutter.Set(&v)
}
// SetSessionCountFlutterNil sets the value for SessionCountFlutter to be an explicit nil.
func (o *UsageRumSessionsHour) SetSessionCountFlutterNil() {
o.SessionCountFlutter.Set(nil)
}
// UnsetSessionCountFlutter ensures that no value is present for SessionCountFlutter, not even an explicit nil.
func (o *UsageRumSessionsHour) UnsetSessionCountFlutter() {
o.SessionCountFlutter.Unset()
}
// GetSessionCountIos returns the SessionCountIos field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UsageRumSessionsHour) GetSessionCountIos() int64 {
if o == nil || o.SessionCountIos.Get() == nil {
var ret int64
return ret
}
return *o.SessionCountIos.Get()
}
// GetSessionCountIosOk returns a tuple with the SessionCountIos field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
func (o *UsageRumSessionsHour) GetSessionCountIosOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.SessionCountIos.Get(), o.SessionCountIos.IsSet()
}
// HasSessionCountIos returns a boolean if a field has been set.
func (o *UsageRumSessionsHour) HasSessionCountIos() bool {
return o != nil && o.SessionCountIos.IsSet()
}
// SetSessionCountIos gets a reference to the given datadog.NullableInt64 and assigns it to the SessionCountIos field.
func (o *UsageRumSessionsHour) SetSessionCountIos(v int64) {
o.SessionCountIos.Set(&v)
}
// SetSessionCountIosNil sets the value for SessionCountIos to be an explicit nil.
func (o *UsageRumSessionsHour) SetSessionCountIosNil() {
o.SessionCountIos.Set(nil)
}
// UnsetSessionCountIos ensures that no value is present for SessionCountIos, not even an explicit nil.
func (o *UsageRumSessionsHour) UnsetSessionCountIos() {
o.SessionCountIos.Unset()
}
// GetSessionCountReactnative returns the SessionCountReactnative field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UsageRumSessionsHour) GetSessionCountReactnative() int64 {
if o == nil || o.SessionCountReactnative.Get() == nil {
var ret int64
return ret
}
return *o.SessionCountReactnative.Get()
}
// GetSessionCountReactnativeOk returns a tuple with the SessionCountReactnative field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
func (o *UsageRumSessionsHour) GetSessionCountReactnativeOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.SessionCountReactnative.Get(), o.SessionCountReactnative.IsSet()
}
// HasSessionCountReactnative returns a boolean if a field has been set.
func (o *UsageRumSessionsHour) HasSessionCountReactnative() bool {
return o != nil && o.SessionCountReactnative.IsSet()
}
// SetSessionCountReactnative gets a reference to the given datadog.NullableInt64 and assigns it to the SessionCountReactnative field.
func (o *UsageRumSessionsHour) SetSessionCountReactnative(v int64) {
o.SessionCountReactnative.Set(&v)
}
// SetSessionCountReactnativeNil sets the value for SessionCountReactnative to be an explicit nil.
func (o *UsageRumSessionsHour) SetSessionCountReactnativeNil() {
o.SessionCountReactnative.Set(nil)
}
// UnsetSessionCountReactnative ensures that no value is present for SessionCountReactnative, not even an explicit nil.
func (o *UsageRumSessionsHour) UnsetSessionCountReactnative() {
o.SessionCountReactnative.Unset()
}
// MarshalJSON serializes the struct using spec logic.
func (o UsageRumSessionsHour) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Hour != nil {
if o.Hour.Nanosecond() == 0 {
toSerialize["hour"] = o.Hour.Format("2006-01-02T15:04:05Z07:00")
} else {
toSerialize["hour"] = o.Hour.Format("2006-01-02T15:04:05.000Z07:00")
}
}
if o.OrgName != nil {
toSerialize["org_name"] = o.OrgName
}
if o.PublicId != nil {
toSerialize["public_id"] = o.PublicId
}
if o.ReplaySessionCount != nil {
toSerialize["replay_session_count"] = o.ReplaySessionCount
}
if o.SessionCount.IsSet() {
toSerialize["session_count"] = o.SessionCount.Get()
}
if o.SessionCountAndroid.IsSet() {
toSerialize["session_count_android"] = o.SessionCountAndroid.Get()
}
if o.SessionCountFlutter.IsSet() {
toSerialize["session_count_flutter"] = o.SessionCountFlutter.Get()
}
if o.SessionCountIos.IsSet() {
toSerialize["session_count_ios"] = o.SessionCountIos.Get()
}
if o.SessionCountReactnative.IsSet() {
toSerialize["session_count_reactnative"] = o.SessionCountReactnative.Get()
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *UsageRumSessionsHour) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Hour *time.Time `json:"hour,omitempty"`
OrgName *string `json:"org_name,omitempty"`
PublicId *string `json:"public_id,omitempty"`
ReplaySessionCount *int64 `json:"replay_session_count,omitempty"`
SessionCount datadog.NullableInt64 `json:"session_count,omitempty"`
SessionCountAndroid datadog.NullableInt64 `json:"session_count_android,omitempty"`
SessionCountFlutter datadog.NullableInt64 `json:"session_count_flutter,omitempty"`
SessionCountIos datadog.NullableInt64 `json:"session_count_ios,omitempty"`
SessionCountReactnative datadog.NullableInt64 `json:"session_count_reactnative,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{"hour", "org_name", "public_id", "replay_session_count", "session_count", "session_count_android", "session_count_flutter", "session_count_ios", "session_count_reactnative"})
} else {
return err
}
o.Hour = all.Hour
o.OrgName = all.OrgName
o.PublicId = all.PublicId
o.ReplaySessionCount = all.ReplaySessionCount
o.SessionCount = all.SessionCount
o.SessionCountAndroid = all.SessionCountAndroid
o.SessionCountFlutter = all.SessionCountFlutter
o.SessionCountIos = all.SessionCountIos
o.SessionCountReactnative = all.SessionCountReactnative
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
return nil
}