Class ApiResponse<T>

ApiResponse - A generic response object for API requests.

Type Parameters

  • T

Constructors

  • Type Parameters

    • T

    Parameters

    • statusCode: number

      The status code of the response.

    • message: string

      The message of the response.

    • data: null | T

      The data of the response.

    Returns ApiResponse<T>

    • A new instance of the ApiResponse class.

Properties

data: null | T
isSuccessful: boolean
message: string
statusCode: number

Methods

  • Returns ApiResponse<App>

    • An ApiResponse.

    Method

    asAppType - Converts the ApiResponse to an ApiResponse.

  • Returns ApiResponse<Field>

    • An ApiResponse.

    Method

    asFieldType - Converts the ApiResponse to an ApiResponse.

  • Parameters

    • response: AxiosResponse<any, any>

    Returns ApiResponse<File>

    • An ApiResponse.

    Method

    asFileType - Converts the ApiResponse to an ApiResponse.

  • Returns ApiResponse<Record>

    • An ApiResponse.

    Method

    asRecordType - Converts the ApiResponse to an ApiResponse.

  • Parameters

    • attachmentItem: any

      The attachment item to convert.

    Returns Attachment

    • The converted attachment object.

    Method

    convertToAttachment - Converts the attachment item to the appropriate attachment object.

  • Parameters

    • delegateItem: any

      The delegate item to convert.

    Returns Delegate

    • The converted Delegate object.

    Method

    convertToDelegate - Converts the delegate item to a Delegate object.

  • Parameters

    • scoringGroupItem: any

      The scoring group item to convert.

    Returns ScoringGroup

    • The converted scoring group object.

    Method

    convertToScoringGroup - Converts the scoring group item to the appropriate scoring group object.

  • Parameters

    • timeSpanItem: any

      The time span item to convert.

    Returns TimeSpanData

    • The converted time span data object.

    Method

    convertToTimeSpanData - Converts the time span item to the appropriate time span data object.

  • Parameters

    • fieldItem: any

      The field item to convert.

    Returns Field

    • The converted field object.

    Method

    getFieldByType - Converts the field item to the appropriate field object based upon the field item's type.

    Throws

    • If the field item's type is unknown.
  • Parameters

    • fieldItem: any

      The field item whose values should be converted.

    Returns ListValue[]

    • The converted list values.

    Method

    getListValues - Converts the field items list values to a ListValue[].

  • Parameters

    • recordValueItem: any

      The record value item.

    Returns RecordValue<any>

    • The RecordValue.

    Method

    getRecordValueByType - Gets the RecordValue by by type.