Fixup guix packaging
This commit is contained in:
20
src/metalapi/project.scm
Normal file
20
src/metalapi/project.scm
Normal file
@@ -0,0 +1,20 @@
|
||||
(define-module (metalapi project)
|
||||
#:use-module (metalapi requests)
|
||||
#:export (list-all-projects
|
||||
build-project
|
||||
project->id
|
||||
project->organization))
|
||||
|
||||
(define (list-all-projects)
|
||||
(handle-pagination "/projects?exclude=devices,memberships,members" "projects" build-project))
|
||||
|
||||
(define (build-project project-alist)
|
||||
(extract-attrs project-alist "id" "name"))
|
||||
|
||||
(define (project->id project)
|
||||
(assoc-ref project "id"))
|
||||
|
||||
(define (project->organization project)
|
||||
(let ((project (GET (format #f "/projects/~a" (project->id project)) (headers))))
|
||||
(let ((org (GET (assoc-ref (assoc-ref project "organization") "href") (headers))))
|
||||
(list (assoc "id" org) (assoc "name" org)))))
|
||||
Reference in New Issue
Block a user