Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new marketing emails (with statistics) stream #5840

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-hubspot/Dockerfile
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading