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)

Param Type Description
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.

Param Type Description
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.

Param Type Description
obj object The resource to create.

genericResource.update(id, obj) ⇒ object

Update a resource.

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

Param Type Description
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

Param Type Description
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.

Param Type Description
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

Param Type Description
url string the URL to fetch.
options object the request options.
Is this page helpful?
Translate with Google
Copied to clipboard