forked from kraney/stackpath
/
model_event_request_user_agent.go
261 lines (222 loc) · 7.27 KB
/
model_event_request_user_agent.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
/*
* Web Application Firewall
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 1.0.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package waf
import (
"encoding/json"
)
// EventRequestUserAgent Parsed user agent information Incoming user agents are parsed by StackPath into categories to help describe the type of device and HTTP client or browser that made a request that triggered a WAF event. Parsed user agent properties have the value \"NA\" if StackPath is unable to parse the incoming user agent.
type EventRequestUserAgent struct {
// The name of the requesting client, typically the name of the requesting web browser
ClientName *string `json:"clientName,omitempty"`
// The requesting client's type, such as \"major browser\" or \"mobile app\"
ClientType *string `json:"clientType,omitempty"`
// The brand name of the device making the request, such as \"iphone\" or \"playstation\"
Device *string `json:"device,omitempty"`
// The operating system of the device making the request
Os *string `json:"os,omitempty"`
// The full user agent string
Raw *string `json:"raw,omitempty"`
}
// NewEventRequestUserAgent instantiates a new EventRequestUserAgent 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 NewEventRequestUserAgent() *EventRequestUserAgent {
this := EventRequestUserAgent{}
return &this
}
// NewEventRequestUserAgentWithDefaults instantiates a new EventRequestUserAgent 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 NewEventRequestUserAgentWithDefaults() *EventRequestUserAgent {
this := EventRequestUserAgent{}
return &this
}
// GetClientName returns the ClientName field value if set, zero value otherwise.
func (o *EventRequestUserAgent) GetClientName() string {
if o == nil || o.ClientName == nil {
var ret string
return ret
}
return *o.ClientName
}
// GetClientNameOk returns a tuple with the ClientName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventRequestUserAgent) GetClientNameOk() (*string, bool) {
if o == nil || o.ClientName == nil {
return nil, false
}
return o.ClientName, true
}
// HasClientName returns a boolean if a field has been set.
func (o *EventRequestUserAgent) HasClientName() bool {
if o != nil && o.ClientName != nil {
return true
}
return false
}
// SetClientName gets a reference to the given string and assigns it to the ClientName field.
func (o *EventRequestUserAgent) SetClientName(v string) {
o.ClientName = &v
}
// GetClientType returns the ClientType field value if set, zero value otherwise.
func (o *EventRequestUserAgent) GetClientType() string {
if o == nil || o.ClientType == nil {
var ret string
return ret
}
return *o.ClientType
}
// GetClientTypeOk returns a tuple with the ClientType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventRequestUserAgent) GetClientTypeOk() (*string, bool) {
if o == nil || o.ClientType == nil {
return nil, false
}
return o.ClientType, true
}
// HasClientType returns a boolean if a field has been set.
func (o *EventRequestUserAgent) HasClientType() bool {
if o != nil && o.ClientType != nil {
return true
}
return false
}
// SetClientType gets a reference to the given string and assigns it to the ClientType field.
func (o *EventRequestUserAgent) SetClientType(v string) {
o.ClientType = &v
}
// GetDevice returns the Device field value if set, zero value otherwise.
func (o *EventRequestUserAgent) GetDevice() string {
if o == nil || o.Device == nil {
var ret string
return ret
}
return *o.Device
}
// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventRequestUserAgent) GetDeviceOk() (*string, bool) {
if o == nil || o.Device == nil {
return nil, false
}
return o.Device, true
}
// HasDevice returns a boolean if a field has been set.
func (o *EventRequestUserAgent) HasDevice() bool {
if o != nil && o.Device != nil {
return true
}
return false
}
// SetDevice gets a reference to the given string and assigns it to the Device field.
func (o *EventRequestUserAgent) SetDevice(v string) {
o.Device = &v
}
// GetOs returns the Os field value if set, zero value otherwise.
func (o *EventRequestUserAgent) GetOs() string {
if o == nil || o.Os == nil {
var ret string
return ret
}
return *o.Os
}
// GetOsOk returns a tuple with the Os field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventRequestUserAgent) GetOsOk() (*string, bool) {
if o == nil || o.Os == nil {
return nil, false
}
return o.Os, true
}
// HasOs returns a boolean if a field has been set.
func (o *EventRequestUserAgent) HasOs() bool {
if o != nil && o.Os != nil {
return true
}
return false
}
// SetOs gets a reference to the given string and assigns it to the Os field.
func (o *EventRequestUserAgent) SetOs(v string) {
o.Os = &v
}
// GetRaw returns the Raw field value if set, zero value otherwise.
func (o *EventRequestUserAgent) GetRaw() string {
if o == nil || o.Raw == nil {
var ret string
return ret
}
return *o.Raw
}
// GetRawOk returns a tuple with the Raw field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventRequestUserAgent) GetRawOk() (*string, bool) {
if o == nil || o.Raw == nil {
return nil, false
}
return o.Raw, true
}
// HasRaw returns a boolean if a field has been set.
func (o *EventRequestUserAgent) HasRaw() bool {
if o != nil && o.Raw != nil {
return true
}
return false
}
// SetRaw gets a reference to the given string and assigns it to the Raw field.
func (o *EventRequestUserAgent) SetRaw(v string) {
o.Raw = &v
}
func (o EventRequestUserAgent) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.ClientName != nil {
toSerialize["clientName"] = o.ClientName
}
if o.ClientType != nil {
toSerialize["clientType"] = o.ClientType
}
if o.Device != nil {
toSerialize["device"] = o.Device
}
if o.Os != nil {
toSerialize["os"] = o.Os
}
if o.Raw != nil {
toSerialize["raw"] = o.Raw
}
return json.Marshal(toSerialize)
}
type NullableEventRequestUserAgent struct {
value *EventRequestUserAgent
isSet bool
}
func (v NullableEventRequestUserAgent) Get() *EventRequestUserAgent {
return v.value
}
func (v *NullableEventRequestUserAgent) Set(val *EventRequestUserAgent) {
v.value = val
v.isSet = true
}
func (v NullableEventRequestUserAgent) IsSet() bool {
return v.isSet
}
func (v *NullableEventRequestUserAgent) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEventRequestUserAgent(val *EventRequestUserAgent) *NullableEventRequestUserAgent {
return &NullableEventRequestUserAgent{value: val, isSet: true}
}
func (v NullableEventRequestUserAgent) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEventRequestUserAgent) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}