-
Notifications
You must be signed in to change notification settings - Fork 4
/
apis.clj
57 lines (51 loc) · 1.5 KB
/
apis.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
(ns happygapi.discovery.apis
"API Discovery Service: apis.
Provides information about other Google APIs, such as what APIs are available, the resource, and method details for each API.
See: https://developers.google.com/discovery/api/reference/rest/v1/apis"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn getRest$
"https://developers.google.com/discovery/api/reference/rest/v1/apis/getRest
Required parameters: api, version
Optional parameters: none
Retrieve the description of a particular version of an api."
{:scopes nil}
[auth args]
{:pre [(util/has-keys? args #{:api :version})]}
(util/get-response
(http/get
(util/get-url
"https://www.googleapis.com/discovery/v1/"
"apis/{api}/{version}/rest"
#{:api :version}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn list$
"https://developers.google.com/discovery/api/reference/rest/v1/apis/list
Required parameters: none
Optional parameters: name, preferred
Retrieve the list of APIs supported at this endpoint."
{:scopes nil}
[auth args]
{:pre [(util/has-keys? args #{})]}
(util/get-response
(http/get
(util/get-url
"https://www.googleapis.com/discovery/v1/"
"apis"
#{}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))