pub struct SyncJobResourceSchema {
pub resource: String,
pub method: String,
pub id: Option<String>,
pub query: Option<Map<String, Value>>,
pub loop_on: Option<String>,
pub depends_on: Option<String>,
pub persist: Option<bool>,
}Fields§
§resource: StringThe name of the resource to sync. For Unified APIs, it should be in the format unified_api_name/resource_name. For Proxy API, it can just be resource_name.
method: StringThe method to call on the resource.
id: Option<String>The ID of the resource to sync. This is optional and can be used to sync a single resource. It also supports placeholders.
query: Option<Map<String, Value>>The query parameters to pass to the resource method. It supports placeholders for values.
loop_on: Option<String>When a particular placeholder argument is an array and you want to repeat the request for each element in that array, you can set this parameter. For example, if you accept an argument called user_ids which is an array of strings, and you want to fetch each user’s details, you can set this parameter to user_ids and the request will be repeated for each element in the user_ids array.
depends_on: Option<String>The resource that this resource depends on (parent resource). This is optional and can be used to sync a resource only after another resource has been synced. Each object synced for the parent resource is available as the resources object in placeholders for the child resource, e.g. {{resources.crm.contacts.id}} if depends on is crm/contacts resource.
persist: Option<bool>Whether to persist the resource in the database or not in case of a Daemon sync job run or send as a payload in case of RapidBridge sync job run. The Proxy API resources are by default NOT persisted and this parameter can be set to true to persist them. Unified API resources are always persisted.