export type DeleteApiV01ApiTokensApiTokenIdArgs = {api_token_id: string}; export type DeleteApiV01ApiTokensApiTokenIdOptions = {baseUrl?: string | undefined, Basic?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete the user api_token object with the specific id * * DELETE /v0.1/api_tokens/{api_token_id} */ export const deleteApiV01ApiTokensApiTokenId = async (args: DeleteApiV01ApiTokensApiTokenIdArgs, options?: DeleteApiV01ApiTokensApiTokenIdOptions) => { const {baseUrl = "https://api.appcenter.ms", 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(/\/+$/, '')}/v0.1/api_tokens/${encodeURIComponent(String(args.api_token_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 };