-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodel_ssl_test_.go
184 lines (178 loc) · 6.09 KB
/
model_ssl_test_.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
/*
* StatusCake API
*
* Copyright (c) 2023
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* API version: 1.2.0
* Contact: [email protected]
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package statuscake
import (
"encoding/json"
"time"
)
// SSLTest struct for SSLTest
type SSLTest struct {
// SSL check ID
ID string `json:"id"`
// URL of the server under test
WebsiteURL string `json:"website_url"`
CheckRate SSLTestCheckRate `json:"check_rate"`
// List representing when alerts should be sent (days).
AlertAt []int32 `json:"alert_at"`
// Whether to enable alerts when SSL certificate issues are found
AlertBroken bool `json:"alert_broken"`
// Whether to enable alerts when the SSL certificate is to expire
AlertExpiry bool `json:"alert_expiry"`
// Whether to enable alerts when mixed content is found
AlertMixed bool `json:"alert_mixed"`
// Whether to enable alert reminders
AlertReminder bool `json:"alert_reminder"`
// SSL certificate score (%)
CertificateScore *int32 `json:"certificate_score,omitempty"`
// SSL certificate status
CertificateStatus *string `json:"certificate_status,omitempty"`
// SSL/TLS cipher suite belonging to the SSL certificate
Cipher *string `json:"cipher,omitempty"`
// SSL certificate cipher strength (%)
CipherScore *int32 `json:"cipher_score,omitempty"`
// List of contact group IDs
ContactGroups []string `json:"contact_groups"`
// Issuer of the SSL certificate
IssuerCommonName *string `json:"issuer_common_name,omitempty"`
Flags *SSLTestFlags `json:"flags,omitempty"`
// Whether to follow redirects when testing. Disabled by default
FollowRedirects bool `json:"follow_redirects"`
// Hostname of the server under test
Hostname *string `json:"hostname,omitempty"`
// The last reminder to have been sent (days)
LastReminder *int32 `json:"last_reminder,omitempty"`
// List of mixed content resources
MixedContent []SSLTestMixedContent `json:"mixed_content"`
// Whether the check should be run
Paused bool `json:"paused"`
// When the SSL certificate was last updated (RFC3339 format)
Updated *time.Time `json:"updated_at,omitempty"`
// Custom user agent string set when testing
UserAgent *string `json:"user_agent,omitempty"`
// SSL certificate validity start (RFC3339 format)
ValidFrom *time.Time `json:"valid_from,omitempty"`
// SSL certificate validity end (RFC3339 format)
ValidUntil *time.Time `json:"valid_until,omitempty"`
}
// NewSSLTest instantiates a new SSLTest 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 NewSSLTest(id string, websiteUrl string, checkRate SSLTestCheckRate, alertAt []int32, alertBroken bool, alertExpiry bool, alertMixed bool, alertReminder bool, contactGroups []string, followRedirects bool, mixedContent []SSLTestMixedContent, paused bool) *SSLTest {
return &SSLTest{
ID: id,
WebsiteURL: websiteUrl,
CheckRate: checkRate,
AlertAt: alertAt,
AlertBroken: alertBroken,
AlertExpiry: alertExpiry,
AlertMixed: alertMixed,
AlertReminder: alertReminder,
ContactGroups: contactGroups,
FollowRedirects: followRedirects,
MixedContent: mixedContent,
Paused: paused,
}
}
// MarshalJSON serialises data in the struct to JSON.
func (o SSLTest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.ID
}
if true {
toSerialize["website_url"] = o.WebsiteURL
}
if true {
toSerialize["check_rate"] = o.CheckRate
}
if true {
toSerialize["alert_at"] = o.AlertAt
}
if true {
toSerialize["alert_broken"] = o.AlertBroken
}
if true {
toSerialize["alert_expiry"] = o.AlertExpiry
}
if true {
toSerialize["alert_mixed"] = o.AlertMixed
}
if true {
toSerialize["alert_reminder"] = o.AlertReminder
}
if o.CertificateScore != nil {
toSerialize["certificate_score"] = o.CertificateScore
}
if o.CertificateStatus != nil {
toSerialize["certificate_status"] = o.CertificateStatus
}
if o.Cipher != nil {
toSerialize["cipher"] = o.Cipher
}
if o.CipherScore != nil {
toSerialize["cipher_score"] = o.CipherScore
}
if true {
toSerialize["contact_groups"] = o.ContactGroups
}
if o.IssuerCommonName != nil {
toSerialize["issuer_common_name"] = o.IssuerCommonName
}
if o.Flags != nil {
toSerialize["flags"] = o.Flags
}
if true {
toSerialize["follow_redirects"] = o.FollowRedirects
}
if o.Hostname != nil {
toSerialize["hostname"] = o.Hostname
}
if o.LastReminder != nil {
toSerialize["last_reminder"] = o.LastReminder
}
if true {
toSerialize["mixed_content"] = o.MixedContent
}
if true {
toSerialize["paused"] = o.Paused
}
if o.Updated != nil {
toSerialize["updated_at"] = o.Updated
}
if o.UserAgent != nil {
toSerialize["user_agent"] = o.UserAgent
}
if o.ValidFrom != nil {
toSerialize["valid_from"] = o.ValidFrom
}
if o.ValidUntil != nil {
toSerialize["valid_until"] = o.ValidUntil
}
return json.Marshal(toSerialize)
}