@devvit/protos 0.12.1-next-2025-09-02-23-32-53-b7c54438b.0 → 0.12.1-next-2025-09-03-16-45-14-78942cdf1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/json/devvit/plugin/redditapi/common/common_msg.d.ts +2 -0
  2. package/json/devvit/plugin/redditapi/common/common_msg.d.ts.map +1 -1
  3. package/meta.min.json +6 -6
  4. package/package.json +4 -4
  5. package/protos.min.js +1 -1
  6. package/protos.min.js.map +2 -2
  7. package/schema/.snootobuf/deps/devvit/plugin/redditapi/common/common_msg.proto +3 -0
  8. package/schema/.snootobuf/deps/devvit/plugin/redditapi/subreddits/subreddits_svc.proto +2 -0
  9. package/schema/.snootobuf/output/go-redditapi/flair_svc.generated.go +96 -13
  10. package/schema/.snootobuf/output/go-redditapi/linksandcomments_svc.generated.go +181 -24
  11. package/schema/.snootobuf/output/go-redditapi/listings_svc.generated.go +48 -8
  12. package/schema/.snootobuf/output/go-redditapi/moderation_svc.generated.go +158 -22
  13. package/schema/.snootobuf/output/go-redditapi/modnote_svc.generated.go +34 -5
  14. package/schema/.snootobuf/output/go-redditapi/newmodmail_svc.generated.go +134 -20
  15. package/schema/.snootobuf/output/go-redditapi/privatemessages_svc.generated.go +78 -10
  16. package/schema/.snootobuf/output/go-redditapi/subreddits_svc.generated.go +180 -27
  17. package/schema/.snootobuf/output/go-redditapi/users_svc.generated.go +84 -12
  18. package/schema/.snootobuf/output/go-redditapi/widgets_svc.generated.go +140 -18
  19. package/schema/.snootobuf/output/go-redditapi/wiki_svc.generated.go +70 -10
  20. package/schema/devvit/plugin/redditapi/common/common_msg.proto +3 -0
  21. package/schema/devvit/plugin/redditapi/subreddits/subreddits_svc.proto +2 -0
  22. package/schema/snootobuf.lock +0 -0
  23. package/schema/snootobuf.redditapi.lock +0 -0
  24. package/types/devvit/plugin/redditapi/common/common_msg.d.ts +2 -0
  25. package/types/devvit/plugin/redditapi/common/common_msg.d.ts.map +1 -1
  26. package/types/devvit/plugin/redditapi/common/common_msg.js +15 -0
  27. package/types/devvit/plugin/redditapi/subreddits/subreddits_svc.d.ts +1 -1
  28. package/types/devvit/plugin/redditapi/subreddits/subreddits_svc.d.ts.map +1 -1
  29. package/types/devvit/plugin/redditapi/subreddits/subreddits_svc.js +2 -0
@@ -17,7 +17,14 @@ func (s *RedditHttpPlugin) Block(ctx context.Context, req *redditapi.GenericPriv
17
17
  body := url.Values{}
18
18
  body.Add("id", req.Id)
19
19
  bodyBytes := []byte(body.Encode())
20
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "Block", BodyType: FORM_CAMEL, Body: bodyBytes, Path: hydratedPath}, &resp)
20
+ requestConfig := requestConfig{
21
+ Method: "POST",
22
+ ProtoMethod: "Block",
23
+ BodyType: FORM_CAMEL,
24
+ Body: bodyBytes,
25
+ Path: hydratedPath,
26
+ }
27
+ err := s.doRequest(ctx, requestConfig, &resp)
21
28
  if err != nil {
22
29
  return nil, err
23
30
  }
@@ -30,7 +37,14 @@ func (s *RedditHttpPlugin) CollapseMessage(ctx context.Context, req *redditapi.G
30
37
  body := make(map[string]interface{})
31
38
  body["id"] = req.Id
32
39
  bodyBytes, _ := json.Marshal(body)
33
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "CollapseMessage", BodyType: JSON_CAMEL, Body: bodyBytes, Path: hydratedPath}, &resp)
40
+ requestConfig := requestConfig{
41
+ Method: "POST",
42
+ ProtoMethod: "CollapseMessage",
43
+ BodyType: JSON_CAMEL,
44
+ Body: bodyBytes,
45
+ Path: hydratedPath,
46
+ }
47
+ err := s.doRequest(ctx, requestConfig, &resp)
34
48
  if err != nil {
35
49
  return nil, err
36
50
  }
@@ -47,7 +61,14 @@ func (s *RedditHttpPlugin) Compose(ctx context.Context, req *redditapi.ComposeRe
47
61
  body.Add("text", req.Text)
48
62
  body.Add("to", req.To)
49
63
  bodyBytes := []byte(body.Encode())
50
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "Compose", BodyType: FORM_SNAKE, Body: bodyBytes, Path: hydratedPath}, &resp)
64
+ requestConfig := requestConfig{
65
+ Method: "POST",
66
+ ProtoMethod: "Compose",
67
+ BodyType: FORM_SNAKE,
68
+ Body: bodyBytes,
69
+ Path: hydratedPath,
70
+ }
71
+ err := s.doRequest(ctx, requestConfig, &resp)
51
72
  if err != nil {
52
73
  return nil, err
53
74
  }
@@ -60,7 +81,14 @@ func (s *RedditHttpPlugin) DelMsg(ctx context.Context, req *redditapi.GenericPri
60
81
  body := make(map[string]interface{})
61
82
  body["id"] = req.Id
62
83
  bodyBytes, _ := json.Marshal(body)
63
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "DelMsg", BodyType: JSON_CAMEL, Body: bodyBytes, Path: hydratedPath}, &resp)
84
+ requestConfig := requestConfig{
85
+ Method: "POST",
86
+ ProtoMethod: "DelMsg",
87
+ BodyType: JSON_CAMEL,
88
+ Body: bodyBytes,
89
+ Path: hydratedPath,
90
+ }
91
+ err := s.doRequest(ctx, requestConfig, &resp)
64
92
  if err != nil {
65
93
  return nil, err
66
94
  }
@@ -73,7 +101,14 @@ func (s *RedditHttpPlugin) ReadAllMessages(ctx context.Context, req *redditapi.R
73
101
  body := make(map[string]interface{})
74
102
  body["filterTypes"] = req.FilterTypes
75
103
  bodyBytes, _ := json.Marshal(body)
76
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "ReadAllMessages", BodyType: JSON_CAMEL, Body: bodyBytes, Path: hydratedPath}, &resp)
104
+ requestConfig := requestConfig{
105
+ Method: "POST",
106
+ ProtoMethod: "ReadAllMessages",
107
+ BodyType: JSON_CAMEL,
108
+ Body: bodyBytes,
109
+ Path: hydratedPath,
110
+ }
111
+ err := s.doRequest(ctx, requestConfig, &resp)
77
112
  if err != nil {
78
113
  return nil, err
79
114
  }
@@ -86,7 +121,14 @@ func (s *RedditHttpPlugin) ReadMessage(ctx context.Context, req *redditapi.Gener
86
121
  body := make(map[string]interface{})
87
122
  body["id"] = req.Id
88
123
  bodyBytes, _ := json.Marshal(body)
89
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "ReadMessage", BodyType: JSON_CAMEL, Body: bodyBytes, Path: hydratedPath}, &resp)
124
+ requestConfig := requestConfig{
125
+ Method: "POST",
126
+ ProtoMethod: "ReadMessage",
127
+ BodyType: JSON_CAMEL,
128
+ Body: bodyBytes,
129
+ Path: hydratedPath,
130
+ }
131
+ err := s.doRequest(ctx, requestConfig, &resp)
90
132
  if err != nil {
91
133
  return nil, err
92
134
  }
@@ -99,7 +141,14 @@ func (s *RedditHttpPlugin) UnblockSubreddit(ctx context.Context, req *redditapi.
99
141
  body := make(map[string]interface{})
100
142
  body["id"] = req.Id
101
143
  bodyBytes, _ := json.Marshal(body)
102
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "UnblockSubreddit", BodyType: JSON_CAMEL, Body: bodyBytes, Path: hydratedPath}, &resp)
144
+ requestConfig := requestConfig{
145
+ Method: "POST",
146
+ ProtoMethod: "UnblockSubreddit",
147
+ BodyType: JSON_CAMEL,
148
+ Body: bodyBytes,
149
+ Path: hydratedPath,
150
+ }
151
+ err := s.doRequest(ctx, requestConfig, &resp)
103
152
  if err != nil {
104
153
  return nil, err
105
154
  }
@@ -112,7 +161,14 @@ func (s *RedditHttpPlugin) UncollapseMessage(ctx context.Context, req *redditapi
112
161
  body := make(map[string]interface{})
113
162
  body["id"] = req.Id
114
163
  bodyBytes, _ := json.Marshal(body)
115
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "UncollapseMessage", BodyType: JSON_CAMEL, Body: bodyBytes, Path: hydratedPath}, &resp)
164
+ requestConfig := requestConfig{
165
+ Method: "POST",
166
+ ProtoMethod: "UncollapseMessage",
167
+ BodyType: JSON_CAMEL,
168
+ Body: bodyBytes,
169
+ Path: hydratedPath,
170
+ }
171
+ err := s.doRequest(ctx, requestConfig, &resp)
116
172
  if err != nil {
117
173
  return nil, err
118
174
  }
@@ -125,7 +181,14 @@ func (s *RedditHttpPlugin) UnreadMessage(ctx context.Context, req *redditapi.Gen
125
181
  body := make(map[string]interface{})
126
182
  body["id"] = req.Id
127
183
  bodyBytes, _ := json.Marshal(body)
128
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "UnreadMessage", BodyType: JSON_CAMEL, Body: bodyBytes, Path: hydratedPath}, &resp)
184
+ requestConfig := requestConfig{
185
+ Method: "POST",
186
+ ProtoMethod: "UnreadMessage",
187
+ BodyType: JSON_CAMEL,
188
+ Body: bodyBytes,
189
+ Path: hydratedPath,
190
+ }
191
+ err := s.doRequest(ctx, requestConfig, &resp)
129
192
  if err != nil {
130
193
  return nil, err
131
194
  }
@@ -172,7 +235,12 @@ func (s *RedditHttpPlugin) MessageWhere(ctx context.Context, req *redditapi.Mess
172
235
  tmpCountValue,
173
236
  tmpLimitValue,
174
237
  tmpShowValue)
175
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "MessageWhere", Path: hydratedPath}, &resp)
238
+ requestConfig := requestConfig{
239
+ Method: "GET",
240
+ ProtoMethod: "MessageWhere",
241
+ Path: hydratedPath,
242
+ }
243
+ err := s.doRequest(ctx, requestConfig, &resp)
176
244
  if err != nil {
177
245
  return nil, err
178
246
  }
@@ -53,7 +53,12 @@ func (s *RedditHttpPlugin) AboutWhere(ctx context.Context, req *redditapi.AboutW
53
53
  tmpLimitValue,
54
54
  tmpShowValue,
55
55
  tmpUserValue)
56
- respBody, err := s.doRequestRaw(ctx, requestConfig{Method: "GET", ProtoMethod: "AboutWhere", Path: hydratedPath})
56
+ requestConfig := requestConfig{
57
+ Method: "GET",
58
+ ProtoMethod: "AboutWhere",
59
+ Path: hydratedPath,
60
+ }
61
+ respBody, err := s.doRequestRaw(ctx, requestConfig)
57
62
  if err != nil {
58
63
  return nil, err
59
64
  }
@@ -72,7 +77,12 @@ func (s *RedditHttpPlugin) DeleteSrBanner(ctx context.Context, req *redditapi.Ba
72
77
  hydratedPath := fmt.Sprintf(
73
78
  "/r/%v/api/delete_sr_banner?raw_json=1",
74
79
  req.Subreddit)
75
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "DeleteSrBanner", Path: hydratedPath}, &resp)
80
+ requestConfig := requestConfig{
81
+ Method: "POST",
82
+ ProtoMethod: "DeleteSrBanner",
83
+ Path: hydratedPath,
84
+ }
85
+ err := s.doRequest(ctx, requestConfig, &resp)
76
86
  if err != nil {
77
87
  return nil, err
78
88
  }
@@ -84,7 +94,12 @@ func (s *RedditHttpPlugin) DeleteSrHeader(ctx context.Context, req *redditapi.Ba
84
94
  hydratedPath := fmt.Sprintf(
85
95
  "/r/%v/api/delete_sr_header?raw_json=1",
86
96
  req.Subreddit)
87
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "DeleteSrHeader", Path: hydratedPath}, &resp)
97
+ requestConfig := requestConfig{
98
+ Method: "POST",
99
+ ProtoMethod: "DeleteSrHeader",
100
+ Path: hydratedPath,
101
+ }
102
+ err := s.doRequest(ctx, requestConfig, &resp)
88
103
  if err != nil {
89
104
  return nil, err
90
105
  }
@@ -96,7 +111,12 @@ func (s *RedditHttpPlugin) DeleteSrIcon(ctx context.Context, req *redditapi.Basi
96
111
  hydratedPath := fmt.Sprintf(
97
112
  "/r/%v/api/delete_sr_icon?raw_json=1",
98
113
  req.Subreddit)
99
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "DeleteSrIcon", Path: hydratedPath}, &resp)
114
+ requestConfig := requestConfig{
115
+ Method: "POST",
116
+ ProtoMethod: "DeleteSrIcon",
117
+ Path: hydratedPath,
118
+ }
119
+ err := s.doRequest(ctx, requestConfig, &resp)
100
120
  if err != nil {
101
121
  return nil, err
102
122
  }
@@ -113,7 +133,14 @@ func (s *RedditHttpPlugin) DeleteSrImg(ctx context.Context, req *redditapi.Delet
113
133
  body.Add("img_name", req.ImgName)
114
134
  body.Add("subreddit", req.Subreddit)
115
135
  bodyBytes := []byte(body.Encode())
116
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "DeleteSrImg", BodyType: FORM_SNAKE, Body: bodyBytes, Path: hydratedPath}, &resp)
136
+ requestConfig := requestConfig{
137
+ Method: "POST",
138
+ ProtoMethod: "DeleteSrImg",
139
+ BodyType: FORM_SNAKE,
140
+ Body: bodyBytes,
141
+ Path: hydratedPath,
142
+ }
143
+ err := s.doRequest(ctx, requestConfig, &resp)
117
144
  if err != nil {
118
145
  return nil, err
119
146
  }
@@ -141,7 +168,14 @@ func (s *RedditHttpPlugin) SearchRedditNames(ctx context.Context, req *redditapi
141
168
  body.Add("typeahead_active", strconv.FormatBool(req.TypeaheadActive.GetValue()))
142
169
  }
143
170
  bodyBytes := []byte(body.Encode())
144
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "SearchRedditNames", BodyType: FORM_SNAKE, Body: bodyBytes, Path: hydratedPath}, &resp)
171
+ requestConfig := requestConfig{
172
+ Method: "POST",
173
+ ProtoMethod: "SearchRedditNames",
174
+ BodyType: FORM_SNAKE,
175
+ Body: bodyBytes,
176
+ Path: hydratedPath,
177
+ }
178
+ err := s.doRequest(ctx, requestConfig, &resp)
145
179
  if err != nil {
146
180
  return nil, err
147
181
  }
@@ -169,7 +203,14 @@ func (s *RedditHttpPlugin) SearchSubreddits(ctx context.Context, req *redditapi.
169
203
  body.Add("typeahead_active", strconv.FormatBool(req.TypeaheadActive.GetValue()))
170
204
  }
171
205
  bodyBytes := []byte(body.Encode())
172
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "SearchSubreddits", BodyType: FORM_SNAKE, Body: bodyBytes, Path: hydratedPath}, &resp)
206
+ requestConfig := requestConfig{
207
+ Method: "POST",
208
+ ProtoMethod: "SearchSubreddits",
209
+ BodyType: FORM_SNAKE,
210
+ Body: bodyBytes,
211
+ Path: hydratedPath,
212
+ }
213
+ err := s.doRequest(ctx, requestConfig, &resp)
173
214
  if err != nil {
174
215
  return nil, err
175
216
  }
@@ -249,7 +290,14 @@ func (s *RedditHttpPlugin) SiteAdmin(ctx context.Context, req *redditapi.SiteAdm
249
290
  body["wiki_edit_karma"] = req.WikiEditKarma
250
291
  body["wikimode"] = req.Wikimode
251
292
  bodyBytes, _ := json.Marshal(body)
252
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "SiteAdmin", BodyType: JSON_SNAKE, Body: bodyBytes, Path: hydratedPath}, &resp)
293
+ requestConfig := requestConfig{
294
+ Method: "POST",
295
+ ProtoMethod: "SiteAdmin",
296
+ BodyType: JSON_SNAKE,
297
+ Body: bodyBytes,
298
+ Path: hydratedPath,
299
+ }
300
+ err := s.doRequest(ctx, requestConfig, &resp)
253
301
  if err != nil {
254
302
  return nil, err
255
303
  }
@@ -261,7 +309,12 @@ func (s *RedditHttpPlugin) SubmitText(ctx context.Context, req *redditapi.BasicS
261
309
  hydratedPath := fmt.Sprintf(
262
310
  "/r/%v/api/submit_text?raw_json=1",
263
311
  req.Subreddit)
264
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubmitText", Path: hydratedPath}, &resp)
312
+ requestConfig := requestConfig{
313
+ Method: "GET",
314
+ ProtoMethod: "SubmitText",
315
+ Path: hydratedPath,
316
+ }
317
+ err := s.doRequest(ctx, requestConfig, &resp)
265
318
  if err != nil {
266
319
  return nil, err
267
320
  }
@@ -298,7 +351,12 @@ func (s *RedditHttpPlugin) SubredditAutocomplete(ctx context.Context, req *reddi
298
351
  req.Query,
299
352
  tmpSearchQueryIdValue,
300
353
  tmpTypeaheadActiveValue)
301
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditAutocomplete", Path: hydratedPath}, &resp)
354
+ requestConfig := requestConfig{
355
+ Method: "GET",
356
+ ProtoMethod: "SubredditAutocomplete",
357
+ Path: hydratedPath,
358
+ }
359
+ err := s.doRequest(ctx, requestConfig, &resp)
302
360
  if err != nil {
303
361
  return nil, err
304
362
  }
@@ -317,7 +375,14 @@ func (s *RedditHttpPlugin) SubredditStylesheet(ctx context.Context, req *reddita
317
375
  body.Add("stylesheet_contents", req.StylesheetContents)
318
376
  body.Add("subreddit", req.Subreddit)
319
377
  bodyBytes := []byte(body.Encode())
320
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "SubredditStylesheet", BodyType: FORM_SNAKE, Body: bodyBytes, Path: hydratedPath}, &resp)
378
+ requestConfig := requestConfig{
379
+ Method: "POST",
380
+ ProtoMethod: "SubredditStylesheet",
381
+ BodyType: FORM_SNAKE,
382
+ Body: bodyBytes,
383
+ Path: hydratedPath,
384
+ }
385
+ err := s.doRequest(ctx, requestConfig, &resp)
321
386
  if err != nil {
322
387
  return nil, err
323
388
  }
@@ -334,7 +399,16 @@ func (s *RedditHttpPlugin) Subscribe(ctx context.Context, req *redditapi.Subscri
334
399
  body.Add("sr", req.Sr)
335
400
  body.Add("sr_name", req.SrName)
336
401
  bodyBytes := []byte(body.Encode())
337
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "Subscribe", BodyType: FORM_SNAKE, Body: bodyBytes, Path: hydratedPath}, &resp)
402
+ requestConfig := requestConfig{
403
+ Method: "POST",
404
+ ProtoMethod: "Subscribe",
405
+ BodyType: FORM_SNAKE,
406
+ Body: bodyBytes,
407
+ Path: hydratedPath,
408
+ AlwaysRunAsUser: true,
409
+ RunAsUserScopes: []string{"SUBSCRIBE_TO_SUBREDDIT"},
410
+ }
411
+ err := s.doRequest(ctx, requestConfig, &resp)
338
412
  if err != nil {
339
413
  return nil, err
340
414
  }
@@ -354,7 +428,14 @@ func (s *RedditHttpPlugin) UploadSrImg(ctx context.Context, req *redditapi.Uploa
354
428
  body.Add("subreddit", req.Subreddit)
355
429
  body.Add("upload_type", req.UploadType)
356
430
  bodyBytes := []byte(body.Encode())
357
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "UploadSrImg", BodyType: FORM_SNAKE, Body: bodyBytes, Path: hydratedPath}, &resp)
431
+ requestConfig := requestConfig{
432
+ Method: "POST",
433
+ ProtoMethod: "UploadSrImg",
434
+ BodyType: FORM_SNAKE,
435
+ Body: bodyBytes,
436
+ Path: hydratedPath,
437
+ }
438
+ err := s.doRequest(ctx, requestConfig, &resp)
358
439
  if err != nil {
359
440
  return nil, err
360
441
  }
@@ -366,7 +447,12 @@ func (s *RedditHttpPlugin) SubredditPostRequirements(ctx context.Context, req *r
366
447
  hydratedPath := fmt.Sprintf(
367
448
  "/api/v1/%v/post_requirements?raw_json=1",
368
449
  req.Subreddit)
369
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditPostRequirements", Path: hydratedPath}, &resp)
450
+ requestConfig := requestConfig{
451
+ Method: "GET",
452
+ ProtoMethod: "SubredditPostRequirements",
453
+ Path: hydratedPath,
454
+ }
455
+ err := s.doRequest(ctx, requestConfig, &resp)
370
456
  if err != nil {
371
457
  return nil, err
372
458
  }
@@ -378,7 +464,12 @@ func (s *RedditHttpPlugin) SubredditAbout(ctx context.Context, req *redditapi.Ba
378
464
  hydratedPath := fmt.Sprintf(
379
465
  "/r/%v/about?quarantine_optin=1&gated_optin=1&raw_json=1",
380
466
  req.Subreddit)
381
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditAbout", Path: hydratedPath}, &resp)
467
+ requestConfig := requestConfig{
468
+ Method: "GET",
469
+ ProtoMethod: "SubredditAbout",
470
+ Path: hydratedPath,
471
+ }
472
+ err := s.doRequest(ctx, requestConfig, &resp)
382
473
  if err != nil {
383
474
  return nil, err
384
475
  }
@@ -392,7 +483,12 @@ func (s *RedditHttpPlugin) SubredditAboutEdit(ctx context.Context, req *redditap
392
483
  req.Subreddit,
393
484
  req.Created,
394
485
  req.Location)
395
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditAboutEdit", Path: hydratedPath}, &resp)
486
+ requestConfig := requestConfig{
487
+ Method: "GET",
488
+ ProtoMethod: "SubredditAboutEdit",
489
+ Path: hydratedPath,
490
+ }
491
+ err := s.doRequest(ctx, requestConfig, &resp)
396
492
  if err != nil {
397
493
  return nil, err
398
494
  }
@@ -404,7 +500,12 @@ func (s *RedditHttpPlugin) SubredditAboutRules(ctx context.Context, req *reddita
404
500
  hydratedPath := fmt.Sprintf(
405
501
  "/r/%v/about/rules?raw_json=1",
406
502
  req.Subreddit)
407
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditAboutRules", Path: hydratedPath}, &resp)
503
+ requestConfig := requestConfig{
504
+ Method: "GET",
505
+ ProtoMethod: "SubredditAboutRules",
506
+ Path: hydratedPath,
507
+ }
508
+ err := s.doRequest(ctx, requestConfig, &resp)
408
509
  if err != nil {
409
510
  return nil, err
410
511
  }
@@ -416,7 +517,12 @@ func (s *RedditHttpPlugin) SubredditAboutTraffic(ctx context.Context, req *reddi
416
517
  hydratedPath := fmt.Sprintf(
417
518
  "/r/%v/about/traffic?raw_json=1",
418
519
  req.Subreddit)
419
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditAboutTraffic", Path: hydratedPath}, &resp)
520
+ requestConfig := requestConfig{
521
+ Method: "GET",
522
+ ProtoMethod: "SubredditAboutTraffic",
523
+ Path: hydratedPath,
524
+ }
525
+ err := s.doRequest(ctx, requestConfig, &resp)
420
526
  if err != nil {
421
527
  return nil, err
422
528
  }
@@ -427,7 +533,12 @@ func (s *RedditHttpPlugin) Sidebar(ctx context.Context, req *redditapi.BasicSubr
427
533
  hydratedPath := fmt.Sprintf(
428
534
  "/r/%v/sidebar?raw_json=1",
429
535
  req.Subreddit)
430
- respBody, err := s.doRequestRaw(ctx, requestConfig{Method: "GET", ProtoMethod: "Sidebar", Path: hydratedPath})
536
+ requestConfig := requestConfig{
537
+ Method: "GET",
538
+ ProtoMethod: "Sidebar",
539
+ Path: hydratedPath,
540
+ }
541
+ respBody, err := s.doRequestRaw(ctx, requestConfig)
431
542
  if err != nil {
432
543
  return nil, err
433
544
  }
@@ -447,7 +558,12 @@ func (s *RedditHttpPlugin) Sticky(ctx context.Context, req *redditapi.StickyRequ
447
558
  "/r/%v/sticky?num=%v&raw_json=1",
448
559
  req.Subreddit,
449
560
  req.Num)
450
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "Sticky", Path: hydratedPath}, &resp)
561
+ requestConfig := requestConfig{
562
+ Method: "GET",
563
+ ProtoMethod: "Sticky",
564
+ Path: hydratedPath,
565
+ }
566
+ err := s.doRequest(ctx, requestConfig, &resp)
451
567
  if err != nil {
452
568
  return nil, err
453
569
  }
@@ -484,7 +600,12 @@ func (s *RedditHttpPlugin) SubredditsMineWhere(ctx context.Context, req *reddita
484
600
  tmpCountValue,
485
601
  tmpLimitValue,
486
602
  tmpShowValue)
487
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditsMineWhere", Path: hydratedPath}, &resp)
603
+ requestConfig := requestConfig{
604
+ Method: "GET",
605
+ ProtoMethod: "SubredditsMineWhere",
606
+ Path: hydratedPath,
607
+ }
608
+ err := s.doRequest(ctx, requestConfig, &resp)
488
609
  if err != nil {
489
610
  return nil, err
490
611
  }
@@ -541,7 +662,12 @@ func (s *RedditHttpPlugin) SubredditsSearch(ctx context.Context, req *redditapi.
541
662
  tmpShowUsersValue,
542
663
  tmpSortValue,
543
664
  tmpTypeaheadActiveValue)
544
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditsSearch", Path: hydratedPath}, &resp)
665
+ requestConfig := requestConfig{
666
+ Method: "GET",
667
+ ProtoMethod: "SubredditsSearch",
668
+ Path: hydratedPath,
669
+ }
670
+ err := s.doRequest(ctx, requestConfig, &resp)
545
671
  if err != nil {
546
672
  return nil, err
547
673
  }
@@ -578,7 +704,12 @@ func (s *RedditHttpPlugin) SubredditsWhere(ctx context.Context, req *redditapi.B
578
704
  tmpCountValue,
579
705
  tmpLimitValue,
580
706
  tmpShowValue)
581
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditsWhere", Path: hydratedPath}, &resp)
707
+ requestConfig := requestConfig{
708
+ Method: "GET",
709
+ ProtoMethod: "SubredditsWhere",
710
+ Path: hydratedPath,
711
+ }
712
+ err := s.doRequest(ctx, requestConfig, &resp)
582
713
  if err != nil {
583
714
  return nil, err
584
715
  }
@@ -630,7 +761,12 @@ func (s *RedditHttpPlugin) UsersSearch(ctx context.Context, req *redditapi.Users
630
761
  tmpShowValue,
631
762
  tmpSortValue,
632
763
  tmpTypeaheadActiveValue)
633
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "UsersSearch", Path: hydratedPath}, &resp)
764
+ requestConfig := requestConfig{
765
+ Method: "GET",
766
+ ProtoMethod: "UsersSearch",
767
+ Path: hydratedPath,
768
+ }
769
+ err := s.doRequest(ctx, requestConfig, &resp)
634
770
  if err != nil {
635
771
  return nil, err
636
772
  }
@@ -667,7 +803,12 @@ func (s *RedditHttpPlugin) UsersWhere(ctx context.Context, req *redditapi.BasicW
667
803
  tmpCountValue,
668
804
  tmpLimitValue,
669
805
  tmpShowValue)
670
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "UsersWhere", Path: hydratedPath}, &resp)
806
+ requestConfig := requestConfig{
807
+ Method: "GET",
808
+ ProtoMethod: "UsersWhere",
809
+ Path: hydratedPath,
810
+ }
811
+ err := s.doRequest(ctx, requestConfig, &resp)
671
812
  if err != nil {
672
813
  return nil, err
673
814
  }
@@ -685,7 +826,14 @@ func (s *RedditHttpPlugin) SubredditAddRemovalReason(ctx context.Context, req *r
685
826
  body.Add("subreddit", req.Subreddit)
686
827
  body.Add("title", req.Title)
687
828
  bodyBytes := []byte(body.Encode())
688
- err := s.doRequest(ctx, requestConfig{Method: "POST", ProtoMethod: "SubredditAddRemovalReason", BodyType: FORM_SNAKE, Body: bodyBytes, Path: hydratedPath}, &resp)
829
+ requestConfig := requestConfig{
830
+ Method: "POST",
831
+ ProtoMethod: "SubredditAddRemovalReason",
832
+ BodyType: FORM_SNAKE,
833
+ Body: bodyBytes,
834
+ Path: hydratedPath,
835
+ }
836
+ err := s.doRequest(ctx, requestConfig, &resp)
689
837
  if err != nil {
690
838
  return nil, err
691
839
  }
@@ -697,7 +845,12 @@ func (s *RedditHttpPlugin) SubredditGetRemovalReasons(ctx context.Context, req *
697
845
  hydratedPath := fmt.Sprintf(
698
846
  "/api/v1/%v/removal_reasons?raw_json=1",
699
847
  req.Subreddit)
700
- err := s.doRequest(ctx, requestConfig{Method: "GET", ProtoMethod: "SubredditGetRemovalReasons", Path: hydratedPath}, &resp)
848
+ requestConfig := requestConfig{
849
+ Method: "GET",
850
+ ProtoMethod: "SubredditGetRemovalReasons",
851
+ Path: hydratedPath,
852
+ }
853
+ err := s.doRequest(ctx, requestConfig, &resp)
701
854
  if err != nil {
702
855
  return nil, err
703
856
  }