diff --git a/src/cral/api/core/categories.clj b/src/cral/api/core/categories.clj index 56d2aad..dae7908 100644 --- a/src/cral/api/core/categories.clj +++ b/src/cral/api/core/categories.clj @@ -23,6 +23,7 @@ (:import (clojure.lang PersistentHashMap PersistentVector) (cral.model.auth Ticket) (cral.model.core CreateCategoryQueryParams + GetCategoryQueryParams ListCategoriesQueryParams ListNodeCategoriesQueryParams))) @@ -81,6 +82,19 @@ nil opts)) +(defn get-category + "Get a specific category with `category-id`.\\ + More info [here](https://api-explorer.alfresco.com/api-explorer/?urls.primaryName=Core%20API)." + ([^Ticket ticket ^String category-id] + (get-gategory ticket category-id nil)) + ([^Ticket ticket ^String category-id ^GetCategoryQueryParams query-params & [^PersistentHashMap opts]] + (utils/call-rest + client/get + (format "%s/categories/%s" (config/get-url 'core) category-id) + ticket + {:query-params query-params} + opts))) + (defn delete-category "Deletes the category with `category-id`. This will cause everything to be removed from the category. You must have admin rights to delete a category.\\ diff --git a/src/cral/model/core.clj b/src/cral/model/core.clj index 9b6beaa..51431d5 100644 --- a/src/cral/model/core.clj +++ b/src/cral/model/core.clj @@ -659,6 +659,10 @@ ^PersistentVector include ^PersistentVector fields]) +(defrecord GetCategoryQueryParams + [^PersistentVector include + ^PersistentVector fields]) + (defrecord ListCategoriesQueryParams [^PersistentVector include ^Integer skip-count