export type DeleteApiEnvironmentsEnvironmentIDFlowsFlowIDVersionsVersionIDArgs = {environmentID: string, flowID: string, versionID: string, 'X-Ping-External-Session-ID'?: string | undefined, 'X-Ping-External-Transaction-ID'?: string | undefined}; export type DeleteApiEnvironmentsEnvironmentIDFlowsFlowIDVersionsVersionIDOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * DELETE /environments/{environmentID}/flows/{flowID}/versions/{versionID} */ export const deleteApiEnvironmentsEnvironmentIDFlowsFlowIDVersionsVersionID = async (args: DeleteApiEnvironmentsEnvironmentIDFlowsFlowIDVersionsVersionIDArgs, options?: DeleteApiEnvironmentsEnvironmentIDFlowsFlowIDVersionsVersionIDOptions) => { const {baseUrl = "https://api.pingone.com/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-Ping-External-Session-ID'] != null) headers.set("X-Ping-External-Session-ID", String(args['X-Ping-External-Session-ID'])) if (args['X-Ping-External-Transaction-ID'] != null) headers.set("X-Ping-External-Transaction-ID", String(args['X-Ping-External-Transaction-ID'])) const url = `${baseUrl.replace(/\/+$/, '')}/environments/${encodeURIComponent(String(args.environmentID))}/flows/${encodeURIComponent(String(args.flowID))}/versions/${encodeURIComponent(String(args.versionID))}${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 };