-
Notifications
You must be signed in to change notification settings - Fork 13
/
documentationresult.go
300 lines (193 loc) · 8.78 KB
/
documentationresult.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
package platformclientv2
import (
"time"
"github.com/leekchan/timeutil"
"encoding/json"
"strconv"
"strings"
)
// Documentationresult
type Documentationresult struct {
// Id - The globally unique identifier for the object.
Id *int `json:"id,omitempty"`
// Categories - The category of the documentation entity. Will be returned in responses for certain entities.
Categories *[]int `json:"categories,omitempty"`
// Description - The description of the documentation entity. Will be returned in responses for certain entities.
Description *string `json:"description,omitempty"`
// Content - The text or html content for the documentation entity. Will be returned in responses for certain entities.
Content *string `json:"content,omitempty"`
// Excerpt - The excerpt of the documentation entity. Will be returned in responses for certain entities.
Excerpt *string `json:"excerpt,omitempty"`
// Link - URL link for the documentation entity. Will be returned in responses for certain entities.
Link *string `json:"link,omitempty"`
// Modified - The modified date for the documentation entity. Will be returned in responses for certain entities. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss[.mmm]Z
Modified *time.Time `json:"modified,omitempty"`
// Name - The name of the documentation entity. Will be returned in responses for certain entities.
Name *string `json:"name,omitempty"`
// Service - The service of the documentation entity. Will be returned in responses for certain entities.
Service *[]int `json:"service,omitempty"`
// Slug - The slug of the documentation entity. Will be returned in responses for certain entities.
Slug *string `json:"slug,omitempty"`
// Title - The title of the documentation entity. Will be returned in responses for certain entities.
Title *string `json:"title,omitempty"`
// GetType - The search type. Will be returned in responses for certain entities.
GetType *string `json:"get_type,omitempty"`
// FacetFeature - The facet feature of the documentation entity. Will be returned in responses for certain entities.
FacetFeature *[]int `json:"facet_feature,omitempty"`
// FacetRole - The facet role of the documentation entity. Will be returned in responses for certain entities.
FacetRole *[]int `json:"facet_role,omitempty"`
// FacetService - The facet service of the documentation entity. Will be returned in responses for certain entities.
FacetService *[]int `json:"facet_service,omitempty"`
// FaqCategories - The faq categories of the documentation entity. Will be returned in responses for certain entities.
FaqCategories *[]int `json:"faq_categories,omitempty"`
// ReleasenoteCategory - The releasenote category of the documentation entity. Will be returned in responses for certain entities.
ReleasenoteCategory *[]int `json:"releasenote_category,omitempty"`
// ReleasenoteTag - The releasenote tag of the documentation entity. Will be returned in responses for certain entities.
ReleasenoteTag *[]int `json:"releasenote_tag,omitempty"`
// ServiceArea - The service area of the documentation entity. Will be returned in responses for certain entities.
ServiceArea *[]int `json:"service-area,omitempty"`
// VideoCategories - The video categories of the documentation entity. Will be returned in responses for certain entities.
VideoCategories *[]int `json:"video_categories,omitempty"`
}
func (o *Documentationresult) MarshalJSON() ([]byte, error) {
// Redundant initialization to avoid unused import errors for models with no Time values
_ = timeutil.Timedelta{}
type Alias Documentationresult
Modified := new(string)
if o.Modified != nil {
*Modified = timeutil.Strftime(o.Modified, "%Y-%m-%dT%H:%M:%S.%fZ")
} else {
Modified = nil
}
return json.Marshal(&struct {
Id *int `json:"id,omitempty"`
Categories *[]int `json:"categories,omitempty"`
Description *string `json:"description,omitempty"`
Content *string `json:"content,omitempty"`
Excerpt *string `json:"excerpt,omitempty"`
Link *string `json:"link,omitempty"`
Modified *string `json:"modified,omitempty"`
Name *string `json:"name,omitempty"`
Service *[]int `json:"service,omitempty"`
Slug *string `json:"slug,omitempty"`
Title *string `json:"title,omitempty"`
GetType *string `json:"get_type,omitempty"`
FacetFeature *[]int `json:"facet_feature,omitempty"`
FacetRole *[]int `json:"facet_role,omitempty"`
FacetService *[]int `json:"facet_service,omitempty"`
FaqCategories *[]int `json:"faq_categories,omitempty"`
ReleasenoteCategory *[]int `json:"releasenote_category,omitempty"`
ReleasenoteTag *[]int `json:"releasenote_tag,omitempty"`
ServiceArea *[]int `json:"service-area,omitempty"`
VideoCategories *[]int `json:"video_categories,omitempty"`
*Alias
}{
Id: o.Id,
Categories: o.Categories,
Description: o.Description,
Content: o.Content,
Excerpt: o.Excerpt,
Link: o.Link,
Modified: Modified,
Name: o.Name,
Service: o.Service,
Slug: o.Slug,
Title: o.Title,
GetType: o.GetType,
FacetFeature: o.FacetFeature,
FacetRole: o.FacetRole,
FacetService: o.FacetService,
FaqCategories: o.FaqCategories,
ReleasenoteCategory: o.ReleasenoteCategory,
ReleasenoteTag: o.ReleasenoteTag,
ServiceArea: o.ServiceArea,
VideoCategories: o.VideoCategories,
Alias: (*Alias)(o),
})
}
func (o *Documentationresult) UnmarshalJSON(b []byte) error {
var DocumentationresultMap map[string]interface{}
err := json.Unmarshal(b, &DocumentationresultMap)
if err != nil {
return err
}
if Id, ok := DocumentationresultMap["id"].(float64); ok {
IdInt := int(Id)
o.Id = &IdInt
}
if Categories, ok := DocumentationresultMap["categories"].([]interface{}); ok {
CategoriesString, _ := json.Marshal(Categories)
json.Unmarshal(CategoriesString, &o.Categories)
}
if Description, ok := DocumentationresultMap["description"].(string); ok {
o.Description = &Description
}
if Content, ok := DocumentationresultMap["content"].(string); ok {
o.Content = &Content
}
if Excerpt, ok := DocumentationresultMap["excerpt"].(string); ok {
o.Excerpt = &Excerpt
}
if Link, ok := DocumentationresultMap["link"].(string); ok {
o.Link = &Link
}
if modifiedString, ok := DocumentationresultMap["modified"].(string); ok {
Modified, _ := time.Parse("2006-01-02T15:04:05.999999Z", modifiedString)
o.Modified = &Modified
}
if Name, ok := DocumentationresultMap["name"].(string); ok {
o.Name = &Name
}
if Service, ok := DocumentationresultMap["service"].([]interface{}); ok {
ServiceString, _ := json.Marshal(Service)
json.Unmarshal(ServiceString, &o.Service)
}
if Slug, ok := DocumentationresultMap["slug"].(string); ok {
o.Slug = &Slug
}
if Title, ok := DocumentationresultMap["title"].(string); ok {
o.Title = &Title
}
if GetType, ok := DocumentationresultMap["get_type"].(string); ok {
o.GetType = &GetType
}
if FacetFeature, ok := DocumentationresultMap["facet_feature"].([]interface{}); ok {
FacetFeatureString, _ := json.Marshal(FacetFeature)
json.Unmarshal(FacetFeatureString, &o.FacetFeature)
}
if FacetRole, ok := DocumentationresultMap["facet_role"].([]interface{}); ok {
FacetRoleString, _ := json.Marshal(FacetRole)
json.Unmarshal(FacetRoleString, &o.FacetRole)
}
if FacetService, ok := DocumentationresultMap["facet_service"].([]interface{}); ok {
FacetServiceString, _ := json.Marshal(FacetService)
json.Unmarshal(FacetServiceString, &o.FacetService)
}
if FaqCategories, ok := DocumentationresultMap["faq_categories"].([]interface{}); ok {
FaqCategoriesString, _ := json.Marshal(FaqCategories)
json.Unmarshal(FaqCategoriesString, &o.FaqCategories)
}
if ReleasenoteCategory, ok := DocumentationresultMap["releasenote_category"].([]interface{}); ok {
ReleasenoteCategoryString, _ := json.Marshal(ReleasenoteCategory)
json.Unmarshal(ReleasenoteCategoryString, &o.ReleasenoteCategory)
}
if ReleasenoteTag, ok := DocumentationresultMap["releasenote_tag"].([]interface{}); ok {
ReleasenoteTagString, _ := json.Marshal(ReleasenoteTag)
json.Unmarshal(ReleasenoteTagString, &o.ReleasenoteTag)
}
if ServiceArea, ok := DocumentationresultMap["service-area"].([]interface{}); ok {
ServiceAreaString, _ := json.Marshal(ServiceArea)
json.Unmarshal(ServiceAreaString, &o.ServiceArea)
}
if VideoCategories, ok := DocumentationresultMap["video_categories"].([]interface{}); ok {
VideoCategoriesString, _ := json.Marshal(VideoCategories)
json.Unmarshal(VideoCategoriesString, &o.VideoCategories)
}
return nil
}
// String returns a JSON representation of the model
func (o *Documentationresult) String() string {
j, _ := json.Marshal(o)
str, _ := strconv.Unquote(strings.Replace(strconv.Quote(string(j)), `\\u`, `\u`, -1))
return str
}