/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { layoutsCreate } from "../funcs/layoutsCreate.js"; import { layoutsDelete } from "../funcs/layoutsDelete.js"; import { layoutsDuplicate } from "../funcs/layoutsDuplicate.js"; import { layoutsGeneratePreview } from "../funcs/layoutsGeneratePreview.js"; import { layoutsList } from "../funcs/layoutsList.js"; import { layoutsRetrieve } from "../funcs/layoutsRetrieve.js"; import { layoutsUpdate } from "../funcs/layoutsUpdate.js"; import { layoutsUsage } from "../funcs/layoutsUsage.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Layouts extends ClientSDK { /** * Create a layout * * @remarks * Creates a new layout in the Novu Cloud environment */ async create( createLayoutDto: components.CreateLayoutDto, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(layoutsCreate( this, createLayoutDto, idempotencyKey, options, )); } /** * List all layouts * * @remarks * Retrieves a list of layouts with optional filtering and pagination */ async list( request: operations.LayoutsControllerListRequest, options?: RequestOptions, ): Promise { return unwrapAsync(layoutsList( this, request, options, )); } /** * Update a layout * * @remarks * Updates the details of an existing layout, here **layoutId** is the identifier of the layout */ async update( updateLayoutDto: components.UpdateLayoutDto, layoutId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(layoutsUpdate( this, updateLayoutDto, layoutId, idempotencyKey, options, )); } /** * Retrieve a layout * * @remarks * Fetches details of a specific layout by its unique identifier **layoutId** */ async retrieve( layoutId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(layoutsRetrieve( this, layoutId, idempotencyKey, options, )); } /** * Delete a layout * * @remarks * Removes a specific layout by its unique identifier **layoutId** */ async delete( layoutId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(layoutsDelete( this, layoutId, idempotencyKey, options, )); } /** * Duplicate a layout * * @remarks * Duplicates a layout by its unique identifier **layoutId**. This will create a new layout with the content of the original layout. */ async duplicate( duplicateLayoutDto: components.DuplicateLayoutDto, layoutId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(layoutsDuplicate( this, duplicateLayoutDto, layoutId, idempotencyKey, options, )); } /** * Generate layout preview * * @remarks * Generates a preview for a layout by its unique identifier **layoutId** */ async generatePreview( layoutPreviewRequestDto: components.LayoutPreviewRequestDto, layoutId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(layoutsGeneratePreview( this, layoutPreviewRequestDto, layoutId, idempotencyKey, options, )); } /** * Get layout usage * * @remarks * Retrieves information about workflows that use the specified layout by its unique identifier **layoutId** */ async usage( layoutId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(layoutsUsage( this, layoutId, idempotencyKey, options, )); } }