export type DeleteApiApiMetaSitesV1MetaSiteIdArgs = {meta_site_id: string}; export type DeleteApiApiMetaSitesV1MetaSiteIdOptions = {baseUrl?: string | undefined, OAuth2ClientCredentials?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete meta site * * DELETE /api/meta-sites/v1/{meta_site_id} */ export const deleteApiApiMetaSitesV1MetaSiteId = async (args: DeleteApiApiMetaSitesV1MetaSiteIdArgs, options?: DeleteApiApiMetaSitesV1MetaSiteIdOptions) => { const {baseUrl = "https://example.piwik.pro", fetch: fetchFn = fetch, OAuth2ClientCredentials} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2ClientCredentials !== undefined) headers.set('authorization', `Bearer ${OAuth2ClientCredentials}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/meta-sites/v1/${encodeURIComponent(String(args.meta_site_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };