-
Notifications
You must be signed in to change notification settings - Fork 4
/
organizations.clj
85 lines (76 loc) · 2.65 KB
/
organizations.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
73
74
75
76
77
78
79
80
81
82
83
84
85
(ns happygapi.cloudprivatecatalog.organizations
"Cloud Private Catalog API: organizations.
Enable cloud users to discover enterprise catalogs and products in their organizations.
See: https://cloud.google.com/private-catalog/api/reference/rest/v1beta1/organizations"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn catalogs-search$
"https://cloud.google.com/private-catalog/api/reference/rest/v1beta1/organizations/catalogs/search
Required parameters: resource
Optional parameters: query, pageToken, pageSize
Search Catalog resources that consumers have access to, within the
scope of the consumer cloud resource hierarchy context."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"]}
[auth args]
{:pre [(util/has-keys? args #{:resource})]}
(util/get-response
(http/get
(util/get-url
"https://cloudprivatecatalog.googleapis.com/"
"v1beta1/{+resource}/catalogs:search"
#{:resource}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn versions-search$
"https://cloud.google.com/private-catalog/api/reference/rest/v1beta1/organizations/versions/search
Required parameters: resource
Optional parameters: pageToken, pageSize, query
Search Version resources that consumers have access to, within the
scope of the consumer cloud resource hierarchy context."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"]}
[auth args]
{:pre [(util/has-keys? args #{:resource})]}
(util/get-response
(http/get
(util/get-url
"https://cloudprivatecatalog.googleapis.com/"
"v1beta1/{+resource}/versions:search"
#{:resource}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))
(defn products-search$
"https://cloud.google.com/private-catalog/api/reference/rest/v1beta1/organizations/products/search
Required parameters: resource
Optional parameters: query, pageToken, pageSize
Search Product resources that consumers have access to, within the
scope of the consumer cloud resource hierarchy context."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"]}
[auth args]
{:pre [(util/has-keys? args #{:resource})]}
(util/get-response
(http/get
(util/get-url
"https://cloudprivatecatalog.googleapis.com/"
"v1beta1/{+resource}/products:search"
#{:resource}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))