export type PublicMembersRelationshipsUpdateRequest = {members: Array, teams?: Array | undefined, locations?: Array | undefined, skills?: Array | undefined}; export type PatchApiV1PublicMembersRelationshipsAddArgs = {body: PublicMembersRelationshipsUpdateRequest}; export type PatchApiV1PublicMembersRelationshipsAddOptions = {baseUrl?: string | undefined, basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Add structural relationships to members * * PATCH /v1/public/members/relationships/add */ export const patchApiV1PublicMembersRelationshipsAdd = async (args: PatchApiV1PublicMembersRelationshipsAddArgs, options?: PatchApiV1PublicMembersRelationshipsAddOptions) => { const {baseUrl = "https://api.evolia.com", fetch: fetchFn = fetch, basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (basic !== undefined) headers.set('authorization', `Basic ${btoa(`${basic.username}:${basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/public/members/relationships/add${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };