export type UpdateApiOpsOrganizationsOrgIdMembersUserIdArgs = {org_id: string, user_id: string}; export type UpdateApiOpsOrganizationsOrgIdMembersUserIdOptions = {baseUrl?: string | undefined, OAuth2TopiHeaderAuthorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Add a member to an organization * * PUT /ops/organizations/{org_id}/members/{user_id} */ export const updateApiOpsOrganizationsOrgIdMembersUserId = async (args: UpdateApiOpsOrganizationsOrgIdMembersUserIdArgs, options?: UpdateApiOpsOrganizationsOrgIdMembersUserIdOptions) => { const {baseUrl = "https://api.topi-staging.eu", fetch: fetchFn = fetch, OAuth2TopiHeaderAuthorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2TopiHeaderAuthorization !== undefined) headers.set('authorization', `Bearer ${OAuth2TopiHeaderAuthorization}`) const url = `${baseUrl.replace(/\/+$/, '')}/ops/organizations/${encodeURIComponent(String(args.org_id))}/members/${encodeURIComponent(String(args.user_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };