Options
All
  • Public
  • Public/Protected
  • All
Menu

Class OnmsResult<T>

Type parameters

  • T

Hierarchy

  • OnmsResult

Index

Constructors

Properties

Methods

Constructors

constructor

  • new OnmsResult(data: T, message?: string, code?: number, type?: string): OnmsResult
  • construct a new result

    Parameters

    • data: T
    • Optional message: string

      the status message

    • Optional code: number

      the response code

    • Optional type: string

    Returns OnmsResult

Properties

code

code: number

the response code associated with this result

data

data: T

the data, if any

message

message: string

the status message associated with this result

type

type: string

the request type, if any

Methods

isSuccess

  • isSuccess(): boolean

Static error

  • error(message: string, code?: number): OnmsResult<any>

Static noContent

Static ok

  • ok(response: any, message?: string, code?: number, type?: string): OnmsResult<any>
  • create a new "OK" result

    Parameters

    • response: any
    • Optional message: string
    • Optional code: number
    • Optional type: string

    Returns OnmsResult<any>

Generated using TypeDoc