Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ApiRequest

An object that is responsible for configuring and performing a single request to the Aeris Weather API.

export

Hierarchy

  • ApiRequest

Index

Constructors

constructor

  • Initializes a new request instance configured with the specified client access keys.

    memberof

    ApiRequest

    Parameters

    Returns ApiRequest

Accessors

requests

  • Returns ApiRequest[]

Methods

action

  • Sets the action for the request.

    memberof

    ApiRequest

    Parameters

    Returns ApiRequest

addRequest

  • Adds a request to the batch request.

    Adding child requests to this request automatically converts the containing request to a batch request.

    memberof

    ApiRequest

    Parameters

    Returns ApiRequest

bounds

  • Sets the request's place to the coordinate bounds string.

    memberof

    ApiRequest

    Parameters

    Returns ApiRequest

cancel

  • cancel(): void
  • Cancels any active request.

    memberof

    ApiRequest

    Returns void

clone

  • Returns a copy of the request.

    memberof

    ApiRequest

    Returns ApiRequest

endpoint

  • Sets the endpoint for the request (required).

    memberof

    ApiRequest

    Parameters

    • endpoint: string

    Returns ApiRequest

fields

  • Sets the fields parameter.

    memberof

    ApiRequest

    Parameters

    • value: string

    Returns ApiRequest

filter

  • Sets the filter parameter.

    memberof

    ApiRequest

    Parameters

    • value: string

    Returns ApiRequest

format

  • Sets the format parameters.

    memberof

    ApiRequest

    Parameters

    • value: string

    Returns ApiRequest

from

  • Sets the from parameter.

    memberof

    ApiRequest

    Parameters

    • value: string | Date

    Returns ApiRequest

get

  • Perform the request.

    memberof

    ApiRequest

    Parameters

    Returns Promise<ApiResult>

getAction

  • Returns the action for the request.

    memberof

    ApiRequest

    Returns ApiAction

getEndpoint

  • getEndpoint(): string
  • Returns the endpoint for the request.

    memberof

    ApiRequest

    Returns string

getParams

  • Returns the current request parameters.

    memberof

    ApiRequest

    Returns ApiRequestOptions

limit

  • Sets the limit parameter.

    memberof

    ApiRequest

    Parameters

    • value: number

    Returns ApiRequest

lod

  • Sets the lod (level-of-detail) parameter.

    memberof

    ApiRequest

    Parameters

    • value: number

    Returns ApiRequest

mindist

  • Sets the mindist parameter.

    memberof

    ApiRequest

    Parameters

    • value: string | number

    Returns ApiRequest

param

  • param(key: string, value?: any): ApiRequest | any
  • Sets or returns the specified parameter.

    memberof

    ApiRequest

    Parameters

    • key: string
    • Optional value: any

    Returns ApiRequest | any

place

  • Sets the place for the request.

    memberof

    ApiRequest

    Parameters

    • value: string

    Returns ApiRequest

plimit

  • Sets the plimit paramter.

    memberof

    ApiRequest

    Parameters

    • value: number

    Returns ApiRequest

pskip

  • Sets the pskip parameter.

    memberof

    ApiRequest

    Parameters

    • value: number

    Returns ApiRequest

psort

  • Sets the psort parameter.

    memberof

    ApiRequest

    Parameters

    • value: string

    Returns ApiRequest

query

  • Sets the query parameter.

    memberof

    ApiRequest

    Parameters

    Returns ApiRequest

radius

  • Sets the radius parameter.

    memberof

    ApiRequest

    Parameters

    • value: string

    Returns ApiRequest

removeAllRequests

  • removeAllRequests(): void
  • Removes all requests from the batch request, converting the request instance to a non-batch request.

    memberof

    ApiRequest

    Returns void

removeRequest

  • Removes a request from the batch request.

    memberof

    ApiRequest

    Parameters

    Returns ApiRequest

resetParams

  • Returns ApiRequest

route

  • Parameters

    • value: any

    Returns ApiRequest

setParams

  • Sets multiple request parameters.

    memberof

    ApiRequest

    Parameters

    Returns ApiRequest

skip

  • Sets the skip parameter.

    memberof

    ApiRequest

    Parameters

    • value: number

    Returns ApiRequest

sort

  • Sets the sort parameter.

    memberof

    ApiRequest

    Parameters

    • value: string

    Returns ApiRequest

to

  • Sets the to parameter.

    memberof

    ApiRequest

    Parameters

    • value: string | Date

    Returns ApiRequest

url

  • url(isBatch?: boolean): string
  • Returns the url string for the request based on the configured parameters and options.

    memberof

    ApiRequest

    Parameters

    • Default value isBatch: boolean = false

    Returns string

Object literals

config

config: object

Base configuration for the request.

memberof

ApiRequest

server

server: string = "https://data.api.xweather.com"

client

client: object

id

id: undefined = undefined

secret

secret: undefined = undefined

Generated using TypeDoc