-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmodel_notification_transport_request.go
312 lines (262 loc) · 9.73 KB
/
model_notification_transport_request.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
/*
authentik
Making authentication simple.
API version: 2025.2.3
Contact: hello@goauthentik.io
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package api
import (
"encoding/json"
)
// NotificationTransportRequest NotificationTransport Serializer
type NotificationTransportRequest struct {
Name string `json:"name"`
Mode *NotificationTransportModeEnum `json:"mode,omitempty"`
WebhookUrl *string `json:"webhook_url,omitempty"`
// Customize the body of the request. Mapping should return data that is JSON-serializable.
WebhookMappingBody NullableString `json:"webhook_mapping_body,omitempty"`
// Configure additional headers to be sent. Mapping should return a dictionary of key-value pairs
WebhookMappingHeaders NullableString `json:"webhook_mapping_headers,omitempty"`
// Only send notification once, for example when sending a webhook into a chat channel.
SendOnce *bool `json:"send_once,omitempty"`
}
// NewNotificationTransportRequest instantiates a new NotificationTransportRequest 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 NewNotificationTransportRequest(name string) *NotificationTransportRequest {
this := NotificationTransportRequest{}
this.Name = name
return &this
}
// NewNotificationTransportRequestWithDefaults instantiates a new NotificationTransportRequest 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 NewNotificationTransportRequestWithDefaults() *NotificationTransportRequest {
this := NotificationTransportRequest{}
return &this
}
// GetName returns the Name field value
func (o *NotificationTransportRequest) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *NotificationTransportRequest) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *NotificationTransportRequest) SetName(v string) {
o.Name = v
}
// GetMode returns the Mode field value if set, zero value otherwise.
func (o *NotificationTransportRequest) GetMode() NotificationTransportModeEnum {
if o == nil || o.Mode == nil {
var ret NotificationTransportModeEnum
return ret
}
return *o.Mode
}
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationTransportRequest) GetModeOk() (*NotificationTransportModeEnum, bool) {
if o == nil || o.Mode == nil {
return nil, false
}
return o.Mode, true
}
// HasMode returns a boolean if a field has been set.
func (o *NotificationTransportRequest) HasMode() bool {
if o != nil && o.Mode != nil {
return true
}
return false
}
// SetMode gets a reference to the given NotificationTransportModeEnum and assigns it to the Mode field.
func (o *NotificationTransportRequest) SetMode(v NotificationTransportModeEnum) {
o.Mode = &v
}
// GetWebhookUrl returns the WebhookUrl field value if set, zero value otherwise.
func (o *NotificationTransportRequest) GetWebhookUrl() string {
if o == nil || o.WebhookUrl == nil {
var ret string
return ret
}
return *o.WebhookUrl
}
// GetWebhookUrlOk returns a tuple with the WebhookUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationTransportRequest) GetWebhookUrlOk() (*string, bool) {
if o == nil || o.WebhookUrl == nil {
return nil, false
}
return o.WebhookUrl, true
}
// HasWebhookUrl returns a boolean if a field has been set.
func (o *NotificationTransportRequest) HasWebhookUrl() bool {
if o != nil && o.WebhookUrl != nil {
return true
}
return false
}
// SetWebhookUrl gets a reference to the given string and assigns it to the WebhookUrl field.
func (o *NotificationTransportRequest) SetWebhookUrl(v string) {
o.WebhookUrl = &v
}
// GetWebhookMappingBody returns the WebhookMappingBody field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *NotificationTransportRequest) GetWebhookMappingBody() string {
if o == nil || o.WebhookMappingBody.Get() == nil {
var ret string
return ret
}
return *o.WebhookMappingBody.Get()
}
// GetWebhookMappingBodyOk returns a tuple with the WebhookMappingBody 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 *NotificationTransportRequest) GetWebhookMappingBodyOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.WebhookMappingBody.Get(), o.WebhookMappingBody.IsSet()
}
// HasWebhookMappingBody returns a boolean if a field has been set.
func (o *NotificationTransportRequest) HasWebhookMappingBody() bool {
if o != nil && o.WebhookMappingBody.IsSet() {
return true
}
return false
}
// SetWebhookMappingBody gets a reference to the given NullableString and assigns it to the WebhookMappingBody field.
func (o *NotificationTransportRequest) SetWebhookMappingBody(v string) {
o.WebhookMappingBody.Set(&v)
}
// SetWebhookMappingBodyNil sets the value for WebhookMappingBody to be an explicit nil
func (o *NotificationTransportRequest) SetWebhookMappingBodyNil() {
o.WebhookMappingBody.Set(nil)
}
// UnsetWebhookMappingBody ensures that no value is present for WebhookMappingBody, not even an explicit nil
func (o *NotificationTransportRequest) UnsetWebhookMappingBody() {
o.WebhookMappingBody.Unset()
}
// GetWebhookMappingHeaders returns the WebhookMappingHeaders field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *NotificationTransportRequest) GetWebhookMappingHeaders() string {
if o == nil || o.WebhookMappingHeaders.Get() == nil {
var ret string
return ret
}
return *o.WebhookMappingHeaders.Get()
}
// GetWebhookMappingHeadersOk returns a tuple with the WebhookMappingHeaders 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 *NotificationTransportRequest) GetWebhookMappingHeadersOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.WebhookMappingHeaders.Get(), o.WebhookMappingHeaders.IsSet()
}
// HasWebhookMappingHeaders returns a boolean if a field has been set.
func (o *NotificationTransportRequest) HasWebhookMappingHeaders() bool {
if o != nil && o.WebhookMappingHeaders.IsSet() {
return true
}
return false
}
// SetWebhookMappingHeaders gets a reference to the given NullableString and assigns it to the WebhookMappingHeaders field.
func (o *NotificationTransportRequest) SetWebhookMappingHeaders(v string) {
o.WebhookMappingHeaders.Set(&v)
}
// SetWebhookMappingHeadersNil sets the value for WebhookMappingHeaders to be an explicit nil
func (o *NotificationTransportRequest) SetWebhookMappingHeadersNil() {
o.WebhookMappingHeaders.Set(nil)
}
// UnsetWebhookMappingHeaders ensures that no value is present for WebhookMappingHeaders, not even an explicit nil
func (o *NotificationTransportRequest) UnsetWebhookMappingHeaders() {
o.WebhookMappingHeaders.Unset()
}
// GetSendOnce returns the SendOnce field value if set, zero value otherwise.
func (o *NotificationTransportRequest) GetSendOnce() bool {
if o == nil || o.SendOnce == nil {
var ret bool
return ret
}
return *o.SendOnce
}
// GetSendOnceOk returns a tuple with the SendOnce field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NotificationTransportRequest) GetSendOnceOk() (*bool, bool) {
if o == nil || o.SendOnce == nil {
return nil, false
}
return o.SendOnce, true
}
// HasSendOnce returns a boolean if a field has been set.
func (o *NotificationTransportRequest) HasSendOnce() bool {
if o != nil && o.SendOnce != nil {
return true
}
return false
}
// SetSendOnce gets a reference to the given bool and assigns it to the SendOnce field.
func (o *NotificationTransportRequest) SetSendOnce(v bool) {
o.SendOnce = &v
}
func (o NotificationTransportRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["name"] = o.Name
}
if o.Mode != nil {
toSerialize["mode"] = o.Mode
}
if o.WebhookUrl != nil {
toSerialize["webhook_url"] = o.WebhookUrl
}
if o.WebhookMappingBody.IsSet() {
toSerialize["webhook_mapping_body"] = o.WebhookMappingBody.Get()
}
if o.WebhookMappingHeaders.IsSet() {
toSerialize["webhook_mapping_headers"] = o.WebhookMappingHeaders.Get()
}
if o.SendOnce != nil {
toSerialize["send_once"] = o.SendOnce
}
return json.Marshal(toSerialize)
}
type NullableNotificationTransportRequest struct {
value *NotificationTransportRequest
isSet bool
}
func (v NullableNotificationTransportRequest) Get() *NotificationTransportRequest {
return v.value
}
func (v *NullableNotificationTransportRequest) Set(val *NotificationTransportRequest) {
v.value = val
v.isSet = true
}
func (v NullableNotificationTransportRequest) IsSet() bool {
return v.isSet
}
func (v *NullableNotificationTransportRequest) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNotificationTransportRequest(val *NotificationTransportRequest) *NullableNotificationTransportRequest {
return &NullableNotificationTransportRequest{value: val, isSet: true}
}
func (v NullableNotificationTransportRequest) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNotificationTransportRequest) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}