export type GetApiEnvironmentsEnvironmentIDSnapshotsSnapshotIDVersionsVersionIDArgs = {environmentID: string, snapshotID: string, versionID: string, expand?: string | undefined, attributes: string, filter?: string | undefined, 'X-Ping-External-Session-ID'?: string | undefined, 'X-Ping-External-Transaction-ID'?: string | undefined}; export type GetApiEnvironmentsEnvironmentIDSnapshotsSnapshotIDVersionsVersionIDOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /environments/{environmentID}/snapshots/{snapshotID}/versions/{versionID} */ export const getApiEnvironmentsEnvironmentIDSnapshotsSnapshotIDVersionsVersionID = async (args: GetApiEnvironmentsEnvironmentIDSnapshotsSnapshotIDVersionsVersionIDArgs, options?: GetApiEnvironmentsEnvironmentIDSnapshotsSnapshotIDVersionsVersionIDOptions) => { const {baseUrl = "https://api.pingone.com/v1", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args.expand != null) query.append("expand", String(args.expand)) if (args.attributes != null) query.append("attributes", String(args.attributes)) if (args.filter != null) query.append("filter", String(args.filter)) 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))}/snapshots/${encodeURIComponent(String(args.snapshotID))}/versions/${encodeURIComponent(String(args.versionID))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };