// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; import * as Core from '../../core'; export class Snapshot extends APIResource { /** * Returns the page's HTML content and screenshot. Control page loading with * `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`, * `fullPage`, `clip` and others. */ create( params: SnapshotCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id, cacheTTL, ...body } = params; return ( this._client.post(`/accounts/${account_id}/browser-rendering/snapshot`, { query: { cacheTTL }, body, ...options, }) as Core.APIPromise<{ result: SnapshotCreateResponse }> )._thenUnwrap((obj) => obj.result); } } export interface SnapshotCreateResponse { /** * HTML content */ content: string; /** * Base64 encoded image */ screenshot: string; } export interface SnapshotCreateParams { /** * Path param: Account ID. */ account_id: string; /** * Query param: Cache TTL default is 5s. Set to 0 to disable. */ cacheTTL?: number; /** * Body param: Adds a `