braze_ruby 0.3.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +14 -3
  3. data/Gemfile.lock +43 -39
  4. data/README.md +59 -0
  5. data/braze_ruby.gemspec +7 -7
  6. data/lib/braze_ruby/api.rb +11 -4
  7. data/lib/braze_ruby/endpoints.rb +4 -0
  8. data/lib/braze_ruby/endpoints/campaigns.rb +1 -1
  9. data/lib/braze_ruby/endpoints/canvas.rb +2 -2
  10. data/lib/braze_ruby/endpoints/create_user_aliases.rb +19 -0
  11. data/lib/braze_ruby/endpoints/delete_users.rb +2 -2
  12. data/lib/braze_ruby/endpoints/email_status.rb +1 -1
  13. data/lib/braze_ruby/endpoints/email_sync.rb +2 -2
  14. data/lib/braze_ruby/endpoints/identify_users.rb +19 -0
  15. data/lib/braze_ruby/endpoints/remove_external_ids.rb +19 -0
  16. data/lib/braze_ruby/endpoints/rename_external_ids.rb +19 -0
  17. data/lib/braze_ruby/endpoints/schedule_messages.rb +1 -1
  18. data/lib/braze_ruby/endpoints/send_messages.rb +1 -1
  19. data/lib/braze_ruby/endpoints/subscription.rb +3 -3
  20. data/lib/braze_ruby/endpoints/track_users.rb +5 -5
  21. data/lib/braze_ruby/http.rb +18 -5
  22. data/lib/braze_ruby/rest.rb +4 -0
  23. data/lib/braze_ruby/rest/base.rb +4 -2
  24. data/lib/braze_ruby/rest/canvas_details.rb +3 -5
  25. data/lib/braze_ruby/rest/create_user_aliases.rb +13 -0
  26. data/lib/braze_ruby/rest/delete_users.rb +1 -2
  27. data/lib/braze_ruby/rest/email_hard_bounces.rb +3 -5
  28. data/lib/braze_ruby/rest/email_status.rb +3 -5
  29. data/lib/braze_ruby/rest/email_unsubscribes.rb +3 -5
  30. data/lib/braze_ruby/rest/export_users.rb +5 -7
  31. data/lib/braze_ruby/rest/identify_users.rb +13 -0
  32. data/lib/braze_ruby/rest/list_segments.rb +2 -4
  33. data/lib/braze_ruby/rest/remove_external_ids.rb +13 -0
  34. data/lib/braze_ruby/rest/rename_external_ids.rb +13 -0
  35. data/lib/braze_ruby/rest/schedule_messages.rb +3 -5
  36. data/lib/braze_ruby/rest/send_messages.rb +3 -5
  37. data/lib/braze_ruby/rest/subscription_status_get.rb +3 -5
  38. data/lib/braze_ruby/rest/subscription_status_set.rb +3 -5
  39. data/lib/braze_ruby/rest/subscription_user_status.rb +3 -5
  40. data/lib/braze_ruby/rest/track_users.rb +1 -2
  41. data/lib/braze_ruby/rest/trigger_campaign_send.rb +4 -8
  42. data/lib/braze_ruby/rest/trigger_canvas_send.rb +3 -5
  43. data/lib/braze_ruby/version.rb +1 -1
  44. data/spec/braze_ruby/endpoints/delete_users_spec.rb +1 -1
  45. data/spec/braze_ruby/endpoints/track_users_spec.rb +8 -8
  46. data/spec/braze_ruby/http_spec.rb +48 -0
  47. data/spec/braze_ruby/rest/create_user_aliases_spec.rb +23 -0
  48. data/spec/braze_ruby/rest/delete_users_spec.rb +3 -3
  49. data/spec/braze_ruby/rest/email_status_spec.rb +1 -2
  50. data/spec/braze_ruby/rest/export_users_spec.rb +3 -3
  51. data/spec/braze_ruby/rest/identify_users_spec.rb +23 -0
  52. data/spec/braze_ruby/rest/remove_external_ids_spec.rb +22 -0
  53. data/spec/braze_ruby/rest/rename_external_ids_spec.rb +22 -0
  54. data/spec/braze_ruby/rest/schedule_messages_spec.rb +1 -2
  55. data/spec/braze_ruby/rest/send_messages_spec.rb +8 -13
  56. data/spec/braze_ruby/rest/track_users_spec.rb +10 -9
  57. data/spec/fixtures/responses/campaigns/trigger_send/sends_an_email.yml +17 -15
  58. data/spec/fixtures/responses/canvas/details/returns_error_when_no_canvas.yml +16 -14
  59. data/spec/fixtures/responses/canvas/trigger_send/sends_a_canvas.yml +18 -16
  60. data/spec/fixtures/responses/create_user_aliases/unauthorized/responds_with_unauthorized.yml +67 -0
  61. data/spec/fixtures/responses/create_user_aliases/with_success/responds_with_created.yml +71 -0
  62. data/spec/fixtures/responses/create_user_aliases/with_success/responds_with_success_message.yml +71 -0
  63. data/spec/fixtures/responses/delete_users/unauthorized/responds_with_unauthorized.yml +20 -18
  64. data/spec/fixtures/responses/delete_users/with_success/responds_with_created.yml +25 -23
  65. data/spec/fixtures/responses/delete_users/with_success/responds_with_success_message.yml +25 -23
  66. data/spec/fixtures/responses/email_status/existing_email/responds_with_created.yml +22 -20
  67. data/spec/fixtures/responses/email_status/existing_email/responds_with_success_message.yml +22 -20
  68. data/spec/fixtures/responses/email_status/unknown_email/responds_with_bad_request.yml +22 -20
  69. data/spec/fixtures/responses/email_status/unknown_email/responds_with_success_message.yml +22 -20
  70. data/spec/fixtures/responses/email_sync/hard_bounces/responds_with_empty_array_when_no_hard_bounces.yml +18 -16
  71. data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_empty_array_when_no_unsubscribes.yml +18 -16
  72. data/spec/fixtures/responses/email_sync/unsubscribes/responds_with_unsubscribed_emails.yml +21 -20
  73. data/spec/fixtures/responses/export_users/by_ids/with_success/responds_with_created.yml +25 -22
  74. data/spec/fixtures/responses/export_users/by_segment/with_success/responds_with_created.yml +24 -22
  75. data/spec/fixtures/responses/identify_users/unauthorized/responds_with_unauthorized.yml +68 -0
  76. data/spec/fixtures/responses/identify_users/with_success/responds_with_created.yml +71 -0
  77. data/spec/fixtures/responses/identify_users/with_success/responds_with_success_message.yml +71 -0
  78. data/spec/fixtures/responses/list_segments/with_success/responds_with_a_list_of_segments.yml +35 -35
  79. data/spec/fixtures/responses/list_segments/with_success/responds_with_success.yml +35 -35
  80. data/spec/fixtures/responses/remove_external_ids/unauthorized/responds_with_unauthorized.yml +67 -0
  81. data/spec/fixtures/responses/remove_external_ids/with_success/responds_with_created.yml +69 -0
  82. data/spec/fixtures/responses/remove_external_ids/with_success/responds_with_success_message.yml +69 -0
  83. data/spec/fixtures/responses/rename_external_ids/unauthorized/responds_with_unauthorized.yml +67 -0
  84. data/spec/fixtures/responses/rename_external_ids/with_success/responds_with_created.yml +69 -0
  85. data/spec/fixtures/responses/rename_external_ids/with_success/responds_with_success_message.yml +69 -0
  86. data/spec/fixtures/responses/schedule_messages/unauthorized/responds_with_unauthorize.yml +20 -19
  87. data/spec/fixtures/responses/schedule_messages/with_success/responds_with_created.yml +24 -23
  88. data/spec/fixtures/responses/schedule_messages/with_success/responds_with_success_message.yml +24 -23
  89. data/spec/fixtures/responses/send_messages/unauthorized/responds_with_unauthorized.yml +20 -18
  90. data/spec/fixtures/responses/send_messages/with_success/responds_with_created.yml +24 -22
  91. data/spec/fixtures/responses/send_messages/with_success/responds_with_success_message.yml +24 -22
  92. data/spec/fixtures/responses/subscription/subscription_status_set/when_subscribing/subscribes_the_user.yml +16 -14
  93. data/spec/fixtures/responses/subscription/subscription_status_set/when_subscription_group_does_not_exist/returns_an_error_status.yml +16 -14
  94. data/spec/fixtures/responses/subscription/subscription_status_set/when_unsubscribing/unsubscribes_the_user.yml +32 -28
  95. 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 +50 -44
  96. data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_status_get/when_group_does_not_exist/returns_an_error.yml +48 -42
  97. data/spec/fixtures/responses/subscription/when_getting_subscription_group_statuses/subscription_user_status/returns_subscription_groups_and_status_for_every_group.yml +50 -46
  98. data/spec/fixtures/responses/track_users/unauthorized/responds_with_unauthorized.yml +23 -21
  99. data/spec/fixtures/responses/track_users/with_success/responds_with_created.yml +22 -20
  100. data/spec/fixtures/responses/track_users/with_success/responds_with_success_message.yml +22 -20
  101. data/spec/integrations/campaigns_spec.rb +4 -2
  102. data/spec/integrations/canvas_spec.rb +4 -2
  103. data/spec/integrations/create_user_aliases_spec.rb +32 -0
  104. data/spec/integrations/delete_users_spec.rb +1 -0
  105. data/spec/integrations/email_sync_spec.rb +2 -2
  106. data/spec/integrations/export_users_spec.rb +2 -2
  107. data/spec/integrations/identify_users_spec.rb +32 -0
  108. data/spec/integrations/list_segments_spec.rb +1 -1
  109. data/spec/integrations/remove_external_ids_spec.rb +33 -0
  110. data/spec/integrations/rename_external_ids_spec.rb +37 -0
  111. data/spec/integrations/schedule_messages_spec.rb +2 -1
  112. data/spec/integrations/send_messages_spec.rb +2 -1
  113. data/spec/integrations/subscription_spec.rb +7 -7
  114. data/spec/integrations/track_users_spec.rb +1 -0
  115. data/spec/spec_helper.rb +0 -8
  116. data/spec/support/integrations.rb +5 -1
  117. data/spec/support/vcr.rb +3 -1
  118. metadata +69 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d13af3abbb4e98372a950bf22a32729721f50e061b5c4259a0ca8441ffc1b718
4
- data.tar.gz: 0ba7370dd8c8bf783643722ff0531a62128deb2361c4b7ce2cd0124659073c26
3
+ metadata.gz: 8aae95520a637f8bfb69c12c2df7700966eec68e243743fabc03798b194a924f
4
+ data.tar.gz: 95791c077beeb50119d715e81374533778032ee85d1fef28ed946352a1bd618b
5
5
  SHA512:
6
- metadata.gz: 12ce012904c603fa5c7d202f46bbbc3b5b0df057a07edb7f04ab18a820154eebba5628f23a3f43ace34b47a03a99415de1911429c6d9a3175b061522ca29025e
7
- data.tar.gz: acb859868636273fa6a8b07370e31805cc17760e8f40b392f0141a3ce963b1e0c902209297d7dea2750d69bed6fa86ab55629ae7d50f2a8997a6b31ffe276207
6
+ metadata.gz: 61bd0b6c2bb7c59e396cc1c3aa40fe0b54095c95f0195c5287e96c6e8504955442052a36d8e137150e816a357e2ae2982c112d4a79df95047d4841adf9b8b448
7
+ data.tar.gz: 1ac6bb7da1dc22c6138c62a00072ec62d82d48ac2ee8b2922607c62dabcd7febe36b798c606466d85c88bc86f8d01067f347a3c4b11d0d92ba7c46a003b6ea91
@@ -7,13 +7,24 @@ jobs:
7
7
  runs-on: ubuntu-latest
8
8
 
9
9
  steps:
10
- - uses: actions/checkout@v1
10
+ - uses: actions/checkout@v2
11
+
11
12
  - name: Set up Ruby
12
- uses: actions/setup-ruby@v1
13
+ uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: 2.6
16
+
17
+ - name: Cache gems
18
+ uses: actions/cache@v1
13
19
  with:
14
- ruby-version: 2.6.x
20
+ path: vendor/bundle
21
+ key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
22
+ restore-keys: |
23
+ ${{ runner.os }}-gems-
24
+
15
25
  - name: Build and test
16
26
  run: |
17
27
  gem install bundler
28
+ bundle config path vendor/bundle
18
29
  bundle install --jobs 4 --retry 3
19
30
  bundle exec rake spec
data/Gemfile.lock CHANGED
@@ -1,64 +1,68 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- braze_ruby (0.3.1)
5
- faraday (~> 0.17.1)
4
+ braze_ruby (0.4.2)
5
+ faraday
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.0)
10
+ activesupport (6.0.3.2)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
12
  i18n (>= 0.7, < 2)
13
13
  minitest (~> 5.1)
14
14
  tzinfo (~> 1.1)
15
- zeitwerk (~> 2.1, >= 2.1.8)
15
+ zeitwerk (~> 2.2, >= 2.2.2)
16
16
  addressable (2.7.0)
17
17
  public_suffix (>= 2.0.2, < 5.0)
18
- coderay (1.1.2)
19
- concurrent-ruby (1.1.5)
18
+ coderay (1.1.3)
19
+ concurrent-ruby (1.1.6)
20
20
  crack (0.4.3)
21
21
  safe_yaml (~> 1.0.0)
22
22
  diff-lcs (1.3)
23
23
  dotenv (2.7.5)
24
- factory_bot (5.1.0)
24
+ factory_bot (5.2.0)
25
25
  activesupport (>= 4.2.0)
26
- faraday (0.17.1)
26
+ faraday (1.3.0)
27
+ faraday-net_http (~> 1.0)
27
28
  multipart-post (>= 1.2, < 3)
28
- hashdiff (1.0.0)
29
- i18n (1.6.0)
29
+ ruby2_keywords
30
+ faraday-net_http (1.0.1)
31
+ hashdiff (1.0.1)
32
+ i18n (1.8.3)
30
33
  concurrent-ruby (~> 1.0)
31
- method_source (0.9.2)
32
- minitest (5.12.0)
34
+ method_source (1.0.0)
35
+ minitest (5.14.1)
33
36
  multipart-post (2.1.1)
34
- pry (0.12.2)
35
- coderay (~> 1.1.0)
36
- method_source (~> 0.9.0)
37
- public_suffix (4.0.1)
38
- rake (12.3.3)
39
- rspec (3.8.0)
40
- rspec-core (~> 3.8.0)
41
- rspec-expectations (~> 3.8.0)
42
- rspec-mocks (~> 3.8.0)
43
- rspec-core (3.8.2)
44
- rspec-support (~> 3.8.0)
45
- rspec-expectations (3.8.4)
37
+ pry (0.13.1)
38
+ coderay (~> 1.1)
39
+ method_source (~> 1.0)
40
+ public_suffix (4.0.5)
41
+ rake (13.0.1)
42
+ rspec (3.9.0)
43
+ rspec-core (~> 3.9.0)
44
+ rspec-expectations (~> 3.9.0)
45
+ rspec-mocks (~> 3.9.0)
46
+ rspec-core (3.9.2)
47
+ rspec-support (~> 3.9.3)
48
+ rspec-expectations (3.9.2)
46
49
  diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.8.0)
48
- rspec-mocks (3.8.1)
50
+ rspec-support (~> 3.9.0)
51
+ rspec-mocks (3.9.1)
49
52
  diff-lcs (>= 1.2.0, < 2.0)
50
- rspec-support (~> 3.8.0)
51
- rspec-support (3.8.2)
53
+ rspec-support (~> 3.9.0)
54
+ rspec-support (3.9.3)
55
+ ruby2_keywords (0.0.4)
52
56
  safe_yaml (1.0.5)
53
57
  thread_safe (0.3.6)
54
- tzinfo (1.2.5)
58
+ tzinfo (1.2.7)
55
59
  thread_safe (~> 0.1)
56
- vcr (5.0.0)
57
- webmock (3.7.5)
60
+ vcr (6.0.0)
61
+ webmock (3.8.3)
58
62
  addressable (>= 2.3.6)
59
63
  crack (>= 0.3.2)
60
64
  hashdiff (>= 0.4.0, < 2.0.0)
61
- zeitwerk (2.1.10)
65
+ zeitwerk (2.3.0)
62
66
 
63
67
  PLATFORMS
64
68
  ruby
@@ -67,12 +71,12 @@ DEPENDENCIES
67
71
  braze_ruby!
68
72
  bundler (>= 1.3)
69
73
  dotenv (~> 2.7.5)
70
- factory_bot (~> 5.1.0)
71
- pry (~> 0.12.2)
72
- rake (~> 12.3.3)
73
- rspec (~> 3.8.0)
74
- vcr (~> 5.0.0)
75
- webmock (~> 3.7.5)
74
+ factory_bot (>= 5.1.0)
75
+ pry (>= 0.12.2)
76
+ rake (>= 12.3.3)
77
+ rspec (~> 3.8)
78
+ vcr (>= 5.0.0)
79
+ webmock (>= 3.7.5)
76
80
 
77
81
  BUNDLED WITH
78
- 2.0.2
82
+ 2.1.4
data/README.md CHANGED
@@ -187,6 +187,65 @@ api.subscription_status_set(
187
187
  )
188
188
  ```
189
189
 
190
+ ### User Alias
191
+
192
+ #### Create an alias-only user
193
+
194
+ ```ruby
195
+ api.create_user_aliases(
196
+ user_aliases: [{
197
+ user_alias: {
198
+ alias_name: "device123",
199
+ alias_label: "my_device_identifier",
200
+ }
201
+ }]
202
+ )
203
+ ```
204
+
205
+ #### Identify an alias-only user
206
+ ```ruby
207
+ api.identify_users(
208
+ aliases_to_identify: [{
209
+ external_id: 1234,
210
+ user_alias: {
211
+ alias_name: "device123",
212
+ alias_label: "my_device_identifier",
213
+ }
214
+ }]
215
+ )
216
+ ```
217
+
218
+ ### External ID Migration
219
+
220
+ #### Rename users' external IDs with an array of external_id_renames
221
+ Note: you can send up to 50 rename objects per request.
222
+ ```ruby
223
+ api.rename_external_ids(
224
+ external_id_renames: [{
225
+ current_external_id: "old_external_id",
226
+ new_external_id: "new_external_id",
227
+ }]
228
+ )
229
+ ```
230
+
231
+ #### Remove users' old deprecated external IDs
232
+ Note: you can send up to 50 external IDs per request.
233
+ ```ruby
234
+ api.remove_external_ids(external_ids: ['old_external_id'])
235
+ ```
236
+
237
+ ### Email Sync
238
+
239
+ #### Get List of or Query Email Unsubscribes
240
+ ```ruby
241
+ api.email_unsubscribes(email: ['jdoe@example.com'])
242
+ ```
243
+
244
+ #### Get List of or Query Hard Bounced Emails
245
+ ```ruby
246
+ api.email_hard_bounces(email: ['jdoe@example.com'])
247
+ ```
248
+
190
249
  ## Debugging
191
250
 
192
251
  The BRAZE_RUBY_DEBUG environment variable will trigger full printouts of the Faraday gem's HTTP requests and responses.
data/braze_ruby.gemspec CHANGED
@@ -25,14 +25,14 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ['lib']
26
26
  spec.required_ruby_version = '>= 2.0'
27
27
 
28
- spec.add_dependency 'faraday', '~> 0.17.1'
28
+ spec.add_dependency 'faraday'
29
29
 
30
30
  spec.add_development_dependency 'bundler', '>= 1.3'
31
- spec.add_development_dependency 'rake', '~> 12.3.3'
32
- spec.add_development_dependency 'rspec', '~> 3.8.0'
31
+ spec.add_development_dependency 'rake', '>= 12.3.3'
32
+ spec.add_development_dependency 'rspec', '~> 3.8'
33
33
  spec.add_development_dependency 'dotenv', '~> 2.7.5'
34
- spec.add_development_dependency 'vcr', '~> 5.0.0'
35
- spec.add_development_dependency 'webmock', '~> 3.7.5'
36
- spec.add_development_dependency 'pry', '~> 0.12.2'
37
- spec.add_development_dependency 'factory_bot', '~> 5.1.0'
34
+ spec.add_development_dependency 'vcr', '>= 5.0.0'
35
+ spec.add_development_dependency 'webmock', '>= 3.7.5'
36
+ spec.add_development_dependency 'pry', '>= 0.12.2'
37
+ spec.add_development_dependency 'factory_bot', '>= 5.1.0'
38
38
  end
@@ -10,6 +10,8 @@ require 'braze_ruby/endpoints/delete_users'
10
10
  require 'braze_ruby/endpoints/campaigns'
11
11
  require 'braze_ruby/endpoints/canvas'
12
12
  require 'braze_ruby/endpoints/subscription'
13
+ require 'braze_ruby/endpoints/rename_external_ids'
14
+ require 'braze_ruby/endpoints/remove_external_ids'
13
15
 
14
16
  module BrazeRuby
15
17
  class API
@@ -24,20 +26,25 @@ module BrazeRuby
24
26
  include BrazeRuby::Endpoints::Campaigns
25
27
  include BrazeRuby::Endpoints::Canvas
26
28
  include BrazeRuby::Endpoints::Subscription
29
+ include BrazeRuby::Endpoints::IdentifyUsers
30
+ include BrazeRuby::Endpoints::CreateUserAliases
31
+ include BrazeRuby::Endpoints::RenameExternalIds
32
+ include BrazeRuby::Endpoints::RemoveExternalIds
27
33
 
28
34
  def export_users(**payload)
29
- BrazeRuby::REST::ExportUsers.new(braze_url).perform(api_key, payload)
35
+ BrazeRuby::REST::ExportUsers.new(api_key, braze_url, options).perform(**payload)
30
36
  end
31
37
 
32
38
  def list_segments
33
- BrazeRuby::REST::ListSegments.new(braze_url).perform(api_key)
39
+ BrazeRuby::REST::ListSegments.new(api_key, braze_url, options).perform
34
40
  end
35
41
 
36
- attr_reader :api_key, :braze_url
42
+ attr_reader :api_key, :braze_url, :options
37
43
 
38
- def initialize(api_key, braze_url)
44
+ def initialize(api_key, braze_url, options = {})
39
45
  @api_key = api_key
40
46
  @braze_url = braze_url
47
+ @options = options
41
48
  end
42
49
  end
43
50
  end
@@ -6,3 +6,7 @@ require 'braze_ruby/endpoints/schedule_messages'
6
6
  require 'braze_ruby/endpoints/send_messages'
7
7
  require 'braze_ruby/endpoints/track_users'
8
8
  require 'braze_ruby/endpoints/delete_users'
9
+ require 'braze_ruby/endpoints/identify_users'
10
+ require 'braze_ruby/endpoints/create_user_aliases'
11
+ require 'braze_ruby/endpoints/rename_external_ids'
12
+ require 'braze_ruby/endpoints/remove_external_ids'
@@ -4,7 +4,7 @@ module BrazeRuby
4
4
  module Endpoints
5
5
  module Campaigns
6
6
  def trigger_campaign_send(**payload)
7
- BrazeRuby::REST::TriggerCampaignSend.new(api_key, braze_url, payload).perform
7
+ BrazeRuby::REST::TriggerCampaignSend.new(api_key, braze_url, options, **payload).perform
8
8
  end
9
9
  end
10
10
  end
@@ -4,11 +4,11 @@ module BrazeRuby
4
4
  module Endpoints
5
5
  module Canvas
6
6
  def trigger_canvas_send(**payload)
7
- BrazeRuby::REST::TriggerCanvasSend.new(api_key, braze_url, payload).perform
7
+ BrazeRuby::REST::TriggerCanvasSend.new(api_key, braze_url, options, **payload).perform
8
8
  end
9
9
 
10
10
  def canvas_details(**payload)
11
- BrazeRuby::REST::CanvasDetails.new(api_key, braze_url, payload).perform
11
+ BrazeRuby::REST::CanvasDetails.new(api_key, braze_url, options, **payload).perform
12
12
  end
13
13
  end
14
14
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrazeRuby
4
+ module Endpoints
5
+ module CreateUserAliases
6
+ attr_writer :create_user_aliases_service
7
+
8
+ def create_user_aliases(**payload)
9
+ create_user_aliases_service.perform(**payload)
10
+ end
11
+
12
+ private
13
+
14
+ def create_user_aliases_service
15
+ @create_user_aliases_service ||= BrazeRuby::REST::CreateUserAliases.new(api_key, braze_url, options)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -6,7 +6,7 @@ module BrazeRuby
6
6
  attr_writer :delete_users_service
7
7
 
8
8
  def delete_users_action(**payload)
9
- delete_users_service.perform(api_key, payload)
9
+ delete_users_service.perform(**payload)
10
10
  end
11
11
 
12
12
  def delete_users(payload)
@@ -16,7 +16,7 @@ module BrazeRuby
16
16
  private
17
17
 
18
18
  def delete_users_service
19
- @delete_users_service ||= BrazeRuby::REST::DeleteUsers.new(braze_url)
19
+ @delete_users_service ||= BrazeRuby::REST::DeleteUsers.new(api_key, braze_url, options)
20
20
  end
21
21
  end
22
22
  end
@@ -4,7 +4,7 @@ module BrazeRuby
4
4
  module Endpoints
5
5
  module EmailStatus
6
6
  def email_status(**payload)
7
- email_status_service.new(api_key, braze_url, payload).perform
7
+ email_status_service.new(api_key, braze_url, options, **payload).perform
8
8
  end
9
9
 
10
10
  def email_status_service
@@ -4,11 +4,11 @@ module BrazeRuby
4
4
  module Endpoints
5
5
  module EmailSync
6
6
  def email_unsubscribes(**payload)
7
- BrazeRuby::REST::EmailUnsubscribes.new(api_key, braze_url, payload).perform
7
+ BrazeRuby::REST::EmailUnsubscribes.new(api_key, braze_url, options, **payload).perform
8
8
  end
9
9
 
10
10
  def email_hard_bounces(**payload)
11
- BrazeRuby::REST::EmailHardBounces.new(api_key, braze_url, payload).perform
11
+ BrazeRuby::REST::EmailHardBounces.new(api_key, braze_url, options, **payload).perform
12
12
  end
13
13
  end
14
14
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrazeRuby
4
+ module Endpoints
5
+ module IdentifyUsers
6
+ attr_writer :identify_users_service
7
+
8
+ def identify_users(**payload)
9
+ identify_users_service.perform(**payload)
10
+ end
11
+
12
+ private
13
+
14
+ def identify_users_service
15
+ @identify_users_service ||= BrazeRuby::REST::IdentifyUsers.new(api_key, braze_url, options)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrazeRuby
4
+ module Endpoints
5
+ module RemoveExternalIds
6
+ attr_writer :remove_external_ids_service
7
+
8
+ def remove_external_ids(**payload)
9
+ remove_external_ids_service.perform(**payload)
10
+ end
11
+
12
+ private
13
+
14
+ def remove_external_ids_service
15
+ @remove_external_ids ||= BrazeRuby::REST::RemoveExternalIds.new(api_key, braze_url, options)
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module BrazeRuby
4
+ module Endpoints
5
+ module RenameExternalIds
6
+ attr_writer :rename_external_ids_service
7
+
8
+ def rename_external_ids(**payload)
9
+ rename_external_ids_service.perform(**payload)
10
+ end
11
+
12
+ private
13
+
14
+ def rename_external_ids_service
15
+ @rename_external_ids ||= BrazeRuby::REST::RenameExternalIds.new(api_key, braze_url, options)
16
+ end
17
+ end
18
+ end
19
+ end