/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { APIPromise } from "../types/async.js"; import { unwrapAsync } from "../types/fp.js"; export enum GetAcceptEnum { applicationJson = "application/json", textCsv = "text/csv", textPlain = "text/plain", applicationOctetStream = "application/octet-stream", applicationPdf = "application/pdf", applicationXml = "application/xml", textHtml = "text/html", } export enum OptionsAcceptEnum { applicationJson = "application/json", textCsv = "text/csv", textPlain = "text/plain", applicationOctetStream = "application/octet-stream", applicationPdf = "application/pdf", applicationXml = "application/xml", textHtml = "text/html", } export enum PostAcceptEnum { applicationJson = "application/json", textCsv = "text/csv", textPlain = "text/plain", applicationOctetStream = "application/octet-stream", applicationPdf = "application/pdf", applicationXml = "application/xml", textHtml = "text/html", } export enum PutAcceptEnum { applicationJson = "application/json", textCsv = "text/csv", textPlain = "text/plain", applicationOctetStream = "application/octet-stream", applicationPdf = "application/pdf", applicationXml = "application/xml", textHtml = "text/html", } export enum PatchAcceptEnum { applicationJson = "application/json", textCsv = "text/csv", textPlain = "text/plain", applicationOctetStream = "application/octet-stream", applicationPdf = "application/pdf", applicationXml = "application/xml", textHtml = "text/html", } export enum DeleteAcceptEnum { applicationJson = "application/json", textCsv = "text/csv", textPlain = "text/plain", applicationOctetStream = "application/octet-stream", applicationPdf = "application/pdf", applicationXml = "application/xml", textHtml = "text/html", } let proxyGet$module: Promise | undefined; const proxyGet = ((...args: Parameters) => new APIPromise( (proxyGet$module ??= import("../funcs/proxyGet.js").catch( (error: unknown) => { proxyGet$module = undefined; throw error; }, )).then((module) => module.proxyGet(...args).$inspect()), )) as typeof import("../funcs/proxyGet.js").proxyGet; let proxyOptions$module: | Promise | undefined; const proxyOptions = (( ...args: Parameters ) => new APIPromise( (proxyOptions$module ??= import("../funcs/proxyOptions.js").catch( (error: unknown) => { proxyOptions$module = undefined; throw error; }, )).then((module) => module.proxyOptions(...args).$inspect()), )) as typeof import("../funcs/proxyOptions.js").proxyOptions; let proxyPost$module: | Promise | undefined; const proxyPost = ((...args: Parameters) => new APIPromise( (proxyPost$module ??= import("../funcs/proxyPost.js").catch( (error: unknown) => { proxyPost$module = undefined; throw error; }, )).then((module) => module.proxyPost(...args).$inspect()), )) as typeof import("../funcs/proxyPost.js").proxyPost; let proxyPut$module: Promise | undefined; const proxyPut = ((...args: Parameters) => new APIPromise( (proxyPut$module ??= import("../funcs/proxyPut.js").catch( (error: unknown) => { proxyPut$module = undefined; throw error; }, )).then((module) => module.proxyPut(...args).$inspect()), )) as typeof import("../funcs/proxyPut.js").proxyPut; let proxyPatch$module: | Promise | undefined; const proxyPatch = ((...args: Parameters) => new APIPromise( (proxyPatch$module ??= import("../funcs/proxyPatch.js").catch( (error: unknown) => { proxyPatch$module = undefined; throw error; }, )).then((module) => module.proxyPatch(...args).$inspect()), )) as typeof import("../funcs/proxyPatch.js").proxyPatch; let proxyDelete$module: | Promise | undefined; const proxyDelete = (( ...args: Parameters ) => new APIPromise( (proxyDelete$module ??= import("../funcs/proxyDelete.js").catch( (error: unknown) => { proxyDelete$module = undefined; throw error; }, )).then((module) => module.proxyDelete(...args).$inspect()), )) as typeof import("../funcs/proxyDelete.js").proxyDelete; export class Proxy extends ClientSDK { /** * GET * * @remarks * Proxies a downstream GET request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. * **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers. */ async get( request: operations.ProxyGetProxyRequest, options?: RequestOptions & { acceptHeaderOverride?: GetAcceptEnum }, ): Promise { return unwrapAsync(proxyGet( this, request, options, )); } /** * OPTIONS * * @remarks * Proxies a downstream OPTION request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. * **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers. */ async options( request: operations.ProxyOptionsProxyRequest, options?: RequestOptions & { acceptHeaderOverride?: OptionsAcceptEnum }, ): Promise { return unwrapAsync(proxyOptions( this, request, options, )); } /** * POST * * @remarks * Proxies a downstream POST request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. * **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers. */ async post( request: operations.ProxyPostProxyRequest, options?: RequestOptions & { acceptHeaderOverride?: PostAcceptEnum }, ): Promise { return unwrapAsync(proxyPost( this, request, options, )); } /** * PUT * * @remarks * Proxies a downstream PUT request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. * **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers. */ async put( request: operations.ProxyPutProxyRequest, options?: RequestOptions & { acceptHeaderOverride?: PutAcceptEnum }, ): Promise { return unwrapAsync(proxyPut( this, request, options, )); } /** * PATCH * * @remarks * Proxies a downstream PATCH request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. * **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers. */ async patch( request: operations.ProxyPatchProxyRequest, options?: RequestOptions & { acceptHeaderOverride?: PatchAcceptEnum }, ): Promise { return unwrapAsync(proxyPatch( this, request, options, )); } /** * DELETE * * @remarks * Proxies a downstream DELETE request to a service and injects the necessary credentials into a request stored in Vault. This allows you to have an additional security layer and logging without needing to rely on Unify for normalization. * **Note**: Vault will proxy all data to the downstream URL and method/verb in the headers. */ async delete( request: operations.ProxyDeleteProxyRequest, options?: RequestOptions & { acceptHeaderOverride?: DeleteAcceptEnum }, ): Promise { return unwrapAsync(proxyDelete( this, request, options, )); } }