/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { APIPromise } from "../types/async.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; let accountingFiscalPeriodsList$module: | Promise | undefined; const accountingFiscalPeriodsList = (( ...args: Parameters< typeof import("../funcs/accountingFiscalPeriodsList.js").accountingFiscalPeriodsList > ) => new APIPromise( (accountingFiscalPeriodsList$module ??= import( "../funcs/accountingFiscalPeriodsList.js" ).catch((error: unknown) => { accountingFiscalPeriodsList$module = undefined; throw error; })).then((module) => module.accountingFiscalPeriodsList(...args).$inspect() ), )) as typeof import("../funcs/accountingFiscalPeriodsList.js").accountingFiscalPeriodsList; let accountingFiscalPeriodsGet$module: | Promise | undefined; const accountingFiscalPeriodsGet = (( ...args: Parameters< typeof import("../funcs/accountingFiscalPeriodsGet.js").accountingFiscalPeriodsGet > ) => new APIPromise( (accountingFiscalPeriodsGet$module ??= import( "../funcs/accountingFiscalPeriodsGet.js" ).catch((error: unknown) => { accountingFiscalPeriodsGet$module = undefined; throw error; })).then((module) => module.accountingFiscalPeriodsGet(...args).$inspect() ), )) as typeof import("../funcs/accountingFiscalPeriodsGet.js").accountingFiscalPeriodsGet; export class FiscalPeriods extends ClientSDK { /** * List Fiscal Periods * * @remarks * List the fiscal (accounting) periods of the company, with their dates and whether they are open for posting. */ async list( request: operations.AccountingFiscalPeriodsAllRequest, options?: RequestOptions, ): Promise< PageIterator< operations.AccountingFiscalPeriodsAllResponse, { cursor: string } > > { return unwrapResultIterator(accountingFiscalPeriodsList( this, request, options, )); } /** * Get Fiscal Period * * @remarks * Get Fiscal Period */ async get( request: operations.AccountingFiscalPeriodsOneRequest, options?: RequestOptions, ): Promise { return unwrapAsync(accountingFiscalPeriodsGet( this, request, options, )); } }