-
Notifications
You must be signed in to change notification settings - Fork 4
/
media.clj
34 lines (30 loc) · 1.02 KB
/
media.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
(ns happygapi.artifactregistry.media
"Artifact Registry API: media.
Store and manage build artifacts in a scalable and integrated service built on Google infrastructure.
See: https://cloud.google.com/artifacts/docs/api/reference/rest/v1/media"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn download$
"https://cloud.google.com/artifacts/docs/api/reference/rest/v1/media/download
Required parameters: name
Optional parameters: none
Download a file."
{:scopes ["https://www.googleapis.com/auth/cloud-platform"
"https://www.googleapis.com/auth/cloud-platform.read-only"]}
[auth parameters]
{:pre [(util/has-keys? parameters #{:name})]}
(util/get-response
(http/get
(util/get-url
"https://artifactregistry.googleapis.com/"
"v1/{+name}:download"
#{:name}
parameters)
(merge-with
merge
{:throw-exceptions false,
:query-params parameters,
:accept :json,
:as :json}
auth))))