ResourceRequest - gomeddo/js-sdk GitHub Wiki

Object that allows you to add different filters before sending a request for resources to the GoMeddo salesforce Rest API.

Example

const resourceResult = gm.buildResourceRequest()
   .includeAllResourcesAt(sfId1, sfId2)
   .withType(sfTypeId)
   .withAvailableSlotsBetween(startDatetime, endDatetime)
   .getResults()

Instance methods

Inherits methods from its parent, DimensionRecordRequest.

For this method to return child resources the conditions need to also match the parent otherwise no records are returned.

includeAllResourcesAt

Syntax

includeAllResourcesAt(sfId1)
includeAllResourcesAt(sfId1, sfId2)
includeAllResourcesAt(sfId1, sfId2, /* … ,*/ sfIdN)

Parameters:

  • sfIdN The Ids of the resources you want to retrieve. Child resources will also be retrieved.

Return value: The updated resource request.

Description

Filter for all resources passed through and all children of those resources.


Multiple types are currently combined using an and condition so no records will be returned if this method is used with multiple ids.

withType

Syntax

withType(sfId1)
withType(sfId1, sfId2)
withType(sfId1, sfId2, /* … ,*/ sfIdN)

Parameters:

  • sfIdN The Ids of the resource types you want to filter on.

Return value: The updated resource request.

Description

Only return resources of the specified types


includeServices

Syntax

includeServices(includeServices)
includeServices(includeServices)

Parameters:

  • includeServices Boolean whether to include the services or not

Return value: The updated resource request.

Description

Also fetch the services including slot for when the services are available Only valid if withAvailableSlotsBetween has also been called.


getResults

Syntax

await getResults()

Return value: A ResourceResult object with the resources matching the request.

Description

async Calls the GoMeddo APIs to construct the requested resources.