diff --git a/tap_hubspot/client.py b/tap_hubspot/client.py index 6ad7892..7b20a8b 100644 --- a/tap_hubspot/client.py +++ b/tap_hubspot/client.py @@ -166,6 +166,34 @@ def get_custom_schema(self, poorly_cast: List[str] = []): properties.append(th.Property('createdAt', th.DateTimeType())) properties.append(th.Property('id', th.StringType())) properties.append(th.Property('archived', th.BooleanType())) + properties.append( + th.Property('associations', th.ObjectType( + th.Property("companies", th.ObjectType( + th.Property("results", th.ArrayType( + th.ObjectType( + th.Property("id", th.StringType()), + th.Property("type", th.StringType()) + ) + )) + )), + th.Property("contacts", th.ObjectType( + th.Property("results", th.ArrayType( + th.ObjectType( + th.Property("id", th.StringType()), + th.Property("type", th.StringType()) + ) + )) + )), + th.Property("deals", th.ObjectType( + th.Property("results", th.ArrayType( + th.ObjectType( + th.Property("id", th.StringType()), + th.Property("type", th.StringType()) + ) + )) + )) + )) + ) properties.append(th.Property( 'properties', th.ObjectType(*internal_properties) )) diff --git a/tap_hubspot/streams.py b/tap_hubspot/streams.py index 96db20c..10f71fe 100644 --- a/tap_hubspot/streams.py +++ b/tap_hubspot/streams.py @@ -86,6 +86,7 @@ def get_url_params( params = super().get_url_params(context, next_page_token) params["properties"] = ",".join(self.properties) params["archived"] = context["archived"] + params["associations"] = "contacts,companies,deals" return params @property @@ -113,6 +114,7 @@ def get_url_params( params = super().get_url_params(context, next_page_token) params["properties"] = ",".join(self.properties) params["archived"] = context["archived"] + params["associations"] = "contacts,companies,deals" return params @property @@ -143,6 +145,7 @@ def get_url_params( params = super().get_url_params(context, next_page_token) params["properties"] = ",".join(self.properties) params["archived"] = context["archived"] + params["associations"] = "contacts,companies,deals" return params @property