/** * PayPal Server SDKLib * * This file was automatically generated by APIMATIC v3.0 ( https://www.apimatic.io ). */ import { array, lazy, number, object, optional, Schema, string, } from '../schema.js'; import { LinkDescription, linkDescriptionSchema } from './linkDescription.js'; import { TransactionDetails, transactionDetailsSchema, } from './transactionDetails.js'; /** The search response information. */ export interface SearchResponse { /** An array of transaction detail objects. */ transactionDetails?: TransactionDetails[]; /** The merchant account number. */ accountNumber?: string; /** The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates. */ startDate?: string; /** The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates. */ endDate?: string; /** The date and time, in [Internet date and time format](https://tools.ietf.org/html/rfc3339#section-5.6). Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates. */ lastRefreshedDatetime?: string; /** A zero-relative index of transactions. */ page?: number; /** The total number of transactions as an integer beginning with the specified `page` in the full result and not just in this response. */ totalItems?: number; /** The total number of pages, as an `integer`, when the `total_items` is divided into pages of the specified `page_size`. */ totalPages?: number; /** An array of request-related [HATEOAS links](/api/rest/responses/#hateoas-links). */ links?: LinkDescription[]; } export const searchResponseSchema: Schema = lazy(() => object({ transactionDetails: [ 'transaction_details', optional(array(transactionDetailsSchema)), ], accountNumber: ['account_number', optional(string())], startDate: ['start_date', optional(string())], endDate: ['end_date', optional(string())], lastRefreshedDatetime: ['last_refreshed_datetime', optional(string())], page: ['page', optional(number())], totalItems: ['total_items', optional(number())], totalPages: ['total_pages', optional(number())], links: ['links', optional(array(linkDescriptionSchema))], }) );