1 /* Helper methods for dealing with responses from API Server. */
6 "git.curoverse.com/arvados.git/sdk/go/arvadosclient"
9 func UserIsAdmin(arv arvadosclient.ArvadosClient) (is_admin bool, err error) {
11 IsAdmin bool `json:"is_admin"`
14 err = arv.Call("GET", "users", "", "current", nil, &u)
18 // Returns the total count of a particular type of resource
20 // resource - the arvados resource to count
22 // count - the number of items of type resource the api server reports, if no error
23 // err - error accessing the resource, or nil if no error
24 func NumberItemsAvailable(client arvadosclient.ArvadosClient, resource string) (count int, err error) {
26 ItemsAvailable int `json:"items_available"`
28 sdkParams := arvadosclient.Dict{"limit": 0}
29 err = client.List(resource, sdkParams, &response)
31 count = response.ItemsAvailable