/
installer.clj
71 lines (58 loc) · 1.85 KB
/
installer.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
(ns happygapi.sasportal.installer
"SAS Portal API: installer.
See: https://developers.google.com/spectrum-access-system/api/reference/rest/v1alpha1/installer"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn generateSecret$
"https://developers.google.com/spectrum-access-system/api/reference/rest/v1alpha1/installer/generateSecret
Required parameters: none
Optional parameters: none
Body:
{}
Generates a secret to be used with the ValidateInstaller method"
{:scopes ["https://www.googleapis.com/auth/userinfo.email"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{})]}
(util/get-response
(http/post
(util/get-url
"https://sasportal.googleapis.com/"
"v1alpha1/installer:generateSecret"
#{}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))
(defn validate$
"https://developers.google.com/spectrum-access-system/api/reference/rest/v1alpha1/installer/validate
Required parameters: none
Optional parameters: none
Body:
{:installerId string, :secret string, :encodedSecret string}
Validates the identity of a Certified Professional Installer (CPI)."
{:scopes ["https://www.googleapis.com/auth/userinfo.email"]}
[auth parameters body]
{:pre [(util/has-keys? parameters #{})]}
(util/get-response
(http/post
(util/get-url
"https://sasportal.googleapis.com/"
"v1alpha1/installer:validate"
#{}
parameters)
(merge-with
merge
{:content-type :json,
:body (json/generate-string body),
:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))