// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as BusinessPartnersAPI from './business-partners'; import { APIPromise } from '../core/api-promise'; import { PageCursorURL, PagePromise } from '../core/pagination'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Vendors in the company's Finance directory */ export class FinanceVendors extends APIResource { /** * A list of finance vendors. * * - Requires: `Spend Management Platform API` * - Filterable fields: `name` * - Sortable fields: `id`, `created_at`, `updated_at` * * @example HTTP * Representative request and response shapes. * ``` * GET /finance-vendors/?filter=filter&order_by=order_by&limit=50&cursor=cursor HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * { * "name": "date_of_birth", * "reason": "Insufficient entitlements" * } * ] * }, * "results": [ * { * "id": "string", * "created_at": "string", * "updated_at": "string", * "name": "string", * "logo": "string", * "is_archived": false * } * ], * "next_link": "string" * } * ``` */ list( query: FinanceVendorListParams | null | undefined = {}, options?: RequestOptions, ): PagePromise { return this._client.getAPIList('/finance-vendors/', PageCursorURL, { query, ...options, }); } /** * Retrieve a specific finance vendor * * @example HTTP * Representative request and response shapes. * ``` * GET /finance-vendors/{id}/ HTTP/1.1 * Host: rest.ripplingapis.com * Accept: application/json * Rippling-Api-Version: 2024-08-01 * * HTTP/1.1 200 OK * Content-Type: application/json * * { * "__meta": { * "redacted_fields": [ * {} * ] * } * } * ``` */ retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/finance-vendors/${id}/`, options); } } export type FinanceVendorListResponsesPageCursorURL = PageCursorURL; /** * A vendor in the company's Finance directory. * * Stub and archived vendors are included so historical transactions can still resolve their vendor. */ export interface FinanceVendorListResponse { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether the vendor is archived. Archived vendors remain available for historical * references. */ is_archived?: boolean; /** * URL of the vendor's logo. Null when no logo is available. */ logo?: string; /** * Canonical name of the Finance vendor. Name eq, ne, and in filters also match * alternate names. */ name?: string; } /** * Meta information for the response. */ export interface FinanceVendorRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Identifier field */ id: string; /** * Record creation date */ created_at: string; /** * Record update date */ updated_at: string; /** * Whether the vendor is archived. Archived vendors remain available for historical * references. */ is_archived?: boolean; /** * URL of the vendor's logo. Null when no logo is available. */ logo?: string; /** * Canonical name of the Finance vendor. Name eq, ne, and in filters also match * alternate names. */ name?: string; } export interface FinanceVendorListParams { cursor?: string; filter?: string; /** * The maximum number of results to return. Defaults to 50. Maximum is 100. */ limit?: number; order_by?: string; } export declare namespace FinanceVendors { export { type FinanceVendorListResponse as FinanceVendorListResponse, type FinanceVendorRetrieveResponse as FinanceVendorRetrieveResponse, type FinanceVendorListResponsesPageCursorURL as FinanceVendorListResponsesPageCursorURL, type FinanceVendorListParams as FinanceVendorListParams, }; }