export type DeleteApiV1alpha1NameArgs = {name: string}; export type DeleteApiV1alpha1NameOptions = {baseUrl?: string | undefined, Oauth2?: string | undefined, Oauth2c?: string | undefined, fetch?: typeof fetch | undefined}; /** * Deletes a device. * * DELETE /v1alpha1/{+name} * * Also accepts auth: Oauth2 + Oauth2c */ export const deleteApiV1alpha1Name = async (args: DeleteApiV1alpha1NameArgs, options?: DeleteApiV1alpha1NameOptions) => { const {baseUrl = "https://prod-tt-sasportal.googleapis.com", fetch: fetchFn = fetch, Oauth2, Oauth2c} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (Oauth2 !== undefined) headers.set('authorization', `Bearer ${Oauth2}`) if (Oauth2c !== undefined) headers.set('authorization', `Bearer ${Oauth2c}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1alpha1/${encodeURIComponent(String(args['+name']))}${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 res.blob() };