forked from svix/svix-webhooks
/
model_application_out.go
326 lines (276 loc) · 10.7 KB
/
model_application_out.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
/*
* Svix API
*
* Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each user on your platform. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
*
* API version: 1.4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
import (
"encoding/json"
"time"
)
// ApplicationOut struct for ApplicationOut
type ApplicationOut struct {
CreatedAt time.Time `json:"createdAt"`
Id string `json:"id"`
Metadata map[string]string `json:"metadata,omitempty"`
Name string `json:"name"`
RateLimit NullableInt32 `json:"rateLimit,omitempty"`
// Optional unique identifier for the application
Uid NullableString `json:"uid,omitempty"`
UpdatedAt time.Time `json:"updatedAt"`
}
// NewApplicationOut instantiates a new ApplicationOut 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 NewApplicationOut(createdAt time.Time, id string, name string, updatedAt time.Time) *ApplicationOut {
this := ApplicationOut{}
this.CreatedAt = createdAt
this.Id = id
this.Name = name
this.UpdatedAt = updatedAt
return &this
}
// NewApplicationOutWithDefaults instantiates a new ApplicationOut 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 NewApplicationOutWithDefaults() *ApplicationOut {
this := ApplicationOut{}
return &this
}
// GetCreatedAt returns the CreatedAt field value
func (o *ApplicationOut) GetCreatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *ApplicationOut) GetCreatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *ApplicationOut) SetCreatedAt(v time.Time) {
o.CreatedAt = v
}
// GetId returns the Id field value
func (o *ApplicationOut) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *ApplicationOut) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *ApplicationOut) SetId(v string) {
o.Id = v
}
// GetMetadata returns the Metadata field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ApplicationOut) GetMetadata() map[string]string {
if o == nil {
var ret map[string]string
return ret
}
return o.Metadata
}
// GetMetadataOk returns a tuple with the Metadata 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 *ApplicationOut) GetMetadataOk() (*map[string]string, bool) {
if o == nil || o.Metadata == nil {
return nil, false
}
return &o.Metadata, true
}
// HasMetadata returns a boolean if a field has been set.
func (o *ApplicationOut) HasMetadata() bool {
if o != nil && o.Metadata != nil {
return true
}
return false
}
// SetMetadata gets a reference to the given map[string]string and assigns it to the Metadata field.
func (o *ApplicationOut) SetMetadata(v map[string]string) {
o.Metadata = v
}
// GetName returns the Name field value
func (o *ApplicationOut) 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 *ApplicationOut) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *ApplicationOut) SetName(v string) {
o.Name = v
}
// GetRateLimit returns the RateLimit field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ApplicationOut) GetRateLimit() int32 {
if o == nil || o.RateLimit.Get() == nil {
var ret int32
return ret
}
return *o.RateLimit.Get()
}
// GetRateLimitOk returns a tuple with the RateLimit 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 *ApplicationOut) GetRateLimitOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.RateLimit.Get(), o.RateLimit.IsSet()
}
// HasRateLimit returns a boolean if a field has been set.
func (o *ApplicationOut) HasRateLimit() bool {
if o != nil && o.RateLimit.IsSet() {
return true
}
return false
}
// SetRateLimit gets a reference to the given NullableInt32 and assigns it to the RateLimit field.
func (o *ApplicationOut) SetRateLimit(v int32) {
o.RateLimit.Set(&v)
}
// SetRateLimitNil sets the value for RateLimit to be an explicit nil
func (o *ApplicationOut) SetRateLimitNil() {
o.RateLimit.Set(nil)
}
// UnsetRateLimit ensures that no value is present for RateLimit, not even an explicit nil
func (o *ApplicationOut) UnsetRateLimit() {
o.RateLimit.Unset()
}
// GetUid returns the Uid field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *ApplicationOut) GetUid() string {
if o == nil || o.Uid.Get() == nil {
var ret string
return ret
}
return *o.Uid.Get()
}
// GetUidOk returns a tuple with the Uid 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 *ApplicationOut) GetUidOk() (*string, bool) {
if o == nil {
return nil, false
}
return o.Uid.Get(), o.Uid.IsSet()
}
// HasUid returns a boolean if a field has been set.
func (o *ApplicationOut) HasUid() bool {
if o != nil && o.Uid.IsSet() {
return true
}
return false
}
// SetUid gets a reference to the given NullableString and assigns it to the Uid field.
func (o *ApplicationOut) SetUid(v string) {
o.Uid.Set(&v)
}
// SetUidNil sets the value for Uid to be an explicit nil
func (o *ApplicationOut) SetUidNil() {
o.Uid.Set(nil)
}
// UnsetUid ensures that no value is present for Uid, not even an explicit nil
func (o *ApplicationOut) UnsetUid() {
o.Uid.Unset()
}
// GetUpdatedAt returns the UpdatedAt field value
func (o *ApplicationOut) GetUpdatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
// and a boolean to check if the value has been set.
func (o *ApplicationOut) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.UpdatedAt, true
}
// SetUpdatedAt sets field value
func (o *ApplicationOut) SetUpdatedAt(v time.Time) {
o.UpdatedAt = v
}
func (o ApplicationOut) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["createdAt"] = o.CreatedAt
}
if true {
toSerialize["id"] = o.Id
}
if o.Metadata != nil {
toSerialize["metadata"] = o.Metadata
}
if true {
toSerialize["name"] = o.Name
}
if o.RateLimit.IsSet() {
toSerialize["rateLimit"] = o.RateLimit.Get()
}
if o.Uid.IsSet() {
toSerialize["uid"] = o.Uid.Get()
}
if true {
toSerialize["updatedAt"] = o.UpdatedAt
}
return json.Marshal(toSerialize)
}
type NullableApplicationOut struct {
value *ApplicationOut
isSet bool
}
func (v NullableApplicationOut) Get() *ApplicationOut {
return v.value
}
func (v *NullableApplicationOut) Set(val *ApplicationOut) {
v.value = val
v.isSet = true
}
func (v NullableApplicationOut) IsSet() bool {
return v.isSet
}
func (v *NullableApplicationOut) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableApplicationOut(val *ApplicationOut) *NullableApplicationOut {
return &NullableApplicationOut{value: val, isSet: true}
}
func (v NullableApplicationOut) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableApplicationOut) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}