UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

37 lines (32 loc) 1.03 kB
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import * as Core from "../../core"; import { APIResource } from "../../resource"; import * as PreviewsAPI from "./previews"; import * as PreviewAPI from "../user/load-balancers/preview"; export class Previews extends APIResource { /** * Get the result of a previous preview operation using the provided preview_id. */ get( previewId: string, params: PreviewGetParams, options?: Core.RequestOptions, ): Core.APIPromise<PreviewAPI.LoadBalancingPreview> { const { account_id } = params; return ( this._client.get( `/accounts/${account_id}/load_balancers/preview/${previewId}`, options, ) as Core.APIPromise<{ result: PreviewAPI.LoadBalancingPreview }> )._thenUnwrap((obj) => obj.result); } } export interface PreviewGetParams { /** * Identifier */ account_id: string; } export namespace Previews { export import PreviewGetParams = PreviewsAPI.PreviewGetParams; }