-
Notifications
You must be signed in to change notification settings - Fork 4
/
namespaces.clj
72 lines (62 loc) · 2.19 KB
/
namespaces.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.proximitybeacon.namespaces
"Proximity Beacon API: namespaces.
Registers, manages, indexes, and searches beacons.
See: https://developers.google.com/beacons/proximity/api/reference/rest/v1beta1/namespaces"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn update$
"https://developers.google.com/beacons/proximity/api/reference/rest/v1beta1/namespaces/update
Required parameters: namespaceName
Optional parameters: projectId
Body:
{:servingVisibility string, :namespaceName string}
Updates the information about the specified namespace. Only the namespace
visibility can be updated."
{:scopes ["https://www.googleapis.com/auth/userlocation.beacon.registry"]}
[auth args body]
{:pre [(util/has-keys? args #{:namespaceName})]}
(util/get-response
(http/put
(util/get-url
"https://proximitybeacon.googleapis.com/"
"v1beta1/{+namespaceName}"
#{:namespaceName}
args)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn list$
"https://developers.google.com/beacons/proximity/api/reference/rest/v1beta1/namespaces/list
Required parameters: none
Optional parameters: projectId
Lists all attachment namespaces owned by your Google Developers Console
project. Attachment data associated with a beacon must include a
namespaced type, and the namespace must be owned by your project.
Authenticate using an [OAuth access
token](https://developers.google.com/identity/protocols/OAuth2) from a
signed-in user with **viewer**, **Is owner** or **Can edit** permissions in
the Google Developers Console project."
{:scopes ["https://www.googleapis.com/auth/userlocation.beacon.registry"]}
[auth args]
{:pre [(util/has-keys? args #{})]}
(util/get-response
(http/get
(util/get-url
"https://proximitybeacon.googleapis.com/"
"v1beta1/namespaces"
#{}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))