Class GenericResource

Updated: March 5, 2020
Contents

GenericResource

The GenericResource map a generic endpoint of the CloudBlue
Connect API. Each API endpoint should extend this class and
implements endpoint specific actions and subresources access.

Kind: global class
Category: Resources

new GenericResource(client, baseUri)

ParamTypeDescription
clientConnectClientA ConnectClient instance.
baseUristringThe base URI of the resource

genericResource.baseUri : string

Returns the base URI of the resource mapped by this class.

Kind: instance property of GenericResource

genericResource.get(id) ⇒ object

Retrieve a resource by its unique identifier.

Kind: instance method of GenericResource
Returns: object – The resource.

ParamTypeDescription
idstringThe unique identifier of the resource to retrieve.

genericResource.create(obj) ⇒ object

Create a new resource.

Kind: instance method of GenericResource
Returns: object – The created resource.

ParamTypeDescription
objobjectThe resource to create.

genericResource.update(id, obj) ⇒ object

Update a resource.

Kind: instance method of GenericResource
Returns: object – The updated resource.

ParamTypeDescription
idstringThe unique identifier of the resource to update.
objobjectThe eventually partial resource to update.

genericResource.delete(id)

Delete a resource.

Kind: instance method of GenericResource

ParamTypeDescription
idstringThe unique identifier of the resource to delete.

genericResource.search(filters) ⇒ Array

Search for a resource.

Kind: instance method of GenericResource
Returns: Array – An array of resources that match the provided filters.

ParamTypeDescription
filtersobjectThe query to send to the server as a RQL object.

genericResource.fetch(url, options)

Fetch the URL and returns a response.

Kind: instance method of GenericResource

ParamTypeDescription
urlstringthe URL to fetch.
optionsobjectthe request options.
Is this page helpful?
Translate with Google
Copied to clipboard