e621_openapi 1.0.385

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.
@@ -0,0 +1,2216 @@
1
+ # Generated by scripts/generate.rb from the E621OpenAPI spec, don't edit by hand.
2
+
3
+ module E621OpenAPI
4
+ # One method per operation in the spec, named after its operationId.
5
+ module Operations
6
+ # API Keys Index
7
+ #
8
+ # Requires [browser authentication](#operations-Sessions-login) (username & password), as well as hourly password confirmations (reauthentication).
9
+ def api_keys_index(limit: nil, page: nil, search: nil)
10
+ request(:get, "/api_keys.json", query: { limit: limit, page: page, search: search })
11
+ end
12
+
13
+ # Create API Key
14
+ #
15
+ # Requires [browser authentication](#operations-Sessions-login) (username & password), as well as hourly password confirmations (reauthentication).
16
+ def api_keys_create(authenticity_token:, api_key:)
17
+ request(:post, "/api_keys.json", body: { authenticity_token: authenticity_token, api_key: api_key }, body_type: "application/x-www-form-urlencoded")
18
+ end
19
+
20
+ # Delete API Key
21
+ #
22
+ # Requires [browser authentication](#operations-Sessions-login) (username & password), as well as hourly password confirmations (reauthentication).
23
+ def api_keys_destroy(id)
24
+ request(:delete, "/api_keys/#{escape(id)}.json")
25
+ end
26
+
27
+ # Regenerate API Key
28
+ #
29
+ # Requires [browser authentication](#operations-Sessions-login) (username & password), as well as hourly password confirmations (reauthentication).
30
+ def api_keys_regenerate(id, authenticity_token:)
31
+ request(:post, "/api_keys/#{escape(id)}/regenerate.json", body: { authenticity_token: authenticity_token }, body_type: "application/x-www-form-urlencoded")
32
+ end
33
+
34
+ # Appeals Index
35
+ #
36
+ # Requires Janitor+ to see appeals not created by you.
37
+ def appeals_index(limit: nil, page: nil, search: nil)
38
+ request(:get, "/appeals.json", query: { limit: limit, page: page, search: search })
39
+ end
40
+
41
+ # Get Appeal
42
+ #
43
+ # Requires Janitor+ to see appeals not created by you.
44
+ def appeals_show(id)
45
+ request(:get, "/appeals/#{escape(id)}.json")
46
+ end
47
+
48
+ # Update Appeal
49
+ #
50
+ # You must be Janitor+.
51
+ def appeals_update(id, appeal: nil)
52
+ request(:patch, "/appeals/#{escape(id)}.json", body: { appeal: appeal }, body_type: "application/x-www-form-urlencoded")
53
+ end
54
+
55
+ # Claim Appeal
56
+ #
57
+ # You must be Janitor+
58
+ def appeals_claim(id)
59
+ request(:post, "/appeals/#{escape(id)}/claim.json")
60
+ end
61
+
62
+ # Unclaim Appeal
63
+ #
64
+ # You must be Janitor+
65
+ def appeals_unclaim(id)
66
+ request(:post, "/appeals/#{escape(id)}/unclaim.json")
67
+ end
68
+
69
+ # Artists Index
70
+ def artists_index(limit: nil, page: nil, search: nil)
71
+ request(:get, "/artists.json", query: { limit: limit, page: page, search: search })
72
+ end
73
+
74
+ # Create Artist
75
+ #
76
+ # `other_names` & `urls` are silently truncated to 25 entries.
77
+ # `notes` is silently truncated to the wiki page limit (250,000).
78
+ # Individual `other_names` are silently truncated to 100 characters.
79
+ # Individual `urls` cannot be longer than 512 characters.
80
+ def artists_create(artist:)
81
+ request(:post, "/artists.json", body: { artist: artist }, body_type: "application/x-www-form-urlencoded")
82
+ end
83
+
84
+ # Get Artist By Name
85
+ #
86
+ # Like `GET /artists/{idOrName}.json`, but always looks up by name, even if it is numeric.
87
+ def artists_show_or_new(name:)
88
+ request(:get, "/artists/show_or_new.json", query: { name: name })
89
+ end
90
+
91
+ # Get Artist
92
+ def artists_show(id_or_name)
93
+ request(:get, "/artists/#{escape(id_or_name)}.json")
94
+ end
95
+
96
+ # Update Artist
97
+ #
98
+ # If an artist is locked, you must be Staff+ to edit them.
99
+ # `other_names` & `urls` are silently truncated to 25 entries.
100
+ # `notes` is silently truncated to the wiki page limit (250,000).
101
+ # Individual `other_names` are silently truncated to 100 characters.
102
+ # Individual `urls` cannot be longer than 512 characters.
103
+ # If an artist is on the avoid posting list, you must have the bd staff user flag to edit name, other_names, or group_name.
104
+ def artists_update(id_or_name, artist: nil)
105
+ request(:patch, "/artists/#{escape(id_or_name)}.json", body: { artist: artist }, body_type: "application/x-www-form-urlencoded")
106
+ end
107
+
108
+ # Delete Artist
109
+ #
110
+ # You must be an Admin+ to delete an artist.
111
+ def artists_destroy(id_or_name)
112
+ request(:delete, "/artists/#{escape(id_or_name)}.json")
113
+ end
114
+
115
+ # Revert Artist
116
+ #
117
+ # If an artist is locked, you must be Staff+ to revert them.
118
+ def artists_revert(id_or_name, version_id:)
119
+ request(:put, "/artists/#{escape(id_or_name)}/revert.json", query: { version_id: version_id })
120
+ end
121
+
122
+ # Artist Versions Index
123
+ def artist_versions_index(limit: nil, page: nil, search: nil)
124
+ request(:get, "/artist_versions.json", query: { limit: limit, page: page, search: search })
125
+ end
126
+
127
+ # Artist URLs Index
128
+ def artist_urls_index(limit: nil, page: nil, search: nil)
129
+ request(:get, "/artist_urls.json", query: { limit: limit, page: page, search: search })
130
+ end
131
+
132
+ # Avoid Posting Index
133
+ def avoid_postings_index(limit: nil, page: nil, search: nil)
134
+ request(:get, "/avoid_postings.json", query: { limit: limit, page: page, search: search })
135
+ end
136
+
137
+ # Create Avoid Posting
138
+ #
139
+ # Must have the bd staff user flag.
140
+ def avoid_postings_create(avoid_posting:)
141
+ request(:post, "/avoid_postings.json", body: { avoid_posting: avoid_posting }, body_type: "application/x-www-form-urlencoded")
142
+ end
143
+
144
+ # Get Avoid Posting
145
+ def avoid_postings_show(id_or_name)
146
+ request(:get, "/avoid_postings/#{escape(id_or_name)}.json")
147
+ end
148
+
149
+ # Update Avoid Posting
150
+ #
151
+ # Must have the bd staff user flag.
152
+ def avoid_postings_update(id_or_name, avoid_posting: nil)
153
+ request(:patch, "/avoid_postings/#{escape(id_or_name)}.json", body: { avoid_posting: avoid_posting }, body_type: "application/x-www-form-urlencoded")
154
+ end
155
+
156
+ # Destroy Avoid Posting
157
+ #
158
+ # Must have the bd staff user flag.
159
+ def avoid_postings_destroy(id_or_name)
160
+ request(:delete, "/avoid_postings/#{escape(id_or_name)}.json")
161
+ end
162
+
163
+ # Delete Avoid Posting
164
+ #
165
+ # Soft deletion. Must have the bd staff user flag.
166
+ def avoid_postings_delete(id_or_name)
167
+ request(:put, "/avoid_postings/#{escape(id_or_name)}/delete.json")
168
+ end
169
+
170
+ # Undelete Avoid Posting
171
+ #
172
+ # Must have the bd staff user flag.
173
+ def avoid_postings_undelete(id_or_name)
174
+ request(:put, "/avoid_postings/#{escape(id_or_name)}/undelete.json")
175
+ end
176
+
177
+ # Avoid Posting Versions Index
178
+ def avoid_posting_versions_index(limit: nil, page: nil, search: nil)
179
+ request(:get, "/avoid_posting_versions.json", query: { limit: limit, page: page, search: search })
180
+ end
181
+
182
+ # Bans Index
183
+ def bans_index(limit: nil, page: nil, search: nil)
184
+ request(:get, "/bans.json", query: { limit: limit, page: page, search: search })
185
+ end
186
+
187
+ # Get Ban
188
+ def bans_show(id)
189
+ request(:get, "/bans/#{escape(id)}.json")
190
+ end
191
+
192
+ # Blips Index
193
+ def blips_index(limit: nil, page: nil, search: nil)
194
+ request(:get, "/blips.json", query: { limit: limit, page: page, search: search })
195
+ end
196
+
197
+ # Create Blip
198
+ def blips_create(blip:)
199
+ request(:post, "/blips.json", body: { blip: blip }, body_type: "application/x-www-form-urlencoded")
200
+ end
201
+
202
+ # Get Blip
203
+ def blips_show(id)
204
+ request(:get, "/blips/#{escape(id)}.json")
205
+ end
206
+
207
+ # Update Blip
208
+ #
209
+ # Unless Admin+, blips cannot be edited after 5 minutes. Marked blips cannot be edited.
210
+ def blips_update(id, blip: nil)
211
+ request(:patch, "/blips/#{escape(id)}.json", body: { blip: blip }, body_type: "application/x-www-form-urlencoded")
212
+ end
213
+
214
+ # Destroy Blip
215
+ #
216
+ # You must be Admin+.
217
+ def blips_destroy(id)
218
+ request(:delete, "/blips/#{escape(id)}.json")
219
+ end
220
+
221
+ # Delete Blip
222
+ #
223
+ # Soft deletion. You must be the creator or Moderator+.
224
+ def blips_delete(id)
225
+ request(:post, "/blips/#{escape(id)}/delete.json")
226
+ end
227
+
228
+ # Undelete Blip
229
+ #
230
+ # You must be Moderator+.
231
+ def blips_undelete(id)
232
+ request(:post, "/blips/#{escape(id)}/undelete.json")
233
+ end
234
+
235
+ # Mark Blip
236
+ #
237
+ # You must be Moderator+.
238
+ def blips_warning(id, record_type:)
239
+ request(:post, "/blips/#{escape(id)}/warning.json", body: { record_type: record_type }, body_type: "application/x-www-form-urlencoded")
240
+ end
241
+
242
+ # Bulk Update Requests Index
243
+ def bulk_update_requests_index(limit: nil, page: nil, search: nil)
244
+ request(:get, "/bulk_update_requests.json", query: { limit: limit, page: page, search: search })
245
+ end
246
+
247
+ # Create Bulk Update Request
248
+ def bulk_update_requests_create(bulk_update_request:)
249
+ request(:post, "/bulk_update_requests.json", body: { bulk_update_request: bulk_update_request }, body_type: "application/x-www-form-urlencoded")
250
+ end
251
+
252
+ # Get Bulk Update Request
253
+ def bulk_update_requests_show(id)
254
+ request(:get, "/bulk_update_requests/#{escape(id)}.json")
255
+ end
256
+
257
+ # Update Bulk Update Request
258
+ #
259
+ # You must be the creator of the BUR, or Admin+.
260
+ def bulk_update_requests_update(id, bulk_update_request: nil)
261
+ request(:patch, "/bulk_update_requests/#{escape(id)}.json", body: { bulk_update_request: bulk_update_request }, body_type: "application/x-www-form-urlencoded")
262
+ end
263
+
264
+ # Reject Bulk Update Request
265
+ #
266
+ # You must be the creator of the BUR, or Admin+.
267
+ def bulk_update_requests_destroy(id)
268
+ request(:delete, "/bulk_update_requests/#{escape(id)}.json")
269
+ end
270
+
271
+ # Approve Bulk Update Request
272
+ #
273
+ # Must be Admin+.
274
+ def bulk_update_requests_approve(id)
275
+ request(:post, "/bulk_update_requests/#{escape(id)}/approve.json")
276
+ end
277
+
278
+ # Comments Index
279
+ #
280
+ # For searching comments, group_by=comment must be set.
281
+ def comments_index(limit: nil, page: nil, search: nil, group_by: nil)
282
+ request(:get, "/comments.json", query: { limit: limit, page: page, search: search, group_by: group_by })
283
+ end
284
+
285
+ # Create Comment
286
+ def comments_create(comment:)
287
+ request(:post, "/comments.json", body: { comment: comment }, body_type: "application/x-www-form-urlencoded")
288
+ end
289
+
290
+ # Get Comment
291
+ #
292
+ # If the comment is hidden, you must be the creator or Staff+ to see it.
293
+ def comments_show(id)
294
+ request(:get, "/comments/#{escape(id)}.json")
295
+ end
296
+
297
+ # Update Comment
298
+ #
299
+ # You must be the creator of the comment, or Admin+ to edit. Marked comments cannot be edited.
300
+ def comments_update(id, comment: nil)
301
+ request(:patch, "/comments/#{escape(id)}.json", body: { comment: comment }, body_type: "application/x-www-form-urlencoded")
302
+ end
303
+
304
+ # Delete Comment
305
+ #
306
+ # You must be Admin+.
307
+ def comments_destroy(id)
308
+ request(:delete, "/comments/#{escape(id)}.json")
309
+ end
310
+
311
+ # Hide Comment
312
+ #
313
+ # You must be the creator or Moderator+.
314
+ def comments_hide(id)
315
+ request(:post, "/comments/#{escape(id)}/hide.json")
316
+ end
317
+
318
+ # Unhide Comment
319
+ #
320
+ # You must be Moderator+.
321
+ def comments_unhide(id)
322
+ request(:post, "/comments/#{escape(id)}/unhide.json")
323
+ end
324
+
325
+ # Mark Comment
326
+ #
327
+ # You must be Moderator+.
328
+ def comments_warning(id, record_type:)
329
+ request(:post, "/comments/#{escape(id)}/warning.json", body: { record_type: record_type }, body_type: "application/x-www-form-urlencoded")
330
+ end
331
+
332
+ # Create Comment Vote
333
+ def comment_votes_create(id, score:, no_unvote: nil)
334
+ request(:post, "/comments/#{escape(id)}/votes.json", query: { score: score, no_unvote: no_unvote })
335
+ end
336
+
337
+ # Delete Comment Vote
338
+ def comment_votes_destroy(id)
339
+ request(:delete, "/comments/#{escape(id)}/votes.json")
340
+ end
341
+
342
+ # Comment Votes Index
343
+ #
344
+ # You must be Moderator+.
345
+ def comment_votes_index(limit: nil, page: nil, search: nil)
346
+ request(:get, "/comment_votes.json", query: { limit: limit, page: page, search: search })
347
+ end
348
+
349
+ # Lock Comment Votes
350
+ #
351
+ # You must be Moderator+. Errors if ids is not provided.
352
+ def comment_votes_lock(ids:)
353
+ request(:post, "/comment_votes/lock.json", query: { ids: ids })
354
+ end
355
+
356
+ # Delete Comment Votes
357
+ #
358
+ # You must be Admin+. Errors if ids is not provided.
359
+ def comment_votes_delete(ids:)
360
+ request(:post, "/comment_votes/delete.json", query: { ids: ids })
361
+ end
362
+
363
+ # Get DB Exports
364
+ def db_exports_index()
365
+ request(:get, "/db_exports.json")
366
+ end
367
+
368
+ # Get health
369
+ def health_index()
370
+ request(:get, "/health")
371
+ end
372
+
373
+ # Get status
374
+ def rails_health_show()
375
+ request(:get, "/status.json")
376
+ end
377
+
378
+ # Get OpenID Connect Discovery Document
379
+ #
380
+ # Returns e621's [OpenID Connect discovery document](https://openid.net/specs/openid-connect-discovery-1_0.html),
381
+ # advertising its OAuth 2.0/OIDC endpoints and the capabilities it supports on them.
382
+ def doorkeeper_openid_connect_discovery_provider()
383
+ request(:get, "/.well-known/openid-configuration")
384
+ end
385
+
386
+ # Get OpenID Connect JSON Web Key Set
387
+ #
388
+ # Returns the [JSON Web Key Set](https://www.rfc-editor.org/rfc/rfc7517) used to verify the
389
+ # signature of issued ID tokens, as advertised by `jwks_uri` in the discovery document.
390
+ def doorkeeper_openid_connect_discovery_keys()
391
+ request(:get, "/oauth/discovery/keys")
392
+ end
393
+
394
+ # Get OpenID Connect User Info
395
+ #
396
+ # Returns claims about the authenticated user, gated by the scopes granted to the access token.
397
+ # Also reachable via POST with an identical response.
398
+ def doorkeeper_openid_connect_userinfo_show()
399
+ request(:get, "/oauth/userinfo")
400
+ end
401
+
402
+ # Create OAuth Token
403
+ #
404
+ # OAuth 2.0 token endpoint. Supports the `authorization_code` and `refresh_token` grant types.
405
+ # The client can authenticate with `client_id`/`client_secret` as form fields (below) or via HTTP Basic Auth instead.
406
+ def doorkeeper_tokens_create(grant_type:, code: nil, redirect_uri: nil, code_verifier: nil, refresh_token: nil, scope: nil, client_id: nil, client_secret: nil)
407
+ request(:post, "/oauth/token", body: { grant_type: grant_type, code: code, redirect_uri: redirect_uri, code_verifier: code_verifier, refresh_token: refresh_token, scope: scope, client_id: client_id, client_secret: client_secret }, body_type: "application/x-www-form-urlencoded")
408
+ end
409
+
410
+ # Revoke OAuth Token
411
+ #
412
+ # [RFC 7009](https://datatracker.ietf.org/doc/html/rfc7009) token revocation. Always responds
413
+ # with 200 and an empty body, even if the token was already invalid - the client can authenticate
414
+ # with `client_id`/`client_secret` as form fields (below) or via HTTP Basic Auth instead.
415
+ def doorkeeper_tokens_revoke(token:, token_type_hint: nil, client_id: nil, client_secret: nil)
416
+ request(:post, "/oauth/revoke", body: { token: token, token_type_hint: token_type_hint, client_id: client_id, client_secret: client_secret }, body_type: "application/x-www-form-urlencoded")
417
+ end
418
+
419
+ # Introspect OAuth Token
420
+ #
421
+ # [RFC 7662](https://datatracker.ietf.org/doc/html/rfc7662) token introspection. The caller must
422
+ # authenticate as the token's OAuth client (`client_id`/`client_secret` as form fields below, or
423
+ # HTTP Basic Auth), or present the token itself as a Bearer token in the `Authorization` header.
424
+ def doorkeeper_tokens_introspect(token:, token_type_hint: nil, client_id: nil, client_secret: nil)
425
+ request(:post, "/oauth/introspect", body: { token: token, token_type_hint: token_type_hint, client_id: client_id, client_secret: client_secret }, body_type: "application/x-www-form-urlencoded")
426
+ end
427
+
428
+ # Get OAuth Token Info
429
+ #
430
+ # Returns metadata about the access token used to authenticate the request.
431
+ def doorkeeper_token_info_show()
432
+ request(:get, "/oauth/token/info")
433
+ end
434
+
435
+ # DMails Index
436
+ def dmails_index(limit: nil, page: nil, search: nil)
437
+ request(:get, "/dmails.json", query: { limit: limit, page: page, search: search })
438
+ end
439
+
440
+ # Get DMail
441
+ #
442
+ # Fetching a dmail will not mark it as read.
443
+ # Unless the dmail is owned:
444
+ # - The current user must be staff and the dmail must be to or from the automod
445
+ # - The current user must be Moderator+ and a ticket must exist for the dmail
446
+ # - The current user must be Admin+ and the dmail must be to or from Admin+
447
+ # - The current user must be Staff and have a share key for the dmail
448
+ def dmails_show(id, key: nil)
449
+ request(:get, "/dmails/#{escape(id)}.json", query: { key: key })
450
+ end
451
+
452
+ # Delete DMail
453
+ #
454
+ # Deleting simply hides your copy of the dmail.
455
+ def dmails_destroy(id)
456
+ request(:delete, "/dmails/#{escape(id)}.json")
457
+ end
458
+
459
+ # Mark DMail As Read
460
+ def dmails_mark_as_read(id)
461
+ request(:put, "/dmails/#{escape(id)}/mark_as_read.json")
462
+ end
463
+
464
+ # Mark DMail As Unread
465
+ def dmails_mark_as_unread(id)
466
+ request(:put, "/dmails/#{escape(id)}/mark_as_unread.json")
467
+ end
468
+
469
+ # Mark All DMails As Read
470
+ def dmails_mark_all_as_read()
471
+ request(:put, "/dmails/mark_all_as_read.json")
472
+ end
473
+
474
+ # Preview DText
475
+ #
476
+ # Limited to 20 requests per minute.
477
+ def dtext_previews_create(body:, allow_color: nil, wiki_includes: nil)
478
+ request(:post, "/dtext_preview.json", body: { body: body, allow_color: allow_color, wiki_includes: wiki_includes }, body_type: "application/x-www-form-urlencoded")
479
+ end
480
+
481
+ # Edit Histories Index
482
+ #
483
+ # You must be Moderator+.
484
+ def edit_histories_index(limit: nil, page: nil, search: nil)
485
+ request(:get, "/edit_histories.json", query: { limit: limit, page: page, search: search })
486
+ end
487
+
488
+ # Get Edit History
489
+ #
490
+ # You must be Moderator+.
491
+ def edit_histories_show(id, type:)
492
+ request(:get, "/edit_histories/#{escape(id)}.json", query: { type: type })
493
+ end
494
+
495
+ # Email Blacklists Index
496
+ def email_blacklists_index(limit: nil, page: nil, search: nil)
497
+ request(:get, "/email_blacklists.json", query: { limit: limit, page: page, search: search })
498
+ end
499
+
500
+ # Create Email Blacklist
501
+ #
502
+ # You must be Admin+.
503
+ def email_blacklists_create(email_blacklist:)
504
+ request(:post, "/email_blacklists.json", body: { email_blacklist: email_blacklist }, body_type: "application/x-www-form-urlencoded")
505
+ end
506
+
507
+ # Delete Email Blacklist
508
+ #
509
+ # You must be Admin+.
510
+ def email_blacklists_destroy(id)
511
+ request(:delete, "/email_blacklists/#{escape(id)}.json")
512
+ end
513
+
514
+ # Favorites Index
515
+ def favorites_index(limit: nil, page: nil, v1: nil, mode: nil)
516
+ request(:get, "/favorites.json", query: { limit: limit, page: page, v1: v1, mode: mode })
517
+ end
518
+
519
+ # Create Favorite
520
+ #
521
+ # Creates and deletes share a limit of 60 per minute. They don't count towards the general write limit.
522
+ def favorites_create(post_id:)
523
+ request(:post, "/favorites.json", body: { post_id: post_id }, body_type: "application/x-www-form-urlencoded")
524
+ end
525
+
526
+ # Delete Favorite
527
+ #
528
+ # Creates and deletes share a limit of 60 per minute. They don't count towards the general write limit.
529
+ def favorites_destroy(id)
530
+ request(:delete, "/favorites/#{escape(id)}.json")
531
+ end
532
+
533
+ # Forum Posts Index
534
+ def forum_posts_index(limit: nil, page: nil, search: nil)
535
+ request(:get, "/forum_posts.json", query: { limit: limit, page: page, search: search })
536
+ end
537
+
538
+ # Create Forum Post
539
+ def forum_posts_create(forum_post:)
540
+ request(:post, "/forum_posts.json", body: { forum_post: forum_post }, body_type: "application/x-www-form-urlencoded")
541
+ end
542
+
543
+ # Get Forum Post
544
+ #
545
+ # If the forum post is hidden, you must be the creator or Moderator+ to see it.
546
+ def forum_posts_show(id)
547
+ request(:get, "/forum_posts/#{escape(id)}.json")
548
+ end
549
+
550
+ # Update Forum Post
551
+ #
552
+ # You must be the creator of the forum post, or Admin+ to edit. Marked forum posts cannot be edited.
553
+ def forum_posts_update(id, forum_post: nil)
554
+ request(:patch, "/forum_posts/#{escape(id)}.json", body: { forum_post: forum_post }, body_type: "application/x-www-form-urlencoded")
555
+ end
556
+
557
+ # Delete Forum Post
558
+ #
559
+ # You must be Admin+.
560
+ def forum_posts_destroy(id)
561
+ request(:delete, "/forum_posts/#{escape(id)}.json")
562
+ end
563
+
564
+ # Hide Forum Post
565
+ #
566
+ # You must be the creator or Moderator+.
567
+ def forum_posts_hide(id)
568
+ request(:post, "/forum_posts/#{escape(id)}/hide.json")
569
+ end
570
+
571
+ # Unhide Forum Post
572
+ #
573
+ # You must be Moderator+.
574
+ def forum_posts_unhide(id)
575
+ request(:post, "/forum_posts/#{escape(id)}/unhide.json")
576
+ end
577
+
578
+ # Mark Forum Post
579
+ #
580
+ # You must be Moderator+.
581
+ def forum_posts_warning(id, record_type:)
582
+ request(:post, "/forum_posts/#{escape(id)}/warning.json", body: { record_type: record_type }, body_type: "application/x-www-form-urlencoded")
583
+ end
584
+
585
+ # Forum Post Votes Index
586
+ def forum_post_votes_show(id)
587
+ request(:get, "/forum_posts/#{escape(id)}/votes.json")
588
+ end
589
+
590
+ # Create Forum Post Vote
591
+ def forum_post_votes_create(id, forum_post_vote:)
592
+ request(:post, "/forum_posts/#{escape(id)}/votes.json", body: { forum_post_vote: forum_post_vote }, body_type: "application/x-www-form-urlencoded")
593
+ end
594
+
595
+ # Delete Forum Post Vote
596
+ def forum_post_votes_destroy(id)
597
+ request(:delete, "/forum_posts/#{escape(id)}/votes.json")
598
+ end
599
+
600
+ # Forum Topics Index
601
+ def forum_topics_index(limit: nil, page: nil, search: nil)
602
+ request(:get, "/forum_topics.json", query: { limit: limit, page: page, search: search })
603
+ end
604
+
605
+ # Create Forum Topic
606
+ def forum_topics_create(forum_topic:)
607
+ request(:post, "/forum_topics.json", body: { forum_topic: forum_topic }, body_type: "application/x-www-form-urlencoded")
608
+ end
609
+
610
+ # Get Forum Forum Topic
611
+ #
612
+ # If the forum topic is hidden, you must be the creator or Moderator+ to see it.
613
+ def forum_topics_show(id)
614
+ request(:get, "/forum_topics/#{escape(id)}.json")
615
+ end
616
+
617
+ # Update Forum Topic
618
+ def forum_topics_update(id, forum_topic: nil)
619
+ request(:patch, "/forum_topics/#{escape(id)}.json", body: { forum_topic: forum_topic }, body_type: "application/x-www-form-urlencoded")
620
+ end
621
+
622
+ # Delete Forum Topic
623
+ #
624
+ # You must be Admin+.
625
+ def forum_topics_destroy(id)
626
+ request(:delete, "/forum_topics/#{escape(id)}.json")
627
+ end
628
+
629
+ # Hide Forum Topic
630
+ #
631
+ # You must be the creator or Moderator+.
632
+ def forum_topics_hide(id)
633
+ request(:post, "/forum_topics/#{escape(id)}/hide.json")
634
+ end
635
+
636
+ # Unhide Forum Topic
637
+ #
638
+ # You must be Moderator+.
639
+ def forum_topics_unhide(id)
640
+ request(:post, "/forum_topics/#{escape(id)}/unhide.json")
641
+ end
642
+
643
+ # Subscribe To Forum Topic
644
+ def forum_topics_subscribe(id)
645
+ request(:post, "/forum_topics/#{escape(id)}/subscribe.json")
646
+ end
647
+
648
+ # Unsubscribe From Forum Topic
649
+ def forum_topics_unsubscribe(id)
650
+ request(:post, "/forum_topics/#{escape(id)}/unsubscribe.json")
651
+ end
652
+
653
+ # Mark All Forum Topics As Read
654
+ def forum_topics_mark_all_as_read(category_id:)
655
+ request(:post, "/forum_topics/mark_all_as_read.json", body: { category_id: category_id }, body_type: "application/x-www-form-urlencoded")
656
+ end
657
+
658
+ # Get Landing Help Page
659
+ def help_index()
660
+ request(:get, "/help.json")
661
+ end
662
+
663
+ # Create Help Page
664
+ #
665
+ # You must be Admin+.
666
+ def help_create(help_page:)
667
+ request(:post, "/help.json", body: { help_page: help_page }, body_type: "application/x-www-form-urlencoded")
668
+ end
669
+
670
+ # Help Pages Index
671
+ def help_list()
672
+ request(:get, "/help/list.json")
673
+ end
674
+
675
+ # Get Help Page
676
+ def help_show(id)
677
+ request(:get, "/help/#{escape(id)}.json")
678
+ end
679
+
680
+ # Update Help Page
681
+ #
682
+ # You must be Admin+
683
+ def help_update(id, help_page: nil)
684
+ request(:patch, "/help/#{escape(id)}.json", body: { help_page: help_page }, body_type: "application/x-www-form-urlencoded")
685
+ end
686
+
687
+ # Delete Help Page
688
+ #
689
+ # You must be Admin+.
690
+ def help_destroy(id)
691
+ request(:delete, "/help/#{escape(id)}.json")
692
+ end
693
+
694
+ # IP Bans Index
695
+ def ip_bans_index(limit: nil, page: nil, search: nil)
696
+ request(:get, "/ip_bans.json", query: { limit: limit, page: page, search: search })
697
+ end
698
+
699
+ # Create IP Ban
700
+ #
701
+ # You must be Admin+.
702
+ def ip_bans_create(ip_ban:)
703
+ request(:post, "/ip_bans.json", body: { ip_ban: ip_ban }, body_type: "application/x-www-form-urlencoded")
704
+ end
705
+
706
+ # Delete IP Ban
707
+ #
708
+ # You must be Admin+.
709
+ def ip_bans_destroy(id)
710
+ request(:delete, "/ip_bans/#{escape(id)}.json")
711
+ end
712
+
713
+ # Query IQDB
714
+ def iqdb_queries_show(v1: nil, search: nil)
715
+ request(:get, "/iqdb_queries.json", query: { v1: v1, search: search })
716
+ end
717
+
718
+ # Query IQDB
719
+ def iqdb_queries_show_post(v1: nil, search: nil)
720
+ request(:post, "/iqdb_queries.json", query: { v1: v1 }, body: { search: search }, body_type: "multipart/form-data")
721
+ end
722
+
723
+ # Mascots Index
724
+ def mascots_index(limit: nil, page: nil, search: nil)
725
+ request(:get, "/mascots.json", query: { limit: limit, page: page, search: search })
726
+ end
727
+
728
+ # Create Mascot
729
+ #
730
+ # You must be Admin+.
731
+ def mascots_create(mascot:)
732
+ request(:post, "/mascots.json", body: { mascot: mascot }, body_type: "multipart/form-data")
733
+ end
734
+
735
+ # Update Mascot
736
+ #
737
+ # You must be Admin+.
738
+ def mascots_update(id, mascot: nil)
739
+ request(:patch, "/mascots/#{escape(id)}.json", body: { mascot: mascot }, body_type: "multipart/form-data")
740
+ end
741
+
742
+ # Delete Mascot
743
+ #
744
+ # You must be Admin+.
745
+ def mascots_destroy(id)
746
+ request(:delete, "/mascots/#{escape(id)}.json")
747
+ end
748
+
749
+ # Mod Actions Index
750
+ #
751
+ # Note that some mod actions are not in use anymore. Their entries exist for historical purposes only.<br>
752
+ # The current legacy actions are as follows:<br>
753
+ # * `created_positive_record`, `created_neutral_record`, `created_negative_record`
754
+ # * `created_flag_reason`, `edited_flag_reason`, `deleted_flag_reason`
755
+ # * `post_move_favorites`, `post_delete`, `post_undelete`, `post_destroy`, `post_rating_lock`, `post_unapprove`
756
+ # * `post_replacement_accept`, `post_replacement_reject`, `post_replacement_delete`
757
+ def mod_actions_index(limit: nil, page: nil, search: nil)
758
+ request(:get, "/mod_actions.json", query: { limit: limit, page: page, search: search })
759
+ end
760
+
761
+ # Get Mod Action
762
+ def mod_actions_show(id)
763
+ request(:get, "/mod_actions/#{escape(id)}.json")
764
+ end
765
+
766
+ # News Updates Index
767
+ def news_updates_index(limit: nil, page: nil)
768
+ request(:get, "/news_updates.json", query: { limit: limit, page: page })
769
+ end
770
+
771
+ # Create News Update
772
+ #
773
+ # You must be Admin+.
774
+ def news_updates_create(news_update:)
775
+ request(:post, "/news_updates.json", body: { news_update: news_update }, body_type: "application/x-www-form-urlencoded")
776
+ end
777
+
778
+ # Update News Update
779
+ #
780
+ # You must be Admin+
781
+ def news_updates_update(id, news_update:)
782
+ request(:patch, "/news_updates/#{escape(id)}.json", body: { news_update: news_update }, body_type: "application/x-www-form-urlencoded")
783
+ end
784
+
785
+ # Delete News Update
786
+ #
787
+ # You must be Admin+.
788
+ def news_updates_destroy(id)
789
+ request(:delete, "/news_updates/#{escape(id)}.json")
790
+ end
791
+
792
+ # Notes Index
793
+ def notes_index(limit: nil, page: nil, search: nil)
794
+ request(:get, "/notes.json", query: { limit: limit, page: page, search: search })
795
+ end
796
+
797
+ # Create Note
798
+ def notes_create(note:)
799
+ request(:post, "/notes.json", body: { note: note }, body_type: "application/x-www-form-urlencoded")
800
+ end
801
+
802
+ # Get Note
803
+ def notes_show(id)
804
+ request(:get, "/notes/#{escape(id)}.json")
805
+ end
806
+
807
+ # Update Note
808
+ def notes_update(id, note: nil)
809
+ request(:patch, "/notes/#{escape(id)}.json", body: { note: note }, body_type: "application/x-www-form-urlencoded")
810
+ end
811
+
812
+ # Delete Note
813
+ def notes_destroy(id)
814
+ request(:delete, "/notes/#{escape(id)}.json")
815
+ end
816
+
817
+ # Revert Note
818
+ def notes_revert(id, version_id:)
819
+ request(:put, "/notes/#{escape(id)}/revert.json", query: { version_id: version_id })
820
+ end
821
+
822
+ # Note Versions Index
823
+ def note_versions_index(limit: nil, page: nil, search: nil)
824
+ request(:get, "/note_versions.json", query: { limit: limit, page: page, search: search })
825
+ end
826
+
827
+ # Pools Index
828
+ def pools_index(limit: nil, page: nil, search: nil)
829
+ request(:get, "/pools.json", query: { limit: limit, page: page, search: search })
830
+ end
831
+
832
+ # Create Pool
833
+ def pools_create(pool:)
834
+ request(:post, "/pools.json", body: { pool: pool }, body_type: "application/x-www-form-urlencoded")
835
+ end
836
+
837
+ # Get Pool
838
+ def pools_show(id)
839
+ request(:get, "/pools/#{escape(id)}.json")
840
+ end
841
+
842
+ # Update Pool
843
+ def pools_update(id, pool: nil)
844
+ request(:patch, "/pools/#{escape(id)}.json", body: { pool: pool }, body_type: "application/x-www-form-urlencoded")
845
+ end
846
+
847
+ # Delete Pool
848
+ #
849
+ # You must be Staff+.
850
+ def pools_destroy(id)
851
+ request(:delete, "/pools/#{escape(id)}.json")
852
+ end
853
+
854
+ # Revert Pool
855
+ def pools_revert(id, version_id:)
856
+ request(:put, "/pools/#{escape(id)}/revert.json", query: { version_id: version_id })
857
+ end
858
+
859
+ # Add Post To Pool
860
+ def pool_elements_create(pool_id: nil, pool_name: nil, post_id:)
861
+ request(:post, "/pool_element.json", body: { pool_id: pool_id, pool_name: pool_name, post_id: post_id }, body_type: "application/x-www-form-urlencoded")
862
+ end
863
+
864
+ # Remove Post From Pool
865
+ def pool_elements_destroy(pool_id: nil, pool_name: nil, post_id:)
866
+ request(:delete, "/pool_element.json", body: { pool_id: pool_id, pool_name: pool_name, post_id: post_id }, body_type: "application/x-www-form-urlencoded")
867
+ end
868
+
869
+ # Get Recent Pools
870
+ def pool_elements_recent(pool_id: nil, pool_name: nil, post_id:)
871
+ request(:get, "/pool_element/recent.json", body: { pool_id: pool_id, pool_name: pool_name, post_id: post_id }, body_type: "application/x-www-form-urlencoded")
872
+ end
873
+
874
+ # Pool Versions Index
875
+ def pool_versions_index(limit: nil, page: nil, search: nil)
876
+ request(:get, "/pool_versions.json", query: { limit: limit, page: page, search: search })
877
+ end
878
+
879
+ # Popular Index
880
+ def popular_index(v1: nil, mode: nil, date: nil, scale: nil)
881
+ request(:get, "/popular.json", query: { v1: v1, mode: mode, date: date, scale: scale })
882
+ end
883
+
884
+ # Posts Index
885
+ def posts_index(limit: nil, page: nil, v1: nil, mode: nil, tags: nil, md5: nil, random: nil)
886
+ request(:get, "/posts.json", query: { limit: limit, page: page, v1: v1, mode: mode, tags: tags, md5: md5, random: random })
887
+ end
888
+
889
+ # Get Random Post
890
+ def posts_random(v1: nil, mode: nil, tags: nil)
891
+ request(:get, "/posts/random.json", query: { v1: v1, mode: mode, tags: tags })
892
+ end
893
+
894
+ # Count Posts
895
+ def posts_count(tags:)
896
+ request(:get, "/posts/count.json", query: { tags: tags })
897
+ end
898
+
899
+ # Get Post
900
+ def posts_show(id, v1: nil, mode: nil)
901
+ request(:get, "/posts/#{escape(id)}.json", query: { v1: v1, mode: mode })
902
+ end
903
+
904
+ # Update Post
905
+ #
906
+ # Most errors are silently swallowed.
907
+ def posts_update(id, v1: nil, mode: nil, post: nil)
908
+ request(:patch, "/posts/#{escape(id)}.json", query: { v1: v1, mode: mode }, body: { post: post }, body_type: "application/x-www-form-urlencoded")
909
+ end
910
+
911
+ # Update Post IQDB
912
+ #
913
+ # You must be Admin+.
914
+ def posts_update_iqdb(id, v1: nil, mode: nil)
915
+ request(:get, "/posts/#{escape(id)}/update_iqdb.json", query: { v1: v1, mode: mode })
916
+ end
917
+
918
+ # Mark Post As Translated
919
+ #
920
+ # Will error if no body is provided.
921
+ def posts_mark_as_translated(id, v1: nil, mode: nil, post: nil)
922
+ request(:put, "/posts/#{escape(id)}/mark_as_translated.json", query: { v1: v1, mode: mode }, body: { post: post }, body_type: "application/x-www-form-urlencoded")
923
+ end
924
+
925
+ # Copy Notes To Post
926
+ def posts_copy_notes(id, other_post_id:)
927
+ request(:put, "/posts/#{escape(id)}/copy_notes.json", body: { other_post_id: other_post_id }, body_type: "application/x-www-form-urlencoded")
928
+ end
929
+
930
+ # Revert Post
931
+ def posts_revert(id, version_id:)
932
+ request(:put, "/posts/#{escape(id)}/revert.json", query: { version_id: version_id })
933
+ end
934
+
935
+ # Get Post In Sequence
936
+ def posts_show_seq(id, v1: nil, mode: nil, seq: nil)
937
+ request(:get, "/posts/#{escape(id)}/show_seq.json", query: { v1: v1, mode: mode, seq: seq })
938
+ end
939
+
940
+ # Unflag Post
941
+ #
942
+ # You must have the "Approve Posts" permission.
943
+ def post_flags_destroy(id, approval: nil)
944
+ request(:delete, "/posts/#{escape(id)}/flag.json", body: { approval: approval }, body_type: "application/x-www-form-urlencoded")
945
+ end
946
+
947
+ # Post Favorites Index
948
+ #
949
+ # You must be the user or Moderator+ to see users that have their favorites hidden.
950
+ def post_favorites_index(id, limit: nil, page: nil)
951
+ request(:get, "/posts/#{escape(id)}/favorites.json", query: { limit: limit, page: page })
952
+ end
953
+
954
+ # Create Post Vote
955
+ def post_votes_create(id, score:, no_unvote: nil)
956
+ request(:post, "/posts/#{escape(id)}/votes.json", query: { score: score, no_unvote: no_unvote })
957
+ end
958
+
959
+ # Delete Post Vote
960
+ def post_votes_destroy(id)
961
+ request(:delete, "/posts/#{escape(id)}/votes.json")
962
+ end
963
+
964
+ # Comments For Post
965
+ def comments_for_post(id)
966
+ request(:get, "/posts/#{escape(id)}/comments.json")
967
+ end
968
+
969
+ # Get Recommended Posts For Artist
970
+ def post_recommendations_artist(id, limit: nil, page: nil)
971
+ request(:get, "/posts/#{escape(id)}/similar/artist.json", query: { limit: limit, page: page })
972
+ end
973
+
974
+ # Get Recommended Posts For Tags
975
+ def post_recommendations_tags(id, limit: nil, page: nil)
976
+ request(:get, "/posts/#{escape(id)}/similar/tags.json", query: { limit: limit, page: page })
977
+ end
978
+
979
+ # Post Sets Index
980
+ def post_sets_index(limit: nil, page: nil, search: nil)
981
+ request(:get, "/post_sets.json", query: { limit: limit, page: page, search: search })
982
+ end
983
+
984
+ # Create Post Set
985
+ def post_sets_create(post_set:)
986
+ request(:post, "/post_sets.json", body: { post_set: post_set }, body_type: "application/x-www-form-urlencoded")
987
+ end
988
+
989
+ # Get Post Set
990
+ #
991
+ # You must be Moderator+ if the set is not public.
992
+ def post_sets_show(id)
993
+ request(:get, "/post_sets/#{escape(id)}.json")
994
+ end
995
+
996
+ # Update Post Set
997
+ #
998
+ # You must be the owner of the set, or Admin+.
999
+ def post_sets_update(id, post_set: nil)
1000
+ request(:patch, "/post_sets/#{escape(id)}.json", body: { post_set: post_set }, body_type: "application/x-www-form-urlencoded")
1001
+ end
1002
+
1003
+ # Delete Post Set
1004
+ #
1005
+ # You must be the owner of the set, or Admin+.
1006
+ def post_sets_destroy(id)
1007
+ request(:delete, "/post_sets/#{escape(id)}.json")
1008
+ end
1009
+
1010
+ # Post Set Post List
1011
+ #
1012
+ # You must be Moderator+ if the set is not public.
1013
+ def post_sets_post_list(id)
1014
+ request(:get, "/post_sets/#{escape(id)}/post_list.json")
1015
+ end
1016
+
1017
+ # Update Post Set Posts
1018
+ #
1019
+ # You must be the owner of the set, a maintainer (if public), or Admin+.
1020
+ def post_sets_update_posts(id, post_set:)
1021
+ request(:post, "/post_sets/#{escape(id)}/update_posts.json", body: { post_set: post_set }, body_type: "application/x-www-form-urlencoded")
1022
+ end
1023
+
1024
+ # Add Posts To Post Set
1025
+ #
1026
+ # You must be the owner of the set, a maintainer (if public), or Admin+.
1027
+ def post_sets_add_posts(id, post_ids:)
1028
+ request(:post, "/post_sets/#{escape(id)}/add_posts.json", body: { post_ids: post_ids }, body_type: "application/x-www-form-urlencoded")
1029
+ end
1030
+
1031
+ # Remove Posts From Post Set
1032
+ #
1033
+ # You must be the owner of the set, a maintainer (if public), or Admin+.
1034
+ def post_sets_remove_posts(id, post_ids:)
1035
+ request(:post, "/post_sets/#{escape(id)}/remove_posts.json", body: { post_ids: post_ids }, body_type: "application/x-www-form-urlencoded")
1036
+ end
1037
+
1038
+ # List Post Sets For Select
1039
+ #
1040
+ # You must be the owner of the set, a maintainer (if public), or Admin+.
1041
+ def post_sets_for_select()
1042
+ request(:get, "/post_sets/for_select.json")
1043
+ end
1044
+
1045
+ # Post Approvals Index
1046
+ def post_approvals_index(limit: nil, page: nil, search: nil)
1047
+ request(:get, "/post_approvals.json", query: { limit: limit, page: page, search: search })
1048
+ end
1049
+
1050
+ # Post Events Index
1051
+ def post_events_index(limit: nil, page: nil, search: nil, v1: nil)
1052
+ request(:get, "/post_events.json", query: { limit: limit, page: page, search: search, v1: v1 })
1053
+ end
1054
+
1055
+ # Post Deletions Index
1056
+ #
1057
+ # Only lists deletions that haven't been undone, unless `search[is_undeleted]`, `search[undeleted_at]`, `search[id]` or `search[post_id]` is given.
1058
+ def post_deletions_index(limit: nil, page: nil, search: nil)
1059
+ request(:get, "/post_deletions.json", query: { limit: limit, page: page, search: search })
1060
+ end
1061
+
1062
+ # Get Post Deletion
1063
+ def post_deletions_show(id)
1064
+ request(:get, "/post_deletions/#{escape(id)}.json")
1065
+ end
1066
+
1067
+ # Post Flags Index
1068
+ def post_flags_index(limit: nil, page: nil, search: nil)
1069
+ request(:get, "/post_flags.json", query: { limit: limit, page: page, search: search })
1070
+ end
1071
+
1072
+ # Create Post Flag
1073
+ #
1074
+ # Will error if post_id is not provided.
1075
+ def post_flags_create(post_flag:)
1076
+ request(:post, "/post_flags.json", body: { post_flag: post_flag }, body_type: "application/x-www-form-urlencoded")
1077
+ end
1078
+
1079
+ # Get Post Flag
1080
+ def post_flags_show(id)
1081
+ request(:get, "/post_flags/#{escape(id)}.json")
1082
+ end
1083
+
1084
+ # Clear Post Flag Note
1085
+ #
1086
+ # You must be Janitor+
1087
+ def post_flags_clear_note(id)
1088
+ request(:post, "/post_flags/#{escape(id)}/clear_note.json")
1089
+ end
1090
+
1091
+ # Post Replacements Index
1092
+ #
1093
+ # Rejected replacements can only be seen by staff.
1094
+ def post_replacements_index(limit: nil, page: nil, search: nil)
1095
+ request(:get, "/post_replacements.json", query: { limit: limit, page: page, search: search })
1096
+ end
1097
+
1098
+ # Create Post Replacement
1099
+ def post_replacements_create(post_replacement:)
1100
+ request(:post, "/post_replacements.json", body: { post_replacement: post_replacement }, body_type: "multipart/form-data")
1101
+ end
1102
+
1103
+ # Delete Post Replacement
1104
+ #
1105
+ # You must be Admin+.
1106
+ def post_replacements_destroy(id)
1107
+ request(:delete, "/post_replacements/#{escape(id)}.json")
1108
+ end
1109
+
1110
+ # Approve Post Replacement
1111
+ #
1112
+ # You must have the "Approve Posts" permission.
1113
+ def post_replacements_approve(id)
1114
+ request(:put, "/post_replacements/#{escape(id)}/approve.json")
1115
+ end
1116
+
1117
+ # Reject Post Replacement
1118
+ #
1119
+ # You must have the "Approve Posts" permission.
1120
+ def post_replacements_reject(id)
1121
+ request(:put, "/post_replacements/#{escape(id)}/reject.json")
1122
+ end
1123
+
1124
+ # Promote Post Replacement
1125
+ #
1126
+ # You must have the "Approve Posts" permission.
1127
+ def post_replacements_promote(id)
1128
+ request(:post, "/post_replacements/#{escape(id)}/promote.json")
1129
+ end
1130
+
1131
+ # Toggle Post Replacement Penalty
1132
+ #
1133
+ # You must have the "Approve Posts" permission.
1134
+ def post_replacements_toggle_penalize(id)
1135
+ request(:put, "/post_replacements/#{escape(id)}/toggle_penalize.json")
1136
+ end
1137
+
1138
+ # Transfer Post Replacement
1139
+ #
1140
+ # You must have the "Approve Posts" permission.
1141
+ def post_replacements_transfer(id, new_post_id:)
1142
+ request(:put, "/post_replacements/#{escape(id)}/transfer.json", body: { new_post_id: new_post_id }, body_type: "application/x-www-form-urlencoded")
1143
+ end
1144
+
1145
+ # Post Versions Index
1146
+ def post_versions_index(limit: nil, page: nil, search: nil)
1147
+ request(:get, "/post_versions.json", query: { limit: limit, page: page, search: search })
1148
+ end
1149
+
1150
+ # Hide Post Version
1151
+ #
1152
+ # You must be Admin+.
1153
+ def post_versions_hide(id)
1154
+ request(:put, "/post_versions/#{escape(id)}/hide.json")
1155
+ end
1156
+
1157
+ # Unhide Post Version
1158
+ #
1159
+ # You must be Admin+.
1160
+ def post_versions_unhide(id)
1161
+ request(:put, "/post_versions/#{escape(id)}/unhide.json")
1162
+ end
1163
+
1164
+ # Undo Post Version
1165
+ def post_versions_undo(id)
1166
+ request(:put, "/post_versions/#{escape(id)}/undo.json")
1167
+ end
1168
+
1169
+ # Post Votes Index
1170
+ #
1171
+ # You must be Moderator+.
1172
+ def post_votes_index(limit: nil, page: nil, search: nil)
1173
+ request(:get, "/post_votes.json", query: { limit: limit, page: page, search: search })
1174
+ end
1175
+
1176
+ # Lock Post Votes
1177
+ #
1178
+ # You must be Moderator+. Errors if ids is not provided.
1179
+ def post_votes_lock(ids:)
1180
+ request(:post, "/post_votes/lock.json", query: { ids: ids })
1181
+ end
1182
+
1183
+ # Delete Post Votes
1184
+ #
1185
+ # You must be Admin+. Errors if ids is not provided.
1186
+ def post_votes_delete(ids:)
1187
+ request(:post, "/post_votes/delete.json", query: { ids: ids })
1188
+ end
1189
+
1190
+ # List Saved Searches
1191
+ #
1192
+ # Lists the current user's saved searches. New post counts are refreshed when this is called.
1193
+ def saved_searches_index()
1194
+ request(:get, "/saved_searches.json")
1195
+ end
1196
+
1197
+ # Create Saved Search
1198
+ #
1199
+ # Users can have up to 250 saved searches, and track up to 50 of them.
1200
+ # Saved search queries cannot contain wildcard tags or `search:` metatags.
1201
+ def saved_searches_create(saved_search:)
1202
+ request(:post, "/saved_searches.json", body: { saved_search: saved_search }, body_type: "application/x-www-form-urlencoded")
1203
+ end
1204
+
1205
+ # Get Saved Search
1206
+ #
1207
+ # You must be the owner of the saved search. `new_count` is read from cache and may be stale.
1208
+ def saved_searches_show(id)
1209
+ request(:get, "/saved_searches/#{escape(id)}.json")
1210
+ end
1211
+
1212
+ # Update Saved Search
1213
+ #
1214
+ # You must be the owner of the saved search. The subscription search cannot be updated.
1215
+ def saved_searches_update(id, saved_search: nil)
1216
+ request(:patch, "/saved_searches/#{escape(id)}.json", body: { saved_search: saved_search }, body_type: "application/x-www-form-urlencoded")
1217
+ end
1218
+
1219
+ # Delete Saved Search
1220
+ #
1221
+ # You must be the owner of the saved search.
1222
+ def saved_searches_destroy(id)
1223
+ request(:delete, "/saved_searches/#{escape(id)}.json")
1224
+ end
1225
+
1226
+ # Mark All Saved Searches Seen
1227
+ def saved_searches_mark_all_seen()
1228
+ request(:post, "/saved_searches/mark_all_seen.json")
1229
+ end
1230
+
1231
+ # Get Saved Search Badge
1232
+ #
1233
+ # Total new post count across the current user's tracked saved searches. Read from cache only.
1234
+ def saved_searches_badge()
1235
+ request(:get, "/saved_searches/badge.json")
1236
+ end
1237
+
1238
+ # Tags Index
1239
+ def tags_index(limit: nil, page: nil, search: nil)
1240
+ request(:get, "/tags.json", query: { limit: limit, page: page, search: search })
1241
+ end
1242
+
1243
+ # Get Tag
1244
+ def tags_show(id)
1245
+ request(:get, "/tags/#{escape(id)}.json")
1246
+ end
1247
+
1248
+ # Update Tag
1249
+ #
1250
+ # Must be Admin+ if the tag is locked or post count is >100.
1251
+ def tags_update(id, tag: nil)
1252
+ request(:patch, "/tags/#{escape(id)}.json", body: { tag: tag }, body_type: "application/x-www-form-urlencoded")
1253
+ end
1254
+
1255
+ # Delete Tag
1256
+ #
1257
+ # You must have the bd staff user flag.
1258
+ def tags_destroy(id)
1259
+ request(:delete, "/tags/#{escape(id)}.json")
1260
+ end
1261
+
1262
+ # Get Tag Correction
1263
+ def tag_corrections_show(id)
1264
+ request(:get, "/tags/#{escape(id)}/correction.json")
1265
+ end
1266
+
1267
+ # Correct Tag
1268
+ #
1269
+ # You must be Staff+. `commit=Fix` must be set.
1270
+ def tag_corrections_create(id, commit:)
1271
+ request(:post, "/tags/#{escape(id)}/correction.json", body: { commit: commit }, body_type: "application/x-www-form-urlencoded")
1272
+ end
1273
+
1274
+ # Preview Tags
1275
+ def tags_preview(tags:)
1276
+ request(:post, "/tags/preview.json", body: { tags: tags }, body_type: "application/x-www-form-urlencoded")
1277
+ end
1278
+
1279
+ # Tag Type Versions Index
1280
+ def tag_type_versions_index(limit: nil, page: nil, search: nil)
1281
+ request(:get, "/tag_type_versions.json", query: { limit: limit, page: page, search: search })
1282
+ end
1283
+
1284
+ # Tag Aliases Index
1285
+ def tag_aliases_index(limit: nil, page: nil, search: nil)
1286
+ request(:get, "/tag_aliases.json", query: { limit: limit, page: page, search: search })
1287
+ end
1288
+
1289
+ # Get Tag Alias
1290
+ def tag_aliases_show(id)
1291
+ request(:get, "/tag_aliases/#{escape(id)}.json")
1292
+ end
1293
+
1294
+ # Update Tag Alias
1295
+ #
1296
+ # You must be Admin+.
1297
+ def tag_aliases_update(id, tag_alias: nil)
1298
+ request(:patch, "/tag_aliases/#{escape(id)}.json", body: { tag_alias: tag_alias }, body_type: "application/x-www-form-urlencoded")
1299
+ end
1300
+
1301
+ # Reject Tag Alias
1302
+ #
1303
+ # You must be the creator of the request (if pending), or Admin+.
1304
+ def tag_aliases_destroy(id)
1305
+ request(:delete, "/tag_aliases/#{escape(id)}.json")
1306
+ end
1307
+
1308
+ # Approve Tag Alias
1309
+ #
1310
+ # You must be Admin+.
1311
+ def tag_aliases_approve(id)
1312
+ request(:post, "/tag_aliases/#{escape(id)}/approve.json")
1313
+ end
1314
+
1315
+ # Undo Tag Alias
1316
+ #
1317
+ # You must be Admin+.
1318
+ def tag_aliases_undo(id)
1319
+ request(:post, "/tag_aliases/#{escape(id)}/undo.json")
1320
+ end
1321
+
1322
+ # Create Tag Alias
1323
+ #
1324
+ # Errors will result in a 406 with no information.
1325
+ def tag_alias_requests_create(tag_alias_request:)
1326
+ request(:post, "/tag_alias_requests.json", body: { tag_alias_request: tag_alias_request }, body_type: "application/x-www-form-urlencoded")
1327
+ end
1328
+
1329
+ # Tag Implications Index
1330
+ def tag_implications_index(limit: nil, page: nil, search: nil)
1331
+ request(:get, "/tag_implications.json", query: { limit: limit, page: page, search: search })
1332
+ end
1333
+
1334
+ # Get Tag Implication
1335
+ def tag_implications_show(id)
1336
+ request(:get, "/tag_implications/#{escape(id)}.json")
1337
+ end
1338
+
1339
+ # Update Tag Implication
1340
+ #
1341
+ # You must be Admin+.
1342
+ def tag_implications_update(id, tag_implication: nil)
1343
+ request(:patch, "/tag_implications/#{escape(id)}.json", body: { tag_implication: tag_implication }, body_type: "application/x-www-form-urlencoded")
1344
+ end
1345
+
1346
+ # Reject Tag Implication
1347
+ #
1348
+ # You must be the creator of the request (if pending), or Admin+.
1349
+ def tag_implications_destroy(id)
1350
+ request(:delete, "/tag_implications/#{escape(id)}.json")
1351
+ end
1352
+
1353
+ # Approve Tag Implication
1354
+ #
1355
+ # You must be Admin+.
1356
+ def tag_implications_approve(id)
1357
+ request(:post, "/tag_implications/#{escape(id)}/approve.json")
1358
+ end
1359
+
1360
+ # Undo Tag Implication
1361
+ #
1362
+ # You must be Admin+.
1363
+ def tag_implications_undo(id)
1364
+ request(:post, "/tag_implications/#{escape(id)}/undo.json")
1365
+ end
1366
+
1367
+ # Create Tag Implication
1368
+ #
1369
+ # Errors will result in a 406 with no information.
1370
+ def tag_implication_requests_create(tag_implication_request:)
1371
+ request(:post, "/tag_implication_requests.json", body: { tag_implication_request: tag_implication_request }, body_type: "application/x-www-form-urlencoded")
1372
+ end
1373
+
1374
+ # List Tag Subscriptions
1375
+ #
1376
+ # Lists the current user's tag subscriptions, ordered by tag name.
1377
+ def tag_subscriptions_index()
1378
+ request(:get, "/tag_subscriptions.json")
1379
+ end
1380
+
1381
+ # Create Tag Subscriptions
1382
+ #
1383
+ # Subscribes to one or more tags, following aliases. Users can subscribe to up to 500 tags.
1384
+ # Subscribed tags can be searched with the `search:subscriptions` metatag.
1385
+ def tag_subscriptions_create(tag_name: nil, tag_names: nil)
1386
+ request(:post, "/tag_subscriptions.json", body: { tag_name: tag_name, tag_names: tag_names }, body_type: "application/x-www-form-urlencoded")
1387
+ end
1388
+
1389
+ # Delete Tag Subscription
1390
+ #
1391
+ # You must be the owner of the tag subscription.
1392
+ def tag_subscriptions_destroy(id)
1393
+ request(:delete, "/tag_subscriptions/#{escape(id)}.json")
1394
+ end
1395
+
1396
+ # List Bulk Related Tags
1397
+ #
1398
+ # Limited to 300 looked up tags per minute, so each tag in `query` counts once.
1399
+ def related_tags_bulk(query: nil, category_id: nil)
1400
+ request(:post, "/related_tag/bulk.json", body: { query: query, category_id: category_id }, body_type: "application/x-www-form-urlencoded")
1401
+ end
1402
+
1403
+ # Search Trends Index
1404
+ def search_trends_index(day: nil, limit: nil, page: nil)
1405
+ request(:get, "/search_trends.json", query: { day: day, limit: limit, page: page })
1406
+ end
1407
+
1408
+ # List Rising Search Trends
1409
+ #
1410
+ # Tags searched notably more than usual in the last 24 hours, compared to the 24 hours before and the daily average over the previous 7 days.<br>
1411
+ # Ranked by how much they rose, not by search count. Searches from the rising list itself (`ref=rising`) aren't counted.
1412
+ def search_trends_rising()
1413
+ request(:get, "/search_trends/rising.json")
1414
+ end
1415
+
1416
+ # Search Trends Track
1417
+ def search_trends_track(tag: nil)
1418
+ request(:get, "/search_trends/track.json", query: { tag: tag })
1419
+ end
1420
+
1421
+ # Clear Search Trends Cache
1422
+ #
1423
+ # You must be Admin+.
1424
+ def search_trends_clear_cache()
1425
+ request(:post, "/search_trends/clear_cache.json")
1426
+ end
1427
+
1428
+ # Update Search Trends Settings
1429
+ #
1430
+ # You must be Admin+.
1431
+ def search_trends_update_settings(search_trend_settings: nil)
1432
+ request(:post, "/search_trends/update_settings.json", body: { search_trend_settings: search_trend_settings }, body_type: "application/x-www-form-urlencoded")
1433
+ end
1434
+
1435
+ # Purge Search Trends
1436
+ #
1437
+ # You must be Admin+.
1438
+ def search_trends_purge(id)
1439
+ request(:delete, "/search_trends/#{escape(id)}/purge.json")
1440
+ end
1441
+
1442
+ # Search Trend Blacklists Index
1443
+ #
1444
+ # You must be Admin+.
1445
+ def search_trend_blacklists_index(limit: nil, page: nil, search: nil, tag: nil, reason: nil)
1446
+ request(:get, "/search_trend_blacklists.json", query: { limit: limit, page: page, search: search, tag: tag, reason: reason })
1447
+ end
1448
+
1449
+ # Create Search Trend Blacklist
1450
+ #
1451
+ # You must be Admin+.
1452
+ def search_trend_blacklists_create(search_trend_blacklist:)
1453
+ request(:post, "/search_trend_blacklists.json", body: { search_trend_blacklist: search_trend_blacklist }, body_type: "application/x-www-form-urlencoded")
1454
+ end
1455
+
1456
+ # Update Search Trend Blacklist
1457
+ #
1458
+ # You must be Admin+.
1459
+ def search_trend_blacklists_update(id, search_trend_blacklist: nil)
1460
+ request(:patch, "/search_trend_blacklists/#{escape(id)}.json", body: { search_trend_blacklist: search_trend_blacklist }, body_type: "application/x-www-form-urlencoded")
1461
+ end
1462
+
1463
+ # Delete Search Trend Blacklist
1464
+ #
1465
+ # You must be Admin+.
1466
+ def search_trend_blacklists_destroy(id)
1467
+ request(:delete, "/search_trend_blacklists/#{escape(id)}.json")
1468
+ end
1469
+
1470
+ # Search Trend Hourlies Index
1471
+ #
1472
+ # You must be Admin+.
1473
+ def search_trend_hourlies_index(limit: nil, page: nil, search: nil, hour: nil)
1474
+ request(:get, "/search_trend_hourlies.json", query: { limit: limit, page: page, search: search, hour: hour })
1475
+ end
1476
+
1477
+ # Login
1478
+ def sessions_create(authenticity_token:, session:)
1479
+ request(:post, "/session.json", body: { authenticity_token: authenticity_token, session: session }, body_type: "application/x-www-form-urlencoded")
1480
+ end
1481
+
1482
+ # Logout
1483
+ #
1484
+ # Ends the login session on the server, so copies of its cookies stop working too.
1485
+ def sessions_destroy(authenticity_token:)
1486
+ request(:delete, "/session.json", body: { authenticity_token: authenticity_token }, body_type: "application/x-www-form-urlencoded")
1487
+ end
1488
+
1489
+ # Verify TOTP
1490
+ def sessions_verify_totp(authenticity_token:, totp:)
1491
+ request(:post, "/session/verify_totp.json", body: { authenticity_token: authenticity_token, totp: totp }, body_type: "application/x-www-form-urlencoded")
1492
+ end
1493
+
1494
+ # Staff Notes Index
1495
+ def staff_notes_index(limit: nil, page: nil, search: nil)
1496
+ request(:get, "/staff_notes.json", query: { limit: limit, page: page, search: search })
1497
+ end
1498
+
1499
+ # Create Staff Note
1500
+ def staff_notes_create(staff_note:)
1501
+ request(:post, "/staff_notes.json", body: { staff_note: staff_note }, body_type: "application/x-www-form-urlencoded")
1502
+ end
1503
+
1504
+ # Get Staff Note
1505
+ def staff_notes_show(id)
1506
+ request(:get, "/staff_notes/#{escape(id)}.json")
1507
+ end
1508
+
1509
+ # Update Staff Note
1510
+ #
1511
+ # You must be the creator or Admin+.
1512
+ def staff_notes_update(id, staff_note: nil)
1513
+ request(:patch, "/staff_notes/#{escape(id)}.json", body: { staff_note: staff_note }, body_type: "application/x-www-form-urlencoded")
1514
+ end
1515
+
1516
+ # Delete Staff Note
1517
+ #
1518
+ # You must be the creator or Admin+.
1519
+ def staff_notes_delete(id)
1520
+ request(:put, "/staff_notes/#{escape(id)}/delete.json")
1521
+ end
1522
+
1523
+ # Undelete Staff Note
1524
+ #
1525
+ # You must be the creator or Admin+.
1526
+ def staff_notes_undelete(id)
1527
+ request(:put, "/staff_notes/#{escape(id)}/undelete.json")
1528
+ end
1529
+
1530
+ # Takedowns Index
1531
+ def takedowns_index(limit: nil, page: nil, search: nil)
1532
+ request(:get, "/takedowns.json", query: { limit: limit, page: page, search: search })
1533
+ end
1534
+
1535
+ # Create Takedown
1536
+ def takedowns_create(takedown:)
1537
+ request(:post, "/takedowns.json", body: { takedown: takedown }, body_type: "application/x-www-form-urlencoded")
1538
+ end
1539
+
1540
+ # Get Takedown
1541
+ def takedowns_show(id)
1542
+ request(:get, "/takedowns/#{escape(id)}.json")
1543
+ end
1544
+
1545
+ # Update Takedown
1546
+ #
1547
+ # You must have the bd staff user flag.
1548
+ def takedowns_update(id, takedown: nil, takedown_posts: nil, process_takedown: nil, delete_reason: nil)
1549
+ request(:patch, "/takedowns/#{escape(id)}.json", body: { takedown: takedown, takedown_posts: takedown_posts, process_takedown: process_takedown, delete_reason: delete_reason }, body_type: "application/x-www-form-urlencoded")
1550
+ end
1551
+
1552
+ # Delete Takedown
1553
+ #
1554
+ # You must have the bd staff user flag.
1555
+ def takedowns_destroy(id)
1556
+ request(:delete, "/takedowns/#{escape(id)}.json")
1557
+ end
1558
+
1559
+ # Add Posts To Takedown By IDs
1560
+ #
1561
+ # You must have the bd staff user flag.
1562
+ def takedowns_add_by_ids(id, post_ids:)
1563
+ request(:post, "/takedowns/#{escape(id)}/add_by_ids.json", body: { post_ids: post_ids }, body_type: "application/x-www-form-urlencoded")
1564
+ end
1565
+
1566
+ # Add Posts To Takedown By Tags
1567
+ #
1568
+ # You must have the bd staff user flag.
1569
+ def takedowns_add_by_tags(id, post_tags:)
1570
+ request(:post, "/takedowns/#{escape(id)}/add_by_tags.json", body: { post_tags: post_tags }, body_type: "application/x-www-form-urlencoded")
1571
+ end
1572
+
1573
+ # Count Matching Posts
1574
+ #
1575
+ # You must have the bd staff user flag. Deleted posts are not counted.
1576
+ def takedowns_count_matching_posts(id, post_tags:)
1577
+ request(:post, "/takedowns/#{escape(id)}/count_matching_posts.json", body: { post_tags: post_tags }, body_type: "application/x-www-form-urlencoded")
1578
+ end
1579
+
1580
+ # Remove Posts From Takedown By IDs
1581
+ #
1582
+ # You must have the bd staff user flag.
1583
+ def takedowns_remove_by_ids(id, post_ids:)
1584
+ request(:post, "/takedowns/#{escape(id)}/remove_by_ids.json", body: { post_ids: post_ids }, body_type: "application/x-www-form-urlencoded")
1585
+ end
1586
+
1587
+ # Clear Posts
1588
+ #
1589
+ # You must have the bd staff user flag. Removes all posts from the takedown.
1590
+ def takedowns_clear_posts(id)
1591
+ request(:post, "/takedowns/#{escape(id)}/clear_posts.json")
1592
+ end
1593
+
1594
+ # Tickets Index
1595
+ #
1596
+ # You must be Staff+ to see tickets you did not create.
1597
+ def tickets_index(limit: nil, page: nil, search: nil)
1598
+ request(:get, "/tickets.json", query: { limit: limit, page: page, search: search })
1599
+ end
1600
+
1601
+ # Get Ticket
1602
+ #
1603
+ # You must be Staff+ to see tickets you did not create.
1604
+ def tickets_show(id)
1605
+ request(:get, "/tickets/#{escape(id)}.json")
1606
+ end
1607
+
1608
+ # Update Ticket
1609
+ #
1610
+ # You must be Moderator+.
1611
+ def tickets_update(id, ticket:)
1612
+ request(:patch, "/tickets/#{escape(id)}.json", body: { ticket: ticket }, body_type: "application/x-www-form-urlencoded")
1613
+ end
1614
+
1615
+ # Claim Ticket
1616
+ #
1617
+ # You must be Moderator+. Errors are quietly swallowed and shown as notices in html.
1618
+ def tickets_claim(id)
1619
+ request(:post, "/tickets/#{escape(id)}/claim.json")
1620
+ end
1621
+
1622
+ # Unclaim Ticket
1623
+ #
1624
+ # You must be Moderator+. Errors are quietly swallowed and shown as notices in html.
1625
+ def tickets_unclaim(id)
1626
+ request(:post, "/tickets/#{escape(id)}/unclaim.json")
1627
+ end
1628
+
1629
+ # Upload Karma Events Index
1630
+ def upload_karma_events_index(limit: nil, page: nil, search: nil)
1631
+ request(:get, "/upload_karma_events.json", query: { limit: limit, page: page, search: search })
1632
+ end
1633
+
1634
+ # Uploads Index
1635
+ def uploads_index(limit: nil, page: nil, search: nil)
1636
+ request(:get, "/uploads.json", query: { limit: limit, page: page, search: search })
1637
+ end
1638
+
1639
+ # Upload Post
1640
+ def uploads_create(upload:)
1641
+ request(:post, "/uploads.json", body: { upload: upload }, body_type: "multipart/form-data")
1642
+ end
1643
+
1644
+ # Get Upload
1645
+ #
1646
+ # You must be the uploader, or Staff+. Can be polled while an upload is processing.
1647
+ def uploads_show(id)
1648
+ request(:get, "/uploads/#{escape(id)}.json")
1649
+ end
1650
+
1651
+ # Upload URL Rules Index
1652
+ def upload_url_rules_index(limit: nil, page: nil, search: nil)
1653
+ request(:get, "/upload_url_rules.json", query: { limit: limit, page: page, search: search })
1654
+ end
1655
+
1656
+ # Check URL Against Upload URL Rules
1657
+ #
1658
+ # Checks a direct upload url against the enabled rules. The first matching `block` rule wins, otherwise the first matching `recommend` rule.<br>
1659
+ # Limited to 60 requests per minute.
1660
+ def upload_url_rules_check(url:)
1661
+ request(:get, "/upload_url_rules/check.json", query: { url: url })
1662
+ end
1663
+
1664
+ # Upload Whitelists Index
1665
+ def upload_whitelists_index(limit: nil, page: nil, search: nil)
1666
+ request(:get, "/upload_whitelists.json", query: { limit: limit, page: page, search: search })
1667
+ end
1668
+
1669
+ # Create Upload Whitelist
1670
+ #
1671
+ # You must be Admin+.
1672
+ def upload_whitelists_create(upload_whitelist:)
1673
+ request(:post, "/upload_whitelists.json", body: { upload_whitelist: upload_whitelist }, body_type: "application/x-www-form-urlencoded")
1674
+ end
1675
+
1676
+ # Update Upload Whitelist
1677
+ def upload_whitelists_update(id, upload_whitelist: nil)
1678
+ request(:patch, "/upload_whitelists/#{escape(id)}.json", body: { upload_whitelist: upload_whitelist }, body_type: "application/x-www-form-urlencoded")
1679
+ end
1680
+
1681
+ # Delete Upload Whitelist
1682
+ #
1683
+ # You must be Admin+.
1684
+ def upload_whitelists_destroy(id)
1685
+ request(:delete, "/upload_whitelists/#{escape(id)}.json")
1686
+ end
1687
+
1688
+ # Check If URL Is Allowed
1689
+ def upload_whitelists_is_allowed(url: nil)
1690
+ request(:get, "/upload_whitelists/is_allowed.json", query: { url: url })
1691
+ end
1692
+
1693
+ # Users Index
1694
+ def users_index(limit: nil, page: nil, search: nil)
1695
+ request(:get, "/users.json", query: { limit: limit, page: page, search: search })
1696
+ end
1697
+
1698
+ # Get Current User
1699
+ #
1700
+ # This will return the default settings for anonymous users if no authentication is used.
1701
+ # This most interesting part is probably the default blacklist, located in `blacklisted_tags`.
1702
+ def users_me()
1703
+ request(:get, "/users/me.json")
1704
+ end
1705
+
1706
+ # Get Avatar Menu
1707
+ def users_avatar_menu()
1708
+ request(:get, "/users/avatar_menu.json")
1709
+ end
1710
+
1711
+ # Get Upload Tags
1712
+ #
1713
+ # Returns the current user's favorite tags and recently used tags, for use in the upload tag editor.
1714
+ def users_upload_tags()
1715
+ request(:get, "/users/upload_tags.json")
1716
+ end
1717
+
1718
+ # Get User
1719
+ def users_show(id_or_name)
1720
+ request(:get, "/users/#{escape(id_or_name)}.json")
1721
+ end
1722
+
1723
+ # Update Current User
1724
+ def users_update(id_or_name, user: nil)
1725
+ request(:patch, "/users/#{escape(id_or_name)}.json", body: { user: user }, body_type: "application/x-www-form-urlencoded")
1726
+ end
1727
+
1728
+ # Get User Upload Limit
1729
+ def users_upload_limit(id_or_name)
1730
+ request(:get, "/users/#{escape(id_or_name)}/upload_limit.json")
1731
+ end
1732
+
1733
+ # Clear User Favorites
1734
+ #
1735
+ # You must be Admin+.
1736
+ def users_flush_favorites(id_or_name)
1737
+ request(:post, "/users/#{escape(id_or_name)}/flush_favorites.json")
1738
+ end
1739
+
1740
+ # Staff Fix User Counts
1741
+ #
1742
+ # You must be Janitor+.
1743
+ def users_fix_counts(id_or_name)
1744
+ request(:get, "/users/#{escape(id_or_name)}/fix_counts.json")
1745
+ end
1746
+
1747
+ # Fix User Counts
1748
+ def maintenance_user_count_fixes_create()
1749
+ request(:post, "/maintenance/user/count_fixes.json")
1750
+ end
1751
+
1752
+ # Update User Dmail Filter
1753
+ def maintenance_user_dmail_filters_update(dmail_id:, dmail_filter:)
1754
+ request(:patch, "/maintenance/user/dmail_filter.json", query: { dmail_id: dmail_id }, body: { dmail_filter: dmail_filter }, body_type: "application/x-www-form-urlencoded")
1755
+ end
1756
+
1757
+ # Update Avatar Crop
1758
+ def maintenance_user_avatars_update(avatar_crop_x:, avatar_crop_y:, avatar_crop_w:)
1759
+ request(:patch, "/maintenance/user/avatar.json", body: { avatar_crop_x: avatar_crop_x, avatar_crop_y: avatar_crop_y, avatar_crop_w: avatar_crop_w }, body_type: "application/x-www-form-urlencoded")
1760
+ end
1761
+
1762
+ # User Feedbacks Index
1763
+ def user_feedbacks_index(limit: nil, page: nil, search: nil)
1764
+ request(:get, "/user_feedbacks.json", query: { limit: limit, page: page, search: search })
1765
+ end
1766
+
1767
+ # Create User Feedback
1768
+ #
1769
+ # You must be Moderator+.
1770
+ def user_feedbacks_create(user_feedback:)
1771
+ request(:post, "/user_feedbacks.json", body: { user_feedback: user_feedback }, body_type: "application/x-www-form-urlencoded")
1772
+ end
1773
+
1774
+ # Get User Feedback
1775
+ #
1776
+ # You must be Staff+ if the feedback is deleted.
1777
+ def user_feedbacks_show(id)
1778
+ request(:get, "/user_feedbacks/#{escape(id)}.json")
1779
+ end
1780
+
1781
+ # Update User Feedback
1782
+ #
1783
+ # You must be Moderator+.
1784
+ def user_feedbacks_update(id, user_feedback: nil)
1785
+ request(:patch, "/user_feedbacks/#{escape(id)}.json", body: { user_feedback: user_feedback }, body_type: "application/x-www-form-urlencoded")
1786
+ end
1787
+
1788
+ # Destroy User Feedback
1789
+ #
1790
+ # You must be Admin+, or the creator and Moderator+.
1791
+ def user_feedbacks_destroy(id)
1792
+ request(:delete, "/user_feedbacks/#{escape(id)}.json")
1793
+ end
1794
+
1795
+ # Delete User Feedback
1796
+ #
1797
+ # You must be Moderator+.
1798
+ def user_feedbacks_delete(id)
1799
+ request(:put, "/user_feedbacks/#{escape(id)}/delete.json")
1800
+ end
1801
+
1802
+ # Undelete User Feedback
1803
+ #
1804
+ # You must be Moderator+.
1805
+ def user_feedbacks_undelete(id)
1806
+ request(:put, "/user_feedbacks/#{escape(id)}/undelete.json")
1807
+ end
1808
+
1809
+ # User Name Change Requests Index
1810
+ #
1811
+ # You must be Moderator+.
1812
+ def user_name_change_requests_index(limit: nil, page: nil, search: nil)
1813
+ request(:get, "/user_name_change_requests.json", query: { limit: limit, page: page, search: search })
1814
+ end
1815
+
1816
+ # Create User Name Change Request
1817
+ #
1818
+ # Requires [browser authentication](#operations-Sessions-login) (username & password), as well as hourly password confirmations (reauthentication).
1819
+ def user_name_change_requests_create(authenticity_token:, user_name_change_request:)
1820
+ request(:post, "/user_name_change_requests.json", body: { authenticity_token: authenticity_token, user_name_change_request: user_name_change_request }, body_type: "application/x-www-form-urlencoded")
1821
+ end
1822
+
1823
+ # Get User Name Change Request
1824
+ #
1825
+ # You must be the creator of the request or Moderator+.
1826
+ def user_name_change_requests_show(id)
1827
+ request(:get, "/user_name_change_requests/#{escape(id)}.json")
1828
+ end
1829
+
1830
+ # Delete User Name Change Request
1831
+ #
1832
+ # You must be Moderator+.
1833
+ def user_name_change_requests_destroy(id)
1834
+ request(:delete, "/user_name_change_requests/#{escape(id)}.json")
1835
+ end
1836
+
1837
+ # Wiki Pages Index
1838
+ def wiki_pages_index(limit: nil, page: nil, search: nil)
1839
+ request(:get, "/wiki_pages.json", query: { limit: limit, page: page, search: search })
1840
+ end
1841
+
1842
+ # Create Wiki Page
1843
+ def wiki_pages_create(wiki_page:)
1844
+ request(:post, "/wiki_pages.json", body: { wiki_page: wiki_page }, body_type: "application/x-www-form-urlencoded")
1845
+ end
1846
+
1847
+ # Get Wiki Page
1848
+ def wiki_pages_show(id)
1849
+ request(:get, "/wiki_pages/#{escape(id)}.json")
1850
+ end
1851
+
1852
+ # Update Wiki Page
1853
+ #
1854
+ # You must be Staff+ if the wiki page is locked.
1855
+ def wiki_pages_update(id, wiki_page: nil)
1856
+ request(:patch, "/wiki_pages/#{escape(id)}.json", body: { wiki_page: wiki_page }, body_type: "application/x-www-form-urlencoded")
1857
+ end
1858
+
1859
+ # Delete Wiki Page
1860
+ #
1861
+ # You must be Admin+
1862
+ def wiki_pages_destroy(id)
1863
+ request(:delete, "/wiki_pages/#{escape(id)}.json")
1864
+ end
1865
+
1866
+ # Revert Wiki Page
1867
+ def wiki_pages_revert(id, version_id:)
1868
+ request(:put, "/wiki_pages/#{escape(id)}/revert.json", query: { version_id: version_id })
1869
+ end
1870
+
1871
+ # Wiki Page Versions Index
1872
+ def wiki_page_versions_index(limit: nil, page: nil, search: nil)
1873
+ request(:get, "/wiki_page_versions.json", query: { limit: limit, page: page, search: search })
1874
+ end
1875
+
1876
+ # Get Wiki Page Version
1877
+ def wiki_page_versions_show(id)
1878
+ request(:get, "/wiki_page_versions/#{escape(id)}.json")
1879
+ end
1880
+
1881
+ # Admin Edit User
1882
+ #
1883
+ # You must be Admin+. If editing an Admin+, you must be Owner+.
1884
+ def staff_users_update(id, user: nil)
1885
+ request(:patch, "/staff/users/#{escape(id)}.json", body: { user: user }, body_type: "application/x-www-form-urlencoded")
1886
+ end
1887
+
1888
+ # Audit User DMails
1889
+ #
1890
+ # Must have the bd auditor user flag.
1891
+ def staff_dmails_index(user_id, limit: nil, page: nil)
1892
+ request(:get, "/staff/users/#{escape(user_id)}/dmails.json", query: { limit: limit, page: page })
1893
+ end
1894
+
1895
+ # Audit User DMail
1896
+ #
1897
+ # Must have the bd auditor user flag.
1898
+ def staff_dmails_show(user_id, id)
1899
+ request(:get, "/staff/users/#{escape(user_id)}/dmails/#{escape(id)}.json")
1900
+ end
1901
+
1902
+ # Get Automod DMails
1903
+ #
1904
+ # You must be Staff+.
1905
+ def staff_automod_dmails_index(limit: nil, page: nil, search: nil)
1906
+ request(:get, "/staff/automod_dmails.json", query: { limit: limit, page: page, search: search })
1907
+ end
1908
+
1909
+ # Get Automod DMail
1910
+ #
1911
+ # You must be Staff+.
1912
+ def staff_automod_dmails_show(id)
1913
+ request(:get, "/staff/automod_dmails/#{escape(id)}.json")
1914
+ end
1915
+
1916
+ # Mark Automod DMail As Read
1917
+ #
1918
+ # You must be Staff+.
1919
+ def staff_automod_dmails_mark_as_read(id)
1920
+ request(:put, "/staff/automod_dmails/#{escape(id)}/mark_as_read.json")
1921
+ end
1922
+
1923
+ # Mark Automod DMail As Unread
1924
+ #
1925
+ # You must be Staff+.
1926
+ def staff_automod_dmails_mark_as_unread(id)
1927
+ request(:put, "/staff/automod_dmails/#{escape(id)}/mark_as_unread.json")
1928
+ end
1929
+
1930
+ # Get Exception Logs
1931
+ #
1932
+ # You must be Staff+.
1933
+ def staff_exceptions_index(limit: nil, page: nil, search: nil)
1934
+ request(:get, "/staff/exceptions.json", query: { limit: limit, page: page, search: search })
1935
+ end
1936
+
1937
+ # Get Exception Log
1938
+ #
1939
+ # You must be Staff+.
1940
+ def staff_exceptions_show(id)
1941
+ request(:get, "/staff/exceptions/#{escape(id)}.json")
1942
+ end
1943
+
1944
+ # Delete Post
1945
+ #
1946
+ # You must have the "Approve Posts" permission. `commit=Delete` must be set.
1947
+ def staff_post_posts_delete(id, reason: nil, move_favorites: nil, copy_sources: nil, copy_tags: nil, dmail: nil, dmail_title: nil, commit: nil)
1948
+ request(:post, "/staff/post/posts/#{escape(id)}/delete.json", body: { reason: reason, move_favorites: move_favorites, copy_sources: copy_sources, copy_tags: copy_tags, dmail: dmail, dmail_title: dmail_title, commit: commit }, body_type: "application/x-www-form-urlencoded")
1949
+ end
1950
+
1951
+ # Undelete Post
1952
+ #
1953
+ # You must have the "Approve Posts" permission.
1954
+ def staff_post_posts_undelete(id)
1955
+ request(:post, "/staff/post/posts/#{escape(id)}/undelete.json")
1956
+ end
1957
+
1958
+ # Regenerate Post Thumbnails
1959
+ #
1960
+ # You must be Janitor+.
1961
+ def staff_post_posts_regenerate_thumbnails(id)
1962
+ request(:post, "/staff/post/posts/#{escape(id)}/regenerate_thumbnails.json")
1963
+ end
1964
+
1965
+ # Regenerate Post Videos
1966
+ #
1967
+ # You must be Janitor+.
1968
+ def staff_post_posts_regenerate_videos(id)
1969
+ request(:post, "/staff/post/posts/#{escape(id)}/regenerate_videos.json")
1970
+ end
1971
+
1972
+ # Expunge Post
1973
+ #
1974
+ # You must have the "Approve Posts" permission and be Admin+.
1975
+ def staff_post_posts_expunge(id, reason: nil)
1976
+ request(:post, "/staff/post/posts/#{escape(id)}/expunge.json", body: { reason: reason }, body_type: "application/x-www-form-urlencoded")
1977
+ end
1978
+
1979
+ # Move Post Favorites
1980
+ #
1981
+ # You must have the "Approve Posts" permission. `commit=Submit`` must be set.
1982
+ def staff_post_posts_move_favorites(id, commit:)
1983
+ request(:post, "/staff/post/posts/#{escape(id)}/move_favorites.json", body: { commit: commit }, body_type: "application/x-www-form-urlencoded")
1984
+ end
1985
+
1986
+ # AI Check Post
1987
+ #
1988
+ # You must be Janitor+.
1989
+ def staff_post_posts_ai_check(id)
1990
+ request(:get, "/staff/post/posts/#{escape(id)}/ai_check.json")
1991
+ end
1992
+
1993
+ # Get Post Previous Owners
1994
+ #
1995
+ # You must be an Approver
1996
+ def staff_post_posts_previous_owners(id)
1997
+ request(:get, "/staff/post/posts/#{escape(id)}/previous_owners.json")
1998
+ end
1999
+
2000
+ # Reown Post
2001
+ #
2002
+ # You must have be Janitor+ and an Approver
2003
+ def staff_post_posts_reowner(id, reowner:)
2004
+ request(:post, "/staff/post/posts/#{escape(id)}/reowner.json", body: { reowner: reowner }, body_type: "application/x-www-form-urlencoded")
2005
+ end
2006
+
2007
+ # Approve Post
2008
+ #
2009
+ # You must have the "Approve Posts" permission.
2010
+ def staff_post_approvals_create(post_id:)
2011
+ request(:post, "/staff/post/approval.json", body: { post_id: post_id }, body_type: "application/x-www-form-urlencoded")
2012
+ end
2013
+
2014
+ # Unapprove Post
2015
+ #
2016
+ # You must have the "Approve Posts" permission. The response does not differ for success or failure.
2017
+ def staff_post_approvals_destroy(post_id:)
2018
+ request(:delete, "/staff/post/approval.json", body: { post_id: post_id }, body_type: "application/x-www-form-urlencoded")
2019
+ end
2020
+
2021
+ # Get User Alts
2022
+ #
2023
+ # You must be Moderator+.
2024
+ def staff_user_alts_show(user_id:)
2025
+ request(:get, "/staff/user_alts.json", query: { user_id: user_id })
2026
+ end
2027
+
2028
+ # Clear User Avatar
2029
+ #
2030
+ # You must be Moderator+.
2031
+ def staff_user_cleanups_clear_avatar(id)
2032
+ request(:post, "/staff/user_cleanups/#{escape(id)}/clear_avatar.json")
2033
+ end
2034
+
2035
+ # Clear User Profile
2036
+ #
2037
+ # You must be Moderator+.
2038
+ def staff_user_cleanups_clear_profile(id)
2039
+ request(:post, "/staff/user_cleanups/#{escape(id)}/clear_profile.json")
2040
+ end
2041
+
2042
+ # Hide User Comments
2043
+ #
2044
+ # You must be Moderator+.
2045
+ def staff_user_cleanups_hide_comments(id)
2046
+ request(:post, "/staff/user_cleanups/#{escape(id)}/hide_comments.json")
2047
+ end
2048
+
2049
+ # Hide User Forum Posts
2050
+ #
2051
+ # You must be Moderator+.
2052
+ def staff_user_cleanups_hide_forum_posts(id)
2053
+ request(:post, "/staff/user_cleanups/#{escape(id)}/hide_forum_posts.json")
2054
+ end
2055
+
2056
+ # Hide User Blips
2057
+ #
2058
+ # You must be Moderator+.
2059
+ def staff_user_cleanups_hide_blips(id)
2060
+ request(:post, "/staff/user_cleanups/#{escape(id)}/hide_blips.json")
2061
+ end
2062
+
2063
+ # Post Disapprovals Index
2064
+ #
2065
+ # You must have the "Approve Posts" permission.
2066
+ def staff_post_disapprovals_index(limit: nil, page: nil, search: nil)
2067
+ request(:get, "/staff/post/disapprovals.json", query: { limit: limit, page: page, search: search })
2068
+ end
2069
+
2070
+ # Create Post Disapproval
2071
+ #
2072
+ # You must have the "Approve Posts" permission.
2073
+ def staff_post_disapprovals_create(post_disapproval:)
2074
+ request(:post, "/staff/post/disapprovals.json", body: { post_disapproval: post_disapproval }, body_type: "application/x-www-form-urlencoded")
2075
+ end
2076
+
2077
+ # Staff Files Index
2078
+ #
2079
+ # You must be Staff+.
2080
+ def staff_files_index(limit: nil, page: nil, search: nil)
2081
+ request(:get, "/staff/files.json", query: { limit: limit, page: page, search: search })
2082
+ end
2083
+
2084
+ # Create Staff File
2085
+ #
2086
+ # You must be Staff+
2087
+ def staff_files_create(staff_file:)
2088
+ request(:post, "/staff/files.json", body: { staff_file: staff_file }, body_type: "multipart/form-data")
2089
+ end
2090
+
2091
+ # Get Staff File
2092
+ #
2093
+ # You must be Staff+.
2094
+ def staff_files_show(id)
2095
+ request(:get, "/staff/files/#{escape(id)}.json")
2096
+ end
2097
+
2098
+ # Update Staff File
2099
+ #
2100
+ # You must be Admin+ if you did not create the file, else Staff+
2101
+ def staff_files_update(id, staff_file: nil)
2102
+ request(:patch, "/staff/files/#{escape(id)}.json", body: { staff_file: staff_file }, body_type: "application/x-www-form-urlencoded")
2103
+ end
2104
+
2105
+ # Delete Staff File
2106
+ #
2107
+ # You must be Admin+ if you did not created the file, else Staff+
2108
+ def staff_files_destroy(id)
2109
+ request(:delete, "/staff/files/#{escape(id)}.json")
2110
+ end
2111
+
2112
+ # Staff Wikis Index
2113
+ #
2114
+ # You must be Staff+.
2115
+ def staff_wikis_index(limit: nil, page: nil, search: nil)
2116
+ request(:get, "/staff/wikis.json", query: { limit: limit, page: page, search: search })
2117
+ end
2118
+
2119
+ # Create Staff Wiki
2120
+ #
2121
+ # You must be Staff+
2122
+ def staff_wikis_create(staff_wiki:)
2123
+ request(:post, "/staff/wikis.json", body: { staff_wiki: staff_wiki }, body_type: "application/x-www-form-urlencoded")
2124
+ end
2125
+
2126
+ # Get Staff Wiki
2127
+ #
2128
+ # You must be Staff+.
2129
+ def staff_wikis_show(id)
2130
+ request(:get, "/staff/wikis/#{escape(id)}.json")
2131
+ end
2132
+
2133
+ # Update Staff Wiki
2134
+ #
2135
+ # You must be Staff+
2136
+ def staff_wikis_update(id, staff_wiki: nil)
2137
+ request(:patch, "/staff/wikis/#{escape(id)}.json", body: { staff_wiki: staff_wiki }, body_type: "application/x-www-form-urlencoded")
2138
+ end
2139
+
2140
+ # Delete Staff Wiki
2141
+ #
2142
+ # You must be Staff+.
2143
+ def staff_wikis_destroy(id)
2144
+ request(:delete, "/staff/wikis/#{escape(id)}.json")
2145
+ end
2146
+
2147
+ # Claim Staff Wiki
2148
+ #
2149
+ # You must be Staff+
2150
+ def staff_wikis_claim(id)
2151
+ request(:post, "/staff/wikis/#{escape(id)}/claim.json")
2152
+ end
2153
+
2154
+ # Unclaim Staff Wiki
2155
+ #
2156
+ # You must be Staff+
2157
+ def staff_wikis_unclaim(id)
2158
+ request(:post, "/staff/wikis/#{escape(id)}/unclaim.json")
2159
+ end
2160
+
2161
+ # Revert Staff Wiki
2162
+ def staff_wikis_revert(id, version_id:)
2163
+ request(:put, "/staff/wikis/#{escape(id)}/revert.json", query: { version_id: version_id })
2164
+ end
2165
+
2166
+ # Staff Wiki Versions Index
2167
+ #
2168
+ # You must be Staff+.
2169
+ def staff_wiki_versions_index(limit: nil, page: nil, search: nil)
2170
+ request(:get, "/staff/wiki_versions.json", query: { limit: limit, page: page, search: search })
2171
+ end
2172
+
2173
+ # Get Staff Wiki Version
2174
+ #
2175
+ # You must be Staff+.
2176
+ def staff_wiki_versions_show(id)
2177
+ request(:get, "/staff/wiki_versions/#{escape(id)}.json")
2178
+ end
2179
+
2180
+ # Get Vote Trends
2181
+ #
2182
+ # You must be Staff+.
2183
+ def staff_vote_trends_index(limit: nil, user:, disable_vote_normality: nil, threshold: nil, duration: nil)
2184
+ request(:get, "/staff/vote_trends.json", query: { limit: limit, user: user, disable_vote_normality: disable_vote_normality, threshold: threshold, duration: duration })
2185
+ end
2186
+
2187
+ # Staff IP Addrs Index
2188
+ #
2189
+ # You must be Admin+.
2190
+ def staff_ip_addrs_index(search: nil)
2191
+ request(:get, "/staff/ip_addrs.json", query: { search: search })
2192
+ end
2193
+
2194
+ # Staff IP Addrs Export
2195
+ #
2196
+ # You must be Admin+. Nothing will be returned if one of the `user_id`/`user_name` search options is not specified.
2197
+ def staff_ip_addrs_export(search: nil)
2198
+ request(:get, "/staff/ip_addrs/export.json", query: { search: search })
2199
+ end
2200
+
2201
+ # Reown Posts
2202
+ def staff_reowner_create(reowner:)
2203
+ request(:post, "/staff/reowner.json", body: { reowner: reowner }, body_type: "application/x-www-form-urlencoded")
2204
+ end
2205
+
2206
+ # Stuck DNP
2207
+ def staff_stuck_dnp_create(stuck_dnp:)
2208
+ request(:post, "/staff/stuck_dnp.json", body: { stuck_dnp: stuck_dnp }, body_type: "application/x-www-form-urlencoded")
2209
+ end
2210
+
2211
+ # Get Site Stats
2212
+ def stats_index()
2213
+ request(:get, "/stats.json")
2214
+ end
2215
+ end
2216
+ end