From 8133edeaa42ece633c5d9f54da8c2d871126729e Mon Sep 17 00:00:00 2001 From: alexey Date: Wed, 16 Oct 2024 11:09:39 +0300 Subject: [PATCH] Update Marketins Events --- .../api/{batch_api.rb => list_associations_api.rb} | 2 +- .../events/api/marketing_events_external_api.rb | 13 ------------- .../api/{search_api.rb => participant_state_api.rb} | 2 +- lib/hubspot/discovery/marketing/events/client.rb | 5 ++--- .../attendance_subscriber_state_changes_api_spec.rb | 4 ++-- spec/discovery/marketing/events/basic_api_spec.rb | 10 +++++++--- spec/discovery/marketing/events/batch_api_spec.rb | 8 -------- .../marketing/events/list_associations_api_spec.rb | 12 ++++++++++++ .../events/marketing_events_external_api_spec.rb | 7 ------- .../marketing/events/participant_state_api_spec.rb | 11 +++++++++++ spec/discovery/marketing/events/search_api_spec.rb | 7 ------- .../discovery/marketing/events/settings_api_spec.rb | 2 +- .../events/subscriber_state_changes_api_spec.rb | 4 ++-- 13 files changed, 39 insertions(+), 48 deletions(-) rename lib/hubspot/discovery/marketing/events/api/{batch_api.rb => list_associations_api.rb} (86%) delete mode 100644 lib/hubspot/discovery/marketing/events/api/marketing_events_external_api.rb rename lib/hubspot/discovery/marketing/events/api/{search_api.rb => participant_state_api.rb} (86%) delete mode 100644 spec/discovery/marketing/events/batch_api_spec.rb create mode 100644 spec/discovery/marketing/events/list_associations_api_spec.rb delete mode 100644 spec/discovery/marketing/events/marketing_events_external_api_spec.rb create mode 100644 spec/discovery/marketing/events/participant_state_api_spec.rb delete mode 100644 spec/discovery/marketing/events/search_api_spec.rb diff --git a/lib/hubspot/discovery/marketing/events/api/batch_api.rb b/lib/hubspot/discovery/marketing/events/api/list_associations_api.rb similarity index 86% rename from lib/hubspot/discovery/marketing/events/api/batch_api.rb rename to lib/hubspot/discovery/marketing/events/api/list_associations_api.rb index baa47adb..16d5f18e 100644 --- a/lib/hubspot/discovery/marketing/events/api/batch_api.rb +++ b/lib/hubspot/discovery/marketing/events/api/list_associations_api.rb @@ -4,7 +4,7 @@ module Hubspot module Discovery module Marketing module Events - class BatchApi + class ListAssociationsApi include Hubspot::Discovery::BaseApiClient end end diff --git a/lib/hubspot/discovery/marketing/events/api/marketing_events_external_api.rb b/lib/hubspot/discovery/marketing/events/api/marketing_events_external_api.rb deleted file mode 100644 index 099638ca..00000000 --- a/lib/hubspot/discovery/marketing/events/api/marketing_events_external_api.rb +++ /dev/null @@ -1,13 +0,0 @@ -require_relative '../../../base_api_client' - -module Hubspot - module Discovery - module Marketing - module Events - class MarketingEventsExternalApi - include Hubspot::Discovery::BaseApiClient - end - end - end - end -end diff --git a/lib/hubspot/discovery/marketing/events/api/search_api.rb b/lib/hubspot/discovery/marketing/events/api/participant_state_api.rb similarity index 86% rename from lib/hubspot/discovery/marketing/events/api/search_api.rb rename to lib/hubspot/discovery/marketing/events/api/participant_state_api.rb index b9192307..3e925fb3 100644 --- a/lib/hubspot/discovery/marketing/events/api/search_api.rb +++ b/lib/hubspot/discovery/marketing/events/api/participant_state_api.rb @@ -4,7 +4,7 @@ module Hubspot module Discovery module Marketing module Events - class SearchApi + class ParticipantStateApi include Hubspot::Discovery::BaseApiClient end end diff --git a/lib/hubspot/discovery/marketing/events/client.rb b/lib/hubspot/discovery/marketing/events/client.rb index e491536b..46c5fc21 100644 --- a/lib/hubspot/discovery/marketing/events/client.rb +++ b/lib/hubspot/discovery/marketing/events/client.rb @@ -10,10 +10,9 @@ class Client def api_classes %i[ attendance_subscriber_state_changes - batch basic - marketing_events_external - search + list_associations + participant_state settings subscriber_state_changes ].freeze diff --git a/spec/discovery/marketing/events/attendance_subscriber_state_changes_api_spec.rb b/spec/discovery/marketing/events/attendance_subscriber_state_changes_api_spec.rb index 9373508f..904212fd 100644 --- a/spec/discovery/marketing/events/attendance_subscriber_state_changes_api_spec.rb +++ b/spec/discovery/marketing/events/attendance_subscriber_state_changes_api_spec.rb @@ -3,6 +3,6 @@ describe 'Hubspot::Discovery::Marketing::Events::AttendanceSubscriberStateChangesApi' do subject(:api) { Hubspot::Client.new(access_token: 'test').marketing.events.attendance_subscriber_state_changes_api } - it { is_expected.to respond_to(:create) } - it { is_expected.to respond_to(:create_by_email) } + it { is_expected.to respond_to(:record_by_contact_ids) } + it { is_expected.to respond_to(:record_by_contact_emails) } end diff --git a/spec/discovery/marketing/events/basic_api_spec.rb b/spec/discovery/marketing/events/basic_api_spec.rb index b9baecbf..cd76fd2d 100644 --- a/spec/discovery/marketing/events/basic_api_spec.rb +++ b/spec/discovery/marketing/events/basic_api_spec.rb @@ -4,9 +4,13 @@ subject(:api) { Hubspot::Client.new(access_token: 'test').marketing.events.basic_api } it { is_expected.to respond_to(:archive) } + it { is_expected.to respond_to(:batch_archive) } + it { is_expected.to respond_to(:batch_upsert) } + it { is_expected.to respond_to(:cancel) } + it { is_expected.to respond_to(:complete) } it { is_expected.to respond_to(:create) } - it { is_expected.to respond_to(:do_cancel) } - it { is_expected.to respond_to(:get_by_id) } - it { is_expected.to respond_to(:replace) } + it { is_expected.to respond_to(:do_search) } + it { is_expected.to respond_to(:get_details) } it { is_expected.to respond_to(:update) } + it { is_expected.to respond_to(:upsert) } end diff --git a/spec/discovery/marketing/events/batch_api_spec.rb b/spec/discovery/marketing/events/batch_api_spec.rb deleted file mode 100644 index 51abb210..00000000 --- a/spec/discovery/marketing/events/batch_api_spec.rb +++ /dev/null @@ -1,8 +0,0 @@ -require 'spec_helper' - -describe 'Hubspot::Discovery::Marketing::Events::BatchApi' do - subject(:api) { Hubspot::Client.new(access_token: 'test').marketing.events.batch_api } - - it { is_expected.to respond_to(:archive) } - it { is_expected.to respond_to(:do_upsert) } -end diff --git a/spec/discovery/marketing/events/list_associations_api_spec.rb b/spec/discovery/marketing/events/list_associations_api_spec.rb new file mode 100644 index 00000000..5009ab0b --- /dev/null +++ b/spec/discovery/marketing/events/list_associations_api_spec.rb @@ -0,0 +1,12 @@ +require 'spec_helper' + +describe 'Hubspot::Discovery::Marketing::Events::ListAssociationsApi' do + subject(:api) { Hubspot::Client.new(access_token: 'test').marketing.events.list_associations_api } + + it { is_expected.to respond_to(:associate_by_external_account_and_event_ids) } + it { is_expected.to respond_to(:associate_by_marketing_event_id) } + it { is_expected.to respond_to(:disassociate_by_external_account_and_event_ids) } + it { is_expected.to respond_to(:disassociate_by_marketing_event_id) } + it { is_expected.to respond_to(:get_all_by_external_account_and_event_ids) } + it { is_expected.to respond_to(:get_all_by_marketing_event_id) } +end diff --git a/spec/discovery/marketing/events/marketing_events_external_api_spec.rb b/spec/discovery/marketing/events/marketing_events_external_api_spec.rb deleted file mode 100644 index 7dab4723..00000000 --- a/spec/discovery/marketing/events/marketing_events_external_api_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'spec_helper' - -describe 'Hubspot::Discovery::Marketing::Events::MarketingEventsExternalApi' do - subject(:api) { Hubspot::Client.new(access_token: 'test').marketing.events.marketing_events_external_api } - - it { is_expected.to respond_to(:complete) } -end diff --git a/spec/discovery/marketing/events/participant_state_api_spec.rb b/spec/discovery/marketing/events/participant_state_api_spec.rb new file mode 100644 index 00000000..8cb7a69f --- /dev/null +++ b/spec/discovery/marketing/events/participant_state_api_spec.rb @@ -0,0 +1,11 @@ +require 'spec_helper' + +describe 'Hubspot::Discovery::Marketing::Events::ParticipantStateApi' do + subject(:api) { Hubspot::Client.new(access_token: 'test').marketing.events.participant_state_api } + + it { is_expected.to respond_to(:get_participations_breakdown_by_contact_id) } + it { is_expected.to respond_to(:get_participations_breakdown_by_external_event_id) } + it { is_expected.to respond_to(:get_participations_breakdown_by_marketing_event_id) } + it { is_expected.to respond_to(:get_participations_counters_by_event_external_id) } + it { is_expected.to respond_to(:get_participations_counters_by_marketing_event_id) } +end diff --git a/spec/discovery/marketing/events/search_api_spec.rb b/spec/discovery/marketing/events/search_api_spec.rb deleted file mode 100644 index d73c5221..00000000 --- a/spec/discovery/marketing/events/search_api_spec.rb +++ /dev/null @@ -1,7 +0,0 @@ -require 'spec_helper' - -describe 'Hubspot::Discovery::Marketing::Events::SearchApi' do - subject(:api) { Hubspot::Client.new(access_token: 'test').marketing.events.search_api } - - it { is_expected.to respond_to(:do_search) } -end diff --git a/spec/discovery/marketing/events/settings_api_spec.rb b/spec/discovery/marketing/events/settings_api_spec.rb index 6aa9ab4e..3aa99324 100644 --- a/spec/discovery/marketing/events/settings_api_spec.rb +++ b/spec/discovery/marketing/events/settings_api_spec.rb @@ -3,6 +3,6 @@ describe 'Hubspot::Discovery::Marketing::Events::SettingsApi' do subject(:api) { Hubspot::Client.new(access_token: 'test').marketing.events.settings_api } - it { is_expected.to respond_to(:create) } it { is_expected.to respond_to(:get_all) } + it { is_expected.to respond_to(:update) } end diff --git a/spec/discovery/marketing/events/subscriber_state_changes_api_spec.rb b/spec/discovery/marketing/events/subscriber_state_changes_api_spec.rb index 5573dca1..1903f365 100644 --- a/spec/discovery/marketing/events/subscriber_state_changes_api_spec.rb +++ b/spec/discovery/marketing/events/subscriber_state_changes_api_spec.rb @@ -3,6 +3,6 @@ describe 'Hubspot::Discovery::Marketing::Events::SubscriberStateChangesApi' do subject(:api) { Hubspot::Client.new(access_token: 'test').marketing.events.subscriber_state_changes_api } - it { is_expected.to respond_to(:do_email_upsert_by_id) } - it { is_expected.to respond_to(:do_upsert_by_id) } + it { is_expected.to respond_to(:upsert_by_contact_email) } + it { is_expected.to respond_to(:upsert_by_contact_id) } end