-
Notifications
You must be signed in to change notification settings - Fork 4
/
statements.clj
48 lines (43 loc) · 1.96 KB
/
statements.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
(ns happygapi.digitalassetlinks.statements
"Digital Asset Links API: statements.
Discovers relationships between online assets such as websites or mobile apps.
See: https://developers.google.com/digital-asset-links/api/reference/rest/v1/statements"
(:require [cheshire.core :as json]
[clj-http.client :as http]
[happy.util :as util]))
(defn list$
"https://developers.google.com/digital-asset-links/api/reference/rest/v1/statements/list
Required parameters: none
Optional parameters: source.web.site, source.androidApp.packageName, source.androidApp.certificate.sha256Fingerprint, relation
Retrieves a list of all statements from a given source that match the
specified target and statement string.
The API guarantees that all statements with secure source assets, such as
HTTPS websites or Android apps, have been made in a secure way by the owner
of those assets, as described in the [Digital Asset Links technical design
specification](https://github.com/google/digitalassetlinks/blob/master/well-known/details.md).
Specifically, you should consider that for insecure websites (that is,
where the URL starts with `http://` instead of `https://`), this guarantee
cannot be made.
The `List` command is most useful in cases where the API client wants to
know all the ways in which two assets are related, or enumerate all the
relationships from a particular source asset. Example: a feature that
helps users navigate to related items. When a mobile app is running on a
device, the feature would make it easy to navigate to the corresponding web
site or Google+ profile."
{:scopes nil}
[auth args]
{:pre [(util/has-keys? args #{})]}
(util/get-response
(http/get
(util/get-url
"https://digitalassetlinks.googleapis.com/"
"v1/statements:list"
#{}
args)
(merge-with
merge
{:throw-exceptions false,
:query-params args,
:accept :json,
:as :json}
auth))))