export type DeleteApiV1ProxyProfilesProxyProfileIdArgs = {proxyProfileId: string}; export type DeleteApiV1ProxyProfilesProxyProfileIdOptions = {baseUrl?: string | undefined, Basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete Proxy Profile * * DELETE /v1/proxy-profiles/{proxyProfileId} */ export const deleteApiV1ProxyProfilesProxyProfileId = async (args: DeleteApiV1ProxyProfilesProxyProfileIdArgs, options?: DeleteApiV1ProxyProfilesProxyProfileIdOptions) => { const {baseUrl = "https://api.configcat.com", fetch: fetchFn = fetch, Basic} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (Basic !== undefined) headers.set('authorization', `Basic ${btoa(`${Basic.username}:${Basic.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/proxy-profiles/${encodeURIComponent(String(args.proxyProfileId))}${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 };