// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../resource'; import { isRequestOptions } from '../../core'; import * as Core from '../../core'; import * as ViewsAPI from './views'; export class Views extends APIResource { /** * Reads the content of a view from the prefect-collection-registry. */ retrieve( view: string, params?: ViewRetrieveParams, options?: Core.RequestOptions, ): Core.APIPromise; retrieve(view: string, options?: Core.RequestOptions): Core.APIPromise; retrieve( view: string, params: ViewRetrieveParams | Core.RequestOptions = {}, options?: Core.RequestOptions, ): Core.APIPromise { if (isRequestOptions(params)) { return this.retrieve(view, {}, params); } const { 'x-prefect-api-version': xPrefectAPIVersion } = params; return this._client.get(`/api/collections/views/${view}`, { ...options, headers: { ...(xPrefectAPIVersion != null ? { 'x-prefect-api-version': xPrefectAPIVersion } : undefined), ...options?.headers, }, }); } } export type ViewRetrieveResponse = unknown; export interface ViewRetrieveParams { 'x-prefect-api-version'?: string; } export namespace Views { export import ViewRetrieveResponse = ViewsAPI.ViewRetrieveResponse; export import ViewRetrieveParams = ViewsAPI.ViewRetrieveParams; }