export type UpdateApiProjectsProjectPropertyPropertynameArgs = {project: string, propertyname: string, body: BodyInit}; export type UpdateApiProjectsProjectPropertyPropertynameOptions = {baseUrl: string, bearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Set property value for the project * * PUT /projects/{project}/property/{propertyname} */ export const updateApiProjectsProjectPropertyPropertyname = async (args: UpdateApiProjectsProjectPropertyPropertynameArgs, options: UpdateApiProjectsProjectPropertyPropertynameOptions) => { const {baseUrl, fetch: fetchFn = fetch, bearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "text/plain") if (bearerAuth !== undefined) headers.set('authorization', `Bearer ${bearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/projects/${encodeURIComponent(String(args.project))}/property/${encodeURIComponent(String(args.propertyname))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: args.body}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };