From 50d907603511444cbbe5abbf6425326b5813725b Mon Sep 17 00:00:00 2001 From: Jamesyoub Date: Fri, 19 Feb 2021 13:51:09 -0500 Subject: [PATCH 1/3] add ticket staging models --- models/src_hubspot.yml | 221 +++++++++++++----- models/stg_hubspot__ticket.sql | 38 +++ models/stg_hubspot__ticket.yml | 114 +++++++++ models/stg_hubspot__ticket_company.sql | 20 ++ models/stg_hubspot__ticket_contact.sql | 20 ++ models/stg_hubspot__ticket_deal.sql | 20 ++ models/stg_hubspot__ticket_engagement.sql | 20 ++ .../stg_hubspot__ticket_property_history.sql | 24 ++ 8 files changed, 420 insertions(+), 57 deletions(-) create mode 100644 models/stg_hubspot__ticket.sql create mode 100644 models/stg_hubspot__ticket.yml create mode 100644 models/stg_hubspot__ticket_company.sql create mode 100644 models/stg_hubspot__ticket_contact.sql create mode 100644 models/stg_hubspot__ticket_deal.sql create mode 100644 models/stg_hubspot__ticket_engagement.sql create mode 100644 models/stg_hubspot__ticket_property_history.sql diff --git a/models/src_hubspot.yml b/models/src_hubspot.yml index 34f3468..7c6e2d0 100644 --- a/models/src_hubspot.yml +++ b/models/src_hubspot.yml @@ -22,7 +22,7 @@ sources: - name: category description: | Type of event. If the event type is PUBLISHING_TASK, it is one of BLOG_POST, EMAIL, LANDING_PAGE, CUSTOM. - If event type is SOCIAL, it is one of twitter, facebook, linkedin, googlepluspages. + If event type is SOCIAL, it is one of twitter, facebook, linkedin, googlepluspages. If event type is CONTENT, it is one of email, recurring-email, blog-post, landing-page, legacy-page, site-page. - name: category_id @@ -33,7 +33,7 @@ sources: - name: content_group_id description: | - The ID of the content group (aka blog) that the associated Blog Post belongs to, if any. + The ID of the content group (aka blog) that the associated Blog Post belongs to, if any. Otherwise null. Only populated for single task GETs and for Blog Post Tasks. - name: content_id @@ -89,13 +89,13 @@ sources: columns: - name: id description: The ID of the company. - + - name: portal_id description: '{{ doc("portal_id") }}' - + - name: is_deleted description: '{{ doc("is_deleted") }}' - + - name: company_property_history description: Each record represents a change to company record in Hubspot. columns: @@ -119,7 +119,7 @@ sources: - name: value description: '{{ doc("history_value") }}' - + - name: contact freshness: warn_after: {count: 84, period: hour} @@ -131,7 +131,7 @@ sources: - name: property_email description: The email address of the contact. - + - name: contact_form_submission description: TBD columns: @@ -158,7 +158,7 @@ sources: - name: title description: The title of the page that the form was submitted on. This will default to the name of the form if no title is provided. - + - name: contact_list description: Each record represents a contact list in Hubspot. columns: @@ -191,7 +191,7 @@ sources: - name: metadata_processing description: | - One of DONE, REFRESHING, INITIALIZING, or PROCESSING. + One of DONE, REFRESHING, INITIALIZING, or PROCESSING. DONE indicates the list has finished processing, any other value indicates that list membership is being evaluated. - name: metadata_size @@ -205,7 +205,7 @@ sources: - name: updated_at description: A timestamp of the time that the list was last modified. - + - name: contact_list_member description: Each record represents a 'link' between a contact and a contact list. @@ -224,7 +224,7 @@ sources: - name: contact_list_id description: The ID of the related contact list. - + - name: contact_property_history freshness: warn_after: {count: 84, period: hour} @@ -251,7 +251,7 @@ sources: - name: value description: '{{ doc("history_value") }}' - + - name: deal description: Each record represents a deal in Hubspot. columns: @@ -271,8 +271,8 @@ sources: description: The ID of the deal's pipeline stage. - name: owner_id - description: The ID of the deal's owner. - + description: The ID of the deal's owner. + - name: deal_contact description: Each record represents a 'link' between a deal and a contact. columns: @@ -284,7 +284,7 @@ sources: - name: deal_id description: The ID of the deal. - + - name: deal_pipeline description: Each record represents a pipeline in Hubspot. columns: @@ -305,7 +305,7 @@ sources: - name: pipeline_id description: The ID of the pipeline. - + - name: deal_pipeline_stage description: Each record represents a pipeline stage in Hubspot. columns: @@ -319,7 +319,7 @@ sources: description: Whether the pipeline stage is currently in use. - name: closed_won - description: Whether the stage represents a Closed Won deal. + description: Whether the stage represents a Closed Won deal. - name: display_order description: Used to determine the order in which the stages appear when viewed in HubSpot. @@ -335,7 +335,7 @@ sources: - name: stage_id description: The ID of the pipeline stage. - + - name: deal_property_history description: Each record represents a change to deal record in Hubspot. columns: @@ -359,7 +359,7 @@ sources: - name: value description: '{{ doc("history_value") }}' - + - name: email_campaign description: Each record represents an email campaign in Hubspot. columns: @@ -395,7 +395,7 @@ sources: - name: type description: The email campaign type. - + - name: email_event freshness: warn_after: {count: 84, period: hour} @@ -446,7 +446,7 @@ sources: - name: type description: The type of event. - + - name: email_event_bounce description: Each record represents a BOUNCE email event. columns: @@ -455,8 +455,8 @@ sources: - name: category description: | - The best-guess of the type of bounce encountered. - If an appropriate category couldn't be determined, this property is omitted. See below for the possible values. + The best-guess of the type of bounce encountered. + If an appropriate category couldn't be determined, this property is omitted. See below for the possible values. Note that this is a derived value, and may be modified at any time to improve the accuracy of classification. - name: id @@ -467,7 +467,7 @@ sources: - name: status description: The status code returned from the recipient's email server. - + - name: email_event_click description: Each record represents a CLICK email event. columns: @@ -494,7 +494,7 @@ sources: - name: user_agent description: '{{ doc("email_event_user_agent") }}' - + - name: email_event_deferred description: Each record represents a DEFERRED email event. columns: @@ -509,7 +509,7 @@ sources: - name: response description: The full response from the recipient's email server. - + - name: email_event_delivered description: Each record represents a DELIVERED email event. columns: @@ -524,7 +524,7 @@ sources: - name: smtp_id description: An ID attached to the message by HubSpot. - + - name: email_event_dropped description: Each record represents a DROPPED email event. columns: @@ -554,7 +554,7 @@ sources: - name: subject description: The subject line of the email message. - + - name: email_event_forward description: Each record represents a FORWARD email event. columns: @@ -599,7 +599,7 @@ sources: - name: user_agent description: '{{ doc("email_event_user_agent") }}' - + - name: email_event_print description: Each record represents a PRINT email event. columns: @@ -620,7 +620,7 @@ sources: - name: user_agent description: '{{ doc("email_event_user_agent") }}' - + - name: email_event_sent description: Each record represents a SENT email event. columns: @@ -644,7 +644,7 @@ sources: - name: subject description: The subject line of the email message. - + - name: email_event_spam_report description: Each record represents a SPAM_REPORT email event. columns: @@ -659,7 +659,7 @@ sources: - name: user_agent description: '{{ doc("email_event_user_agent") }}' - + - name: email_event_status_change description: Each record represents a STATUS_CHANGE email event in Hubspot. columns: @@ -667,8 +667,8 @@ sources: description: '{{ doc("_fivetran_synced") }}' - name: bounced - description: | - A HubSpot employee explicitly initiated the status change to block messages to the recipient. + description: | + A HubSpot employee explicitly initiated the status change to block messages to the recipient. (Note this usage has been deprecated in favor of dropping messages with a 'dropReason' of BLOCKED_ADDRESS.) - name: id @@ -676,21 +676,21 @@ sources: - name: portal_subscription_status description: | - The recipient's portal subscription status. - Note that if this is 'UNSUBSCRIBED', the property 'subscriptions' is not necessarily an empty array, nor are all + The recipient's portal subscription status. + Note that if this is 'UNSUBSCRIBED', the property 'subscriptions' is not necessarily an empty array, nor are all subscriptions contained in it necessarily going to have their statuses set to 'UNSUBSCRIBED'.) - name: requested_by description: The email address of the person requesting the change on behalf of the recipient. If not applicable, this property is omitted. - name: source - description: The source of the subscription change. + description: The source of the subscription change. - name: subscriptions description: | - An array of JSON objects representing the status of subscriptions for the recipient. + An array of JSON objects representing the status of subscriptions for the recipient. Each JSON subscription object is comprised of the properties: 'id', 'status'. - + - name: email_subscription description: Each record represents an email subscription in Hubspot. columns: @@ -711,7 +711,7 @@ sources: - name: portal_id description: '{{ doc("portal_id") }}' - + - name: email_subscription_change description: Each record represents a change to an email subscription in Hubspot. columns: @@ -737,13 +737,13 @@ sources: description: The email address of the related contact. - name: source - description: The source of the subscription change. + description: The source of the subscription change. - name: timestamp description: The timestamp when this change occurred. If 'causedByEvent' is present, this will be absent. - + - name: engagement - description: Each record represents an engagement + description: Each record represents an engagement columns: - name: _fivetran_synced description: '{{ doc("_fivetran_synced") }}' @@ -774,7 +774,7 @@ sources: - name: type description: One of NOTE, EMAIL, TASK, MEETING, or CALL, the type of the engagement. - + - name: engagement_call description: Each record represents a CALL engagement event. columns: @@ -810,7 +810,7 @@ sources: - name: to_number description: The phone number that was called. - + - name: engagement_company description: Each record represents a 'link' between a company and an engagement. columns: @@ -822,7 +822,7 @@ sources: - name: engagement_id description: The ID of the related engagement. - + - name: engagement_contact description: Each record represents a 'link' between a contact and an engagement. columns: @@ -834,7 +834,7 @@ sources: - name: engagement_id description: The ID of the related engagement. - + - name: engagement_deal description: Each record represents a 'link' between a deal and an engagement. columns: @@ -846,7 +846,7 @@ sources: - name: engagement_id description: The ID of the related engagement. - + - name: engagement_email description: Each record represents an EMAIL engagement event. columns: @@ -906,7 +906,7 @@ sources: - name: thread_id description: The ID of the email thread. - + - name: engagement_email_cc description: Each record represents a CC'd email address as part of an EMAIL engagement. columns: @@ -924,7 +924,7 @@ sources: - name: last_name description: The last name of the recipient. - + - name: engagement_email_to description: Each record represents a TO email address as part of an EMAIL engagement. columns: @@ -942,7 +942,7 @@ sources: - name: last_name description: The last name of the recipient. - + - name: engagement_meeting description: Each record represents a MEETING engagement event. columns: @@ -981,7 +981,7 @@ sources: - name: web_conference_meeting_id description: The ID of the web conference meeting. - + - name: engagement_note description: Each record represents a NOTE engagement event. columns: @@ -993,7 +993,7 @@ sources: - name: engagement_id description: The ID of the engagement. - + - name: engagement_task description: Each record represents a TASK engagement event. columns: @@ -1029,7 +1029,7 @@ sources: - name: task_type description: The type of task - + - name: form description: Each record represents a Hubspot form. columns: @@ -1062,7 +1062,7 @@ sources: - name: notify_recipients description: | - A comma-separated list of user IDs that should receive submission notifications. + A comma-separated list of user IDs that should receive submission notifications. Email addresses will be returned for individuals who aren't users. - name: portal_id @@ -1076,7 +1076,7 @@ sources: - name: updated_at description: A timestamp for when the form was last updated. - + - name: owner description: Each record represents an owner/user in Hubspot. columns: @@ -1106,4 +1106,111 @@ sources: - name: updated_at description: A timestamp for when the owner was last updated. - \ No newline at end of file + + - name: ticket_company + description: Each record represents a 'link' between a ticket and company. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: ticket_id + description: The ID of the related ticket. + + - name: company_id + description: The ID of the related company. + + - name: ticket_contact + description: Each record represents a 'link' between a ticket and a contact. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: ticket_id + description: The ID of the related ticket. + + - name: contact_id + description: The ID of the related contact. + + - name: ticket_deal + description: Each record represents a 'link' between a ticket and a deal. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: ticket_id + description: The ID of the related ticket. + + - name: deal_id + description: The ID of the related deal. + + - name: ticket_engagement + description: Each record represents a 'link' between a ticket and an engagement. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: ticket_id + description: The ID of the related ticket. + + - name: engagement_id + description: The ID of the related deal. + + - name: ticket_property_history + description: Each record represents a change to ticket record in Hubspot. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: source + description: '{{ doc("history_source") }}' + + - name: source_id + description: '{{ doc("history_source_id") }}' + + - name: timestamp_instant + description: '{{ doc("history_timestamp") }}' + + - name: ticket_id + description: The ID of the related ticket record. + + - name: name + description: '{{ doc("history_name") }}' + + - name: value + description: '{{ doc("history_value") }}' + + - name: stg_hubspot__ticket + description: Each record represents a ticket in Hubspot. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: id + description: ID of the ticket. + + - name: is_deleted + description: Whether the record was deleted. + + - name: portal_id + description: '{{ doc("portal_id") }}' + + - name: property_hs_pipeline + description: The ID of the tickets's pipeline. + + - name: property_hs_pipeline_stage + description: The ID of the ticket's pipeline stage. + + - name: property_hubspot_owner_id + description: The ID of the deal's owner. + + - name: property_subject + description: Short summary of ticket. + + - name: property_content + description: Text in body of the ticket. + + - name: property_reason_for_contact + description: Reason for customer contact. + + - name: property_root_cause + description: Root cause of customer contact. diff --git a/models/stg_hubspot__ticket.sql b/models/stg_hubspot__ticket.sql new file mode 100644 index 0000000..cfcfb41 --- /dev/null +++ b/models/stg_hubspot__ticket.sql @@ -0,0 +1,38 @@ +{{ config(enabled=enabled_vars(['hubspot_service_enabled','hubspot_ticket_enabled'])) }} + +with base as ( + + select * + from {{ var('ticket') }} + where is_deleted = False + +), fields as ( + + select + id as ticket_id, + property_closed_date as closed_at, + property_createdate as created_at, + property_hubspot_owner_id as owner_id, + property_hs_pipeline as ticket_pipeline_id, + property_hs_pipeline_stage as ticket_pipeline_stage_id, + {{ + fivetran_utils.remove_prefix_from_columns( + columns=columns, + prefix='property_', + exclude=[ + 'id', + 'property_closed_date', + 'property_createdate', + 'property_hubspot_owner_id', + 'property_hs_pipeline', + 'property_hs_pipeline_stage' + ] + ) + }} + + from base + +) + +select * +from fields diff --git a/models/stg_hubspot__ticket.yml b/models/stg_hubspot__ticket.yml new file mode 100644 index 0000000..0aa423b --- /dev/null +++ b/models/stg_hubspot__ticket.yml @@ -0,0 +1,114 @@ +version: 2 + +models: + + - name: stg_hubspot__ticket_company + description: Each record represents a 'link' between a ticket and company. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: ticket_id + description: The ID of the related ticket. + + - name: company_id + description: The ID of the related company. + + - name: stg_hubspot__ticket_contact + description: Each record represents a 'link' between a ticket and a contact. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: ticket_id + description: The ID of the related ticket. + + - name: contact_id + description: The ID of the related contact. + + - name: stg_hubspot__ticket_deal + description: Each record represents a 'link' between a ticket and a deal. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: ticket_id + description: The ID of the related ticket. + + - name: deal_id + description: The ID of the related deal. + + - name: stg_hubspot__ticket_engagement + description: Each record represents a 'link' between a ticket and an engagement. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: ticket_id + description: The ID of the related ticket. + + - name: engagement_id + description: The ID of the related deal. + + - name: stg_hubspot__ticket_property_history + description: Each record represents a change to ticket record in Hubspot. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: change_source + description: '{{ doc("history_source") }}' + + - name: change_source_id + description: '{{ doc("history_source_id") }}' + + - name: change_timestamp + description: '{{ doc("history_timestamp") }}' + + - name: ticket_id + description: The ID of the related ticket record. + + - name: field_name + description: '{{ doc("history_name") }}' + + - name: new_value + description: '{{ doc("history_value") }}' + + - name: stg_hubspot__ticket + description: Each record represents a ticket in Hubspot. + columns: + - name: _fivetran_synced + description: '{{ doc("_fivetran_synced") }}' + + - name: ticket_id + description: ID of the ticket. + tests: + - unique + - not_null + + - name: is_deleted + description: Whether the record was deleted. + + - name: portal_id + description: '{{ doc("portal_id") }}' + + - name: ticket_pipeline_id + description: The ID of the tickets's pipeline. + + - name: ticket_pipeline_stage_id + description: The ID of the ticket's pipeline stage. + + - name: owner_id + description: The ID of the deal's owner. + + - name: subject + description: Short summary of ticket. + + - name: content + description: Text in body of the ticket. + + - name: reason_for_contact + description: Reason for customer contact. + + - name: root_cause + description: Root cause of customer contact. diff --git a/models/stg_hubspot__ticket_company.sql b/models/stg_hubspot__ticket_company.sql new file mode 100644 index 0000000..23e3f95 --- /dev/null +++ b/models/stg_hubspot__ticket_company.sql @@ -0,0 +1,20 @@ +{{ config(enabled=enabled_vars(['hubspot_service_enabled','hubspot_ticket_enabled'])) }} + +with base as ( + + select * + from {{ var('ticket_company') }} + +), fields as ( + + select + _fivetran_synced, + ticket_id, + company_id + + from base + +) + +select * +from fields diff --git a/models/stg_hubspot__ticket_contact.sql b/models/stg_hubspot__ticket_contact.sql new file mode 100644 index 0000000..fbc76f7 --- /dev/null +++ b/models/stg_hubspot__ticket_contact.sql @@ -0,0 +1,20 @@ +{{ config(enabled=enabled_vars(['hubspot_service_enabled','hubspot_ticket_enabled'])) }} + +with base as ( + + select * + from {{ var('ticket_contact') }} + +), fields as ( + + select + _fivetran_synced, + ticket_id, + contact_id + + from base + +) + +select * +from fields diff --git a/models/stg_hubspot__ticket_deal.sql b/models/stg_hubspot__ticket_deal.sql new file mode 100644 index 0000000..d0c4f9d --- /dev/null +++ b/models/stg_hubspot__ticket_deal.sql @@ -0,0 +1,20 @@ +{{ config(enabled=enabled_vars(['hubspot_service_enabled','hubspot_ticket_enabled'])) }} + +with base as ( + + select * + from {{ var('ticket_deal') }} + +), fields as ( + + select + _fivetran_synced, + ticket_id, + deal_id + + from base + +) + +select * +from fields diff --git a/models/stg_hubspot__ticket_engagement.sql b/models/stg_hubspot__ticket_engagement.sql new file mode 100644 index 0000000..9c1f892 --- /dev/null +++ b/models/stg_hubspot__ticket_engagement.sql @@ -0,0 +1,20 @@ +{{ config(enabled=enabled_vars(['hubspot_service_enabled','hubspot_ticket_enabled','hubspot_engagement_enabled'])) }} + +with base as ( + + select * + from {{ var('ticket_engagement') }} + +), fields as ( + + select + _fivetran_synced, + ticket_id, + engagement_id + + from base + +) + +select * +from fields diff --git a/models/stg_hubspot__ticket_property_history.sql b/models/stg_hubspot__ticket_property_history.sql new file mode 100644 index 0000000..e2d8ca8 --- /dev/null +++ b/models/stg_hubspot__ticket_property_history.sql @@ -0,0 +1,24 @@ +{{ config(enabled=enabled_vars(['hubspot_service_enabled','hubspot_ticket_enabled'])) }} + +with base as ( + + select * + from {{ var('ticket_property_history')}} + +), fields as ( + + select + _fivetran_synced, + ticket_id, + name as field_name, + source as change_source, + source_id as change_source_id, + timestamp_instant as change_timestamp, + value as new_value + + from base + +) + +select * +from fields From d40a4c41fc8f3ea86e45e9d2ad57ed856d25ee80 Mon Sep 17 00:00:00 2001 From: Jamesyoub Date: Fri, 19 Feb 2021 13:51:34 -0500 Subject: [PATCH 2/3] add source vars for ticket models --- dbt_project.yml | 75 ++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/dbt_project.yml b/dbt_project.yml index 83a80b9..4dfd786 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -4,38 +4,43 @@ config-version: 2 require-dbt-version: [">=0.18.0", "<0.19.0"] vars: - hubspot_source: - company: "{{ source('hubspot','company') }}" - company_property_history: "{{ source('hubspot','company_property_history') }}" - contact: "{{ source('hubspot','contact') }}" - contact_list: "{{ source('hubspot','contact_list') }}" - contact_list_member: "{{ source('hubspot','contact_list_member') }}" - contact_property_history: "{{ source('hubspot','contact_property_history') }}" - deal: "{{ source('hubspot','deal') }}" - deal_pipeline: "{{ source('hubspot','deal_pipeline') }}" - deal_pipeline_stage: "{{ source('hubspot','deal_pipeline_stage') }}" - deal_property_history: "{{ source('hubspot','deal_property_history') }}" - email_campaign: "{{ source('hubspot','email_campaign') }}" - email_event: "{{ source('hubspot','email_event') }}" - email_event_bounce: "{{ source('hubspot','email_event_bounce') }}" - email_event_click: "{{ source('hubspot','email_event_click') }}" - email_event_deferred: "{{ source('hubspot','email_event_deferred') }}" - email_event_delivered: "{{ source('hubspot','email_event_delivered') }}" - email_event_dropped: "{{ source('hubspot','email_event_dropped') }}" - email_event_forward: "{{ source('hubspot','email_event_forward') }}" - email_event_open: "{{ source('hubspot','email_event_open') }}" - email_event_print: "{{ source('hubspot','email_event_print') }}" - email_event_sent: "{{ source('hubspot','email_event_sent') }}" - email_event_spam_report: "{{ source('hubspot','email_event_spam_report') }}" - email_event_status_change: "{{ source('hubspot','email_event_status_change') }}" - engagement: "{{ source('hubspot','engagement') }}" - engagement_call: "{{ source('hubspot','engagement_call') }}" - engagement_company: "{{ source('hubspot','engagement_company') }}" - engagement_contact: "{{ source('hubspot','engagement_contact') }}" - engagement_deal: "{{ source('hubspot','engagement_deal') }}" - engagement_email: "{{ source('hubspot','engagement_email') }}" - engagement_meeting: "{{ source('hubspot','engagement_meeting') }}" - engagement_note: "{{ source('hubspot','engagement_note') }}" - engagement_task: "{{ source('hubspot','engagement_task') }}" - owner: "{{ source('hubspot','owner') }}" - + hubspot_source: + company: "{{ source('hubspot','company') }}" + company_property_history: "{{ source('hubspot','company_property_history') }}" + contact: "{{ source('hubspot','contact') }}" + contact_list: "{{ source('hubspot','contact_list') }}" + contact_list_member: "{{ source('hubspot','contact_list_member') }}" + contact_property_history: "{{ source('hubspot','contact_property_history') }}" + deal: "{{ source('hubspot','deal') }}" + deal_pipeline: "{{ source('hubspot','deal_pipeline') }}" + deal_pipeline_stage: "{{ source('hubspot','deal_pipeline_stage') }}" + deal_property_history: "{{ source('hubspot','deal_property_history') }}" + email_campaign: "{{ source('hubspot','email_campaign') }}" + email_event: "{{ source('hubspot','email_event') }}" + email_event_bounce: "{{ source('hubspot','email_event_bounce') }}" + email_event_click: "{{ source('hubspot','email_event_click') }}" + email_event_deferred: "{{ source('hubspot','email_event_deferred') }}" + email_event_delivered: "{{ source('hubspot','email_event_delivered') }}" + email_event_dropped: "{{ source('hubspot','email_event_dropped') }}" + email_event_forward: "{{ source('hubspot','email_event_forward') }}" + email_event_open: "{{ source('hubspot','email_event_open') }}" + email_event_print: "{{ source('hubspot','email_event_print') }}" + email_event_sent: "{{ source('hubspot','email_event_sent') }}" + email_event_spam_report: "{{ source('hubspot','email_event_spam_report') }}" + email_event_status_change: "{{ source('hubspot','email_event_status_change') }}" + engagement: "{{ source('hubspot','engagement') }}" + engagement_call: "{{ source('hubspot','engagement_call') }}" + engagement_company: "{{ source('hubspot','engagement_company') }}" + engagement_contact: "{{ source('hubspot','engagement_contact') }}" + engagement_deal: "{{ source('hubspot','engagement_deal') }}" + engagement_email: "{{ source('hubspot','engagement_email') }}" + engagement_meeting: "{{ source('hubspot','engagement_meeting') }}" + engagement_note: "{{ source('hubspot','engagement_note') }}" + engagement_task: "{{ source('hubspot','engagement_task') }}" + owner: "{{ source('hubspot','owner') }}" + ticket_company: "{{ source('hubspot','ticket_company') }}" + ticket_contact: "{{ source('hubspot','ticket_contact') }}" + ticket_deal: "{{ source('hubspot','ticket_deal') }}" + ticket_engagement: "{{ source('hubspot','ticket_engagement') }}" + ticket_property_history: "{{ source('hubspot','ticket_property_history') }}" + ticket: "{{ source('hubspot','ticket') }}" From e7b1832836b972d88648a82fe4ae738f222291bc Mon Sep 17 00:00:00 2001 From: Jamesyoub Date: Fri, 19 Feb 2021 13:51:57 -0500 Subject: [PATCH 3/3] updating readme to reflect added service hub --- README.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 7c7f037..3d4e63e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Hubspot (Source) -This package models Hubspot data from [Fivetran's connector](https://fivetran.com/docs/applications/hubspot). It uses data in the format described by the [marketing](https://docs.google.com/presentation/d/1hrPp310SNK2qyESCV_g_JFx_Knm1MwB467wN3dEgy0M/edit#slide=id.g244d368397_0_1) and [sales](https://docs.google.com/presentation/d/1KABQnt8WmtZe7u5l7WFUoPIsWzv63P9gsWF79XGLoZE/edit#slide=id.g244d368397_0_1) ERDs. +This package models Hubspot data from [Fivetran's connector](https://fivetran.com/docs/applications/hubspot). It uses data in the format described by the [marketing](https://docs.google.com/presentation/d/1hrPp310SNK2qyESCV_g_JFx_Knm1MwB467wN3dEgy0M/edit#slide=id.g244d368397_0_1), [sales](https://docs.google.com/presentation/d/1KABQnt8WmtZe7u5l7WFUoPIsWzv63P9gsWF79XGLoZE/edit#slide=id.g244d368397_0_1) and [service](https://docs.google.com/presentation/d/1OIPFpkqkSYAPPFfq1-yICdfArg6mmG71P-cm15cpy7U/edit) ERDs. This package enriches your Fivetran data by doing the following: @@ -33,12 +33,12 @@ config-version: 2 vars: hubspot_source: hubspot_database: your_database_name - hubspot_schema: your_schema_name + hubspot_schema: your_schema_name ``` ### Disabling models -When setting up your Hubspot connection in Fivetran, it is possible that not every table this package expects will be synced. This can occur because you either don't use that functionality in Hubspot or have actively decided to not sync some tables. In order to disable the relevant functionality in the package, you will need to add the relevant variables. By default, all variables are assumed to be `true`. You only need to add variables for the tables you would like to disable: +When setting up your Hubspot connection in Fivetran, it is possible that not every table this package expects will be synced. This can occur because you either don't use that functionality in Hubspot or have actively decided to not sync some tables. In order to disable the relevant functionality in the package, you will need to add the relevant variables. By default, all variables are assumed to be `true`. You only need to add variables for the tables you would like to disable: ```yml # dbt_project.yml @@ -51,7 +51,7 @@ vars: # Marketing - hubspot_marketing_enabled: false # Disables all marketing models + hubspot_marketing_enabled: false # Disables all marketing models hubspot_email_event_enabled: false # Disables all email_event models and functionality hubspot_email_event_bounce_enabled: false hubspot_email_event_click_enabled: false @@ -80,13 +80,17 @@ vars: hubspot_engagement_meetings_enabled: false hubspot_engagement_notes_enabled: false hubspot_engagement_tasks_enabled: false + + # Service + hubspot_service_enabled: false # Disables all service models + hubspot_ticket_enabled: false # Disables all ticket models and functionality ``` ## Contributions Additional contributions to this package are very welcome! Please create issues -or open PRs against `master`. Check out -[this post](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) +or open PRs against `master`. Check out +[this post](https://discourse.getdbt.com/t/contributing-to-a-dbt-package/657) on the best workflow for contributing to a package. ## Resources: