Hi, I’m currently extending the Pipedrive connector. Currently, it only syncs the deals, but I’m extending it to also sync the deal_flow (child entity, describing the changes on the deal - docs).
Basically what I did was adding following:
class PipedriveSubstream(PipedriveStream, HttpSubStream, ABC):
def __init__(self, parent: PipedriveStream, authenticator, replication_start_date=None, **kwargs):
super().__init__(parent=parent, authenticator=authenticator, replication_start_date=replication_start_date, **kwargs)
class DealFlow(PipedriveSubstream, ABC):
"""
API docs: https://developers.pipedrive.com/docs/api/v1/Deals#getDealUpdates
"""
def __init__(self, deals_stream: Deals, authenticator, replication_start_date=None, **kwargs):
super().__init__(parent=deals_stream, authenticator=authenticator, replication_start_date=replication_start_date, **kwargs)
def path(
self, stream_state: Mapping[str, Any] = None, stream_slice: Mapping[str, Any] = None, next_page_token: Mapping[str, Any] = None
) -> str:
return f"deals/{stream_slice['parent']['id']}/flow"
See full diff on Github.
This miraculously works, but I was wondering the behavior of this depending on the sync mode. The base stream is here Deals
.
- What happens when
Deals
is set to Incremental? Would it only sync the new deals, and syncDealFlow
of thoseDeals
?- What happens when
Deals
is set to Full?
- What happens when
- Or will it always sync all
DealFlow
by syncing allDeals
(asDealFlow
is set to Full)?