1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as _ from "lodash";
6 import { CommonResourceService, ListResults } from "../../common/api/common-resource-service";
7 import { FilterBuilder } from "../../common/api/filter-builder";
8 import { OrderBuilder } from "../../common/api/order-builder";
9 import { AxiosInstance } from "axios";
10 import { GroupResource } from "../../models/group";
11 import { CollectionResource } from "../../models/collection";
12 import { ProjectResource } from "../../models/project";
13 import { ProcessResource } from "../../models/process";
15 export interface ContentsArguments {
19 filters?: FilterBuilder;
23 export type GroupContentsResource =
28 export class GroupsService<T extends GroupResource = GroupResource> extends CommonResourceService<T> {
30 constructor(serverApi: AxiosInstance) {
31 super(serverApi, "groups");
34 contents(uuid: string, args: ContentsArguments = {}): Promise<ListResults<GroupContentsResource>> {
35 const { filters, order, ...other } = args;
38 filters: filters ? filters.serialize() : undefined,
39 order: order ? order.getOrder() : undefined
42 .get(this.resourceType + `${uuid}/contents/`, {
43 params: CommonResourceService.mapKeys(_.snakeCase)(params)
45 .then(CommonResourceService.mapResponseKeys);
49 export enum GroupContentsResourcePrefix {
50 COLLECTION = "collections",
52 PROCESS = "container_requests"