/
model_content_search_result.go
671 lines (574 loc) · 17.3 KB
/
model_content_search_result.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
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
/*
CMS Site Search
Use these endpoints for searching content on your HubSpot hosted CMS website(s).
API version: v3
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package site_search
import (
"encoding/json"
)
// ContentSearchResult An individual search result.
type ContentSearchResult struct {
// The ID of the document in HubSpot.
CombinedId *string `json:"combinedId,omitempty"`
// The result's description. The content will be determined by the value of `length` in the request.
Description *string `json:"description,omitempty"`
// The document's language.
Language *string `json:"language,omitempty"`
// The type of document. Can be `SITE_PAGE`, `LANDING_PAGE`, `BLOG_POST`, `LISTING_PAGE`, or `KNOWLEDGE_ARTICLE`.
Type string `json:"type"`
// The title of the returned document.
Title *string `json:"title,omitempty"`
// The url of the document.
Url string `json:"url"`
// If a blog post, the tags associated with it.
Tags []string `json:"tags,omitempty"`
// If a dynamic page, the row ID in the HubDB table.
RowId *int64 `json:"rowId,omitempty"`
// URL of the featured image.
FeaturedImageUrl *string `json:"featuredImageUrl,omitempty"`
// The matching score of the document.
Score float32 `json:"score"`
// Name of the author.
AuthorFullName *string `json:"authorFullName,omitempty"`
// The domain the document is hosted on.
Domain string `json:"domain"`
// If a dynamic page, the ID of the HubDB table.
TableId *int64 `json:"tableId,omitempty"`
// The ID of the content.
Id int32 `json:"id"`
// The date the content was published.
PublishedDate *int64 `json:"publishedDate,omitempty"`
// For knowledge articles, the category of the article.
Category *string `json:"category,omitempty"`
// For knowledge articles, the subcategory of the article.
Subcategory *string `json:"subcategory,omitempty"`
}
// NewContentSearchResult instantiates a new ContentSearchResult 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 NewContentSearchResult(type_ string, url string, score float32, domain string, id int32) *ContentSearchResult {
this := ContentSearchResult{}
this.Type = type_
this.Url = url
this.Score = score
this.Domain = domain
this.Id = id
return &this
}
// NewContentSearchResultWithDefaults instantiates a new ContentSearchResult 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 NewContentSearchResultWithDefaults() *ContentSearchResult {
this := ContentSearchResult{}
return &this
}
// GetCombinedId returns the CombinedId field value if set, zero value otherwise.
func (o *ContentSearchResult) GetCombinedId() string {
if o == nil || o.CombinedId == nil {
var ret string
return ret
}
return *o.CombinedId
}
// GetCombinedIdOk returns a tuple with the CombinedId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetCombinedIdOk() (*string, bool) {
if o == nil || o.CombinedId == nil {
return nil, false
}
return o.CombinedId, true
}
// HasCombinedId returns a boolean if a field has been set.
func (o *ContentSearchResult) HasCombinedId() bool {
if o != nil && o.CombinedId != nil {
return true
}
return false
}
// SetCombinedId gets a reference to the given string and assigns it to the CombinedId field.
func (o *ContentSearchResult) SetCombinedId(v string) {
o.CombinedId = &v
}
// GetDescription returns the Description field value if set, zero value otherwise.
func (o *ContentSearchResult) GetDescription() string {
if o == nil || o.Description == nil {
var ret string
return ret
}
return *o.Description
}
// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetDescriptionOk() (*string, bool) {
if o == nil || o.Description == nil {
return nil, false
}
return o.Description, true
}
// HasDescription returns a boolean if a field has been set.
func (o *ContentSearchResult) HasDescription() bool {
if o != nil && o.Description != nil {
return true
}
return false
}
// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *ContentSearchResult) SetDescription(v string) {
o.Description = &v
}
// GetLanguage returns the Language field value if set, zero value otherwise.
func (o *ContentSearchResult) GetLanguage() string {
if o == nil || o.Language == nil {
var ret string
return ret
}
return *o.Language
}
// GetLanguageOk returns a tuple with the Language field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetLanguageOk() (*string, bool) {
if o == nil || o.Language == nil {
return nil, false
}
return o.Language, true
}
// HasLanguage returns a boolean if a field has been set.
func (o *ContentSearchResult) HasLanguage() bool {
if o != nil && o.Language != nil {
return true
}
return false
}
// SetLanguage gets a reference to the given string and assigns it to the Language field.
func (o *ContentSearchResult) SetLanguage(v string) {
o.Language = &v
}
// GetType returns the Type field value
func (o *ContentSearchResult) GetType() string {
if o == nil {
var ret string
return ret
}
return o.Type
}
// GetTypeOk returns a tuple with the Type field value
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetTypeOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Type, true
}
// SetType sets field value
func (o *ContentSearchResult) SetType(v string) {
o.Type = v
}
// GetTitle returns the Title field value if set, zero value otherwise.
func (o *ContentSearchResult) GetTitle() string {
if o == nil || o.Title == nil {
var ret string
return ret
}
return *o.Title
}
// GetTitleOk returns a tuple with the Title field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetTitleOk() (*string, bool) {
if o == nil || o.Title == nil {
return nil, false
}
return o.Title, true
}
// HasTitle returns a boolean if a field has been set.
func (o *ContentSearchResult) HasTitle() bool {
if o != nil && o.Title != nil {
return true
}
return false
}
// SetTitle gets a reference to the given string and assigns it to the Title field.
func (o *ContentSearchResult) SetTitle(v string) {
o.Title = &v
}
// GetUrl returns the Url field value
func (o *ContentSearchResult) GetUrl() string {
if o == nil {
var ret string
return ret
}
return o.Url
}
// GetUrlOk returns a tuple with the Url field value
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetUrlOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Url, true
}
// SetUrl sets field value
func (o *ContentSearchResult) SetUrl(v string) {
o.Url = v
}
// GetTags returns the Tags field value if set, zero value otherwise.
func (o *ContentSearchResult) GetTags() []string {
if o == nil || o.Tags == nil {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetTagsOk() ([]string, bool) {
if o == nil || o.Tags == nil {
return nil, false
}
return o.Tags, true
}
// HasTags returns a boolean if a field has been set.
func (o *ContentSearchResult) HasTags() bool {
if o != nil && o.Tags != nil {
return true
}
return false
}
// SetTags gets a reference to the given []string and assigns it to the Tags field.
func (o *ContentSearchResult) SetTags(v []string) {
o.Tags = v
}
// GetRowId returns the RowId field value if set, zero value otherwise.
func (o *ContentSearchResult) GetRowId() int64 {
if o == nil || o.RowId == nil {
var ret int64
return ret
}
return *o.RowId
}
// GetRowIdOk returns a tuple with the RowId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetRowIdOk() (*int64, bool) {
if o == nil || o.RowId == nil {
return nil, false
}
return o.RowId, true
}
// HasRowId returns a boolean if a field has been set.
func (o *ContentSearchResult) HasRowId() bool {
if o != nil && o.RowId != nil {
return true
}
return false
}
// SetRowId gets a reference to the given int64 and assigns it to the RowId field.
func (o *ContentSearchResult) SetRowId(v int64) {
o.RowId = &v
}
// GetFeaturedImageUrl returns the FeaturedImageUrl field value if set, zero value otherwise.
func (o *ContentSearchResult) GetFeaturedImageUrl() string {
if o == nil || o.FeaturedImageUrl == nil {
var ret string
return ret
}
return *o.FeaturedImageUrl
}
// GetFeaturedImageUrlOk returns a tuple with the FeaturedImageUrl field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetFeaturedImageUrlOk() (*string, bool) {
if o == nil || o.FeaturedImageUrl == nil {
return nil, false
}
return o.FeaturedImageUrl, true
}
// HasFeaturedImageUrl returns a boolean if a field has been set.
func (o *ContentSearchResult) HasFeaturedImageUrl() bool {
if o != nil && o.FeaturedImageUrl != nil {
return true
}
return false
}
// SetFeaturedImageUrl gets a reference to the given string and assigns it to the FeaturedImageUrl field.
func (o *ContentSearchResult) SetFeaturedImageUrl(v string) {
o.FeaturedImageUrl = &v
}
// GetScore returns the Score field value
func (o *ContentSearchResult) GetScore() float32 {
if o == nil {
var ret float32
return ret
}
return o.Score
}
// GetScoreOk returns a tuple with the Score field value
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetScoreOk() (*float32, bool) {
if o == nil {
return nil, false
}
return &o.Score, true
}
// SetScore sets field value
func (o *ContentSearchResult) SetScore(v float32) {
o.Score = v
}
// GetAuthorFullName returns the AuthorFullName field value if set, zero value otherwise.
func (o *ContentSearchResult) GetAuthorFullName() string {
if o == nil || o.AuthorFullName == nil {
var ret string
return ret
}
return *o.AuthorFullName
}
// GetAuthorFullNameOk returns a tuple with the AuthorFullName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetAuthorFullNameOk() (*string, bool) {
if o == nil || o.AuthorFullName == nil {
return nil, false
}
return o.AuthorFullName, true
}
// HasAuthorFullName returns a boolean if a field has been set.
func (o *ContentSearchResult) HasAuthorFullName() bool {
if o != nil && o.AuthorFullName != nil {
return true
}
return false
}
// SetAuthorFullName gets a reference to the given string and assigns it to the AuthorFullName field.
func (o *ContentSearchResult) SetAuthorFullName(v string) {
o.AuthorFullName = &v
}
// GetDomain returns the Domain field value
func (o *ContentSearchResult) GetDomain() string {
if o == nil {
var ret string
return ret
}
return o.Domain
}
// GetDomainOk returns a tuple with the Domain field value
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetDomainOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Domain, true
}
// SetDomain sets field value
func (o *ContentSearchResult) SetDomain(v string) {
o.Domain = v
}
// GetTableId returns the TableId field value if set, zero value otherwise.
func (o *ContentSearchResult) GetTableId() int64 {
if o == nil || o.TableId == nil {
var ret int64
return ret
}
return *o.TableId
}
// GetTableIdOk returns a tuple with the TableId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetTableIdOk() (*int64, bool) {
if o == nil || o.TableId == nil {
return nil, false
}
return o.TableId, true
}
// HasTableId returns a boolean if a field has been set.
func (o *ContentSearchResult) HasTableId() bool {
if o != nil && o.TableId != nil {
return true
}
return false
}
// SetTableId gets a reference to the given int64 and assigns it to the TableId field.
func (o *ContentSearchResult) SetTableId(v int64) {
o.TableId = &v
}
// GetId returns the Id field value
func (o *ContentSearchResult) GetId() int32 {
if o == nil {
var ret int32
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 *ContentSearchResult) GetIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *ContentSearchResult) SetId(v int32) {
o.Id = v
}
// GetPublishedDate returns the PublishedDate field value if set, zero value otherwise.
func (o *ContentSearchResult) GetPublishedDate() int64 {
if o == nil || o.PublishedDate == nil {
var ret int64
return ret
}
return *o.PublishedDate
}
// GetPublishedDateOk returns a tuple with the PublishedDate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetPublishedDateOk() (*int64, bool) {
if o == nil || o.PublishedDate == nil {
return nil, false
}
return o.PublishedDate, true
}
// HasPublishedDate returns a boolean if a field has been set.
func (o *ContentSearchResult) HasPublishedDate() bool {
if o != nil && o.PublishedDate != nil {
return true
}
return false
}
// SetPublishedDate gets a reference to the given int64 and assigns it to the PublishedDate field.
func (o *ContentSearchResult) SetPublishedDate(v int64) {
o.PublishedDate = &v
}
// GetCategory returns the Category field value if set, zero value otherwise.
func (o *ContentSearchResult) GetCategory() string {
if o == nil || o.Category == nil {
var ret string
return ret
}
return *o.Category
}
// GetCategoryOk returns a tuple with the Category field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetCategoryOk() (*string, bool) {
if o == nil || o.Category == nil {
return nil, false
}
return o.Category, true
}
// HasCategory returns a boolean if a field has been set.
func (o *ContentSearchResult) HasCategory() bool {
if o != nil && o.Category != nil {
return true
}
return false
}
// SetCategory gets a reference to the given string and assigns it to the Category field.
func (o *ContentSearchResult) SetCategory(v string) {
o.Category = &v
}
// GetSubcategory returns the Subcategory field value if set, zero value otherwise.
func (o *ContentSearchResult) GetSubcategory() string {
if o == nil || o.Subcategory == nil {
var ret string
return ret
}
return *o.Subcategory
}
// GetSubcategoryOk returns a tuple with the Subcategory field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ContentSearchResult) GetSubcategoryOk() (*string, bool) {
if o == nil || o.Subcategory == nil {
return nil, false
}
return o.Subcategory, true
}
// HasSubcategory returns a boolean if a field has been set.
func (o *ContentSearchResult) HasSubcategory() bool {
if o != nil && o.Subcategory != nil {
return true
}
return false
}
// SetSubcategory gets a reference to the given string and assigns it to the Subcategory field.
func (o *ContentSearchResult) SetSubcategory(v string) {
o.Subcategory = &v
}
func (o ContentSearchResult) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.CombinedId != nil {
toSerialize["combinedId"] = o.CombinedId
}
if o.Description != nil {
toSerialize["description"] = o.Description
}
if o.Language != nil {
toSerialize["language"] = o.Language
}
if true {
toSerialize["type"] = o.Type
}
if o.Title != nil {
toSerialize["title"] = o.Title
}
if true {
toSerialize["url"] = o.Url
}
if o.Tags != nil {
toSerialize["tags"] = o.Tags
}
if o.RowId != nil {
toSerialize["rowId"] = o.RowId
}
if o.FeaturedImageUrl != nil {
toSerialize["featuredImageUrl"] = o.FeaturedImageUrl
}
if true {
toSerialize["score"] = o.Score
}
if o.AuthorFullName != nil {
toSerialize["authorFullName"] = o.AuthorFullName
}
if true {
toSerialize["domain"] = o.Domain
}
if o.TableId != nil {
toSerialize["tableId"] = o.TableId
}
if true {
toSerialize["id"] = o.Id
}
if o.PublishedDate != nil {
toSerialize["publishedDate"] = o.PublishedDate
}
if o.Category != nil {
toSerialize["category"] = o.Category
}
if o.Subcategory != nil {
toSerialize["subcategory"] = o.Subcategory
}
return json.Marshal(toSerialize)
}
type NullableContentSearchResult struct {
value *ContentSearchResult
isSet bool
}
func (v NullableContentSearchResult) Get() *ContentSearchResult {
return v.value
}
func (v *NullableContentSearchResult) Set(val *ContentSearchResult) {
v.value = val
v.isSet = true
}
func (v NullableContentSearchResult) IsSet() bool {
return v.isSet
}
func (v *NullableContentSearchResult) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableContentSearchResult(val *ContentSearchResult) *NullableContentSearchResult {
return &NullableContentSearchResult{value: val, isSet: true}
}
func (v NullableContentSearchResult) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableContentSearchResult) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}