-
Notifications
You must be signed in to change notification settings - Fork 4
/
liveChatBans.clj
72 lines (63 loc) · 1.93 KB
/
liveChatBans.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
(ns happygapi.youtube.liveChatBans
"YouTube Data API: liveChatBans.
Supports core YouTube features, such as uploading videos, creating and managing playlists, searching for content, and much more.
See: https://developers.google.com/youtube/v3api/reference/rest/v3/liveChatBans"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn delete$
"https://developers.google.com/youtube/v3api/reference/rest/v3/liveChatBans/delete
Required parameters: id
Optional parameters: none
Removes a chat ban."
{:scopes ["https://www.googleapis.com/auth/youtube"
"https://www.googleapis.com/auth/youtube.force-ssl"]}
[auth args]
{:pre [(util/has-keys? args #{:id})]}
(util/get-response
(http/delete
(util/get-url
"https://www.googleapis.com/youtube/v3/"
"liveChat/bans"
#{:id}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn insert$
"https://developers.google.com/youtube/v3api/reference/rest/v3/liveChatBans/insert
Required parameters: part
Optional parameters: none
Body:
{:etag string,
:id string,
:kind string,
:snippet {:banDurationSeconds string,
:bannedUserDetails ChannelProfileDetails,
:liveChatId string,
:type string}}
Adds a new ban to the chat."
{:scopes ["https://www.googleapis.com/auth/youtube"
"https://www.googleapis.com/auth/youtube.force-ssl"]}
[auth args body]
{:pre [(util/has-keys? args #{:part})]}
(util/get-response
(http/post
(util/get-url
"https://www.googleapis.com/youtube/v3/"
"liveChat/bans"
#{:part}
args)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))