+111
-12
api/bsky/actordefs.go
+111
-12
api/bsky/actordefs.go
···
155
155
BirthDate *string `json:"birthDate,omitempty" cborgen:"birthDate,omitempty"`
156
156
}
157
157
158
+
// ActorDefs_PostInteractionSettingsPref is a "postInteractionSettingsPref" in the app.bsky.actor.defs schema.
159
+
//
160
+
// Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.
161
+
//
162
+
// RECORDTYPE: ActorDefs_PostInteractionSettingsPref
163
+
type ActorDefs_PostInteractionSettingsPref struct {
164
+
LexiconTypeID string `json:"$type,const=app.bsky.actor.defs#postInteractionSettingsPref" cborgen:"$type,const=app.bsky.actor.defs#postInteractionSettingsPref"`
165
+
// postgateEmbeddingRules: Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.
166
+
PostgateEmbeddingRules []*ActorDefs_PostInteractionSettingsPref_PostgateEmbeddingRules_Elem `json:"postgateEmbeddingRules,omitempty" cborgen:"postgateEmbeddingRules,omitempty"`
167
+
// threadgateAllowRules: Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.
168
+
ThreadgateAllowRules []*ActorDefs_PostInteractionSettingsPref_ThreadgateAllowRules_Elem `json:"threadgateAllowRules,omitempty" cborgen:"threadgateAllowRules,omitempty"`
169
+
}
170
+
171
+
type ActorDefs_PostInteractionSettingsPref_PostgateEmbeddingRules_Elem struct {
172
+
FeedPostgate_DisableRule *FeedPostgate_DisableRule
173
+
}
174
+
175
+
func (t *ActorDefs_PostInteractionSettingsPref_PostgateEmbeddingRules_Elem) MarshalJSON() ([]byte, error) {
176
+
if t.FeedPostgate_DisableRule != nil {
177
+
t.FeedPostgate_DisableRule.LexiconTypeID = "app.bsky.feed.postgate#disableRule"
178
+
return json.Marshal(t.FeedPostgate_DisableRule)
179
+
}
180
+
return nil, fmt.Errorf("cannot marshal empty enum")
181
+
}
182
+
func (t *ActorDefs_PostInteractionSettingsPref_PostgateEmbeddingRules_Elem) UnmarshalJSON(b []byte) error {
183
+
typ, err := util.TypeExtract(b)
184
+
if err != nil {
185
+
return err
186
+
}
187
+
188
+
switch typ {
189
+
case "app.bsky.feed.postgate#disableRule":
190
+
t.FeedPostgate_DisableRule = new(FeedPostgate_DisableRule)
191
+
return json.Unmarshal(b, t.FeedPostgate_DisableRule)
192
+
193
+
default:
194
+
return nil
195
+
}
196
+
}
197
+
198
+
type ActorDefs_PostInteractionSettingsPref_ThreadgateAllowRules_Elem struct {
199
+
FeedThreadgate_MentionRule *FeedThreadgate_MentionRule
200
+
FeedThreadgate_FollowerRule *FeedThreadgate_FollowerRule
201
+
FeedThreadgate_FollowingRule *FeedThreadgate_FollowingRule
202
+
FeedThreadgate_ListRule *FeedThreadgate_ListRule
203
+
}
204
+
205
+
func (t *ActorDefs_PostInteractionSettingsPref_ThreadgateAllowRules_Elem) MarshalJSON() ([]byte, error) {
206
+
if t.FeedThreadgate_MentionRule != nil {
207
+
t.FeedThreadgate_MentionRule.LexiconTypeID = "app.bsky.feed.threadgate#mentionRule"
208
+
return json.Marshal(t.FeedThreadgate_MentionRule)
209
+
}
210
+
if t.FeedThreadgate_FollowerRule != nil {
211
+
t.FeedThreadgate_FollowerRule.LexiconTypeID = "app.bsky.feed.threadgate#followerRule"
212
+
return json.Marshal(t.FeedThreadgate_FollowerRule)
213
+
}
214
+
if t.FeedThreadgate_FollowingRule != nil {
215
+
t.FeedThreadgate_FollowingRule.LexiconTypeID = "app.bsky.feed.threadgate#followingRule"
216
+
return json.Marshal(t.FeedThreadgate_FollowingRule)
217
+
}
218
+
if t.FeedThreadgate_ListRule != nil {
219
+
t.FeedThreadgate_ListRule.LexiconTypeID = "app.bsky.feed.threadgate#listRule"
220
+
return json.Marshal(t.FeedThreadgate_ListRule)
221
+
}
222
+
return nil, fmt.Errorf("cannot marshal empty enum")
223
+
}
224
+
func (t *ActorDefs_PostInteractionSettingsPref_ThreadgateAllowRules_Elem) UnmarshalJSON(b []byte) error {
225
+
typ, err := util.TypeExtract(b)
226
+
if err != nil {
227
+
return err
228
+
}
229
+
230
+
switch typ {
231
+
case "app.bsky.feed.threadgate#mentionRule":
232
+
t.FeedThreadgate_MentionRule = new(FeedThreadgate_MentionRule)
233
+
return json.Unmarshal(b, t.FeedThreadgate_MentionRule)
234
+
case "app.bsky.feed.threadgate#followerRule":
235
+
t.FeedThreadgate_FollowerRule = new(FeedThreadgate_FollowerRule)
236
+
return json.Unmarshal(b, t.FeedThreadgate_FollowerRule)
237
+
case "app.bsky.feed.threadgate#followingRule":
238
+
t.FeedThreadgate_FollowingRule = new(FeedThreadgate_FollowingRule)
239
+
return json.Unmarshal(b, t.FeedThreadgate_FollowingRule)
240
+
case "app.bsky.feed.threadgate#listRule":
241
+
t.FeedThreadgate_ListRule = new(FeedThreadgate_ListRule)
242
+
return json.Unmarshal(b, t.FeedThreadgate_ListRule)
243
+
244
+
default:
245
+
return nil
246
+
}
247
+
}
248
+
158
249
type ActorDefs_Preferences_Elem struct {
159
-
ActorDefs_AdultContentPref *ActorDefs_AdultContentPref
160
-
ActorDefs_ContentLabelPref *ActorDefs_ContentLabelPref
161
-
ActorDefs_SavedFeedsPref *ActorDefs_SavedFeedsPref
162
-
ActorDefs_SavedFeedsPrefV2 *ActorDefs_SavedFeedsPrefV2
163
-
ActorDefs_PersonalDetailsPref *ActorDefs_PersonalDetailsPref
164
-
ActorDefs_FeedViewPref *ActorDefs_FeedViewPref
165
-
ActorDefs_ThreadViewPref *ActorDefs_ThreadViewPref
166
-
ActorDefs_InterestsPref *ActorDefs_InterestsPref
167
-
ActorDefs_MutedWordsPref *ActorDefs_MutedWordsPref
168
-
ActorDefs_HiddenPostsPref *ActorDefs_HiddenPostsPref
169
-
ActorDefs_BskyAppStatePref *ActorDefs_BskyAppStatePref
170
-
ActorDefs_LabelersPref *ActorDefs_LabelersPref
250
+
ActorDefs_AdultContentPref *ActorDefs_AdultContentPref
251
+
ActorDefs_ContentLabelPref *ActorDefs_ContentLabelPref
252
+
ActorDefs_SavedFeedsPref *ActorDefs_SavedFeedsPref
253
+
ActorDefs_SavedFeedsPrefV2 *ActorDefs_SavedFeedsPrefV2
254
+
ActorDefs_PersonalDetailsPref *ActorDefs_PersonalDetailsPref
255
+
ActorDefs_FeedViewPref *ActorDefs_FeedViewPref
256
+
ActorDefs_ThreadViewPref *ActorDefs_ThreadViewPref
257
+
ActorDefs_InterestsPref *ActorDefs_InterestsPref
258
+
ActorDefs_MutedWordsPref *ActorDefs_MutedWordsPref
259
+
ActorDefs_HiddenPostsPref *ActorDefs_HiddenPostsPref
260
+
ActorDefs_BskyAppStatePref *ActorDefs_BskyAppStatePref
261
+
ActorDefs_LabelersPref *ActorDefs_LabelersPref
262
+
ActorDefs_PostInteractionSettingsPref *ActorDefs_PostInteractionSettingsPref
171
263
}
172
264
173
265
func (t *ActorDefs_Preferences_Elem) MarshalJSON() ([]byte, error) {
···
219
311
t.ActorDefs_LabelersPref.LexiconTypeID = "app.bsky.actor.defs#labelersPref"
220
312
return json.Marshal(t.ActorDefs_LabelersPref)
221
313
}
314
+
if t.ActorDefs_PostInteractionSettingsPref != nil {
315
+
t.ActorDefs_PostInteractionSettingsPref.LexiconTypeID = "app.bsky.actor.defs#postInteractionSettingsPref"
316
+
return json.Marshal(t.ActorDefs_PostInteractionSettingsPref)
317
+
}
222
318
return nil, fmt.Errorf("cannot marshal empty enum")
223
319
}
224
320
func (t *ActorDefs_Preferences_Elem) UnmarshalJSON(b []byte) error {
···
264
360
case "app.bsky.actor.defs#labelersPref":
265
361
t.ActorDefs_LabelersPref = new(ActorDefs_LabelersPref)
266
362
return json.Unmarshal(b, t.ActorDefs_LabelersPref)
363
+
case "app.bsky.actor.defs#postInteractionSettingsPref":
364
+
t.ActorDefs_PostInteractionSettingsPref = new(ActorDefs_PostInteractionSettingsPref)
365
+
return json.Unmarshal(b, t.ActorDefs_PostInteractionSettingsPref)
267
366
268
367
default:
269
368
return nil
+3
-2
api/bsky/feedpostgate.go
+3
-2
api/bsky/feedpostgate.go
···
22
22
LexiconTypeID string `json:"$type,const=app.bsky.feed.postgate" cborgen:"$type,const=app.bsky.feed.postgate"`
23
23
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
24
24
// detachedEmbeddingUris: List of AT-URIs embedding this post that the author has detached from.
25
-
DetachedEmbeddingUris []string `json:"detachedEmbeddingUris,omitempty" cborgen:"detachedEmbeddingUris,omitempty"`
26
-
EmbeddingRules []*FeedPostgate_EmbeddingRules_Elem `json:"embeddingRules,omitempty" cborgen:"embeddingRules,omitempty"`
25
+
DetachedEmbeddingUris []string `json:"detachedEmbeddingUris,omitempty" cborgen:"detachedEmbeddingUris,omitempty"`
26
+
// embeddingRules: List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed.
27
+
EmbeddingRules []*FeedPostgate_EmbeddingRules_Elem `json:"embeddingRules,omitempty" cborgen:"embeddingRules,omitempty"`
27
28
// post: Reference (AT-URI) to the post record.
28
29
Post string `json:"post" cborgen:"post"`
29
30
}
+4
-3
api/bsky/feedthreadgate.go
+4
-3
api/bsky/feedthreadgate.go
···
19
19
} //
20
20
// RECORDTYPE: FeedThreadgate
21
21
type FeedThreadgate struct {
22
-
LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate" cborgen:"$type,const=app.bsky.feed.threadgate"`
23
-
Allow []*FeedThreadgate_Allow_Elem `json:"allow,omitempty" cborgen:"allow,omitempty"`
24
-
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
22
+
LexiconTypeID string `json:"$type,const=app.bsky.feed.threadgate" cborgen:"$type,const=app.bsky.feed.threadgate"`
23
+
// allow: List of rules defining who can reply to this post. If value is an empty array, no one can reply. If value is undefined, anyone can reply.
24
+
Allow []*FeedThreadgate_Allow_Elem `json:"allow,omitempty" cborgen:"allow,omitempty"`
25
+
CreatedAt string `json:"createdAt" cborgen:"createdAt"`
25
26
// hiddenReplies: List of hidden reply URIs.
26
27
HiddenReplies []string `json:"hiddenReplies,omitempty" cborgen:"hiddenReplies,omitempty"`
27
28
// post: Reference (AT-URI) to the post record.