export type DeleteApiAppAppIdLicenseFieldLicenseFieldNameArgs = {app_id: string, license_field_name: string, preserve_fields?: boolean | undefined}; export type DeleteApiAppAppIdLicenseFieldLicenseFieldNameOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a field for a given app and named field. * * DELETE /app/{app_id}/license-field/{license_field_name} */ export const deleteApiAppAppIdLicenseFieldLicenseFieldName = async (args: DeleteApiAppAppIdLicenseFieldLicenseFieldNameArgs, options?: DeleteApiAppAppIdLicenseFieldLicenseFieldNameOptions) => { const {baseUrl = "https://api.replicated.com/vendor/v3", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.preserve_fields != null) query.append("preserve_fields", String(args.preserve_fields)) if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/app/${encodeURIComponent(String(args.app_id))}/license-field/${encodeURIComponent(String(args.license_field_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 undefined };