Home Manual Reference Source
protected class | source

ResourceProxy

Extends:

SimpleResourceProxy → ResourceProxy

Direct Subclass:

GeoResourceProxy

Proxy for accessing resource. This will make sure that they are properly wrapped before the promise resolves.

Constructor Summary

Public Constructor
public

Method Summary

Public Methods
public

async get(id: Number | String | Object, deleted: String): Promise<ResourceBase>

Get target resource

public

Select target resource without obtaining data

Inherited Summary

From class SimpleResourceProxy
public get

Target to wrap results in

public get

Get api instance

public get

Proxy target url

public

List target resource

public
this method was deprecated.

List target resource

public

Get the resource lister

public

Build a new instance of the target

Public Constructors

public constructor() source

Override:

SimpleResourceProxy#constructor

Public Methods

public async get(id: Number | String | Object, deleted: String): Promise<ResourceBase> source

Get target resource

Params:

NameTypeAttributeDescription
id Number | String | Object
  • optional
  • default:

The resource id to be requested

deleted String
  • optional
  • default: RequestParameters.deleted

Determines if the resource should be shown if deleted, requires special resource permissions. Possible values: only, none, all

Return:

Promise<ResourceBase>

Target resource

Throw:

ApiError

public select(id: Number | String): ResourceBase source

Select target resource without obtaining data

Params:

NameTypeAttributeDescription
id Number | String
  • optional
  • default:

Resource id

Return:

ResourceBase

Empty target resource

Example:

api.users.select('me').colors().then(doSomethingCool);