import { type AxiosResponse } from 'axios'; import { App } from './App.js'; import { CollectionResponse } from './CollectionResponse.js'; import { CreatedWithIdResponse } from './CreatedWithIdResponse.js'; import { Field } from './Field.js'; import { File } from './File.js'; import { FileInfo } from './FileInfo.js'; import { GetPagedAppsResponse } from './GetPagedAppsResponse.js'; import { GetPagedFieldsResponse } from './GetPagedFieldsResponse.js'; import { GetPagedRecordsResponse } from './GetPagedRecordsResponse.js'; import { GetPagedReportsResponse } from './GetPagedReportsResponse.js'; import { ListItemResponse } from './ListItemResponse.js'; import { Record } from './Record.js'; import { ReportData } from './ReportData.js'; import { SaveRecordResponse } from './SaveRecordResponse.js'; /** * @class ApiResponse - A generic response object for API requests. */ export declare class ApiResponse { /** * @property {number} statusCode - The status code of the response. */ statusCode: number; /** * @property {boolean} isSuccessful - True if the status code is less than 400; otherwise, false. */ isSuccessful: boolean; /** * @property {string} message - The message of the response. */ message: string; /** * @property {T} data - The data of the response. */ data: T | null; /** * @constructor - Creates a new instance of the ApiResponse class. * @param {number} statusCode - The status code of the response. * @param {string} message - The message of the response. * @param {T | null} data - The data of the response. * @returns {ApiResponse} - A new instance of the ApiResponse class. */ constructor(statusCode: number, message: string, data: T | null); /** * @method asGetPagedAppsResponseType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asGetPagedAppsResponseType(): ApiResponse; /** * @method asAppType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asAppType(): ApiResponse; /** * @method asAppCollectionType - Converts the ApiResponse to an ApiResponse>. * @returns {ApiResponse>} - An ApiResponse>. */ asAppCollectionType(): ApiResponse>; /** * @method asFieldType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asFieldType(): ApiResponse; /** * @method asFieldCollectionType - Converts the ApiResponse to an ApiResponse>. * @returns {ApiResponse>} - An ApiResponse>. */ asFieldCollectionType(): ApiResponse>; /** * @method asGetPagedFieldsResponseType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asGetPagedFieldsResponseType(): ApiResponse; /** * @method asCreatedWithIdResponseType - Converts the ApiResponse to an ApiResponse>. * @returns {ApiResponse>} - An ApiResponse>. */ asCreatedWithIdResponseType(): ApiResponse>; /** * @method asFileInfoType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asFileInfoType(): ApiResponse; /** * @method asFileType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asFileType(response: AxiosResponse): ApiResponse; /** * @method asListItemResponseType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asListItemResponseType(): ApiResponse; /** * @method asGetPagedReportsResponseType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asGetPagedReportsResponseType(): ApiResponse; /** * @method asReportDataType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asReportDataType(): ApiResponse; /** * @method asGetPagedRecordsResponseType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asGetPagedRecordsResponseType(): ApiResponse; /** * @method asRecordType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asRecordType(): ApiResponse; /** * @method asRecordCollectionType - Converts the ApiResponse to an ApiResponse>. * @returns {ApiResponse>} - An ApiResponse>. */ asRecordCollectionType(): ApiResponse>; /** * @method asSaveRecordResponseType - Converts the ApiResponse to an ApiResponse. * @returns {ApiResponse} - An ApiResponse. */ asSaveRecordResponseType(): ApiResponse; /** * @method getRecordValueByType - Gets the RecordValue by by type. * @param {RecordValue} recordValueItem - The record value item. * @returns {RecordValue} - The RecordValue. */ private static getRecordValueByType; /** * @method getFieldByType - Converts the field item to the appropriate field object based upon the field item's type. * @param {any} fieldItem - The field item to convert. * @returns {Field} - The converted field object. * @throws {Error} - If the field item's type is unknown. */ private static getFieldByType; /** * @method convertToDelegate - Converts the delegate item to a Delegate object. * @param {any} delegateItem - The delegate item to convert. * @returns {Delegate} - The converted Delegate object. */ private static convertToDelegate; /** * @method convertToScoringGroup - Converts the scoring group item to the appropriate scoring group object. * @param {any} scoringGroupItem - The scoring group item to convert. * @returns {ScoringGroup} - The converted scoring group object. */ private static convertToScoringGroup; /** * @method convertToAttachment - Converts the attachment item to the appropriate attachment object. * @param {any} attachmentItem - The attachment item to convert. * @returns {Attachment} - The converted attachment object. */ private static convertToAttachment; /** * @method convertToTimeSpanData - Converts the time span item to the appropriate time span data object. * @param {any} timeSpanItem - The time span item to convert. * @returns {TimeSpanData} - The converted time span data object. */ private static convertToTimeSpanData; /** * @method getListValues - Converts the field items list values to a ListValue[]. * @param fieldItem - The field item whose values should be converted. * @returns {ListValue[]} - The converted list values. */ private static getListValues; }