/
channels.clj
52 lines (46 loc) · 1.46 KB
/
channels.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
(ns happygapi.calendar.channels
"Calendar API: channels.
Manipulates events and other calendar data.
See: https://developers.google.com/google-apps/calendar/firstappapi/reference/rest/v3/channels"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn stop$
"https://developers.google.com/google-apps/calendar/firstappapi/reference/rest/v3/channels/stop
Required parameters: none
Optional parameters: none
Body:
{:address string,
:resourceUri string,
:payload boolean,
:expiration string,
:params {},
:type string,
:resourceId string,
:token string,
:id string,
:kind string}
Stop watching resources through this channel"
{:scopes ["https://www.googleapis.com/auth/calendar"
"https://www.googleapis.com/auth/calendar.events"
"https://www.googleapis.com/auth/calendar.events.readonly"
"https://www.googleapis.com/auth/calendar.readonly"
"https://www.googleapis.com/auth/calendar.settings.readonly"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{})]}
(util/get-response
(http/post
(util/get-url
"https://www.googleapis.com/calendar/v3/"
"channels/stop"
#{}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))