async listGroupRelatedGroups()

in source/packages/libraries/clients/assetlibrary-client/src/client/groups.apigw.service.ts [295:347]


    async listGroupRelatedGroups(
        groupPath: string,
        relationship: string,
        template?: string,
        direction?: string,
        offset?: number,
        count?: number,
        sort?: string,
        additionalHeaders?: RequestHeaders
    ): Promise<GroupResourceList> {
        ow(groupPath, 'groupPath', ow.string.nonEmpty);
        ow(relationship, 'relationship', ow.string.nonEmpty);

        let url = `${this.baseUrl}${super.groupRelatedGroupUrl(groupPath, relationship)}`;

        let queryString = '';
        if (template != undefined && template.trim().length > 0) {
            queryString = queryString + '&template=' + template;
        }
        if (direction != undefined && direction.trim().length > 0) {
            queryString = queryString + '&direction=' + direction;
        }
        if (offset != undefined) {
            if (String(offset).trim().length > 0) {
                queryString = queryString + '&offset=' + offset;
            }
        }
        if (count != undefined) {
            if (String(count).trim().length > 0) {
                queryString = queryString + '&count=' + count;
            }
        }
        if (sort != undefined && sort.trim().length > 0) {
            queryString = queryString + '&sort=' + sort;
        }
        if (queryString) {
            queryString = queryString.slice(1);
        }

        if (queryString) {
            url += `?${queryString}`;
        }
        return await request
            .get(url)
            .set(this.buildHeaders(additionalHeaders))
            .use(await signClientRequest())
            .then((res) => {
                return res.body;
            })
            .catch((err) => {
                throw createError(err.response.status, err.response.text);
            });
    }