-
Notifications
You must be signed in to change notification settings - Fork 52
/
model_synthetics_timing.go
383 lines (337 loc) · 11.3 KB
/
model_synthetics_timing.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
// 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 (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)
// SyntheticsTiming Object containing all metrics and their values collected for a Synthetic API test.
// See the [Synthetic Monitoring Metrics documentation](https://docs.datadoghq.com/synthetics/metrics/).
type SyntheticsTiming struct {
// The duration in millisecond of the DNS lookup.
Dns *float64 `json:"dns,omitempty"`
// The time in millisecond to download the response.
Download *float64 `json:"download,omitempty"`
// The time in millisecond to first byte.
FirstByte *float64 `json:"firstByte,omitempty"`
// The duration in millisecond of the TLS handshake.
Handshake *float64 `json:"handshake,omitempty"`
// The time in millisecond spent during redirections.
Redirect *float64 `json:"redirect,omitempty"`
// The duration in millisecond of the TLS handshake.
Ssl *float64 `json:"ssl,omitempty"`
// Time in millisecond to establish the TCP connection.
Tcp *float64 `json:"tcp,omitempty"`
// The overall time in millisecond the request took to be processed.
Total *float64 `json:"total,omitempty"`
// Time spent in millisecond waiting for a response.
Wait *float64 `json:"wait,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{}
}
// NewSyntheticsTiming instantiates a new SyntheticsTiming 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 NewSyntheticsTiming() *SyntheticsTiming {
this := SyntheticsTiming{}
return &this
}
// NewSyntheticsTimingWithDefaults instantiates a new SyntheticsTiming 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 NewSyntheticsTimingWithDefaults() *SyntheticsTiming {
this := SyntheticsTiming{}
return &this
}
// GetDns returns the Dns field value if set, zero value otherwise.
func (o *SyntheticsTiming) GetDns() float64 {
if o == nil || o.Dns == nil {
var ret float64
return ret
}
return *o.Dns
}
// GetDnsOk returns a tuple with the Dns field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTiming) GetDnsOk() (*float64, bool) {
if o == nil || o.Dns == nil {
return nil, false
}
return o.Dns, true
}
// HasDns returns a boolean if a field has been set.
func (o *SyntheticsTiming) HasDns() bool {
return o != nil && o.Dns != nil
}
// SetDns gets a reference to the given float64 and assigns it to the Dns field.
func (o *SyntheticsTiming) SetDns(v float64) {
o.Dns = &v
}
// GetDownload returns the Download field value if set, zero value otherwise.
func (o *SyntheticsTiming) GetDownload() float64 {
if o == nil || o.Download == nil {
var ret float64
return ret
}
return *o.Download
}
// GetDownloadOk returns a tuple with the Download field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTiming) GetDownloadOk() (*float64, bool) {
if o == nil || o.Download == nil {
return nil, false
}
return o.Download, true
}
// HasDownload returns a boolean if a field has been set.
func (o *SyntheticsTiming) HasDownload() bool {
return o != nil && o.Download != nil
}
// SetDownload gets a reference to the given float64 and assigns it to the Download field.
func (o *SyntheticsTiming) SetDownload(v float64) {
o.Download = &v
}
// GetFirstByte returns the FirstByte field value if set, zero value otherwise.
func (o *SyntheticsTiming) GetFirstByte() float64 {
if o == nil || o.FirstByte == nil {
var ret float64
return ret
}
return *o.FirstByte
}
// GetFirstByteOk returns a tuple with the FirstByte field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTiming) GetFirstByteOk() (*float64, bool) {
if o == nil || o.FirstByte == nil {
return nil, false
}
return o.FirstByte, true
}
// HasFirstByte returns a boolean if a field has been set.
func (o *SyntheticsTiming) HasFirstByte() bool {
return o != nil && o.FirstByte != nil
}
// SetFirstByte gets a reference to the given float64 and assigns it to the FirstByte field.
func (o *SyntheticsTiming) SetFirstByte(v float64) {
o.FirstByte = &v
}
// GetHandshake returns the Handshake field value if set, zero value otherwise.
func (o *SyntheticsTiming) GetHandshake() float64 {
if o == nil || o.Handshake == nil {
var ret float64
return ret
}
return *o.Handshake
}
// GetHandshakeOk returns a tuple with the Handshake field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTiming) GetHandshakeOk() (*float64, bool) {
if o == nil || o.Handshake == nil {
return nil, false
}
return o.Handshake, true
}
// HasHandshake returns a boolean if a field has been set.
func (o *SyntheticsTiming) HasHandshake() bool {
return o != nil && o.Handshake != nil
}
// SetHandshake gets a reference to the given float64 and assigns it to the Handshake field.
func (o *SyntheticsTiming) SetHandshake(v float64) {
o.Handshake = &v
}
// GetRedirect returns the Redirect field value if set, zero value otherwise.
func (o *SyntheticsTiming) GetRedirect() float64 {
if o == nil || o.Redirect == nil {
var ret float64
return ret
}
return *o.Redirect
}
// GetRedirectOk returns a tuple with the Redirect field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTiming) GetRedirectOk() (*float64, bool) {
if o == nil || o.Redirect == nil {
return nil, false
}
return o.Redirect, true
}
// HasRedirect returns a boolean if a field has been set.
func (o *SyntheticsTiming) HasRedirect() bool {
return o != nil && o.Redirect != nil
}
// SetRedirect gets a reference to the given float64 and assigns it to the Redirect field.
func (o *SyntheticsTiming) SetRedirect(v float64) {
o.Redirect = &v
}
// GetSsl returns the Ssl field value if set, zero value otherwise.
func (o *SyntheticsTiming) GetSsl() float64 {
if o == nil || o.Ssl == nil {
var ret float64
return ret
}
return *o.Ssl
}
// GetSslOk returns a tuple with the Ssl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTiming) GetSslOk() (*float64, bool) {
if o == nil || o.Ssl == nil {
return nil, false
}
return o.Ssl, true
}
// HasSsl returns a boolean if a field has been set.
func (o *SyntheticsTiming) HasSsl() bool {
return o != nil && o.Ssl != nil
}
// SetSsl gets a reference to the given float64 and assigns it to the Ssl field.
func (o *SyntheticsTiming) SetSsl(v float64) {
o.Ssl = &v
}
// GetTcp returns the Tcp field value if set, zero value otherwise.
func (o *SyntheticsTiming) GetTcp() float64 {
if o == nil || o.Tcp == nil {
var ret float64
return ret
}
return *o.Tcp
}
// GetTcpOk returns a tuple with the Tcp field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTiming) GetTcpOk() (*float64, bool) {
if o == nil || o.Tcp == nil {
return nil, false
}
return o.Tcp, true
}
// HasTcp returns a boolean if a field has been set.
func (o *SyntheticsTiming) HasTcp() bool {
return o != nil && o.Tcp != nil
}
// SetTcp gets a reference to the given float64 and assigns it to the Tcp field.
func (o *SyntheticsTiming) SetTcp(v float64) {
o.Tcp = &v
}
// GetTotal returns the Total field value if set, zero value otherwise.
func (o *SyntheticsTiming) GetTotal() float64 {
if o == nil || o.Total == nil {
var ret float64
return ret
}
return *o.Total
}
// GetTotalOk returns a tuple with the Total field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTiming) GetTotalOk() (*float64, bool) {
if o == nil || o.Total == nil {
return nil, false
}
return o.Total, true
}
// HasTotal returns a boolean if a field has been set.
func (o *SyntheticsTiming) HasTotal() bool {
return o != nil && o.Total != nil
}
// SetTotal gets a reference to the given float64 and assigns it to the Total field.
func (o *SyntheticsTiming) SetTotal(v float64) {
o.Total = &v
}
// GetWait returns the Wait field value if set, zero value otherwise.
func (o *SyntheticsTiming) GetWait() float64 {
if o == nil || o.Wait == nil {
var ret float64
return ret
}
return *o.Wait
}
// GetWaitOk returns a tuple with the Wait field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SyntheticsTiming) GetWaitOk() (*float64, bool) {
if o == nil || o.Wait == nil {
return nil, false
}
return o.Wait, true
}
// HasWait returns a boolean if a field has been set.
func (o *SyntheticsTiming) HasWait() bool {
return o != nil && o.Wait != nil
}
// SetWait gets a reference to the given float64 and assigns it to the Wait field.
func (o *SyntheticsTiming) SetWait(v float64) {
o.Wait = &v
}
// MarshalJSON serializes the struct using spec logic.
func (o SyntheticsTiming) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Dns != nil {
toSerialize["dns"] = o.Dns
}
if o.Download != nil {
toSerialize["download"] = o.Download
}
if o.FirstByte != nil {
toSerialize["firstByte"] = o.FirstByte
}
if o.Handshake != nil {
toSerialize["handshake"] = o.Handshake
}
if o.Redirect != nil {
toSerialize["redirect"] = o.Redirect
}
if o.Ssl != nil {
toSerialize["ssl"] = o.Ssl
}
if o.Tcp != nil {
toSerialize["tcp"] = o.Tcp
}
if o.Total != nil {
toSerialize["total"] = o.Total
}
if o.Wait != nil {
toSerialize["wait"] = o.Wait
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}
// UnmarshalJSON deserializes the given payload.
func (o *SyntheticsTiming) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Dns *float64 `json:"dns,omitempty"`
Download *float64 `json:"download,omitempty"`
FirstByte *float64 `json:"firstByte,omitempty"`
Handshake *float64 `json:"handshake,omitempty"`
Redirect *float64 `json:"redirect,omitempty"`
Ssl *float64 `json:"ssl,omitempty"`
Tcp *float64 `json:"tcp,omitempty"`
Total *float64 `json:"total,omitempty"`
Wait *float64 `json:"wait,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{"dns", "download", "firstByte", "handshake", "redirect", "ssl", "tcp", "total", "wait"})
} else {
return err
}
o.Dns = all.Dns
o.Download = all.Download
o.FirstByte = all.FirstByte
o.Handshake = all.Handshake
o.Redirect = all.Redirect
o.Ssl = all.Ssl
o.Tcp = all.Tcp
o.Total = all.Total
o.Wait = all.Wait
if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}
return nil
}