Skip to content

Commit

Permalink
Source Hubspot: Add new marketing emails (with statistics) stream (#5840
Browse files Browse the repository at this point in the history
)

* Add new marketing emails (with statistics) stream

* Update docs and changelog
  • Loading branch information
n0rritt committed Oct 20, 2021
1 parent a7ddd16 commit fae4d00
Show file tree
Hide file tree
Showing 7 changed files with 563 additions and 2 deletions.
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-hubspot/Dockerfile
Expand Up @@ -14,5 +14,5 @@ RUN pip install .

ENV AIRBYTE_ENTRYPOINT "/airbyte/base.sh"

LABEL io.airbyte.version=0.1.17
LABEL io.airbyte.version=0.1.18
LABEL io.airbyte.name=airbyte/source-hubspot
Expand Up @@ -93,6 +93,18 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "marketing_emails",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_cursor": false,
"default_cursor_field": ["updated"]
},
"sync_mode": "full_refresh",
"cursor_field": null,
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "owners",
Expand Down
Expand Up @@ -93,6 +93,18 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "marketing_emails",
"json_schema": {},
"supported_sync_modes": ["full_refresh"],
"source_defined_cursor": false,
"default_cursor_field": ["updated"]
},
"sync_mode": "full_refresh",
"cursor_field": null,
"destination_sync_mode": "overwrite"
},
{
"stream": {
"name": "owners",
Expand Down
Expand Up @@ -650,6 +650,18 @@ class FormStream(Stream):
created_at_field = "createdAt"


class MarketingEmailStream(Stream):
"""Marketing Email, API v1
Docs: https://legacydocs.hubspot.com/docs/methods/cms_email/get-all-marketing-emails
"""

url = "/marketing-emails/v1/emails/with-statistics"
data_field = "objects"
limit = 250
updated_at_field = "updated"
created_at_field = "created"


class OwnerStream(Stream):
"""Owners, API v3
Docs: https://legacydocs.hubspot.com/docs/methods/owners/get_owners
Expand Down
Expand Up @@ -18,6 +18,7 @@
EmailEventStream,
EngagementStream,
FormStream,
MarketingEmailStream,
OwnerStream,
SubscriptionChangeStream,
WorkflowStream,
Expand All @@ -43,6 +44,7 @@ def __init__(self, start_date, credentials, **kwargs):
"engagements": EngagementStream(**common_params),
"forms": FormStream(**common_params),
"line_items": CRMObjectStream(entity="line_item", **common_params),
"marketing_emails": MarketingEmailStream(**common_params),
"owners": OwnerStream(**common_params),
"products": CRMObjectStream(entity="product", **common_params),
"subscription_changes": SubscriptionChangeStream(**common_params),
Expand Down

0 comments on commit fae4d00

Please sign in to comment.