diff --git a/src/cral/api/core/categories.clj b/src/cral/api/core/categories.clj index dc8cebc..c478159 100644 --- a/src/cral/api/core/categories.clj +++ b/src/cral/api/core/categories.clj @@ -25,7 +25,9 @@ (cral.model.core CreateCategoryQueryParams GetCategoryQueryParams ListCategoriesQueryParams - ListNodeCategoriesQueryParams))) + ListNodeCategoriesQueryParams + UpdateCategoryBody + UpdateCategoryQueryParams))) (defn list-node-categories "Gets a list of categories for node `node-id`.\\ @@ -107,6 +109,22 @@ nil opts)) +(defn update-category + "Updates the category `category-id`. + You must have admin rights to update a category.\\ + More info [here](https://api-explorer.alfresco.com/api-explorer/?urls.primaryName=Core%20API)." + ([^Ticket ticket ^String category-id ^UpdateCategoryBody body] + (update-category ticket category-id body nil)) + ([^Ticket ticket ^String category-id ^UpdateCategoryBody body ^UpdateCategoryQueryParams query-params & [^PersistentHashMap opts]] + (utils/call-rest + client/post + (format "%s/categories/%s" (config/get-url 'core) category-id) + ticket + {:body (json/write-str (utils/camel-case-stringify-keys body)) + :query-params query-params + :content-type :json} + opts))) + (defn list-categories "Gets a list of subcategories within the category `category-id`. The parameter `category-id` can be set to the alias -root- to obtain a list of top level categories.\\ diff --git a/src/cral/model/core.clj b/src/cral/model/core.clj index 51431d5..2c920e8 100644 --- a/src/cral/model/core.clj +++ b/src/cral/model/core.clj @@ -663,6 +663,13 @@ [^PersistentVector include ^PersistentVector fields]) +(defrecord UpdateCategoryBody + [^String name]) + +(defrecord UpdateCategoryQueryParams + [^PersistentVector include + ^PersistentVector fields]) + (defrecord ListCategoriesQueryParams [^PersistentVector include ^Integer skip-count