export type UpdatePhpCliVersionRequest = {php_version: '5.6' | '7.0' | '7.1' | '7.2' | '7.3' | '7.4' | '8.0' | '8.1' | '8.2' | '8.3' | '8.4' | '8.5'}; export type UpdateApiOrgsOrganizationServersServerPhpSiteVersionArgs = {organization: string, server: number, body: UpdatePhpCliVersionRequest}; export type UpdateApiOrgsOrganizationServersServerPhpSiteVersionOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update PHP site version * * PUT /orgs/{organization}/servers/{server}/php/site-version */ export const updateApiOrgsOrganizationServersServerPhpSiteVersion = async (args: UpdateApiOrgsOrganizationServersServerPhpSiteVersionArgs, options?: UpdateApiOrgsOrganizationServersServerPhpSiteVersionOptions) => { const {baseUrl = "https://forge.laravel.com/api", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/orgs/${encodeURIComponent(String(args.organization))}/servers/${encodeURIComponent(String(args.server))}/php/site-version${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };