/* * 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"; let vaultValidateConnectionState$module: | Promise | undefined; const vaultValidateConnectionState = (( ...args: Parameters< typeof import("../funcs/vaultValidateConnectionState.js").vaultValidateConnectionState > ) => new APIPromise( (vaultValidateConnectionState$module ??= import( "../funcs/vaultValidateConnectionState.js" ).catch((error: unknown) => { vaultValidateConnectionState$module = undefined; throw error; })).then((module) => module.vaultValidateConnectionState(...args).$inspect() ), )) as typeof import("../funcs/vaultValidateConnectionState.js").vaultValidateConnectionState; export class ValidateConnection extends ClientSDK { /** * Validate Connection State * * @remarks * This endpoint validates the current state of a given connection. This will perform different checks based on the connection auth type. For basic and apiKey auth types, the presence of required fields is checked. * For connectors that implement OAuth2, this operation forces the refresh flow for an access token regardless of its expiry. * * Note: * - Do not include any credentials in the request body. This operation does not persist changes, but only triggers the validation of connection state. * - If a refresh token flow was performed and successful, the new access token will then be used for subsequent API requests. */ async state( request: operations.VaultValidateConnectionStateRequest, options?: RequestOptions, ): Promise { return unwrapAsync(vaultValidateConnectionState( this, request, options, )); } }