Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DevicesAPI

api

public DevicesAPI - Provides methods to interact with the Devices API

Hierarchy

Index

Constructors

constructor

Properties

Protected _api

Protected _endpoint

_endpoint: string

Protected _headers

_headers: object

Protected _okuna

_okuna: Client

Defines an API request.

param

Protected _params

_params: RequestParams

Protected _paths

_paths: string[] = []

Protected _url

_url: string

requiresToken

requiresToken: boolean = true

Methods

_constructFormdata

  • _constructFormdata(opts?: object | null): FormData
  • constructFormdata() Constructs a FormData instance from an object.

    Parameters

    • Default value opts: object | null = null

      the object to generate the FormData from

    Returns FormData

createDevice

  • createDevice(uuid: string, name: string): Promise<any>
  • PUT /api/devices/ - Promises to create a device

    Parameters

    • uuid: string

      The universally unique identifier of the device

    • name: string

      The name of the device

    Returns Promise<any>

Protected delete

  • delete(): Promise<any>

deleteDevice

  • deleteDevice(uuid: string): Promise<any>
  • DELETE /api/devices/:uuid/ - Promise to delete a device

    Parameters

    • uuid: string

      The universally unique identifier of the device

    Returns Promise<any>

deleteDevices

  • deleteDevices(): Promise<any>
  • DELETE /api/devices/ - Promises to delete the devices

    Returns Promise<any>

generateHeaders

  • generateHeaders(contentType?: string | null): object
  • generateHeaders() A function used to generate the headers that need to be passed to the request performee.

    Parameters

    • Default value contentType: string | null = null

    Returns object

Protected get

  • get(): Promise<any>

getDevice

  • getDevice(uuid: string): Promise<any>
  • GET /api/devices/uuid/ - Promises to get a device based on its UUID

    Parameters

    • uuid: string

      The universally unique identifier of the device

    Returns Promise<any>

getDevices

  • getDevices(): Promise<any>
  • GET /api/devices/ - Promises to retrieve an array of devices

    Returns Promise<any>

Protected patch

  • patch(body: object): Promise<any>

Protected patchFormdata

  • patchFormdata(body: object): Promise<any>

Protected post

  • post(body: object): Promise<any>

Protected postFormdata

  • postFormdata(body: object): Promise<any>

Protected put

  • put(body: object): Promise<any>

Protected putFormdata

  • putFormdata(body: object): Promise<any>

updateDevice

  • updateDevice(uuid: string, name: string): Promise<any>
  • PATCH /api/devices/:uuid/ - Promises to update a device

    Parameters

    • uuid: string

      The universally unique identifier of the device

    • name: string

      The name of the device

    Returns Promise<any>

Generated using TypeDoc