braze_ruby 0.3.2 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +57 -0
- data/.circleci/gem_credentials +2 -0
- data/.circleci/setup-rubygems +6 -0
- data/.gitignore +12 -19
- data/.standard.yml +1 -0
- data/Gemfile +1 -2
- data/LICENSE.txt +17 -18
- data/README.md +49 -2
- data/Rakefile +2 -1
- data/bin/release +16 -0
- data/braze_ruby.gemspec +28 -31
- data/lib/braze_ruby.rb +4 -4
- data/lib/braze_ruby/api.rb +20 -14
- data/lib/braze_ruby/deprecated.rb +4 -4
- data/lib/braze_ruby/endpoints.rb +10 -7
- data/lib/braze_ruby/endpoints/campaigns.rb +1 -1
- data/lib/braze_ruby/endpoints/canvas.rb +2 -2
- data/lib/braze_ruby/endpoints/create_user_aliases.rb +19 -0
- data/lib/braze_ruby/endpoints/delete_users.rb +2 -2
- data/lib/braze_ruby/endpoints/email_status.rb +1 -1
- data/lib/braze_ruby/endpoints/email_sync.rb +2 -2
- data/lib/braze_ruby/endpoints/identify_users.rb +2 -2
- data/lib/braze_ruby/endpoints/remove_external_ids.rb +19 -0
- data/lib/braze_ruby/endpoints/rename_external_ids.rb +19 -0
- data/lib/braze_ruby/endpoints/schedule_messages.rb +1 -1
- data/lib/braze_ruby/endpoints/send_messages.rb +1 -1
- data/lib/braze_ruby/endpoints/subscription.rb +3 -4
- data/lib/braze_ruby/endpoints/track_users.rb +5 -5
- data/lib/braze_ruby/http.rb +21 -8
- data/lib/braze_ruby/rest.rb +20 -17
- data/lib/braze_ruby/rest/base.rb +5 -3
- data/lib/braze_ruby/rest/canvas_details.rb +4 -6
- data/lib/braze_ruby/rest/create_user_aliases.rb +13 -0
- data/lib/braze_ruby/rest/delete_users.rb +3 -4
- data/lib/braze_ruby/rest/email_hard_bounces.rb +4 -6
- data/lib/braze_ruby/rest/email_status.rb +6 -8
- data/lib/braze_ruby/rest/email_unsubscribes.rb +4 -6
- data/lib/braze_ruby/rest/export_users.rb +9 -11
- data/lib/braze_ruby/rest/identify_users.rb +3 -4
- data/lib/braze_ruby/rest/list_segments.rb +2 -4
- data/lib/braze_ruby/rest/remove_external_ids.rb +13 -0
- data/lib/braze_ruby/rest/rename_external_ids.rb +13 -0
- data/lib/braze_ruby/rest/schedule_messages.rb +9 -11
- data/lib/braze_ruby/rest/send_messages.rb +6 -8
- data/lib/braze_ruby/rest/subscription_status_get.rb +4 -6
- data/lib/braze_ruby/rest/subscription_status_set.rb +4 -6
- data/lib/braze_ruby/rest/subscription_user_status.rb +4 -6
- data/lib/braze_ruby/rest/track_users.rb +5 -6
- data/lib/braze_ruby/rest/trigger_campaign_send.rb +4 -8
- data/lib/braze_ruby/rest/trigger_canvas_send.rb +4 -6
- data/lib/braze_ruby/version.rb +1 -1
- metadata +61 -175
- data/.github/workflows/ci.yml +0 -19
- data/Gemfile.lock +0 -78
- data/spec/braze_ruby/api_spec.rb +0 -6
- data/spec/braze_ruby/endpoints/delete_users_spec.rb +0 -31
- data/spec/braze_ruby/endpoints/track_users_spec.rb +0 -74
- data/spec/braze_ruby/rest/delete_users_spec.rb +0 -22
- data/spec/braze_ruby/rest/email_status_spec.rb +0 -21
- data/spec/braze_ruby/rest/export_users_spec.rb +0 -21
- data/spec/braze_ruby/rest/identify_users_spec.rb +0 -23
- data/spec/braze_ruby/rest/schedule_messages_spec.rb +0 -38
- data/spec/braze_ruby/rest/send_messages_spec.rb +0 -35
- data/spec/braze_ruby/rest/track_users_spec.rb +0 -26
- data/spec/factories.rb +0 -38
- data/spec/fixtures/responses/campaigns/trigger_send/sends_an_email.yml +0 -69
- data/spec/fixtures/responses/canvas/details/returns_error_when_no_canvas.yml +0 -67
- data/spec/fixtures/responses/canvas/trigger_send/sends_a_canvas.yml +0 -69
- data/spec/fixtures/responses/delete_users/unauthorized/responds_with_unauthorized.yml +0 -66
- data/spec/fixtures/responses/delete_users/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/delete_users/with_success/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/email_status/existing_email/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/email_status/existing_email/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/email_status/unknown_email/responds_with_bad_request.yml +0 -69
- data/spec/fixtures/responses/email_status/unknown_email/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/email_sync/hard_bounces/responds_with_empty_array_when_no_hard_bounces.yml +0 -73
- data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_empty_array_when_no_unsubscribes.yml +0 -73
- data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_unsubscribed_emails.yml +0 -74
- data/spec/fixtures/responses/export_users/by_ids/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/export_users/by_segment/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/identify_users/unauthorized/responds_with_unauthorized.yml +0 -66
- data/spec/fixtures/responses/identify_users/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/identify_users/with_success/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/list_segments/with_success/responds_with_a_list_of_segments.yml +0 -81
- data/spec/fixtures/responses/list_segments/with_success/responds_with_success.yml +0 -81
- data/spec/fixtures/responses/schedule_messages/unauthorized/responds_with_unauthorize.yml +0 -67
- data/spec/fixtures/responses/schedule_messages/with_success/responds_with_created.yml +0 -70
- data/spec/fixtures/responses/schedule_messages/with_success/responds_with_success_message.yml +0 -70
- data/spec/fixtures/responses/send_messages/unauthorized/responds_with_unauthorized.yml +0 -66
- data/spec/fixtures/responses/send_messages/with_success/responds_with_created.yml +0 -69
- data/spec/fixtures/responses/send_messages/with_success/responds_with_success_message.yml +0 -69
- data/spec/fixtures/responses/subscription/subscription_status_set/when_subscribing/subscribes_the_user.yml +0 -69
- data/spec/fixtures/responses/subscription/subscription_status_set/when_subscription_group_does_not_exist/returns_an_error_status.yml +0 -66
- data/spec/fixtures/responses/subscription/subscription_status_set/when_unsubscribing/unsubscribes_the_user.yml +0 -135
- data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_status_get/when_checking_subscribed_and_unsubscribed_user_status/returns_only_users_that_were_once_subscribed.yml +0 -205
- data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_status_get/when_group_does_not_exist/returns_an_error.yml +0 -193
- data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_user_status/returns_subscription_groups_and_status_for_every_group.yml +0 -207
- data/spec/fixtures/responses/track_users/unauthorized/responds_with_unauthorized.yml +0 -68
- data/spec/fixtures/responses/track_users/with_success/responds_with_created.yml +0 -71
- data/spec/fixtures/responses/track_users/with_success/responds_with_success_message.yml +0 -71
- data/spec/integrations/campaigns_spec.rb +0 -17
- data/spec/integrations/canvas_spec.rb +0 -26
- data/spec/integrations/delete_users_spec.rb +0 -31
- data/spec/integrations/email_status_spec.rb +0 -38
- data/spec/integrations/email_sync_spec.rb +0 -31
- data/spec/integrations/export_users_spec.rb +0 -29
- data/spec/integrations/identify_users_spec.rb +0 -32
- data/spec/integrations/list_segments_spec.rb +0 -21
- data/spec/integrations/schedule_messages_spec.rb +0 -33
- data/spec/integrations/send_messages_spec.rb +0 -32
- data/spec/integrations/subscription_spec.rb +0 -149
- data/spec/integrations/track_users_spec.rb +0 -37
- data/spec/spec_helper.rb +0 -33
- data/spec/support/factory_bot.rb +0 -12
- data/spec/support/integrations.rb +0 -23
- data/spec/support/vcr.rb +0 -18
data/spec/spec_helper.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'pry'
|
5
|
-
require 'dotenv'
|
6
|
-
|
7
|
-
Dotenv.load
|
8
|
-
|
9
|
-
require 'braze_ruby'
|
10
|
-
require 'support/vcr'
|
11
|
-
require 'support/factory_bot'
|
12
|
-
require 'support/integrations'
|
13
|
-
|
14
|
-
BRAZE_REST_API_KEY = ENV.fetch('BRAZE_REST_API_KEY', 'test')
|
15
|
-
BRAZE_REST_URL = ENV.fetch('BRAZE_REST_URL', 'https://rest.iad-03.braze.com')
|
16
|
-
|
17
|
-
RSpec.configure do |config|
|
18
|
-
def test_time
|
19
|
-
Time.parse('2019-02-15 00:00:00 -0500')
|
20
|
-
end
|
21
|
-
|
22
|
-
def braze_rest_api_key
|
23
|
-
BRAZE_REST_API_KEY
|
24
|
-
end
|
25
|
-
|
26
|
-
def braze_rest_url
|
27
|
-
BRAZE_REST_URL
|
28
|
-
end
|
29
|
-
|
30
|
-
def braze_test_segment
|
31
|
-
'a8fde797-4c44-4406-8e6c-5850d323f169'
|
32
|
-
end
|
33
|
-
end
|
data/spec/support/factory_bot.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Integrations
|
4
|
-
def api_key
|
5
|
-
braze_rest_api_key
|
6
|
-
end
|
7
|
-
|
8
|
-
def rest_url
|
9
|
-
braze_rest_url
|
10
|
-
end
|
11
|
-
|
12
|
-
def segment_id
|
13
|
-
braze_test_segment
|
14
|
-
end
|
15
|
-
|
16
|
-
def api
|
17
|
-
BrazeRuby::API.new(api_key, rest_url)
|
18
|
-
end
|
19
|
-
|
20
|
-
RSpec.configure do |config|
|
21
|
-
config.include self, type: :integrations, file_path: %r(spec/integrations)
|
22
|
-
end
|
23
|
-
end
|
data/spec/support/vcr.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'vcr'
|
4
|
-
|
5
|
-
VCR.configure do |config|
|
6
|
-
config.filter_sensitive_data('<BRAZE_REST_API_KEY>') { BRAZE_REST_API_KEY }
|
7
|
-
config.filter_sensitive_data('<BRAZE_REST_URL>') { BRAZE_REST_URL }
|
8
|
-
|
9
|
-
config.cassette_library_dir = 'spec/fixtures/responses'
|
10
|
-
|
11
|
-
config.default_cassette_options = {
|
12
|
-
match_requests_on: [:method, :uri, :body]
|
13
|
-
}
|
14
|
-
|
15
|
-
config.configure_rspec_metadata!
|
16
|
-
|
17
|
-
config.hook_into :webmock
|
18
|
-
end
|