export type DeleteApiV1CustomfieldsCustomFieldIdValuesValueIdArgs = {customFieldId: string, valueId: string}; export type DeleteApiV1CustomfieldsCustomFieldIdValuesValueIdOptions = {baseUrl: string, ApiKeyAuth?: string | undefined, WorkspaceIdAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * /customfields/:customFieldId:/values/:valueId * * DELETE /v1/customfields/{customFieldId}/values/{valueId} * * Also accepts auth: BearerAuth + WorkspaceIdAuth */ export const deleteApiV1CustomfieldsCustomFieldIdValuesValueId = async (args: DeleteApiV1CustomfieldsCustomFieldIdValuesValueIdArgs, options: DeleteApiV1CustomfieldsCustomFieldIdValuesValueIdOptions) => { const {baseUrl, fetch: fetchFn = fetch, ApiKeyAuth, WorkspaceIdAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) if (WorkspaceIdAuth !== undefined) headers.set("x-air-workspace-id", WorkspaceIdAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v1/customfields/${encodeURIComponent(String(args.customFieldId))}/values/${encodeURIComponent(String(args.valueId))}${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 };