/
model_check_general.go
534 lines (453 loc) · 29.3 KB
/
model_check_general.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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
/*
Pingdom Public API
# Welcome to the Pingdom API! The Pingdom API is a way for you to automate your interaction with the Pingdom system. With the API, you can create your own scripts or applications with most of the functionality you can find inside the Pingdom control panel. The Pingdom API is RESTful and HTTP-based. Basically, this means that the communication is made through normal HTTP requests. # Authentication Authentication is needed in order to use the Pingdom API, and for this a Pingdom API Token is required. You generate your Pingdom API Token inside My Pingdom. The Pingdom API Token has a property called “Access level” to define its permissions. All operations that create or modify something (e.g. checks) need the Read/Write permission. If you only need to read data using the API token, we recommend to set the access level to “Read access”. The authentication method for using tokens is HTTP Bearer Authentication (encrypted over HTTPS). This means that you will provide your token every time you make a request. No sessions are used. Request ``` GET /checks HTTP/1.1 Host: api.pingdom.com Authorization: Bearer ofOhK18Ca6w4S_XmInGv0QPkqly-rbRBBoHsp_2FEH5QnIbH0VZhRPO3tlvrjMIKQ36VapX ``` Response ``` HTTP/1.1 200 OK Content-Length: 13 Content-Type: application/json {\"checks\":[]} ``` ## Basic Auth For compatibility reasons, the Pingdom API allows to use HTTP Basic Authentication with tokens. In cases where this is necessary, input the API token as the username and leave the password field empty. An example request of how that would look like with the following API token: ofOhK18Ca6w4S_XmInGv0QPkqly-rbRBBoHsp_2FEH5QnIbH0VZhRPO3tlvrjMIKQ36VapX ``` GET /checks HTTP/1.1 Host: api.pingdom.com Authorization: Basic b2ZPaEsxOENhNnc0U19YbUluR3YwUVBrcWx5LXJiUkJCb0hzcF8yRkVINVFuSWJIMFZaaFJQTzN0bHZyak1JS1EzNlZhcFg6 ``` # Server Address The base server address is: https://api.pingdom.com Please note that HTTPS is required. You will not be able to connect through unencrypted HTTP. # Providing Parameters GET requests should provide their parameters as a query string, part of the URL. POST, PUT and DELETE requests should provide their parameters as a JSON. This should be part of the request body. Remember to add the proper content type header to the request: `Content-Type: application/json`. We still support providing parameters as a query string for POST, PUT and DELETE requests, but we recommend using JSON going forward. If you are using query strings, they should be part of the body, URL or a combination. The encoding of the query string should be standard URL-encoding, as provided by various programming libraries. When using `requests` library for Python, use `json` parameter instead of `data`. Due to the inner mechanisms of requests.post() etc. some endpoints may return responses not conforming to the documentation when dealing with `data` body. # HTTP/1.1 Status Code Definitions The HTTP status code returned by a successful API request is defined in the documentation for that method. Usually, this will be 200 OK. If something goes wrong, other codes may be returned. The API uses standard HTTP/1.1 status codes defined by [RFC 2616](https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html). # JSON Responses All responses are sent JSON-encoded. The specific responses (successful ones) are described in the documentation section for each method. However, if something goes wrong, our standard JSON error message (together with an appropriate status code) follows this format: ``` { \"error\": { \"statuscode\": 403, \"statusdesc\": \"Forbidden\", \"errormessage\":\" Something went wrong! This string describes what happened.\" } } ``` See http://en.wikipedia.org/wiki/Json for more information on JSON. Please note that all attributes of a method response are not always present. A client application should never assume that a certain attribute is present in a response. # Limits The Pingdom API has usage limits to avoid individual rampant applications degrading the overall user experience. There are two layers of limits, the first cover a shorter period of time and the second a longer period. This enables you to \"burst\" requests for shorter periods. There are two HTTP headers in every response describing your limits status. The response headers are: * **Req-Limit-Short** * **Req-Limit-Long** An example of the values of these headers: * **Req-Limit-Short: Remaining: 394 Time until reset: 3589** * **Req-Limit-Long: Remaining: 71994 Time until reset: 2591989** In this case, we can see that the user has 394 requests left until the short limit is reached. In 3589 seconds, the short limit will be reset. In similar fashion, the long limit has 71994 requests left, and will be reset in 2591989 seconds. If limits are exceeded, an HTTP 429 error code with the message \"Request limit exceeded, try again later\" is sent back. # gzip Responses can be gzip-encoded on demand. This is nice if your bandwidth is limited, or if big results are causing performance issues. To enable gzip, simply add the following header to your request: Accept-Encoding: gzip # Best Practices ## Use caching If you are building a web page using the Pingdom API, we recommend that you do all API request on the server side, and if possible cache them. If you get any substantial traffic, you do not want to call the API each time you get a page hit, since this may cause you to hit the request limit faster than expected. In general, whenever you can cache data, do so. ## Send your user credentials in a preemptive manner Some HTTP clients omit the authentication header, and make a second request with the header when they get a 401 Unauthorized response. Please make sure you send the credentials directly, to avoid unnecessary requests. ## Use common sense Should be simple enough. For example, don't check for the status of a check every other second. The highest check resolution is one minute. Checking more often than that won't give you much of an advantage. ## The Internet is unreliable Networks in general are unreliable, and particularly one as large and complex as the Internet. Your application should not assume it will get an answer. There may be timeouts. # PHP Code Example **\"This is too much to read. I just want to get started right now! Give me a simple example!\"** Here is a short example of how you can use the API with PHP. You need the cURL extension for PHP. The example prints the current status of all your checks. This sample obviously focuses on Pingdom API code and does not worry about any potential problems connecting to the API, but your code should. Code: ```php <?php // Init cURL $curl = curl_init(); // Set target URL curl_setopt($curl, CURLOPT_URL, \"https://api.pingdom.com/api/3.1/checks\"); // Set the desired HTTP method (GET is default, see the documentation for each request) curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\"); // Add header with Bearer Authorization curl_setopt($curl, CURLOPT_HTTPHEADER, array(\"Authorization: Bearer 907c762e069589c2cd2a229cdae7b8778caa9f07\")); // Ask cURL to return the result as a string curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // Execute the request and decode the json result into an associative array $response = json_decode(curl_exec($curl), true); // Check for errors returned by the API if (isset($response['error'])) { print \"Error: \" . $response['error']['errormessage'] . \"\\n\"; exit; } // Fetch the list of checks from the response $checksList = $response['checks']; // Print the names and statuses of all checks in the list foreach ($checksList as $check) { print $check['name'] . \" is \" . $check['status'] . \"\\n\"; } ?> ``` Example output: ``` Ubuntu Packages is up Google is up Pingdom is up My server 1 is down My server 2 is up ``` If you are running PHP on Windows, you need to be sure that you have installed the CA certificates for HTTPS/SSL to work correctly. Please see the cURL manual for more information. As a quick (but unsafe) workaround, you can add the following cURL option to ignore certificate validation. ` curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); ` # TMS Steps Vocabulary There are two types of transaction checks: <ul> <li><b>script</b>: the legacy TMS check created with predefined commands in the Pingdom UI or via the public API</li> <li><b>recording</b>: the TMS check created by recording performed actions in WPM recorder. More information about how to use it can be found in the <a class=\"default-link\" href=\"https://documentation.solarwinds.com/en/success_center/wpm/Content/WPM-Use-the-WPM3-Recorder.htm\"> WPM recorder documentation</a> </li> </ul> ## Script transaction checks ### Commands Actions to be performed for the script TMS check Step Name | \"fn\" | Required \"args\" | Remarks ----------------------------------------- | --------------------- | -------------- | ------- Go to URL | go_to | url | There has to be **exactly one** go_to step Click | click | element | label, name or CSS selector Fill in field | fill | input, value | input: label, name or CSS selector, value: text Check checkbox | check | checkbox | label, name or CSS selector Uncheck checkbox | uncheck | checkbox | label, name or CSS selector Sleep for | sleep | seconds | number (e.g. 0.1) Select radio button | select_radio | radio | name of the radio button Select dropdown | select | select, option | select: label, name or CSS selector, option: content, value or CSS selector Basic auth login with | basic_auth | username, password | username and password as text Submit form | submit | form | name or CSS selector Wait for element | wait_for_element | element | label, name or CSS selector Wait for element to contain | wait_for_contains | element, value | element: label, name or CSS selector, value: text ### Validations Verify the state of the page Step Name | \"fn\" | Required \"args\" | Remarks ----------------------------------------- | --------------------- | -------------- | ------- URL should be | url | url | url to be verified Element should exist | exists | element | label, name or CSS selector Element shouldn't exist | not_exists | element | label, name or CSS selector Element should contain | contains | element, value | element: label, name or CSS selector, value: text Element shouldn't containt | not_contains | element, value | element: label, name or CSS selector, value: text Text field should contain | field_contains | input, value | input: label, name or CSS selector, value: text Text field shouldn't contain | field_not_contains | input, value | input: label, name or CSS selector, value: text Checkbox should be checked | is_checked | checkbox | label, name or CSS selector Checkbox shouldn't be checked | is_not_checked | checkbox | label, name or CSS selector Radio button should be selected | radio_selected | radio | name of the radio button Dropdown with name should be selected | dropdown_selected | select, option | select: label, name or CSS selector, option: content, value or CSS selector Dropdown with name shouldn't be selected | dropdown_not_selected | select, option | select: label, name or CSS selector, option: content, value or CSS selector ### Example steps ``` \"steps\": [ { \"fn\": \"go_to\", \"args\": { \"url\": \"pingdom.com\" } }, { \"fn\": \"click\", \"args\": { \"element\": \"START FREE TRIAL\" } }, { \"fn\": \"url\", \"args\": { \"url\": \"https://www.pingdom.com/sign-up/\" } } ] ``` ## Recording transaction checks Each of check steps contains: <ul> <li><b>fn</b>: function name of the step</li> <li><b>args</b>: function arguments</li> <li><b>guid</b>: automatically generated identifier</li> <li><b>contains_navigate</b>: recorder sets it on true if the step would trigger a page navigation</li> </ul> ### Commands Actions to be performed for the recording TMS check Step Name | \"fn\" | Required \"args\" | Remarks ------------------------- | ------------------------- | ------------------------------- | ------- Go to URL | wpm_go_to | url | Goes to the given url location Click | wpm_click | element, offsetX, offsetY | **element**: label, name or CSS selector,</br> **offsetX/Y**: exact position of a click in the element Click in a exact location | wpm_click_xy | element, x, y, scrollX, scrollY | **element**: label, name or CSS selector,</br> **x/y**: coordinates for the click (in viewport),</br> **scrollX/Y**: scrollbar position Fill | wpm_fill | input, value | **input**: target element,</br> **value**: text to fill the target Move mouse to element | wpm_move_mouse_to_element | element, offsetX, offsetY | **element**: target element,</br> **offsetX/Y**: exact position of the mouse in the element Select dropdown | wpm_select_dropdown | select, option | **select**: target element (drop-down),</br> **option**: text of the option to select Wait | wpm_wait | seconds | **seconds:** numbers of seconds to wait Close tab | wpm_close_tab | - | Closes the latest tab on the tab stack ### Validations Verify the state of the page Step Name | \"fn\" | Required \"args\" | Remarks ---------------------- | ------------------------ | ---------------------------------------------- | ------- Contains text | wpm_contains_timeout | element, value, waitTime, useRegularExpression | **element**: label, name or CSS selector,</br> **value**: text to search for,</br> **waitTime**: time to wait for the value to appear,</br> **useRegularExpression**: use the value as a RegEx Does not contains text | wpm_not_contains_timeout | element, value, waitTime, useRegularExpression | **element**: label, name or CSS selector,</br> **value**: text to search for,</br> **waitTime**: time to wait for the value to appear,</br> **useRegularExpression**: use the value as a RegEx ### Metadata Recording checks contain metadata which is automatically generated by the WPM recorder. Modify with caution!
API version: 3.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
)
// checks if the CheckGeneral type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CheckGeneral{}
// CheckGeneral struct for CheckGeneral
type CheckGeneral struct {
// Check status: active or inactive
Active *bool `json:"active,omitempty"`
// Timestamp when the check was created
CreatedAt *int64 `json:"created_at,omitempty"`
// Id of the check
Id *int64 `json:"id,omitempty"`
// TMS test intervals in minutes. Allowed intervals: 5,10,20,60,720,1440. The interval you're allowed to set may vary depending on your current plan.
Interval *int64 `json:"interval,omitempty"`
// Timestamp when the check was modified
ModifiedAt *int64 `json:"modified_at,omitempty"`
// Timestamp when the last downtime started. This field is optional
LastDowntimeStart *int64 `json:"last_downtime_start,omitempty"`
// Timestamp when the last downtime ended. This field is optional
LastDowntimeEnd *int64 `json:"last_downtime_end,omitempty"`
// Name of the check
Name *string `json:"name,omitempty"`
// Name of the region where the check is executed. Supported regions: us-east, us-west, eu, au
Region *string `json:"region,omitempty"`
// Whether the check is passing or failing at the moment (successful, failing, unknown)
Status *string `json:"status,omitempty"`
// List of tags for a check. The tag name may contain the characters 'A-Z', 'a-z', '0-9', '_' and '-'. The maximum length of a tag is 64 characters.
Tags []string `json:"tags,omitempty"`
// Type of transaction check: \"script\" for regular TMS checks and \"recording\" for checks made using the Transaction Recorder
Type *string `json:"type,omitempty"`
}
// NewCheckGeneral instantiates a new CheckGeneral 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 NewCheckGeneral() *CheckGeneral {
this := CheckGeneral{}
return &this
}
// NewCheckGeneralWithDefaults instantiates a new CheckGeneral 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 NewCheckGeneralWithDefaults() *CheckGeneral {
this := CheckGeneral{}
return &this
}
// GetActive returns the Active field value if set, zero value otherwise.
func (o *CheckGeneral) GetActive() bool {
if o == nil || IsNil(o.Active) {
var ret bool
return ret
}
return *o.Active
}
// GetActiveOk returns a tuple with the Active field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetActiveOk() (*bool, bool) {
if o == nil || IsNil(o.Active) {
return nil, false
}
return o.Active, true
}
// HasActive returns a boolean if a field has been set.
func (o *CheckGeneral) HasActive() bool {
if o != nil && !IsNil(o.Active) {
return true
}
return false
}
// SetActive gets a reference to the given bool and assigns it to the Active field.
func (o *CheckGeneral) SetActive(v bool) {
o.Active = &v
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *CheckGeneral) GetCreatedAt() int64 {
if o == nil || IsNil(o.CreatedAt) {
var ret int64
return ret
}
return *o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetCreatedAtOk() (*int64, bool) {
if o == nil || IsNil(o.CreatedAt) {
return nil, false
}
return o.CreatedAt, true
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *CheckGeneral) HasCreatedAt() bool {
if o != nil && !IsNil(o.CreatedAt) {
return true
}
return false
}
// SetCreatedAt gets a reference to the given int64 and assigns it to the CreatedAt field.
func (o *CheckGeneral) SetCreatedAt(v int64) {
o.CreatedAt = &v
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *CheckGeneral) GetId() int64 {
if o == nil || IsNil(o.Id) {
var ret int64
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetIdOk() (*int64, bool) {
if o == nil || IsNil(o.Id) {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *CheckGeneral) HasId() bool {
if o != nil && !IsNil(o.Id) {
return true
}
return false
}
// SetId gets a reference to the given int64 and assigns it to the Id field.
func (o *CheckGeneral) SetId(v int64) {
o.Id = &v
}
// GetInterval returns the Interval field value if set, zero value otherwise.
func (o *CheckGeneral) GetInterval() int64 {
if o == nil || IsNil(o.Interval) {
var ret int64
return ret
}
return *o.Interval
}
// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetIntervalOk() (*int64, bool) {
if o == nil || IsNil(o.Interval) {
return nil, false
}
return o.Interval, true
}
// HasInterval returns a boolean if a field has been set.
func (o *CheckGeneral) HasInterval() bool {
if o != nil && !IsNil(o.Interval) {
return true
}
return false
}
// SetInterval gets a reference to the given int64 and assigns it to the Interval field.
func (o *CheckGeneral) SetInterval(v int64) {
o.Interval = &v
}
// GetModifiedAt returns the ModifiedAt field value if set, zero value otherwise.
func (o *CheckGeneral) GetModifiedAt() int64 {
if o == nil || IsNil(o.ModifiedAt) {
var ret int64
return ret
}
return *o.ModifiedAt
}
// GetModifiedAtOk returns a tuple with the ModifiedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetModifiedAtOk() (*int64, bool) {
if o == nil || IsNil(o.ModifiedAt) {
return nil, false
}
return o.ModifiedAt, true
}
// HasModifiedAt returns a boolean if a field has been set.
func (o *CheckGeneral) HasModifiedAt() bool {
if o != nil && !IsNil(o.ModifiedAt) {
return true
}
return false
}
// SetModifiedAt gets a reference to the given int64 and assigns it to the ModifiedAt field.
func (o *CheckGeneral) SetModifiedAt(v int64) {
o.ModifiedAt = &v
}
// GetLastDowntimeStart returns the LastDowntimeStart field value if set, zero value otherwise.
func (o *CheckGeneral) GetLastDowntimeStart() int64 {
if o == nil || IsNil(o.LastDowntimeStart) {
var ret int64
return ret
}
return *o.LastDowntimeStart
}
// GetLastDowntimeStartOk returns a tuple with the LastDowntimeStart field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetLastDowntimeStartOk() (*int64, bool) {
if o == nil || IsNil(o.LastDowntimeStart) {
return nil, false
}
return o.LastDowntimeStart, true
}
// HasLastDowntimeStart returns a boolean if a field has been set.
func (o *CheckGeneral) HasLastDowntimeStart() bool {
if o != nil && !IsNil(o.LastDowntimeStart) {
return true
}
return false
}
// SetLastDowntimeStart gets a reference to the given int64 and assigns it to the LastDowntimeStart field.
func (o *CheckGeneral) SetLastDowntimeStart(v int64) {
o.LastDowntimeStart = &v
}
// GetLastDowntimeEnd returns the LastDowntimeEnd field value if set, zero value otherwise.
func (o *CheckGeneral) GetLastDowntimeEnd() int64 {
if o == nil || IsNil(o.LastDowntimeEnd) {
var ret int64
return ret
}
return *o.LastDowntimeEnd
}
// GetLastDowntimeEndOk returns a tuple with the LastDowntimeEnd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetLastDowntimeEndOk() (*int64, bool) {
if o == nil || IsNil(o.LastDowntimeEnd) {
return nil, false
}
return o.LastDowntimeEnd, true
}
// HasLastDowntimeEnd returns a boolean if a field has been set.
func (o *CheckGeneral) HasLastDowntimeEnd() bool {
if o != nil && !IsNil(o.LastDowntimeEnd) {
return true
}
return false
}
// SetLastDowntimeEnd gets a reference to the given int64 and assigns it to the LastDowntimeEnd field.
func (o *CheckGeneral) SetLastDowntimeEnd(v int64) {
o.LastDowntimeEnd = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *CheckGeneral) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *CheckGeneral) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *CheckGeneral) SetName(v string) {
o.Name = &v
}
// GetRegion returns the Region field value if set, zero value otherwise.
func (o *CheckGeneral) GetRegion() string {
if o == nil || IsNil(o.Region) {
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 *CheckGeneral) GetRegionOk() (*string, bool) {
if o == nil || IsNil(o.Region) {
return nil, false
}
return o.Region, true
}
// HasRegion returns a boolean if a field has been set.
func (o *CheckGeneral) HasRegion() bool {
if o != nil && !IsNil(o.Region) {
return true
}
return false
}
// SetRegion gets a reference to the given string and assigns it to the Region field.
func (o *CheckGeneral) SetRegion(v string) {
o.Region = &v
}
// GetStatus returns the Status field value if set, zero value otherwise.
func (o *CheckGeneral) GetStatus() string {
if o == nil || IsNil(o.Status) {
var ret string
return ret
}
return *o.Status
}
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetStatusOk() (*string, bool) {
if o == nil || IsNil(o.Status) {
return nil, false
}
return o.Status, true
}
// HasStatus returns a boolean if a field has been set.
func (o *CheckGeneral) HasStatus() bool {
if o != nil && !IsNil(o.Status) {
return true
}
return false
}
// SetStatus gets a reference to the given string and assigns it to the Status field.
func (o *CheckGeneral) SetStatus(v string) {
o.Status = &v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *CheckGeneral) GetTags() []string {
if o == nil || IsNil(o.Tags) {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetTagsOk() ([]string, bool) {
if o == nil || IsNil(o.Tags) {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *CheckGeneral) HasTags() bool {
if o != nil && !IsNil(o.Tags) {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *CheckGeneral) SetTags(v []string) {
o.Tags = v
}
// GetType returns the Type field value if set, zero value otherwise.
func (o *CheckGeneral) GetType() string {
if o == nil || IsNil(o.Type) {
var ret string
return ret
}
return *o.Type
}
// GetTypeOk returns a tuple with the Type field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CheckGeneral) GetTypeOk() (*string, bool) {
if o == nil || IsNil(o.Type) {
return nil, false
}
return o.Type, true
}
// HasType returns a boolean if a field has been set.
func (o *CheckGeneral) HasType() bool {
if o != nil && !IsNil(o.Type) {
return true
}
return false
}
// SetType gets a reference to the given string and assigns it to the Type field.
func (o *CheckGeneral) SetType(v string) {
o.Type = &v
}
func (o CheckGeneral) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CheckGeneral) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Active) {
toSerialize["active"] = o.Active
}
if !IsNil(o.CreatedAt) {
toSerialize["created_at"] = o.CreatedAt
}
if !IsNil(o.Id) {
toSerialize["id"] = o.Id
}
if !IsNil(o.Interval) {
toSerialize["interval"] = o.Interval
}
if !IsNil(o.ModifiedAt) {
toSerialize["modified_at"] = o.ModifiedAt
}
if !IsNil(o.LastDowntimeStart) {
toSerialize["last_downtime_start"] = o.LastDowntimeStart
}
if !IsNil(o.LastDowntimeEnd) {
toSerialize["last_downtime_end"] = o.LastDowntimeEnd
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Region) {
toSerialize["region"] = o.Region
}
if !IsNil(o.Status) {
toSerialize["status"] = o.Status
}
if !IsNil(o.Tags) {
toSerialize["tags"] = o.Tags
}
if !IsNil(o.Type) {
toSerialize["type"] = o.Type
}
return toSerialize, nil
}
type NullableCheckGeneral struct {
value *CheckGeneral
isSet bool
}
func (v NullableCheckGeneral) Get() *CheckGeneral {
return v.value
}
func (v *NullableCheckGeneral) Set(val *CheckGeneral) {
v.value = val
v.isSet = true
}
func (v NullableCheckGeneral) IsSet() bool {
return v.isSet
}
func (v *NullableCheckGeneral) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCheckGeneral(val *CheckGeneral) *NullableCheckGeneral {
return &NullableCheckGeneral{value: val, isSet: true}
}
func (v NullableCheckGeneral) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCheckGeneral) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}