export type PatchApiProjectsProjectIdKeysKeyIdCommentsIdReadArgs = {'X-PhraseApp-OTP'?: string | undefined, project_id: string, key_id: string, id: string, body: {branch?: string | undefined}}; export type PatchApiProjectsProjectIdKeysKeyIdCommentsIdReadOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Mark a comment as read * * PATCH /projects/{project_id}/keys/{key_id}/comments/{id}/read */ export const patchApiProjectsProjectIdKeysKeyIdCommentsIdRead = async (args: PatchApiProjectsProjectIdKeysKeyIdCommentsIdReadArgs, options?: PatchApiProjectsProjectIdKeysKeyIdCommentsIdReadOptions) => { const {baseUrl = "https://eu.phrase.com/control-hub", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['X-PhraseApp-OTP'] != null) headers.set("X-PhraseApp-OTP", String(args['X-PhraseApp-OTP'])) const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.project_id))}/keys/${encodeURIComponent(String(args.key_id))}/comments/${encodeURIComponent(String(args.id))}/read${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 };