-
Notifications
You must be signed in to change notification settings - Fork 6
/
apps.clj
97 lines (79 loc) · 3.92 KB
/
apps.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
86
87
88
89
90
91
92
93
94
95
96
97
(ns common-swagger-api.schema.apps.admin.apps
(:use [common-swagger-api.schema
:only [->optional-param
optional-key->keyword
describe
PagingParams
SortFieldDocs
SortFieldOptionalKey]]
[schema.core :only [defschema enum optional-key]])
(:require [clojure.set :as sets]
[common-swagger-api.schema.apps :as apps])
(:import [java.util Date]))
(def AdminAppPatchSummary "Update App Details and Labels")
(def AppDeleteDocs
"An app can be marked as deleted in the DE without being completely removed from the database using this service.
This endpoint is the same as the non-admin endpoint,
except an error is not returned if the user does not own the App.")
(def AppDetailsDocs "This service allows administrative users to view detailed information about private apps.")
(def AppDocumentationAddDocs "This service is used by DE administrators to add documentation for a single App.")
(def AppDocumentationUpdateDocs "This service is used by DE administrators to update documentation for a single App.")
(def AppIntegrationDataUpdateSummary "Update the Integration Data Record for an App")
(def AppIntegrationDataUpdateDocs
"This service allows administrators to change the integration data record associated with an app.")
(def AppListingDocs
"This service allows admins to list all public apps, including apps listed under the `Trash` category:
deleted public apps and private apps that are 'orphaned' (not categorized in any user's workspace).
If the `search` parameter is included, then the results are filtered by the App name, description,
integrator's name, tool name, or category name the app is under.")
(def AppShredderSummary "Permanently Deleting Apps")
(def AppShredderDocs
"This service physically removes an App from the database,
which allows administrators to completely remove Apps that are causing problems.")
(defschema AdminAppListingJobStats
(merge apps/AppListingJobStats
{:job_count
(describe Long "The number of times this app has run")
:job_count_failed
(describe Long "The number of times this app has run to `Failed` status")
(optional-key :last_used)
(describe Date "The start date this app was last run")}))
(defschema AdminAppListingDetail
(merge apps/AppListingDetail
{(optional-key :job_stats)
(describe AdminAppListingJobStats apps/AppListingJobStatsDocs)}))
(defschema AdminAppListing
(merge apps/AppListing
{:apps (describe [AdminAppListingDetail] "A listing of App details")}))
(def AdminAppListingJobStatsKeys
(->> AdminAppListingJobStats
keys
(map optional-key->keyword)
set))
(def AdminAppSearchValidSortFields
(sets/union apps/AppSearchValidSortFields
AdminAppListingJobStatsKeys))
(def AppSubsetDocs "The subset of apps to search.")
(def AppSubsetOptionalKey (optional-key :app-subset))
(def AppSubsets [:public :private :all])
(defschema AdminAppSearchParams
(merge apps/AppSearchParams
{SortFieldOptionalKey
(describe (apply enum AdminAppSearchValidSortFields) SortFieldDocs)
AppSubsetOptionalKey
(describe (apply enum AppSubsets) AppSubsetDocs :default :public)}))
(defschema AdminAppDetails
(merge apps/AppDetails
{(optional-key :job_stats)
(describe AdminAppListingJobStats apps/AppListingJobStatsDocs)}))
(defschema AdminAppPatchRequest
(-> apps/AppBase
(->optional-param :id)
(->optional-param :name)
(->optional-param :description)
(assoc (optional-key :wiki_url) apps/AppDocUrlParam
(optional-key :references) apps/AppReferencesParam
(optional-key :deleted) apps/AppDeletedParam
(optional-key :disabled) apps/AppDisabledParam
apps/OptionalGroupsKey (describe [apps/AppGroup] apps/GroupListDocs))
(describe "The App to update.")))