// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; import * as Core from '../../core'; export class Screenshot extends APIResource { /** * Takes a screenshot of a webpage from provided URL or HTML. Control page loading * with `gotoOptions` and `waitFor*` options. Customize screenshots with * `viewport`, `fullPage`, `clip` and others. */ create( params: ScreenshotCreateParams, options?: Core.RequestOptions, ): Core.APIPromise { const { account_id, cacheTTL, ...body } = params; return this._client.post(`/accounts/${account_id}/browser-rendering/screenshot`, { query: { cacheTTL }, body, ...options, }); } } export interface ScreenshotCreateResponse { /** * Response status */ status: boolean; errors?: Array; } export namespace ScreenshotCreateResponse { export interface Error { /** * Error code */ code: number; /** * Error Message */ message: string; } } export interface ScreenshotCreateParams { /** * 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 `