forked from clarkmcc/go-hubspot
/
model_url_mapping.go
480 lines (409 loc) · 12.3 KB
/
model_url_mapping.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
/*
URL redirects
URL redirect operations
API version: v3
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package url_redirects
import (
"encoding/json"
"time"
)
// UrlMapping struct for UrlMapping
type UrlMapping struct {
// The unique ID of this URL redirect.
Id string `json:"id"`
// The target incoming URL, path, or pattern to match for redirection.
RoutePrefix string `json:"routePrefix"`
// The destination URL, where the target URL should be redirected if it matches the `routePrefix`.
Destination string `json:"destination"`
// The type of redirect to create. Options include: 301 (permanent), 302 (temporary), or 305 (proxy). Find more details [here](https://knowledge.hubspot.com/cos-general/how-to-redirect-a-hubspot-page).
RedirectStyle int32 `json:"redirectStyle"`
// Whether the URL redirect mapping should apply only if a live page on the URL isn't found. If False, the URL redirect mapping will take precedence over any existing page.
IsOnlyAfterNotFound bool `json:"isOnlyAfterNotFound"`
// Whether the `routePrefix` should match on the entire URL, including the domain.
IsMatchFullUrl bool `json:"isMatchFullUrl"`
// Whether the `routePrefix` should match on the entire URL path, including the query string.
IsMatchQueryString bool `json:"isMatchQueryString"`
// Whether the `routePrefix` should match based on pattern.
IsPattern bool `json:"isPattern"`
// Whether a trailing slash will be ignored.
IsTrailingSlashOptional bool `json:"isTrailingSlashOptional"`
// Whether the `routePrefix` should match both HTTP and HTTPS protocols.
IsProtocolAgnostic bool `json:"isProtocolAgnostic"`
// Used to prioritize URL redirection. If a given URL matches more than one redirect, the one with the **lower** precedence will be used.
Precedence int32 `json:"precedence"`
Created *time.Time `json:"created,omitempty"`
Updated *time.Time `json:"updated,omitempty"`
}
// NewUrlMapping instantiates a new UrlMapping 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 NewUrlMapping(id string, routePrefix string, destination string, redirectStyle int32, isOnlyAfterNotFound bool, isMatchFullUrl bool, isMatchQueryString bool, isPattern bool, isTrailingSlashOptional bool, isProtocolAgnostic bool, precedence int32) *UrlMapping {
this := UrlMapping{}
this.Id = id
this.RoutePrefix = routePrefix
this.Destination = destination
this.RedirectStyle = redirectStyle
this.IsOnlyAfterNotFound = isOnlyAfterNotFound
this.IsMatchFullUrl = isMatchFullUrl
this.IsMatchQueryString = isMatchQueryString
this.IsPattern = isPattern
this.IsTrailingSlashOptional = isTrailingSlashOptional
this.IsProtocolAgnostic = isProtocolAgnostic
this.Precedence = precedence
return &this
}
// NewUrlMappingWithDefaults instantiates a new UrlMapping 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 NewUrlMappingWithDefaults() *UrlMapping {
this := UrlMapping{}
return &this
}
// GetId returns the Id field value
func (o *UrlMapping) 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 *UrlMapping) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *UrlMapping) SetId(v string) {
o.Id = v
}
// GetRoutePrefix returns the RoutePrefix field value
func (o *UrlMapping) GetRoutePrefix() string {
if o == nil {
var ret string
return ret
}
return o.RoutePrefix
}
// GetRoutePrefixOk returns a tuple with the RoutePrefix field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetRoutePrefixOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RoutePrefix, true
}
// SetRoutePrefix sets field value
func (o *UrlMapping) SetRoutePrefix(v string) {
o.RoutePrefix = v
}
// GetDestination returns the Destination field value
func (o *UrlMapping) GetDestination() string {
if o == nil {
var ret string
return ret
}
return o.Destination
}
// GetDestinationOk returns a tuple with the Destination field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetDestinationOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Destination, true
}
// SetDestination sets field value
func (o *UrlMapping) SetDestination(v string) {
o.Destination = v
}
// GetRedirectStyle returns the RedirectStyle field value
func (o *UrlMapping) GetRedirectStyle() int32 {
if o == nil {
var ret int32
return ret
}
return o.RedirectStyle
}
// GetRedirectStyleOk returns a tuple with the RedirectStyle field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetRedirectStyleOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.RedirectStyle, true
}
// SetRedirectStyle sets field value
func (o *UrlMapping) SetRedirectStyle(v int32) {
o.RedirectStyle = v
}
// GetIsOnlyAfterNotFound returns the IsOnlyAfterNotFound field value
func (o *UrlMapping) GetIsOnlyAfterNotFound() bool {
if o == nil {
var ret bool
return ret
}
return o.IsOnlyAfterNotFound
}
// GetIsOnlyAfterNotFoundOk returns a tuple with the IsOnlyAfterNotFound field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetIsOnlyAfterNotFoundOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsOnlyAfterNotFound, true
}
// SetIsOnlyAfterNotFound sets field value
func (o *UrlMapping) SetIsOnlyAfterNotFound(v bool) {
o.IsOnlyAfterNotFound = v
}
// GetIsMatchFullUrl returns the IsMatchFullUrl field value
func (o *UrlMapping) GetIsMatchFullUrl() bool {
if o == nil {
var ret bool
return ret
}
return o.IsMatchFullUrl
}
// GetIsMatchFullUrlOk returns a tuple with the IsMatchFullUrl field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetIsMatchFullUrlOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsMatchFullUrl, true
}
// SetIsMatchFullUrl sets field value
func (o *UrlMapping) SetIsMatchFullUrl(v bool) {
o.IsMatchFullUrl = v
}
// GetIsMatchQueryString returns the IsMatchQueryString field value
func (o *UrlMapping) GetIsMatchQueryString() bool {
if o == nil {
var ret bool
return ret
}
return o.IsMatchQueryString
}
// GetIsMatchQueryStringOk returns a tuple with the IsMatchQueryString field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetIsMatchQueryStringOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsMatchQueryString, true
}
// SetIsMatchQueryString sets field value
func (o *UrlMapping) SetIsMatchQueryString(v bool) {
o.IsMatchQueryString = v
}
// GetIsPattern returns the IsPattern field value
func (o *UrlMapping) GetIsPattern() bool {
if o == nil {
var ret bool
return ret
}
return o.IsPattern
}
// GetIsPatternOk returns a tuple with the IsPattern field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetIsPatternOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsPattern, true
}
// SetIsPattern sets field value
func (o *UrlMapping) SetIsPattern(v bool) {
o.IsPattern = v
}
// GetIsTrailingSlashOptional returns the IsTrailingSlashOptional field value
func (o *UrlMapping) GetIsTrailingSlashOptional() bool {
if o == nil {
var ret bool
return ret
}
return o.IsTrailingSlashOptional
}
// GetIsTrailingSlashOptionalOk returns a tuple with the IsTrailingSlashOptional field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetIsTrailingSlashOptionalOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsTrailingSlashOptional, true
}
// SetIsTrailingSlashOptional sets field value
func (o *UrlMapping) SetIsTrailingSlashOptional(v bool) {
o.IsTrailingSlashOptional = v
}
// GetIsProtocolAgnostic returns the IsProtocolAgnostic field value
func (o *UrlMapping) GetIsProtocolAgnostic() bool {
if o == nil {
var ret bool
return ret
}
return o.IsProtocolAgnostic
}
// GetIsProtocolAgnosticOk returns a tuple with the IsProtocolAgnostic field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetIsProtocolAgnosticOk() (*bool, bool) {
if o == nil {
return nil, false
}
return &o.IsProtocolAgnostic, true
}
// SetIsProtocolAgnostic sets field value
func (o *UrlMapping) SetIsProtocolAgnostic(v bool) {
o.IsProtocolAgnostic = v
}
// GetPrecedence returns the Precedence field value
func (o *UrlMapping) GetPrecedence() int32 {
if o == nil {
var ret int32
return ret
}
return o.Precedence
}
// GetPrecedenceOk returns a tuple with the Precedence field value
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetPrecedenceOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Precedence, true
}
// SetPrecedence sets field value
func (o *UrlMapping) SetPrecedence(v int32) {
o.Precedence = v
}
// GetCreated returns the Created field value if set, zero value otherwise.
func (o *UrlMapping) GetCreated() time.Time {
if o == nil || isNil(o.Created) {
var ret time.Time
return ret
}
return *o.Created
}
// GetCreatedOk returns a tuple with the Created field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetCreatedOk() (*time.Time, bool) {
if o == nil || isNil(o.Created) {
return nil, false
}
return o.Created, true
}
// HasCreated returns a boolean if a field has been set.
func (o *UrlMapping) HasCreated() bool {
if o != nil && !isNil(o.Created) {
return true
}
return false
}
// SetCreated gets a reference to the given time.Time and assigns it to the Created field.
func (o *UrlMapping) SetCreated(v time.Time) {
o.Created = &v
}
// GetUpdated returns the Updated field value if set, zero value otherwise.
func (o *UrlMapping) GetUpdated() time.Time {
if o == nil || isNil(o.Updated) {
var ret time.Time
return ret
}
return *o.Updated
}
// GetUpdatedOk returns a tuple with the Updated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *UrlMapping) GetUpdatedOk() (*time.Time, bool) {
if o == nil || isNil(o.Updated) {
return nil, false
}
return o.Updated, true
}
// HasUpdated returns a boolean if a field has been set.
func (o *UrlMapping) HasUpdated() bool {
if o != nil && !isNil(o.Updated) {
return true
}
return false
}
// SetUpdated gets a reference to the given time.Time and assigns it to the Updated field.
func (o *UrlMapping) SetUpdated(v time.Time) {
o.Updated = &v
}
func (o UrlMapping) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["id"] = o.Id
}
if true {
toSerialize["routePrefix"] = o.RoutePrefix
}
if true {
toSerialize["destination"] = o.Destination
}
if true {
toSerialize["redirectStyle"] = o.RedirectStyle
}
if true {
toSerialize["isOnlyAfterNotFound"] = o.IsOnlyAfterNotFound
}
if true {
toSerialize["isMatchFullUrl"] = o.IsMatchFullUrl
}
if true {
toSerialize["isMatchQueryString"] = o.IsMatchQueryString
}
if true {
toSerialize["isPattern"] = o.IsPattern
}
if true {
toSerialize["isTrailingSlashOptional"] = o.IsTrailingSlashOptional
}
if true {
toSerialize["isProtocolAgnostic"] = o.IsProtocolAgnostic
}
if true {
toSerialize["precedence"] = o.Precedence
}
if !isNil(o.Created) {
toSerialize["created"] = o.Created
}
if !isNil(o.Updated) {
toSerialize["updated"] = o.Updated
}
return json.Marshal(toSerialize)
}
type NullableUrlMapping struct {
value *UrlMapping
isSet bool
}
func (v NullableUrlMapping) Get() *UrlMapping {
return v.value
}
func (v *NullableUrlMapping) Set(val *UrlMapping) {
v.value = val
v.isSet = true
}
func (v NullableUrlMapping) IsSet() bool {
return v.isSet
}
func (v *NullableUrlMapping) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUrlMapping(val *UrlMapping) *NullableUrlMapping {
return &NullableUrlMapping{value: val, isSet: true}
}
func (v NullableUrlMapping) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUrlMapping) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}