/
operations.clj
40 lines (36 loc) · 1.5 KB
/
operations.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
(ns happygapi.cloudsearch.operations
"Cloud Search API: operations.
Cloud Search provides cloud-based search capabilities over G Suite data. The Cloud Search API allows indexing of non-G Suite data into Cloud Search.
See: https://developers.google.com/cloud-search/docs/guides/api/reference/rest/v1/operations"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn get$
"https://developers.google.com/cloud-search/docs/guides/api/reference/rest/v1/operations/get
Required parameters: name
Optional parameters: none
Gets the latest state of a long-running operation. Clients can use this
method to poll the operation result at intervals as recommended by the API
service."
{:scopes ["https://www.googleapis.com/auth/cloud_search"
"https://www.googleapis.com/auth/cloud_search.debug"
"https://www.googleapis.com/auth/cloud_search.indexing"
"https://www.googleapis.com/auth/cloud_search.settings"
"https://www.googleapis.com/auth/cloud_search.settings.indexing"
"https://www.googleapis.com/auth/cloud_search.settings.query"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/get
(util/get-url
"https://cloudsearch.googleapis.com/"
"v1/{+name}"
#{:name}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))