Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

Commit

Permalink
DE-1717 Hubspot - Create replace existing associations tables for com…
Browse files Browse the repository at this point in the history
…panies, contacts & deals with new version of the API (#60)

* Added new client type

* Added parameters

* Logging metrics url

* Added params

* Printing response and removed properties

* Removed type

* Changed logger

* Added logs

* Removed error

* Removed debugging

* Removed logging _2

* Removed self.logger

* Added endlines

* Removed tab
  • Loading branch information
SBurwash authored Jun 2, 2023
1 parent 703d688 commit 85407d1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tap_hubspot/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
))
Expand Down
3 changes: 3 additions & 0 deletions tap_hubspot/streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 85407d1

Please sign in to comment.