diff --git a/airbyte-integrations/connectors/source-hubspot/integration_tests/incremental_catalog.json b/airbyte-integrations/connectors/source-hubspot/integration_tests/incremental_catalog.json index 9175ed2b72aad..a88047afb1f3d 100644 --- a/airbyte-integrations/connectors/source-hubspot/integration_tests/incremental_catalog.json +++ b/airbyte-integrations/connectors/source-hubspot/integration_tests/incremental_catalog.json @@ -1,328 +1,3715 @@ { "streams": [ - { - "stream": { - "name": "campaigns", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["lastUpdatedTime"] - }, - "sync_mode": "incremental", - "cursor_field": ["lastUpdatedTime"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "companies", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "contact_lists", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, { "stream": { "name": "contacts", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], + "json_schema": { + "$schema": "http://json-schema.org/draft-07/schema#", + "properties": { + "archived": { + "description": "Indicates if the contact is archived or not.", + "type": [ + "null", + "boolean" + ] + }, + "companies": { + "description": "List of companies associated with the contact.", + "items": { + "description": "Details of a company associated with the contact.", + "type": [ + "null", + "string" + ] + }, + "type": [ + "null", + "array" + ] + }, + "createdAt": { + "description": "Date and time when the contact was created.", + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "id": { + "description": "Unique identifier for the contact.", + "type": [ + "null", + "string" + ] + }, + "properties": { + "properties": { + "address": { + "type": [ + "null", + "string" + ] + }, + "annualrevenue": { + "type": [ + "null", + "string" + ] + }, + "associatedcompanyid": { + "type": [ + "null", + "number" + ] + }, + "associatedcompanylastupdated": { + "type": [ + "null", + "number" + ] + }, + "bird_connector_test": { + "type": [ + "null", + "string" + ] + }, + "city": { + "type": [ + "null", + "string" + ] + }, + "closedate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "company": { + "type": [ + "null", + "string" + ] + }, + "company_size": { + "type": [ + "null", + "string" + ] + }, + "country": { + "type": [ + "null", + "string" + ] + }, + "createdate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "currentlyinworkflow": { + "type": [ + "null", + "string" + ] + }, + "date_of_birth": { + "type": [ + "null", + "string" + ] + }, + "days_to_close": { + "type": [ + "null", + "number" + ] + }, + "degree": { + "type": [ + "null", + "string" + ] + }, + "email": { + "type": [ + "null", + "string" + ] + }, + "engagements_last_meeting_booked": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "engagements_last_meeting_booked_campaign": { + "type": [ + "null", + "string" + ] + }, + "engagements_last_meeting_booked_medium": { + "type": [ + "null", + "string" + ] + }, + "engagements_last_meeting_booked_source": { + "type": [ + "null", + "string" + ] + }, + "fax": { + "type": [ + "null", + "string" + ] + }, + "field_of_study": { + "type": [ + "null", + "string" + ] + }, + "firstname": { + "type": [ + "null", + "string" + ] + }, + "first_conversion_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "first_conversion_event_name": { + "type": [ + "null", + "string" + ] + }, + "first_deal_created_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "gender": { + "type": [ + "null", + "string" + ] + }, + "graduation_date": { + "type": [ + "null", + "string" + ] + }, + "hs_additional_emails": { + "type": [ + "null", + "string" + ] + }, + "hs_all_accessible_team_ids": { + "type": [ + "null", + "string" + ] + }, + "hs_all_contact_vids": { + "type": [ + "null", + "string" + ] + }, + "hs_all_owner_ids": { + "type": [ + "null", + "string" + ] + }, + "hs_all_team_ids": { + "type": [ + "null", + "string" + ] + }, + "hs_analytics_average_page_views": { + "type": [ + "null", + "number" + ] + }, + "hs_analytics_first_referrer": { + "type": [ + "null", + "string" + ] + }, + "hs_analytics_first_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_analytics_first_touch_converting_campaign": { + "type": [ + "null", + "string" + ] + }, + "hs_analytics_first_url": { + "type": [ + "null", + "string" + ] + }, + "hs_analytics_first_visit_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_analytics_last_referrer": { + "type": [ + "null", + "string" + ] + }, + "hs_analytics_last_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_analytics_last_touch_converting_campaign": { + "type": [ + "null", + "string" + ] + }, + "hs_analytics_last_url": { + "type": [ + "null", + "string" + ] + }, + "hs_analytics_last_visit_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_analytics_num_event_completions": { + "type": [ + "null", + "number" + ] + }, + "hs_analytics_num_page_views": { + "type": [ + "null", + "number" + ] + }, + "hs_analytics_num_visits": { + "type": [ + "null", + "number" + ] + }, + "hs_analytics_revenue": { + "type": [ + "null", + "number" + ] + }, + "hs_associated_target_accounts": { + "type": [ + "null", + "number" + ] + }, + "hs_avatar_filemanager_key": { + "type": [ + "null", + "string" + ] + }, + "hs_buying_role": { + "type": [ + "null", + "string" + ] + }, + "hs_calculated_form_submissions": { + "type": [ + "null", + "string" + ] + }, + "hs_calculated_merged_vids": { + "type": [ + "null", + "string" + ] + }, + "hs_calculated_mobile_number": { + "type": [ + "null", + "string" + ] + }, + "hs_calculated_phone_number": { + "type": [ + "null", + "string" + ] + }, + "hs_calculated_phone_number_area_code": { + "type": [ + "null", + "string" + ] + }, + "hs_calculated_phone_number_country_code": { + "type": [ + "null", + "string" + ] + }, + "hs_calculated_phone_number_region_code": { + "type": [ + "null", + "string" + ] + }, + "hs_clicked_linkedin_ad": { + "type": [ + "null", + "string" + ] + }, + "hs_contact_enrichment_opt_out": { + "type": [ + "null", + "boolean" + ] + }, + "hs_contact_enrichment_opt_out_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_content_membership_email": { + "type": [ + "null", + "string" + ] + }, + "hs_content_membership_email_confirmed": { + "type": [ + "null", + "boolean" + ] + }, + "hs_content_membership_follow_up_enqueued_at": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_content_membership_notes": { + "type": [ + "null", + "string" + ] + }, + "hs_content_membership_registered_at": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_content_membership_registration_domain_sent_to": { + "type": [ + "null", + "string" + ] + }, + "hs_content_membership_registration_email_sent_at": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_content_membership_status": { + "type": [ + "null", + "string" + ] + }, + "hs_conversations_visitor_email": { + "type": [ + "null", + "string" + ] + }, + "hs_country_region_code": { + "type": [ + "null", + "string" + ] + }, + "hs_count_is_unworked": { + "type": [ + "null", + "number" + ] + }, + "hs_count_is_worked": { + "type": [ + "null", + "number" + ] + }, + "hs_createdate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_created_by_conversations": { + "type": [ + "null", + "boolean" + ] + }, + "hs_created_by_user_id": { + "type": [ + "null", + "number" + ] + }, + "hs_date_entered_customer": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_entered_evangelist": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_entered_lead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_entered_marketingqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_entered_opportunity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_entered_other": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_entered_salesqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_entered_subscriber": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_exited_customer": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_exited_evangelist": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_exited_lead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_exited_marketingqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_exited_opportunity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_exited_other": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_exited_salesqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_date_exited_subscriber": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_document_last_revisited": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_emailconfirmationstatus": { + "type": [ + "null", + "string" + ] + }, + "hs_email_bad_address": { + "type": [ + "null", + "boolean" + ] + }, + "hs_email_bounce": { + "type": [ + "null", + "number" + ] + }, + "hs_email_click": { + "type": [ + "null", + "number" + ] + }, + "hs_email_customer_quarantined_reason": { + "type": [ + "null", + "string" + ] + }, + "hs_email_delivered": { + "type": [ + "null", + "number" + ] + }, + "hs_email_domain": { + "type": [ + "null", + "string" + ] + }, + "hs_email_first_click_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_email_first_open_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_email_first_reply_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_email_first_send_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_email_hard_bounce_reason": { + "type": [ + "null", + "string" + ] + }, + "hs_email_hard_bounce_reason_enum": { + "type": [ + "null", + "string" + ] + }, + "hs_email_is_ineligible": { + "type": [ + "null", + "boolean" + ] + }, + "hs_email_last_click_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_email_last_email_name": { + "type": [ + "null", + "string" + ] + }, + "hs_email_last_open_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_email_last_reply_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_email_last_send_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_email_open": { + "type": [ + "null", + "number" + ] + }, + "hs_email_optout": { + "type": [ + "null", + "boolean" + ] + }, + "hs_email_optout_353635700": { + "type": [ + "null", + "string" + ] + }, + "hs_email_optout_353635701": { + "type": [ + "null", + "string" + ] + }, + "hs_email_quarantined": { + "type": [ + "null", + "boolean" + ] + }, + "hs_email_quarantined_reason": { + "type": [ + "null", + "string" + ] + }, + "hs_email_replied": { + "type": [ + "null", + "number" + ] + }, + "hs_email_sends_since_last_engagement": { + "type": [ + "null", + "number" + ] + }, + "hs_facebook_ad_clicked": { + "type": [ + "null", + "boolean" + ] + }, + "hs_facebook_click_id": { + "type": [ + "null", + "string" + ] + }, + "hs_first_engagement_object_id": { + "type": [ + "null", + "number" + ] + }, + "hs_first_order_closed_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_first_outreach_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_first_subscription_create_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_google_click_id": { + "type": [ + "null", + "string" + ] + }, + "hs_has_active_subscription": { + "type": [ + "null", + "number" + ] + }, + "hs_ip_timezone": { + "type": [ + "null", + "string" + ] + }, + "hs_is_contact": { + "type": [ + "null", + "boolean" + ] + }, + "hs_is_enriched": { + "type": [ + "null", + "boolean" + ] + }, + "hs_is_unworked": { + "type": [ + "null", + "boolean" + ] + }, + "hs_language": { + "type": [ + "null", + "string" + ] + }, + "hs_lastmodifieddate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_last_sales_activity_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_last_sales_activity_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_last_sales_activity_type": { + "type": [ + "null", + "string" + ] + }, + "hs_latest_disqualified_lead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_latest_meeting_activity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_latest_open_lead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_latest_qualified_lead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_latest_sequence_ended_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_latest_sequence_enrolled": { + "type": [ + "null", + "number" + ] + }, + "hs_latest_sequence_enrolled_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_latest_sequence_finished_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_latest_sequence_unenrolled_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_latest_source": { + "type": [ + "null", + "string" + ] + }, + "hs_latest_source_data_1": { + "type": [ + "null", + "string" + ] + }, + "hs_latest_source_data_2": { + "type": [ + "null", + "string" + ] + }, + "hs_latest_source_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_latest_subscription_create_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_lead_status": { + "type": [ + "null", + "string" + ] + }, + "hs_legal_basis": { + "type": [ + "null", + "string" + ] + }, + "hs_lifecyclestage_customer_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_lifecyclestage_evangelist_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_lifecyclestage_lead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_lifecyclestage_marketingqualifiedlead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_lifecyclestage_opportunity_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_lifecyclestage_other_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_lifecyclestage_salesqualifiedlead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_lifecyclestage_subscriber_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_linkedin_ad_clicked": { + "type": [ + "null", + "string" + ] + }, + "hs_linkedin_url": { + "type": [ + "null", + "string" + ] + }, + "hs_membership_has_accessed_private_content": { + "type": [ + "null", + "number" + ] + }, + "hs_membership_last_private_content_access_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_merged_object_ids": { + "type": [ + "null", + "string" + ] + }, + "hs_mobile_sdk_push_tokens": { + "type": [ + "null", + "string" + ] + }, + "hs_notes_next_activity_type": { + "type": [ + "null", + "string" + ] + }, + "hs_object_id": { + "type": [ + "null", + "number" + ] + }, + "hs_object_source": { + "type": [ + "null", + "string" + ] + }, + "hs_object_source_detail_1": { + "type": [ + "null", + "string" + ] + }, + "hs_object_source_detail_2": { + "type": [ + "null", + "string" + ] + }, + "hs_object_source_detail_3": { + "type": [ + "null", + "string" + ] + }, + "hs_object_source_id": { + "type": [ + "null", + "string" + ] + }, + "hs_object_source_label": { + "type": [ + "null", + "string" + ] + }, + "hs_object_source_user_id": { + "type": [ + "null", + "number" + ] + }, + "hs_persona": { + "type": [ + "null", + "string" + ] + }, + "hs_pinned_engagement_id": { + "type": [ + "null", + "number" + ] + }, + "hs_pipeline": { + "type": [ + "null", + "string" + ] + }, + "hs_prospecting_agent_actively_enrolled_count": { + "type": [ + "null", + "number" + ] + }, + "hs_quarantined_emails": { + "type": [ + "null", + "string" + ] + }, + "hs_read_only": { + "type": [ + "null", + "boolean" + ] + }, + "hs_recent_closed_order_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_registered_member": { + "type": [ + "null", + "number" + ] + }, + "hs_registration_method": { + "type": [ + "null", + "string" + ] + }, + "hs_role": { + "type": [ + "null", + "string" + ] + }, + "hs_sales_email_last_clicked": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_sales_email_last_opened": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_sales_email_last_replied": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_sa_first_engagement_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_sa_first_engagement_descr": { + "type": [ + "null", + "string" + ] + }, + "hs_sa_first_engagement_object_type": { + "type": [ + "null", + "string" + ] + }, + "hs_searchable_calculated_international_mobile_number": { + "type": [ + "null", + "string" + ] + }, + "hs_searchable_calculated_international_phone_number": { + "type": [ + "null", + "string" + ] + }, + "hs_searchable_calculated_mobile_number": { + "type": [ + "null", + "string" + ] + }, + "hs_searchable_calculated_phone_number": { + "type": [ + "null", + "string" + ] + }, + "hs_seniority": { + "type": [ + "null", + "string" + ] + }, + "hs_sequences_actively_enrolled_count": { + "type": [ + "null", + "number" + ] + }, + "hs_sequences_enrolled_count": { + "type": [ + "null", + "number" + ] + }, + "hs_sequences_is_enrolled": { + "type": [ + "null", + "boolean" + ] + }, + "hs_state_code": { + "type": [ + "null", + "string" + ] + }, + "hs_sub_role": { + "type": [ + "null", + "string" + ] + }, + "hs_testpurge": { + "type": [ + "null", + "string" + ] + }, + "hs_testrollback": { + "type": [ + "null", + "string" + ] + }, + "hs_timezone": { + "type": [ + "null", + "string" + ] + }, + "hs_time_in_customer": { + "type": [ + "null", + "number" + ] + }, + "hs_time_in_evangelist": { + "type": [ + "null", + "number" + ] + }, + "hs_time_in_lead": { + "type": [ + "null", + "number" + ] + }, + "hs_time_in_marketingqualifiedlead": { + "type": [ + "null", + "number" + ] + }, + "hs_time_in_opportunity": { + "type": [ + "null", + "number" + ] + }, + "hs_time_in_other": { + "type": [ + "null", + "number" + ] + }, + "hs_time_in_salesqualifiedlead": { + "type": [ + "null", + "number" + ] + }, + "hs_time_in_subscriber": { + "type": [ + "null", + "number" + ] + }, + "hs_time_to_first_engagement": { + "type": [ + "null", + "number" + ] + }, + "hs_unique_creation_key": { + "type": [ + "null", + "string" + ] + }, + "hs_updated_by_user_id": { + "type": [ + "null", + "number" + ] + }, + "hs_user_ids_of_all_notification_followers": { + "type": [ + "null", + "string" + ] + }, + "hs_user_ids_of_all_notification_unfollowers": { + "type": [ + "null", + "string" + ] + }, + "hs_user_ids_of_all_owners": { + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_entered_customer": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_entered_evangelist": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_entered_lead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_entered_marketingqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_entered_opportunity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_entered_other": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_entered_salesqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_entered_subscriber": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_exited_customer": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_exited_evangelist": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_exited_lead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_exited_marketingqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_exited_opportunity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_exited_other": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_exited_salesqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_v2_date_exited_subscriber": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hs_was_imported": { + "type": [ + "null", + "boolean" + ] + }, + "hs_whatsapp_phone_number": { + "type": [ + "null", + "string" + ] + }, + "hubspotscore": { + "type": [ + "null", + "number" + ] + }, + "hubspot_owner_assigneddate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "hubspot_owner_id": { + "type": [ + "null", + "string" + ] + }, + "hubspot_team_id": { + "type": [ + "null", + "string" + ] + }, + "industry": { + "type": [ + "null", + "string" + ] + }, + "ip_city": { + "type": [ + "null", + "string" + ] + }, + "ip_country": { + "type": [ + "null", + "string" + ] + }, + "ip_country_code": { + "type": [ + "null", + "string" + ] + }, + "ip_latlon": { + "type": [ + "null", + "string" + ] + }, + "ip_state": { + "type": [ + "null", + "string" + ] + }, + "ip_state_code": { + "type": [ + "null", + "string" + ] + }, + "ip_zipcode": { + "type": [ + "null", + "string" + ] + }, + "jobtitle": { + "type": [ + "null", + "string" + ] + }, + "job_function": { + "type": [ + "null", + "string" + ] + }, + "lastmodifieddate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "lastname": { + "type": [ + "null", + "string" + ] + }, + "lifecyclestage": { + "type": [ + "null", + "string" + ] + }, + "marital_status": { + "type": [ + "null", + "string" + ] + }, + "message": { + "type": [ + "null", + "string" + ] + }, + "military_status": { + "type": [ + "null", + "string" + ] + }, + "mobilephone": { + "type": [ + "null", + "string" + ] + }, + "notes_last_contacted": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "notes_last_updated": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "notes_next_activity_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "numemployees": { + "type": [ + "null", + "string" + ] + }, + "num_associated_deals": { + "type": [ + "null", + "number" + ] + }, + "num_contacted_notes": { + "type": [ + "null", + "number" + ] + }, + "num_conversion_events": { + "type": [ + "null", + "number" + ] + }, + "num_notes": { + "type": [ + "null", + "number" + ] + }, + "num_unique_conversion_events": { + "type": [ + "null", + "number" + ] + }, + "phone": { + "type": [ + "null", + "string" + ] + }, + "recent_conversion_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "recent_conversion_event_name": { + "type": [ + "null", + "string" + ] + }, + "recent_deal_amount": { + "type": [ + "null", + "number" + ] + }, + "recent_deal_close_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "relationship_status": { + "type": [ + "null", + "string" + ] + }, + "salutation": { + "type": [ + "null", + "string" + ] + }, + "school": { + "type": [ + "null", + "string" + ] + }, + "seniority": { + "type": [ + "null", + "string" + ] + }, + "start_date": { + "type": [ + "null", + "string" + ] + }, + "state": { + "type": [ + "null", + "string" + ] + }, + "surveymonkeyeventlastupdated": { + "type": [ + "null", + "number" + ] + }, + "total_revenue": { + "type": [ + "null", + "number" + ] + }, + "twitterhandle": { + "type": [ + "null", + "string" + ] + }, + "vip": { + "type": [ + "null", + "boolean" + ] + }, + "webinareventlastupdated": { + "type": [ + "null", + "number" + ] + }, + "website": { + "type": [ + "null", + "string" + ] + }, + "work_email": { + "type": [ + "null", + "string" + ] + }, + "zip": { + "type": [ + "null", + "string" + ] + } + }, + "type": "object" + }, + "properties_address": { + "type": [ + "null", + "string" + ] + }, + "properties_annualrevenue": { + "type": [ + "null", + "string" + ] + }, + "properties_associatedcompanyid": { + "type": [ + "null", + "number" + ] + }, + "properties_associatedcompanylastupdated": { + "type": [ + "null", + "number" + ] + }, + "properties_bird_connector_test": { + "type": [ + "null", + "string" + ] + }, + "properties_city": { + "type": [ + "null", + "string" + ] + }, + "properties_closedate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_company": { + "type": [ + "null", + "string" + ] + }, + "properties_company_size": { + "type": [ + "null", + "string" + ] + }, + "properties_country": { + "type": [ + "null", + "string" + ] + }, + "properties_createdate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_currentlyinworkflow": { + "type": [ + "null", + "string" + ] + }, + "properties_date_of_birth": { + "type": [ + "null", + "string" + ] + }, + "properties_days_to_close": { + "type": [ + "null", + "number" + ] + }, + "properties_degree": { + "type": [ + "null", + "string" + ] + }, + "properties_email": { + "type": [ + "null", + "string" + ] + }, + "properties_engagements_last_meeting_booked": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_engagements_last_meeting_booked_campaign": { + "type": [ + "null", + "string" + ] + }, + "properties_engagements_last_meeting_booked_medium": { + "type": [ + "null", + "string" + ] + }, + "properties_engagements_last_meeting_booked_source": { + "type": [ + "null", + "string" + ] + }, + "properties_fax": { + "type": [ + "null", + "string" + ] + }, + "properties_field_of_study": { + "type": [ + "null", + "string" + ] + }, + "properties_firstname": { + "type": [ + "null", + "string" + ] + }, + "properties_first_conversion_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_first_conversion_event_name": { + "type": [ + "null", + "string" + ] + }, + "properties_first_deal_created_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_gender": { + "type": [ + "null", + "string" + ] + }, + "properties_graduation_date": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_additional_emails": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_all_accessible_team_ids": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_all_contact_vids": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_all_owner_ids": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_all_team_ids": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_average_page_views": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_analytics_first_referrer": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_first_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_first_touch_converting_campaign": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_first_url": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_first_visit_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_last_referrer": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_last_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_last_touch_converting_campaign": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_last_url": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_last_visit_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_analytics_num_event_completions": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_analytics_num_page_views": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_analytics_num_visits": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_analytics_revenue": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_associated_target_accounts": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_avatar_filemanager_key": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_buying_role": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_calculated_form_submissions": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_calculated_merged_vids": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_calculated_mobile_number": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_calculated_phone_number": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_calculated_phone_number_area_code": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_calculated_phone_number_country_code": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_calculated_phone_number_region_code": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_clicked_linkedin_ad": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_contact_enrichment_opt_out": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_contact_enrichment_opt_out_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_content_membership_email": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_content_membership_email_confirmed": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_content_membership_follow_up_enqueued_at": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_content_membership_notes": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_content_membership_registered_at": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_content_membership_registration_domain_sent_to": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_content_membership_registration_email_sent_at": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_content_membership_status": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_conversations_visitor_email": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_country_region_code": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_count_is_unworked": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_count_is_worked": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_createdate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_created_by_conversations": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_created_by_user_id": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_date_entered_customer": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_entered_evangelist": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_entered_lead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_entered_marketingqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_entered_opportunity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_entered_other": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_entered_salesqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_entered_subscriber": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_exited_customer": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_exited_evangelist": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_exited_lead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_exited_marketingqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_exited_opportunity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_exited_other": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_exited_salesqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_date_exited_subscriber": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_document_last_revisited": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_emailconfirmationstatus": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_bad_address": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_email_bounce": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_email_click": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_email_customer_quarantined_reason": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_delivered": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_email_domain": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_first_click_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_first_open_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_first_reply_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_first_send_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_hard_bounce_reason": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_hard_bounce_reason_enum": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_is_ineligible": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_email_last_click_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_last_email_name": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_last_open_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_last_reply_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_last_send_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_open": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_email_optout": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_email_optout_353635700": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_optout_353635701": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_quarantined": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_email_quarantined_reason": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_email_replied": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_email_sends_since_last_engagement": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_facebook_ad_clicked": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_facebook_click_id": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_first_engagement_object_id": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_first_order_closed_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_first_outreach_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_first_subscription_create_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_google_click_id": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_has_active_subscription": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_ip_timezone": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_is_contact": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_is_enriched": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_is_unworked": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_language": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_lastmodifieddate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_last_sales_activity_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_last_sales_activity_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_last_sales_activity_type": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_disqualified_lead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_meeting_activity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_open_lead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_qualified_lead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_sequence_ended_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_sequence_enrolled": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_latest_sequence_enrolled_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_sequence_finished_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_sequence_unenrolled_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_source": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_source_data_1": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_source_data_2": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_source_timestamp": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_latest_subscription_create_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_lead_status": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_legal_basis": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_lifecyclestage_customer_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_lifecyclestage_evangelist_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_lifecyclestage_lead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_lifecyclestage_marketingqualifiedlead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_lifecyclestage_opportunity_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_lifecyclestage_other_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_lifecyclestage_salesqualifiedlead_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_lifecyclestage_subscriber_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_linkedin_ad_clicked": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_linkedin_url": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_membership_has_accessed_private_content": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_membership_last_private_content_access_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_merged_object_ids": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_mobile_sdk_push_tokens": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_notes_next_activity_type": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_object_id": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_object_source": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_object_source_detail_1": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_object_source_detail_2": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_object_source_detail_3": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_object_source_id": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_object_source_label": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_object_source_user_id": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_persona": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_pinned_engagement_id": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_pipeline": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_prospecting_agent_actively_enrolled_count": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_quarantined_emails": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_read_only": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_recent_closed_order_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_registered_member": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_registration_method": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_role": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_sales_email_last_clicked": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_sales_email_last_opened": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_sales_email_last_replied": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_sa_first_engagement_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_sa_first_engagement_descr": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_sa_first_engagement_object_type": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_searchable_calculated_international_mobile_number": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_searchable_calculated_international_phone_number": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_searchable_calculated_mobile_number": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_searchable_calculated_phone_number": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_seniority": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_sequences_actively_enrolled_count": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_sequences_enrolled_count": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_sequences_is_enrolled": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_state_code": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_sub_role": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_testpurge": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_testrollback": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_timezone": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_time_in_customer": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_time_in_evangelist": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_time_in_lead": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_time_in_marketingqualifiedlead": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_time_in_opportunity": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_time_in_other": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_time_in_salesqualifiedlead": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_time_in_subscriber": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_time_to_first_engagement": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_unique_creation_key": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_updated_by_user_id": { + "type": [ + "null", + "number" + ] + }, + "properties_hs_user_ids_of_all_notification_followers": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_user_ids_of_all_notification_unfollowers": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_user_ids_of_all_owners": { + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_entered_customer": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_entered_evangelist": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_entered_lead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_entered_marketingqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_entered_opportunity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_entered_other": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_entered_salesqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_entered_subscriber": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_exited_customer": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_exited_evangelist": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_exited_lead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_exited_marketingqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_exited_opportunity": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_exited_other": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_exited_salesqualifiedlead": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_v2_date_exited_subscriber": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hs_was_imported": { + "type": [ + "null", + "boolean" + ] + }, + "properties_hs_whatsapp_phone_number": { + "type": [ + "null", + "string" + ] + }, + "properties_hubspotscore": { + "type": [ + "null", + "number" + ] + }, + "properties_hubspot_owner_assigneddate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_hubspot_owner_id": { + "type": [ + "null", + "string" + ] + }, + "properties_hubspot_team_id": { + "type": [ + "null", + "string" + ] + }, + "properties_industry": { + "type": [ + "null", + "string" + ] + }, + "properties_ip_city": { + "type": [ + "null", + "string" + ] + }, + "properties_ip_country": { + "type": [ + "null", + "string" + ] + }, + "properties_ip_country_code": { + "type": [ + "null", + "string" + ] + }, + "properties_ip_latlon": { + "type": [ + "null", + "string" + ] + }, + "properties_ip_state": { + "type": [ + "null", + "string" + ] + }, + "properties_ip_state_code": { + "type": [ + "null", + "string" + ] + }, + "properties_ip_zipcode": { + "type": [ + "null", + "string" + ] + }, + "properties_jobtitle": { + "type": [ + "null", + "string" + ] + }, + "properties_job_function": { + "type": [ + "null", + "string" + ] + }, + "properties_lastmodifieddate": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_lastname": { + "type": [ + "null", + "string" + ] + }, + "properties_lifecyclestage": { + "type": [ + "null", + "string" + ] + }, + "properties_marital_status": { + "type": [ + "null", + "string" + ] + }, + "properties_message": { + "type": [ + "null", + "string" + ] + }, + "properties_military_status": { + "type": [ + "null", + "string" + ] + }, + "properties_mobilephone": { + "type": [ + "null", + "string" + ] + }, + "properties_notes_last_contacted": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_notes_last_updated": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_notes_next_activity_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_numemployees": { + "type": [ + "null", + "string" + ] + }, + "properties_num_associated_deals": { + "type": [ + "null", + "number" + ] + }, + "properties_num_contacted_notes": { + "type": [ + "null", + "number" + ] + }, + "properties_num_conversion_events": { + "type": [ + "null", + "number" + ] + }, + "properties_num_notes": { + "type": [ + "null", + "number" + ] + }, + "properties_num_unique_conversion_events": { + "type": [ + "null", + "number" + ] + }, + "properties_phone": { + "type": [ + "null", + "string" + ] + }, + "properties_recent_conversion_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_recent_conversion_event_name": { + "type": [ + "null", + "string" + ] + }, + "properties_recent_deal_amount": { + "type": [ + "null", + "number" + ] + }, + "properties_recent_deal_close_date": { + "format": "date-time", + "type": [ + "null", + "string" + ] + }, + "properties_relationship_status": { + "type": [ + "null", + "string" + ] + }, + "properties_salutation": { + "type": [ + "null", + "string" + ] + }, + "properties_school": { + "type": [ + "null", + "string" + ] + }, + "properties_seniority": { + "type": [ + "null", + "string" + ] + }, + "properties_start_date": { + "type": [ + "null", + "string" + ] + }, + "properties_state": { + "type": [ + "null", + "string" + ] + }, + "properties_surveymonkeyeventlastupdated": { + "type": [ + "null", + "number" + ] + }, + "properties_total_revenue": { + "type": [ + "null", + "number" + ] + }, + "properties_twitterhandle": { + "type": [ + "null", + "string" + ] + }, + "properties_vip": { + "type": [ + "null", + "boolean" + ] + }, + "properties_webinareventlastupdated": { + "type": [ + "null", + "number" + ] + }, + "properties_website": { + "type": [ + "null", + "string" + ] + }, + "properties_work_email": { + "type": [ + "null", + "string" + ] + }, + "properties_zip": { + "type": [ + "null", + "string" + ] + }, + "updatedAt": { + "description": "Date and time when the contact was last updated.", + "format": "date-time", + "type": [ + "null", + "string" + ] + } + }, + "type": [ + "null", + "object" + ] + }, + "supported_sync_modes": [ + "full_refresh", + "incremental" + ], "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] + "default_cursor_field": [ + "updatedAt" + ] }, "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "deal_pipelines", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "deal_splits", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], + "cursor_field": [ + "updatedAt" + ], "destination_sync_mode": "append" }, { "stream": { "name": "deals", "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "deals_archived", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["archivedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["archivedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "email_events", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["created"] - }, - "sync_mode": "incremental", - "cursor_field": ["created"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "engagements", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["lastUpdated"] - }, - "sync_mode": "incremental", - "cursor_field": ["lastUpdated"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "engagements_calls", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "engagements_emails", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "engagements_meetings", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "engagements_notes", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "engagements_tasks", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "forms", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "goals", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "leads", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "line_items", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "owners", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "products", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "subscription_changes", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["timestamp"] - }, - "sync_mode": "incremental", - "cursor_field": ["timestamp"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "tickets", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "workflows", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["updatedAt"] - }, - "sync_mode": "incremental", - "cursor_field": ["updatedAt"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "contacts_property_history", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["timestamp"] - }, - "sync_mode": "incremental", - "cursor_field": ["timestamp"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "companies_property_history", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], - "source_defined_cursor": true, - "default_cursor_field": ["timestamp"] - }, - "sync_mode": "incremental", - "cursor_field": ["timestamp"], - "destination_sync_mode": "append" - }, - { - "stream": { - "name": "deals_property_history", - "json_schema": {}, - "supported_sync_modes": ["full_refresh", "incremental"], + "supported_sync_modes": [ + "full_refresh", + "incremental" + ], "source_defined_cursor": true, - "default_cursor_field": ["timestamp"] + "default_cursor_field": [ + "updatedAt" + ] }, "sync_mode": "incremental", - "cursor_field": ["timestamp"], + "cursor_field": [ + "updatedAt" + ], "destination_sync_mode": "append" } ] -} +} \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-hubspot/sample_files/sample_config_oauth.json b/airbyte-integrations/connectors/source-hubspot/sample_files/sample_config_oauth.json index f3b7f165c557b..5ec85a8ba904b 100644 --- a/airbyte-integrations/connectors/source-hubspot/sample_files/sample_config_oauth.json +++ b/airbyte-integrations/connectors/source-hubspot/sample_files/sample_config_oauth.json @@ -5,5 +5,68 @@ "client_id": "123456789_client_id_hubspot", "client_secret": "123456789_client_secret_hubspot", "refresh_token": "123456789_some_refresh_token" - } -} + }, + "stream_filters": [ + { + "stream_name": "contacts", + "filter_groups": [ + { + "filters": [ + { + "propertyName": "city", + "operator": "EQ", + "value": "Madrid" + }, + { + "propertyName": "firstname", + "operator": "EQ", + "value": "Kathryne" + }, + { + "propertyName": "email", + "operator": "EQ", + "value": "jasenschultz@paucek2.com" + } + ] + }, + { + "filters": [ + { + "propertyName": "city", + "operator": "EQ", + "value": "Warsaw" + }, + { + "propertyName": "firstname", + "operator": "EQ", + "value": "Aga" + } + ] + } + ] + }, + { + "stream_name": "deals", + "filter_groups": [ + { + "filters": [ + { + "propertyName": "dealstage", + "operator": "EQ", + "value": "contractsent" + } + ] + }, + { + "filters": [ + { + "propertyName": "dealname", + "operator": "EQ", + "value": "Boring tech" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/run.py b/airbyte-integrations/connectors/source-hubspot/source_hubspot/run.py index 26f4d0abef15e..6c4506405c443 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/run.py +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/run.py @@ -1,14 +1,45 @@ # # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # - - import sys +import traceback +from datetime import datetime +from typing import List -from airbyte_cdk.entrypoint import launch +from airbyte_cdk.entrypoint import AirbyteEntrypoint, launch +from airbyte_cdk.models import AirbyteErrorTraceMessage, AirbyteMessage, AirbyteTraceMessage, TraceType, Type from source_hubspot import SourceHubspot +def _get_source(args: List[str]): + catalog_path = AirbyteEntrypoint.extract_catalog(args) + config_path = AirbyteEntrypoint.extract_config(args) + state_path = AirbyteEntrypoint.extract_state(args) + try: + return SourceHubspot( + SourceHubspot.read_catalog(catalog_path) if catalog_path else None, + SourceHubspot.read_config(config_path) if config_path else None, + SourceHubspot.read_state(state_path) if state_path else None, + ) + except Exception as error: + print( + AirbyteMessage( + type=Type.TRACE, + trace=AirbyteTraceMessage( + type=TraceType.ERROR, + emitted_at=int(datetime.now().timestamp() * 1000), + error=AirbyteErrorTraceMessage( + message=f"Error starting the sync. This could be due to an invalid configuration or catalog. Please contact Support for assistance. Error: {error}", + stack_trace=traceback.format_exc(), + ), + ), + ).json() + ) + return None + def run(): - source = SourceHubspot() - launch(source, sys.argv[1:]) + _args = sys.argv[1:] + source = _get_source(_args) + if source: + launch(source, _args) + diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/source.py b/airbyte-integrations/connectors/source-hubspot/source_hubspot/source.py index 7bc5eda8ce53c..64d27af7658bd 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/source.py +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/source.py @@ -8,8 +8,9 @@ from itertools import chain from typing import Any, Generator, List, Mapping, Optional, Tuple, Union -from airbyte_cdk.models import FailureType +from airbyte_cdk.models import FailureType, ConfiguredAirbyteCatalog from airbyte_cdk.sources import AbstractSource +from airbyte_cdk.sources.source import TState from airbyte_cdk.sources.streams import Stream from airbyte_cdk.sources.streams.http import HttpClient from airbyte_cdk.sources.streams.http.error_handlers import ErrorResolution, HttpStatusErrorHandler, ResponseAction @@ -79,6 +80,11 @@ class SourceHubspot(AbstractSource): logger = logging.getLogger("airbyte") + def __init__(self, catalog: Optional[ConfiguredAirbyteCatalog], config: Optional[Mapping[str, Any]], state: Optional[TState], **kwargs): + self.catalog = catalog + self.state = state + self.config = config + def check_connection(self, logger: logging.Logger, config: Mapping[str, Any]) -> Tuple[bool, Optional[Any]]: """Check connection""" common_params = self.get_common_params(config=config) @@ -130,11 +136,21 @@ def get_common_params(self, config) -> Mapping[str, Any]: api = self.get_api(config=config) # Additional configuration is necessary for testing certain streams due to their specific restrictions. acceptance_test_config = config.get("acceptance_test_config", {}) - return dict(api=api, start_date=start_date, credentials=credentials, acceptance_test_config=acceptance_test_config) + + common_param = dict(api=api, start_date=start_date, credentials=credentials, acceptance_test_config=acceptance_test_config) + + stream_filters = "stream_filters" in config and config["stream_filters"] + if stream_filters: + common_param.update(stream_filters=stream_filters) + + if self.catalog: + common_param.update(catalog=self.catalog) + + return common_param def streams(self, config: Mapping[str, Any]) -> List[Stream]: - credentials = config.get("credentials", {}) - common_params = self.get_common_params(config=config) + credentials = self.config.get("credentials", {}) + common_params = self.get_common_params(config=self.config) streams = [ Campaigns(**common_params), Companies(**common_params), @@ -173,7 +189,7 @@ def streams(self, config: Mapping[str, Any]) -> List[Stream]: Workflows(**common_params), ] - enable_experimental_streams = "enable_experimental_streams" in config and config["enable_experimental_streams"] + enable_experimental_streams = "enable_experimental_streams" in self.config and self.config["enable_experimental_streams"] if enable_experimental_streams: streams.extend( diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/spec.yaml b/airbyte-integrations/connectors/source-hubspot/source_hubspot/spec.yaml index 6f105f4d05a5a..9ac62e1570cdd 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/spec.yaml +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/spec.yaml @@ -91,6 +91,53 @@ connectionSpecification: description: If enabled then experimental streams become available for sync. type: boolean default: false + stream_filters: + title: Filter Groups + description: Filter groups to limit the results. Records matching ANY of the filter groups will be returned. Within a filter group, all conditions are combined with AND. + type: array + items: + type: object + properties: + stream_name: + type: string + title: Stream Name + description: Name of the stream to apply filters to + filter_groups: + type: array + title: Filter Groups + description: Groups of filters. Records matching ANY of these groups will be returned. + items: + type: object + properties: + filters: + type: array + title: Filters + description: List of filters that will be combined with AND logic + items: + type: object + required: + - propertyName + - operator + properties: + propertyName: + type: string + title: Property Name + description: The name of the property to filter on + operator: + type: string + title: Operator + description: The operator to use for filtering + enum: + - EQ + - NEQ + - LT + - LTE + - GT + - GTE + value: + type: string + title: Value + description: The value to compare against. advanced_auth: auth_flow_type: oauth2.0 predicate_key: diff --git a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py index e7236828bb7de..9ff1794c48d61 100644 --- a/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py +++ b/airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py @@ -401,12 +401,16 @@ def __init__( api: API, start_date: Union[str, pendulum.datetime], credentials: Mapping[str, Any] = None, + stream_filters: Mapping[str, Any] = None, + catalog: Mapping[str, Any] = None, acceptance_test_config: Mapping[str, Any] = None, **kwargs, ): super().__init__(**kwargs) self._api: API = api self._credentials = credentials + self._stream_filter = None + self.catalog = None self._start_date = start_date if isinstance(self._start_date, str): @@ -424,6 +428,14 @@ def __init__( self._is_test = self.name in acceptance_test_config self._acceptance_test_config = acceptance_test_config.get(self.name, {}) + # Filter for records + if stream_filters: + for filter in stream_filters: + if filter["stream_name"] == self.name: + self._stream_filter = filter["filter_groups"] + if catalog: + self.catalog = catalog + def should_retry(self, response: requests.Response) -> bool: if response.status_code == HTTPStatus.UNAUTHORIZED: message = response.json().get("message") @@ -836,10 +848,20 @@ def properties(self) -> Mapping[str, Any]: f"to be able to fetch all properties available." ) return props - data, response = self._api.get(f"/properties/v2/{self.entity}/properties") - for row in data: - props[row["name"]] = self._get_field_props(row["type"]) + if self.catalog: + for catalog_stream in self.catalog.streams: + if self.name == catalog_stream.stream.name and catalog_stream.stream.json_schema.get("properties", {}): + #properties are nested field + props=catalog_stream.stream.json_schema.get("properties").get("properties").get('properties') + elif self.name == catalog_stream.stream.name: + data, response = self._api.get(f"/properties/v2/{self.entity}/properties") + for row in data: + props[row["name"]] = self._get_field_props(row["type"]) + else: + data, response = self._api.get(f"/properties/v2/{self.entity}/properties") + for row in data: + props[row["name"]] = self._get_field_props(row["type"]) if self._transformations: for transformation in self._transformations: transformation.transform(record_or_schema=props) @@ -941,6 +963,7 @@ def read_records( yield record + class AssociationsStream(Stream): """ Designed to read associations of CRM objects during incremental syncs, since Search API does not support @@ -1123,7 +1146,7 @@ class CRMSearchStream(IncrementalStream, ABC): @property def url(self): object_type_id = self.fully_qualified_name or self.entity - return f"/crm/v3/objects/{object_type_id}/search" if self.state else f"/crm/v3/objects/{object_type_id}" + return f"/crm/v3/objects/{object_type_id}/search" def __init__( self, @@ -1169,18 +1192,66 @@ def _process_search( key = "hs_object_id" payload = ( { - "filters": [ - {"value": int(self._state.timestamp() * 1000), "propertyName": self.last_modified_field, "operator": "GTE"}, - {"value": int(self._init_sync.timestamp() * 1000), "propertyName": self.last_modified_field, "operator": "LTE"}, - {"value": last_id, "propertyName": key, "operator": "GTE"}, - ], "sorts": [{"propertyName": key, "direction": "ASCENDING"}], "properties": properties_list, - "limit": 100, + "limit": 200, } if self.state - else {} + else { + "sorts": [{"propertyName": key, "direction": "ASCENDING"}], + "properties": properties_list, + "limit": 200, + } ) + if self._stream_filter: + payload["filterGroups"] = [] + for filter_group in self._stream_filter: + if "filters" in filter_group: + if self.state: + payload["filterGroups"].append({ + "filters": [ + { + "propertyName": filter["propertyName"], + "operator": filter["operator"], + "value": filter.get("value") + } + for filter in filter_group["filters"] + [ + {"value": int(self._state.timestamp() * 1000), "propertyName": self.last_modified_field, "operator": "GTE"}, + {"value": int(self._init_sync.timestamp() * 1000), "propertyName": self.last_modified_field, "operator": "LTE"}, + {"value": last_id, "propertyName": key, "operator": "GTE"} + ] + ] + }) + else: + payload["filterGroups"].append({ + "filters": [ + { + "propertyName": filter["propertyName"], + "operator": filter["operator"], + "value": filter.get("value") + } + for filter in filter_group["filters"] + [ + {"value": int(self._start_date.timestamp() * 1000), "propertyName": self.last_modified_field, "operator": "GTE"} + ] + ] + }) + else: + payload["filterGroups"] = [] + if self.state: + payload["filterGroups"].append({ + "filters": [ + {"value": int(self._state.timestamp() * 1000), "propertyName": self.last_modified_field, "operator": "GTE"}, + {"value": int(self._init_sync.timestamp() * 1000), "propertyName": self.last_modified_field, "operator": "LTE"}, + {"value": last_id, "propertyName": key, "operator": "GTE"} + ] + }) + else: + payload["filterGroups"].append({ + "filters": [ + {"value": int(self._start_date.timestamp() * 1000), "propertyName": self.last_modified_field, "operator": "GTE"} + ] + }) + if next_page_token: payload.update(next_page_token["payload"]) @@ -1232,19 +1303,15 @@ def read_records( max_last_id = None while not pagination_complete: - if self.state: - records, raw_response = self._process_search( - next_page_token=next_page_token, stream_state=stream_state, stream_slice=stream_slice, last_id=max_last_id - ) - if self.associations: - records = self._read_associations(records) - else: - records, raw_response = self._read_stream_records( - stream_slice=stream_slice, - stream_state=stream_state, - next_page_token=next_page_token, - ) - records = self._flat_associations(records) + records, raw_response = self._process_search( + next_page_token=next_page_token, + stream_state=stream_state, + stream_slice=stream_slice, + last_id=max_last_id + ) + + if self.associations: + records = self._read_associations(records) records = self._filter_old_records(records) records = self.record_unnester.unnest(records) @@ -1255,7 +1322,7 @@ def read_records( next_page_token = self.next_page_token(raw_response) if not next_page_token: pagination_complete = True - elif self.state and next_page_token["payload"]["after"] >= 10000: + elif next_page_token["payload"]["after"] >= 10000: # Hubspot documentation states that the search endpoints are limited to 10,000 total results # for any given query. Attempting to page beyond 10,000 will result in a 400 error. # https://developers.hubspot.com/docs/api/crm/search. We stop getting data at 10,000 and diff --git a/airbyte-integrations/connectors/source-hubspot/unit_tests/conftest.py b/airbyte-integrations/connectors/source-hubspot/unit_tests/conftest.py index deecb0b377d3a..2142de222bafd 100644 --- a/airbyte-integrations/connectors/source-hubspot/unit_tests/conftest.py +++ b/airbyte-integrations/connectors/source-hubspot/unit_tests/conftest.py @@ -64,6 +64,16 @@ def config_eperimantal_fixture(): } +@pytest.fixture(name="config_with_filters") +def config_with_filters_fixture(): + return { + "start_date": "2021-01-10T00:00:00Z", + "credentials": {"credentials_title": "Private App Credentials", "access_token": "test_access_token"}, + "enable_experimental_streams": True, + "stream_filters": [{"stream_name": "contacts", "filter_value": {"propertyName": "city","operator": "EQ","value": "Madrid"}}], + } + + @pytest.fixture(name="config_invalid_date") def config_invalid_date_fixture(): return {