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
client ConnectClient A ConnectClient instance.
baseUri string The 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
id string The 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
obj object The resource to create.

genericResource.update(id, obj) ⇒ object

Update a resource.

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

ParamTypeDescription
id string The unique identifier of the resource to update.
obj object The eventually partial resource to update.

genericResource.delete(id)

Delete a resource.

Kind: instance method of GenericResource

ParamTypeDescription
id string The 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
filters object The 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
url string the URL to fetch.
options object the request options.
Is this page helpful?
Translate with Google
Copied to clipboard