Options
All
  • Public
  • Public/Protected
  • All
Menu

An IOnmsHTTP query result.

Type parameters

  • T

Hierarchy

  • OnmsResult

Index

Constructors

  • new OnmsResult<T>(data: T, message?: string, code?: number, type?: string): API.OnmsResult<T>
  • Construct a new result.

    Type parameters

    • T

    Parameters

    • data: T

      The payload of the response.

    • Optional message: string

      The status message associated with the result.

    • Optional code: number

      The response code of the response.

    • Optional type: string

      The request type of the response.

    Returns API.OnmsResult<T>

Properties

code?: number

The response code associated with this result.

data: T

The data, if any.

message?: string

The status message associated with this result.

type?: string

The request type, if any.

Methods

  • isSuccess(): boolean
  • ok(response: any, message?: string, code?: number, type?: string): API.OnmsResult<any>
  • Create a new success result.

    Parameters

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

    Returns API.OnmsResult<any>

Generated using TypeDoc