diff --git a/.prospector.yaml b/.prospector.yaml index 623e76d..e5a4ed6 100644 --- a/.prospector.yaml +++ b/.prospector.yaml @@ -25,6 +25,7 @@ pylint: - cyclic-import - import-outside-toplevel - unnecessary-comprehension + - C0112 options: max-args: 12 diff --git a/hubspot3/__init__.py b/hubspot3/__init__.py index 255bd60..2fcfefc 100644 --- a/hubspot3/__init__.py +++ b/hubspot3/__init__.py @@ -33,12 +33,14 @@ def __init__( def __str__(self) -> str: """string representation""" - return "".format( - self.current_usage, - self.usage_limit, - self.calls_used, - self.until_reset, - self.until_cache_expire, + return ( + "".format( + self.current_usage, + self.usage_limit, + self.calls_used, + self.until_reset, + self.until_cache_expire, + ) ) def __repr__(self) -> str: diff --git a/hubspot3/contacts.py b/hubspot3/contacts.py index eab3159..85f6ebb 100644 --- a/hubspot3/contacts.py +++ b/hubspot3/contacts.py @@ -114,7 +114,9 @@ def merge(self, primary_id: int, secondary_id: int, **options): "associatedcompanyid", ] - def get_batch(self, ids, extra_properties: Union[list, str] = None): + def get_batch( + self, ids, extra_properties: Union[list, str] = None, property_mode: str = None + ): """given a batch of vids, get more of their info""" # default properties to fetch properties = set(self.default_batch_properties) @@ -126,6 +128,17 @@ def get_batch(self, ids, extra_properties: Union[list, str] = None): if isinstance(extra_properties, str): properties.add(extra_properties) + if property_mode == "value_and_history": + return self._call( + "contact/vids/batch", + method="GET", + doseq=True, + params={ + "vid": ids, + "property": list(properties), + "propertyMode": property_mode, + }, + ) batch = self._call( "contact/vids/batch", method="GET",