Options
All
  • Public
  • Public/Protected
  • All
Menu

Class TwitarrResult<T>

An ITwitarrHTTP query result.

Type parameters

  • T

Hierarchy

  • TwitarrResult

Index

Constructors

Properties

Methods

Constructors

constructor

  • new TwitarrResult(data: T, message?: string, code?: number, type?: string): TwitarrResult
  • Construct a new result.

    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 TwitarrResult

Properties

code

code: number

The response code associated with this result.

data

data: T

The data, if any.

error

The error associated with this response 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 noContent

Static ok

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

    Parameters

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

    Returns TwitarrResult<any>

Generated using TypeDoc