A fork of https://github.com/teal-fm/piper
at main 487 lines 21 kB view raw
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package bsky 4 5// schema: app.bsky.feed.defs 6 7import ( 8 "encoding/json" 9 "fmt" 10 11 comatprototypes "github.com/bluesky-social/indigo/api/atproto" 12 "github.com/bluesky-social/indigo/lex/util" 13) 14 15// FeedDefs_BlockedAuthor is a "blockedAuthor" in the app.bsky.feed.defs schema. 16type FeedDefs_BlockedAuthor struct { 17 Did string `json:"did" cborgen:"did"` 18 Viewer *ActorDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 19} 20 21// FeedDefs_BlockedPost is a "blockedPost" in the app.bsky.feed.defs schema. 22// 23// RECORDTYPE: FeedDefs_BlockedPost 24type FeedDefs_BlockedPost struct { 25 LexiconTypeID string `json:"$type,const=app.bsky.feed.defs#blockedPost" cborgen:"$type,const=app.bsky.feed.defs#blockedPost"` 26 Author *FeedDefs_BlockedAuthor `json:"author" cborgen:"author"` 27 Blocked bool `json:"blocked" cborgen:"blocked"` 28 Uri string `json:"uri" cborgen:"uri"` 29} 30 31// FeedDefs_FeedViewPost is a "feedViewPost" in the app.bsky.feed.defs schema. 32type FeedDefs_FeedViewPost struct { 33 // feedContext: Context provided by feed generator that may be passed back alongside interactions. 34 FeedContext *string `json:"feedContext,omitempty" cborgen:"feedContext,omitempty"` 35 Post *FeedDefs_PostView `json:"post" cborgen:"post"` 36 Reason *FeedDefs_FeedViewPost_Reason `json:"reason,omitempty" cborgen:"reason,omitempty"` 37 Reply *FeedDefs_ReplyRef `json:"reply,omitempty" cborgen:"reply,omitempty"` 38} 39 40type FeedDefs_FeedViewPost_Reason struct { 41 FeedDefs_ReasonRepost *FeedDefs_ReasonRepost 42 FeedDefs_ReasonPin *FeedDefs_ReasonPin 43} 44 45func (t *FeedDefs_FeedViewPost_Reason) MarshalJSON() ([]byte, error) { 46 if t.FeedDefs_ReasonRepost != nil { 47 t.FeedDefs_ReasonRepost.LexiconTypeID = "app.bsky.feed.defs#reasonRepost" 48 return json.Marshal(t.FeedDefs_ReasonRepost) 49 } 50 if t.FeedDefs_ReasonPin != nil { 51 t.FeedDefs_ReasonPin.LexiconTypeID = "app.bsky.feed.defs#reasonPin" 52 return json.Marshal(t.FeedDefs_ReasonPin) 53 } 54 return nil, fmt.Errorf("cannot marshal empty enum") 55} 56func (t *FeedDefs_FeedViewPost_Reason) UnmarshalJSON(b []byte) error { 57 typ, err := util.TypeExtract(b) 58 if err != nil { 59 return err 60 } 61 62 switch typ { 63 case "app.bsky.feed.defs#reasonRepost": 64 t.FeedDefs_ReasonRepost = new(FeedDefs_ReasonRepost) 65 return json.Unmarshal(b, t.FeedDefs_ReasonRepost) 66 case "app.bsky.feed.defs#reasonPin": 67 t.FeedDefs_ReasonPin = new(FeedDefs_ReasonPin) 68 return json.Unmarshal(b, t.FeedDefs_ReasonPin) 69 70 default: 71 return nil 72 } 73} 74 75// FeedDefs_GeneratorView is a "generatorView" in the app.bsky.feed.defs schema. 76// 77// RECORDTYPE: FeedDefs_GeneratorView 78type FeedDefs_GeneratorView struct { 79 LexiconTypeID string `json:"$type,const=app.bsky.feed.defs#generatorView" cborgen:"$type,const=app.bsky.feed.defs#generatorView"` 80 AcceptsInteractions *bool `json:"acceptsInteractions,omitempty" cborgen:"acceptsInteractions,omitempty"` 81 Avatar *string `json:"avatar,omitempty" cborgen:"avatar,omitempty"` 82 Cid string `json:"cid" cborgen:"cid"` 83 ContentMode *string `json:"contentMode,omitempty" cborgen:"contentMode,omitempty"` 84 Creator *ActorDefs_ProfileView `json:"creator" cborgen:"creator"` 85 Description *string `json:"description,omitempty" cborgen:"description,omitempty"` 86 DescriptionFacets []*RichtextFacet `json:"descriptionFacets,omitempty" cborgen:"descriptionFacets,omitempty"` 87 Did string `json:"did" cborgen:"did"` 88 DisplayName string `json:"displayName" cborgen:"displayName"` 89 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 90 Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 91 LikeCount *int64 `json:"likeCount,omitempty" cborgen:"likeCount,omitempty"` 92 Uri string `json:"uri" cborgen:"uri"` 93 Viewer *FeedDefs_GeneratorViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 94} 95 96// FeedDefs_GeneratorViewerState is a "generatorViewerState" in the app.bsky.feed.defs schema. 97type FeedDefs_GeneratorViewerState struct { 98 Like *string `json:"like,omitempty" cborgen:"like,omitempty"` 99} 100 101// FeedDefs_Interaction is a "interaction" in the app.bsky.feed.defs schema. 102type FeedDefs_Interaction struct { 103 Event *string `json:"event,omitempty" cborgen:"event,omitempty"` 104 // feedContext: Context on a feed item that was originally supplied by the feed generator on getFeedSkeleton. 105 FeedContext *string `json:"feedContext,omitempty" cborgen:"feedContext,omitempty"` 106 Item *string `json:"item,omitempty" cborgen:"item,omitempty"` 107} 108 109// FeedDefs_NotFoundPost is a "notFoundPost" in the app.bsky.feed.defs schema. 110// 111// RECORDTYPE: FeedDefs_NotFoundPost 112type FeedDefs_NotFoundPost struct { 113 LexiconTypeID string `json:"$type,const=app.bsky.feed.defs#notFoundPost" cborgen:"$type,const=app.bsky.feed.defs#notFoundPost"` 114 NotFound bool `json:"notFound" cborgen:"notFound"` 115 Uri string `json:"uri" cborgen:"uri"` 116} 117 118// FeedDefs_PostView is a "postView" in the app.bsky.feed.defs schema. 119// 120// RECORDTYPE: FeedDefs_PostView 121type FeedDefs_PostView struct { 122 LexiconTypeID string `json:"$type,const=app.bsky.feed.defs#postView" cborgen:"$type,const=app.bsky.feed.defs#postView"` 123 Author *ActorDefs_ProfileViewBasic `json:"author" cborgen:"author"` 124 Cid string `json:"cid" cborgen:"cid"` 125 Embed *FeedDefs_PostView_Embed `json:"embed,omitempty" cborgen:"embed,omitempty"` 126 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 127 Labels []*comatprototypes.LabelDefs_Label `json:"labels,omitempty" cborgen:"labels,omitempty"` 128 LikeCount *int64 `json:"likeCount,omitempty" cborgen:"likeCount,omitempty"` 129 QuoteCount *int64 `json:"quoteCount,omitempty" cborgen:"quoteCount,omitempty"` 130 Record *util.LexiconTypeDecoder `json:"record" cborgen:"record"` 131 ReplyCount *int64 `json:"replyCount,omitempty" cborgen:"replyCount,omitempty"` 132 RepostCount *int64 `json:"repostCount,omitempty" cborgen:"repostCount,omitempty"` 133 Threadgate *FeedDefs_ThreadgateView `json:"threadgate,omitempty" cborgen:"threadgate,omitempty"` 134 Uri string `json:"uri" cborgen:"uri"` 135 Viewer *FeedDefs_ViewerState `json:"viewer,omitempty" cborgen:"viewer,omitempty"` 136} 137 138type FeedDefs_PostView_Embed struct { 139 EmbedImages_View *EmbedImages_View 140 EmbedVideo_View *EmbedVideo_View 141 EmbedExternal_View *EmbedExternal_View 142 EmbedRecord_View *EmbedRecord_View 143 EmbedRecordWithMedia_View *EmbedRecordWithMedia_View 144} 145 146func (t *FeedDefs_PostView_Embed) MarshalJSON() ([]byte, error) { 147 if t.EmbedImages_View != nil { 148 t.EmbedImages_View.LexiconTypeID = "app.bsky.embed.images#view" 149 return json.Marshal(t.EmbedImages_View) 150 } 151 if t.EmbedVideo_View != nil { 152 t.EmbedVideo_View.LexiconTypeID = "app.bsky.embed.video#view" 153 return json.Marshal(t.EmbedVideo_View) 154 } 155 if t.EmbedExternal_View != nil { 156 t.EmbedExternal_View.LexiconTypeID = "app.bsky.embed.external#view" 157 return json.Marshal(t.EmbedExternal_View) 158 } 159 if t.EmbedRecord_View != nil { 160 t.EmbedRecord_View.LexiconTypeID = "app.bsky.embed.record#view" 161 return json.Marshal(t.EmbedRecord_View) 162 } 163 if t.EmbedRecordWithMedia_View != nil { 164 t.EmbedRecordWithMedia_View.LexiconTypeID = "app.bsky.embed.recordWithMedia#view" 165 return json.Marshal(t.EmbedRecordWithMedia_View) 166 } 167 return nil, fmt.Errorf("cannot marshal empty enum") 168} 169func (t *FeedDefs_PostView_Embed) UnmarshalJSON(b []byte) error { 170 typ, err := util.TypeExtract(b) 171 if err != nil { 172 return err 173 } 174 175 switch typ { 176 case "app.bsky.embed.images#view": 177 t.EmbedImages_View = new(EmbedImages_View) 178 return json.Unmarshal(b, t.EmbedImages_View) 179 case "app.bsky.embed.video#view": 180 t.EmbedVideo_View = new(EmbedVideo_View) 181 return json.Unmarshal(b, t.EmbedVideo_View) 182 case "app.bsky.embed.external#view": 183 t.EmbedExternal_View = new(EmbedExternal_View) 184 return json.Unmarshal(b, t.EmbedExternal_View) 185 case "app.bsky.embed.record#view": 186 t.EmbedRecord_View = new(EmbedRecord_View) 187 return json.Unmarshal(b, t.EmbedRecord_View) 188 case "app.bsky.embed.recordWithMedia#view": 189 t.EmbedRecordWithMedia_View = new(EmbedRecordWithMedia_View) 190 return json.Unmarshal(b, t.EmbedRecordWithMedia_View) 191 192 default: 193 return nil 194 } 195} 196 197// FeedDefs_ReasonPin is a "reasonPin" in the app.bsky.feed.defs schema. 198// 199// RECORDTYPE: FeedDefs_ReasonPin 200type FeedDefs_ReasonPin struct { 201 LexiconTypeID string `json:"$type,const=app.bsky.feed.defs#reasonPin" cborgen:"$type,const=app.bsky.feed.defs#reasonPin"` 202} 203 204// FeedDefs_ReasonRepost is a "reasonRepost" in the app.bsky.feed.defs schema. 205// 206// RECORDTYPE: FeedDefs_ReasonRepost 207type FeedDefs_ReasonRepost struct { 208 LexiconTypeID string `json:"$type,const=app.bsky.feed.defs#reasonRepost" cborgen:"$type,const=app.bsky.feed.defs#reasonRepost"` 209 By *ActorDefs_ProfileViewBasic `json:"by" cborgen:"by"` 210 IndexedAt string `json:"indexedAt" cborgen:"indexedAt"` 211} 212 213// FeedDefs_ReplyRef is a "replyRef" in the app.bsky.feed.defs schema. 214type FeedDefs_ReplyRef struct { 215 // grandparentAuthor: When parent is a reply to another post, this is the author of that post. 216 GrandparentAuthor *ActorDefs_ProfileViewBasic `json:"grandparentAuthor,omitempty" cborgen:"grandparentAuthor,omitempty"` 217 Parent *FeedDefs_ReplyRef_Parent `json:"parent" cborgen:"parent"` 218 Root *FeedDefs_ReplyRef_Root `json:"root" cborgen:"root"` 219} 220 221type FeedDefs_ReplyRef_Parent struct { 222 FeedDefs_PostView *FeedDefs_PostView 223 FeedDefs_NotFoundPost *FeedDefs_NotFoundPost 224 FeedDefs_BlockedPost *FeedDefs_BlockedPost 225} 226 227func (t *FeedDefs_ReplyRef_Parent) MarshalJSON() ([]byte, error) { 228 if t.FeedDefs_PostView != nil { 229 t.FeedDefs_PostView.LexiconTypeID = "app.bsky.feed.defs#postView" 230 return json.Marshal(t.FeedDefs_PostView) 231 } 232 if t.FeedDefs_NotFoundPost != nil { 233 t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" 234 return json.Marshal(t.FeedDefs_NotFoundPost) 235 } 236 if t.FeedDefs_BlockedPost != nil { 237 t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost" 238 return json.Marshal(t.FeedDefs_BlockedPost) 239 } 240 return nil, fmt.Errorf("cannot marshal empty enum") 241} 242func (t *FeedDefs_ReplyRef_Parent) UnmarshalJSON(b []byte) error { 243 typ, err := util.TypeExtract(b) 244 if err != nil { 245 return err 246 } 247 248 switch typ { 249 case "app.bsky.feed.defs#postView": 250 t.FeedDefs_PostView = new(FeedDefs_PostView) 251 return json.Unmarshal(b, t.FeedDefs_PostView) 252 case "app.bsky.feed.defs#notFoundPost": 253 t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) 254 return json.Unmarshal(b, t.FeedDefs_NotFoundPost) 255 case "app.bsky.feed.defs#blockedPost": 256 t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) 257 return json.Unmarshal(b, t.FeedDefs_BlockedPost) 258 259 default: 260 return nil 261 } 262} 263 264type FeedDefs_ReplyRef_Root struct { 265 FeedDefs_PostView *FeedDefs_PostView 266 FeedDefs_NotFoundPost *FeedDefs_NotFoundPost 267 FeedDefs_BlockedPost *FeedDefs_BlockedPost 268} 269 270func (t *FeedDefs_ReplyRef_Root) MarshalJSON() ([]byte, error) { 271 if t.FeedDefs_PostView != nil { 272 t.FeedDefs_PostView.LexiconTypeID = "app.bsky.feed.defs#postView" 273 return json.Marshal(t.FeedDefs_PostView) 274 } 275 if t.FeedDefs_NotFoundPost != nil { 276 t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" 277 return json.Marshal(t.FeedDefs_NotFoundPost) 278 } 279 if t.FeedDefs_BlockedPost != nil { 280 t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost" 281 return json.Marshal(t.FeedDefs_BlockedPost) 282 } 283 return nil, fmt.Errorf("cannot marshal empty enum") 284} 285func (t *FeedDefs_ReplyRef_Root) UnmarshalJSON(b []byte) error { 286 typ, err := util.TypeExtract(b) 287 if err != nil { 288 return err 289 } 290 291 switch typ { 292 case "app.bsky.feed.defs#postView": 293 t.FeedDefs_PostView = new(FeedDefs_PostView) 294 return json.Unmarshal(b, t.FeedDefs_PostView) 295 case "app.bsky.feed.defs#notFoundPost": 296 t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) 297 return json.Unmarshal(b, t.FeedDefs_NotFoundPost) 298 case "app.bsky.feed.defs#blockedPost": 299 t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) 300 return json.Unmarshal(b, t.FeedDefs_BlockedPost) 301 302 default: 303 return nil 304 } 305} 306 307// FeedDefs_SkeletonFeedPost is a "skeletonFeedPost" in the app.bsky.feed.defs schema. 308type FeedDefs_SkeletonFeedPost struct { 309 // feedContext: Context that will be passed through to client and may be passed to feed generator back alongside interactions. 310 FeedContext *string `json:"feedContext,omitempty" cborgen:"feedContext,omitempty"` 311 Post string `json:"post" cborgen:"post"` 312 Reason *FeedDefs_SkeletonFeedPost_Reason `json:"reason,omitempty" cborgen:"reason,omitempty"` 313} 314 315type FeedDefs_SkeletonFeedPost_Reason struct { 316 FeedDefs_SkeletonReasonRepost *FeedDefs_SkeletonReasonRepost 317 FeedDefs_SkeletonReasonPin *FeedDefs_SkeletonReasonPin 318} 319 320func (t *FeedDefs_SkeletonFeedPost_Reason) MarshalJSON() ([]byte, error) { 321 if t.FeedDefs_SkeletonReasonRepost != nil { 322 t.FeedDefs_SkeletonReasonRepost.LexiconTypeID = "app.bsky.feed.defs#skeletonReasonRepost" 323 return json.Marshal(t.FeedDefs_SkeletonReasonRepost) 324 } 325 if t.FeedDefs_SkeletonReasonPin != nil { 326 t.FeedDefs_SkeletonReasonPin.LexiconTypeID = "app.bsky.feed.defs#skeletonReasonPin" 327 return json.Marshal(t.FeedDefs_SkeletonReasonPin) 328 } 329 return nil, fmt.Errorf("cannot marshal empty enum") 330} 331func (t *FeedDefs_SkeletonFeedPost_Reason) UnmarshalJSON(b []byte) error { 332 typ, err := util.TypeExtract(b) 333 if err != nil { 334 return err 335 } 336 337 switch typ { 338 case "app.bsky.feed.defs#skeletonReasonRepost": 339 t.FeedDefs_SkeletonReasonRepost = new(FeedDefs_SkeletonReasonRepost) 340 return json.Unmarshal(b, t.FeedDefs_SkeletonReasonRepost) 341 case "app.bsky.feed.defs#skeletonReasonPin": 342 t.FeedDefs_SkeletonReasonPin = new(FeedDefs_SkeletonReasonPin) 343 return json.Unmarshal(b, t.FeedDefs_SkeletonReasonPin) 344 345 default: 346 return nil 347 } 348} 349 350// FeedDefs_SkeletonReasonPin is a "skeletonReasonPin" in the app.bsky.feed.defs schema. 351// 352// RECORDTYPE: FeedDefs_SkeletonReasonPin 353type FeedDefs_SkeletonReasonPin struct { 354 LexiconTypeID string `json:"$type,const=app.bsky.feed.defs#skeletonReasonPin" cborgen:"$type,const=app.bsky.feed.defs#skeletonReasonPin"` 355} 356 357// FeedDefs_SkeletonReasonRepost is a "skeletonReasonRepost" in the app.bsky.feed.defs schema. 358// 359// RECORDTYPE: FeedDefs_SkeletonReasonRepost 360type FeedDefs_SkeletonReasonRepost struct { 361 LexiconTypeID string `json:"$type,const=app.bsky.feed.defs#skeletonReasonRepost" cborgen:"$type,const=app.bsky.feed.defs#skeletonReasonRepost"` 362 Repost string `json:"repost" cborgen:"repost"` 363} 364 365// FeedDefs_ThreadContext is a "threadContext" in the app.bsky.feed.defs schema. 366// 367// Metadata about this post within the context of the thread it is in. 368type FeedDefs_ThreadContext struct { 369 RootAuthorLike *string `json:"rootAuthorLike,omitempty" cborgen:"rootAuthorLike,omitempty"` 370} 371 372// FeedDefs_ThreadViewPost is a "threadViewPost" in the app.bsky.feed.defs schema. 373// 374// RECORDTYPE: FeedDefs_ThreadViewPost 375type FeedDefs_ThreadViewPost struct { 376 LexiconTypeID string `json:"$type,const=app.bsky.feed.defs#threadViewPost" cborgen:"$type,const=app.bsky.feed.defs#threadViewPost"` 377 Parent *FeedDefs_ThreadViewPost_Parent `json:"parent,omitempty" cborgen:"parent,omitempty"` 378 Post *FeedDefs_PostView `json:"post" cborgen:"post"` 379 Replies []*FeedDefs_ThreadViewPost_Replies_Elem `json:"replies,omitempty" cborgen:"replies,omitempty"` 380 ThreadContext *FeedDefs_ThreadContext `json:"threadContext,omitempty" cborgen:"threadContext,omitempty"` 381} 382 383type FeedDefs_ThreadViewPost_Parent struct { 384 FeedDefs_ThreadViewPost *FeedDefs_ThreadViewPost 385 FeedDefs_NotFoundPost *FeedDefs_NotFoundPost 386 FeedDefs_BlockedPost *FeedDefs_BlockedPost 387} 388 389func (t *FeedDefs_ThreadViewPost_Parent) MarshalJSON() ([]byte, error) { 390 if t.FeedDefs_ThreadViewPost != nil { 391 t.FeedDefs_ThreadViewPost.LexiconTypeID = "app.bsky.feed.defs#threadViewPost" 392 return json.Marshal(t.FeedDefs_ThreadViewPost) 393 } 394 if t.FeedDefs_NotFoundPost != nil { 395 t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" 396 return json.Marshal(t.FeedDefs_NotFoundPost) 397 } 398 if t.FeedDefs_BlockedPost != nil { 399 t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost" 400 return json.Marshal(t.FeedDefs_BlockedPost) 401 } 402 return nil, fmt.Errorf("cannot marshal empty enum") 403} 404func (t *FeedDefs_ThreadViewPost_Parent) UnmarshalJSON(b []byte) error { 405 typ, err := util.TypeExtract(b) 406 if err != nil { 407 return err 408 } 409 410 switch typ { 411 case "app.bsky.feed.defs#threadViewPost": 412 t.FeedDefs_ThreadViewPost = new(FeedDefs_ThreadViewPost) 413 return json.Unmarshal(b, t.FeedDefs_ThreadViewPost) 414 case "app.bsky.feed.defs#notFoundPost": 415 t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) 416 return json.Unmarshal(b, t.FeedDefs_NotFoundPost) 417 case "app.bsky.feed.defs#blockedPost": 418 t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) 419 return json.Unmarshal(b, t.FeedDefs_BlockedPost) 420 421 default: 422 return nil 423 } 424} 425 426type FeedDefs_ThreadViewPost_Replies_Elem struct { 427 FeedDefs_ThreadViewPost *FeedDefs_ThreadViewPost 428 FeedDefs_NotFoundPost *FeedDefs_NotFoundPost 429 FeedDefs_BlockedPost *FeedDefs_BlockedPost 430} 431 432func (t *FeedDefs_ThreadViewPost_Replies_Elem) MarshalJSON() ([]byte, error) { 433 if t.FeedDefs_ThreadViewPost != nil { 434 t.FeedDefs_ThreadViewPost.LexiconTypeID = "app.bsky.feed.defs#threadViewPost" 435 return json.Marshal(t.FeedDefs_ThreadViewPost) 436 } 437 if t.FeedDefs_NotFoundPost != nil { 438 t.FeedDefs_NotFoundPost.LexiconTypeID = "app.bsky.feed.defs#notFoundPost" 439 return json.Marshal(t.FeedDefs_NotFoundPost) 440 } 441 if t.FeedDefs_BlockedPost != nil { 442 t.FeedDefs_BlockedPost.LexiconTypeID = "app.bsky.feed.defs#blockedPost" 443 return json.Marshal(t.FeedDefs_BlockedPost) 444 } 445 return nil, fmt.Errorf("cannot marshal empty enum") 446} 447func (t *FeedDefs_ThreadViewPost_Replies_Elem) UnmarshalJSON(b []byte) error { 448 typ, err := util.TypeExtract(b) 449 if err != nil { 450 return err 451 } 452 453 switch typ { 454 case "app.bsky.feed.defs#threadViewPost": 455 t.FeedDefs_ThreadViewPost = new(FeedDefs_ThreadViewPost) 456 return json.Unmarshal(b, t.FeedDefs_ThreadViewPost) 457 case "app.bsky.feed.defs#notFoundPost": 458 t.FeedDefs_NotFoundPost = new(FeedDefs_NotFoundPost) 459 return json.Unmarshal(b, t.FeedDefs_NotFoundPost) 460 case "app.bsky.feed.defs#blockedPost": 461 t.FeedDefs_BlockedPost = new(FeedDefs_BlockedPost) 462 return json.Unmarshal(b, t.FeedDefs_BlockedPost) 463 464 default: 465 return nil 466 } 467} 468 469// FeedDefs_ThreadgateView is a "threadgateView" in the app.bsky.feed.defs schema. 470type FeedDefs_ThreadgateView struct { 471 Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` 472 Lists []*GraphDefs_ListViewBasic `json:"lists,omitempty" cborgen:"lists,omitempty"` 473 Record *util.LexiconTypeDecoder `json:"record,omitempty" cborgen:"record,omitempty"` 474 Uri *string `json:"uri,omitempty" cborgen:"uri,omitempty"` 475} 476 477// FeedDefs_ViewerState is a "viewerState" in the app.bsky.feed.defs schema. 478// 479// Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests. 480type FeedDefs_ViewerState struct { 481 EmbeddingDisabled *bool `json:"embeddingDisabled,omitempty" cborgen:"embeddingDisabled,omitempty"` 482 Like *string `json:"like,omitempty" cborgen:"like,omitempty"` 483 Pinned *bool `json:"pinned,omitempty" cborgen:"pinned,omitempty"` 484 ReplyDisabled *bool `json:"replyDisabled,omitempty" cborgen:"replyDisabled,omitempty"` 485 Repost *string `json:"repost,omitempty" cborgen:"repost,omitempty"` 486 ThreadMuted *bool `json:"threadMuted,omitempty" cborgen:"threadMuted,omitempty"` 487}